|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////2 a, e! n6 D1 E3 B8 M' l& X! F5 c
// Theme Option3 {: f# Q4 \ Q8 C9 n; f! q6 w
////////////////////////////////////////////////////////////////////////////////
* N& h6 t( ~7 @7 Z' [+ M
3 u- n( f6 F7 K4 T$themename = "Zenx";: n9 D% b A* S8 h7 J: h/ W; Y
$shortname = str_replace(' ', '_', strtolower($themename));7 ~$ g1 S. I- h' ]; L' s
Q6 @% s6 r1 H& C8 }4 Y- d
function get_theme_option($option)
. Q! v8 l* `! K/ U& `) e# S{0 y5 W/ {: L) ~8 J5 N, v
global $shortname;8 H( t( p* {. G( s9 Y- r0 g- R
return stripslashes(get_option($shortname . '_' . $option));, E, V% s/ A3 a$ N0 e( Z y- d# `
}
" e+ E L( A# m$ k' y' p# |( u
2 \8 G. T& k+ E: o" l- L8 |function get_theme_settings($option)) N+ Y' T( d, y x1 K& }- J6 F& I
{
% A; P( w; v" S' {" ^. n return stripslashes(get_option($option));
" I* p$ o+ R2 r: U}
0 A9 ~* ^ Q" O1 H" N; [$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
: E+ ^2 _7 V3 ~+ D9 u' ~! R$wp_getcat = array();/ j! v8 c) e, P' W
foreach ($wp_dropdown_rd_admin as $category_list) {( s+ \- _3 R/ q# B0 k% [
$wp_getcat[$category_list->term_id] = $category_list->name;' U% {9 m( W4 \; [1 n. V
}
, y/ H% d- }/ L. u$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
/ W9 P. u9 R! Z4 S0 N$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
+ \* V6 P, t4 d5 a: \& d% T$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");0 B) R M) M: q
, U& J: t; u' l5 \. }2 l$ l$options = array (9 c- N0 g+ y; }1 q% j' a- L2 a
4 G+ L* {% N. y/ _$ ` ~& H% W5 v1 J% l0 d
array( "name" => "Blog Header Settings",$ @. x4 n8 j$ C: v5 [8 Q8 D3 g/ z5 }$ m
"type" => "heading",
6 g! Y' V( @6 }0 N$ ? ),
4 T. x, Y9 Y; J- i$ z3 F& V6 I
, c% z. H6 a8 m! C& A array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
@4 s6 u, J( o& y "id" => $shortname."_header_logo_activate", W1 p3 c4 D# _' T" E; e5 E6 q
"type" => "select",
; T0 Z H {# N. k) x% t8 m _/ D "std" => "No",
& h, n# q! W5 L7 T W' d6 `& W "options" => array("No", "Yes")),. z! @3 _' J3 q. ~6 U) C
9 J; j' G$ P( D, o$ w array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",% I! y9 P: C( N. C0 P @
"id" => $shortname."_logo_url",0 a9 x& H: |9 ^7 {4 V3 O1 i( o
"type" => "text",
# l! U: T0 g3 d7 t "box" => "social",0 a4 Y" ~2 F b) j- I
"std" => "",2 j: K# z2 q. I. V! v) T6 A$ n% A4 k4 T
),4 }8 t P. t9 ~- P
% I" Y9 P( _$ Q: H3 l! N* R/ q array( "name" => "Insert Header Banner HTML Code (Header)
% a( c& ^, q5 ]: Y5 q. N <br /><em>*Recommended Size 468 x 60</em>
3 z/ o, ^2 ]8 H$ I8 K <br /><em>*leave blank if not use</em>",9 z: r# }* k7 X0 b! i- j& P1 s
"id" => $shortname."_header_banner",
& j3 Y! r9 d3 b" r2 o, Y @; f* _ "type" => "textarea",
0 u& o5 ~. w9 X1 A5 h$ _ "std" => "",, Y! U9 V A+ ^% H
),0 t2 Z& m2 i0 a+ b+ ~
1 o! B. X; b( s: l9 h7 I4 o array( "name" => "</div></div>",# Q) Q. G# \ y( `; Z
"type" => "close",
% \0 K4 d! S: o$ |" i/ g% E ),( h9 {1 B+ P9 Q4 P* c
# K( H2 U* U8 |7 l& o8 V+ T/ C& ]# O. i. n' u$ g
array( "name" => "Header Navigation Settings",/ U' I0 z1 d/ u# m( `
"type" => "heading",! `/ @) R, l! ]! G* g# m8 d
),
* Y9 \! T, o# u9 z9 G/ X4 J3 b; V( Z$ h
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
" H: n9 ?8 ^' R+ P5 O: D/ e <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
0 E$ Q' ~ L) x# V <em>*Enter the page post ID number only</em><br />
S! K; y9 m0 S3 z <em>*separate by comma</em><br />
$ ]' ]" f1 I! v: s! T# q3 T& ~ <em>*Exclude pages which you don't want to show on the header navigation</em>",
) w( o7 s. B, [/ ?, Q H "id" => $shortname."_header_page_navigation",
2 O- }4 G% U F7 D: S4 ] "type" => "text",' [. g: F9 ~! t) l; o8 E
"std" => "",2 ], R- U9 U4 O* ^3 |7 W. [' B
),
( S. D2 ^0 n6 |0 Q- ~% l1 I' c5 X& H5 W$ i) l. a# x
array( "name" => "</div></div>",* B' F, P. a5 ?& q+ P
"type" => "close",* w( E; `+ B& s
),
' n* B K$ Z' q
; h5 \1 X- D1 c7 A+ y2 D6 H m' G7 R5 ?* S: U
array( "name" => "Post Auto Thumbnails Settings",
& D7 v4 z3 D0 G6 Y6 e; I0 {1 G7 o "type" => "heading",2 a. d- p9 @% }+ Y7 T
),/ N" J! h: E3 M2 m( b/ u# \
' U8 Y( i* X5 F array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
7 y0 H# g8 |1 A6 b- J "id" => $shortname."_timthumb_activate",9 I e7 p+ U( ]$ F: x7 m; i
"type" => "select",
4 G; i* v( w" I4 ^6 j "std" => "No",
( I: F8 u& D# a. |$ I "options" => array("No", "Yes"))," ~% @, U4 [& A, K# \- d+ u# s
; B/ \/ _" m# H. l& [- L4 z( w
array( "name" => "If Timthumb is enabled, Please choose its cropping method",( N7 a6 ]$ D) e0 \& [9 ]
"id" => $shortname."_timthumb_cropping",( F9 e& z4 x* f% [3 u
"type" => "select",* ?) G. ^; _) a
"std" => "",7 W3 W2 P' F- N1 j
"options" => $crop_position),6 ?1 J3 f& |1 R8 p, l
) X6 m V }& y6 x; _ array( "name" => "Insert Width Of Thumbnail Image<br />
( l9 z; [+ x+ M7 q3 h3 Z( I! H <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
# |8 q k- g5 g1 v* l4 ` <em>*Leave Blank To Use Default: 250</em><br />",; L+ s6 ]- n! ?3 P* V5 P+ B N
"id" => $shortname."_thumb_width",; g# C/ _9 P9 O4 w+ g
"type" => "text",
4 p7 G4 K: F$ R0 K "std" => "",! Q0 g1 X" _ [& g: q* z: g- y* Q) n
),/ O3 y4 W! `* ]9 @; X- A7 \# T
7 f+ [$ r+ D: ?7 y+ I/ r- G array( "name" => "Insert Height Of Thumbnail Image<br />" o4 y- E& P1 ?# D! X
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />4 f U" q( N: Q/ m1 R& u+ ^
<em>*Leave Blank To Use Default: 200</em><br />",
5 V3 x1 z! V) |1 w- Z( w "id" => $shortname."_thumb_height",: }' b' R5 k5 X% x1 [: k
"type" => "text",2 ` q# e( H+ }7 S. f8 e
"std" => "",
1 ?+ X& X4 [1 p) j b# l* l$ @ ),
5 f# ^/ `& O2 y0 L4 _# d& Z T% d
& i( d& y& n4 O: k7 T array( "name" => "</div></div>",* L% k& o+ h& Q$ _0 w O
"type" => "close",3 ]) ]! b# S) F/ u
),
( y2 V8 d% t/ q P6 ]7 H" o3 k, p2 y
9 c* N& _* s1 ]1 _ array( "name" => "Featured Content Slider Settings",7 |" D. L% o9 E: d+ H
"type" => "heading",! X! ~$ f2 h: T
),- l) o' @3 c) d
+ X* ^: d2 d) e) F" _ array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
0 k3 u+ z$ j t& R! o "id" => $shortname."_featured_activate",9 i* B0 E9 ~& @8 Q# ^ o$ B3 b2 \
"type" => "select",
6 n- u* v) z9 G6 |1 \) J8 x "std" => "No",
# [: Q% f e& r "options" => array("No", "Yes")),
% j+ W: I# U$ u; Z2 ]5 S3 {' b5 v9 a+ w% t8 F& M
$ m% ]" L: d F9 w5 @7 S array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
/ K& r5 N/ b. |( f "id" => $shortname."_featured_category",/ U6 U$ ^& q" [8 \: |/ s
"type" => "select",
) I7 l# n1 e6 ~% q "std" => "Choose a category:",
( f0 z2 D8 u; X- X9 q "options" => $wp_getcat),8 {) Z6 l2 z. o( q& N4 I6 p
7 i9 I: z- g' Y/ Q array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",4 L+ V0 o' U. P' U& }) `7 f
"id" => $shortname."_featured_number",1 q% @; V" W3 s/ p) k
"type" => "select",0 l6 \( S- b+ W# f2 a1 E9 V% ]% l
"std" => "Number of post:",
2 F6 E& T! e3 y: ~# Y" v "options" => $number_entries),; \) r0 c7 \8 b; Z% |
& M( b6 M4 p6 p) i/ Y
array( "name" => "</div></div>",
$ ^* _; _! n( C% d! G' t ] "type" => "close",
2 z5 p3 i, F! N' w ),
3 {+ f) N- L, P" G# B
4 a- v7 t L9 }. c& `4 y" `) Z array( "name" => "Featured Category Settings",: ]# g8 L [( ~# w9 a
"type" => "heading",& W, X5 ^3 t' v6 r
),+ I1 h, L ^1 M/ E
- {- G& p9 F5 {2 p/ W% P
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
# ~' v7 ]" Y3 Z R "id" => $shortname."_featured_category_activate",- K- a+ W+ p: _) a ~
"type" => "select",
5 H+ }9 f' w; u) x& [ l "std" => "No",; A H/ f9 I; d9 K
"options" => array("No", "Yes")),
+ q3 }6 X9 e! {1 | ; O7 I; S+ W" I
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
, y6 S3 Z! i* |7 t9 E- P "id" => $shortname."_featured_category_id1",
0 k& H; y. v* f% i4 l5 b "type" => "select",9 x K6 u/ n$ \, ^, V: E
"std" => "Choose a category:",
( H H5 I; |/ K& |: g "options" => $wp_getcat),* t4 {: \8 D* \" a2 t8 f: n0 h
8 N1 t+ X0 j. C3 [& l) N5 n
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",- Y8 I* j+ |% p( ?
"id" => $shortname."_featured_number1",
4 j! x t Y3 Y "type" => "select",7 U$ k! E/ d/ a; J9 e
"std" => "Number of post:",. Z! P* Y: t( _& [- b) \
"options" => $number_entries),9 {: {2 C9 G5 ]
' ~$ u Q- U( a3 n/ W
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
3 m) ~8 ]: P5 X- ?0 h$ \* V "id" => $shortname."_featured_category_id2",- Q! L* f, R, [0 n( g; Q! q- F* h
"type" => "select",& U' g& ]: Z8 \) q% o1 b' u: s
"std" => "Choose a category:",
9 T) A! S2 r7 b7 W/ F3 W& Z+ W: C7 o "options" => $wp_getcat),' U; L% B# D# q% Y- q* T, ]
7 k7 d( ?2 V- l* ^& u
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
8 @$ I/ Z5 O0 v9 f" w6 ~ X$ s "id" => $shortname."_featured_number2",
2 v/ K; S2 } ?( Q2 C5 G5 f "type" => "select",
* F& h: F6 I/ X, R0 r1 t% @9 m "std" => "Number of post:",' i/ _% q) X. b) U+ H
"options" => $number_entries),
8 G. n- D( K0 }5 `
3 t6 R- G) W1 p& a8 m 4 V2 I7 ~* ?; b9 i( I
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
1 }3 R3 b% _- E, Q( D7 [: M2 _/ Q "id" => $shortname."_featured_category_id3",1 ?: O& z6 Y* p1 q
"type" => "select",: Q$ C( x4 p7 h0 R$ n1 H1 T* O
"std" => "Choose a category:", L9 v2 e5 D9 _' o
"options" => $wp_getcat),
& u2 y4 K- Z* |1 w7 a/ Z L
" p# U( z- j1 q0 M$ V4 W* I array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",/ @% l8 S: p- @* X C& ?
"id" => $shortname."_featured_number3",. a- T% q' v$ }2 D2 |
"type" => "select",
" x5 W1 k6 y3 d) T* G "std" => "Number of post:",
: D& k# v8 P- x+ y' T5 Z/ O/ H3 Q: N1 j "options" => $number_entries),4 i2 X2 c. Q5 ~ Z
" s' U9 D8 d( f) B* K% R& v' k1 z: d o+ h$ F; i% m
array( "name" => "</div></div>",
R. Z5 e( w0 Z. Q( D' k9 Q "type" => "close",1 p% U% m6 S1 X( ?! I) j O
),0 b2 A M7 D* Z- U6 A( a" s) Q
6 u+ Y5 B" h C0 O9 Q4 ]0 ]/ C0 x
8 p# X! \2 i9 M) i/ F# [ array( "name" => "Google Adsense & Analytics Settings",( G0 Z; ?+ `+ F# k. M" Y/ G5 C. m
"type" => "heading", _- ~9 A- q' M" }7 l. ]( e
),
: @% j, }, M* ]1 n3 \5 ^. r1 C+ S' h: g* c
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",1 P+ }6 \8 l1 \
"id" => $shortname."_adsense_loop_activate",
9 l8 K/ C# g4 F L9 f& ^ "type" => "select",
7 y9 ?' u$ {- Z4 |$ J5 { "std" => "Disable",
7 r4 Y8 w; D& |5 H: w8 Z "options" => array("Disable", "Enable")),
$ D2 C: u$ ^/ m
, Y$ ]7 K% K$ ~" z) V array( "name" => "Insert Google Adsense Code For Loops Here<br />* K- P% M4 z7 Y8 F6 g- D
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
+ D* G& E' v2 ]9 I# e "id" => $shortname."_adsense_loop",
# s0 J" g9 F) K6 ~& E "type" => "textarea",4 P$ V7 p* p) X$ Q
"std" => "",
; S! C k# ~# ` h ),, p! G3 Z) F8 x# z% I5 v
* ]$ c+ x' n ~8 d* I" t/ O
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",! l; M6 C4 @9 T& q, I5 F7 G
"id" => $shortname."_adsense_single_activate",
5 p K# h, Z0 _; ^; b6 _ "type" => "select",6 A6 q1 r# {7 }( {
"std" => "Disable",
. V1 V, r) ^( `3 S$ I& J8 A "options" => array("Disable", "Enable")),
# R f* ^! g L! z0 y
. ^ r" R6 j0 C$ z' F* q array( "name" => "Insert Google Adsense Code For Single Page Here<br />* [, `' ~+ J* K6 E1 h1 T U+ N
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",4 p/ a* O1 b3 `2 y
"id" => $shortname."_adsense_single",: B' {0 \$ `8 c/ I
"type" => "textarea",4 H2 ^3 G- A1 \/ Z' @
"std" => "",
/ h) y g2 S! w. B Y7 P3 f1 \ ),( v$ Z8 g9 R- A! f: O$ N
. a F4 Q/ w% i$ |4 ]* m+ l
; m4 t1 a1 c6 g array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
: a4 ^: K2 |7 f "id" => $shortname."_google_analytics",2 u+ _9 s w4 `' q( N9 E
"type" => "textarea",
* u- J; p) S7 `/ _1 t- G. _3 J0 R( ] "std" => "",$ g; o0 h% _. ?+ a, J" Z" V
),3 O' F/ C) N6 J8 G
6 C7 l% i7 h& c9 _! v6 `3 ]! x array( "name" => "</div></div>",
! L) ]# N% u# R& r( D( O6 n+ s "type" => "close",/ {! i* y4 Z6 Q& ^
), F8 S) F y+ g) C& N" ?' f9 w
2 i, q% q) V% K& ?/ [( V! v8 R0 f
3 _* f( P, s v array( "name" => "AddThis Social Bookmarking Settings",( j, j$ d# N5 W9 _% u k
"type" => "heading",/ `$ `8 s! i9 Q/ \. T) F# t
),
1 M: C6 H) w5 r0 ]
5 o G( \. T' u) i array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>( d: Q' q( N' f/ R8 u3 a
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
: Q. G9 h, |( y6 D+ }4 v "id" => $shortname."_addthis",! d- ^1 F7 N k: [
"type" => "text",/ k$ Z: b1 i) Q5 Y, S0 p9 E# t
"box" => "social",
! V5 ]% C% n# x) c* i& L- `/ T "std" => "",; B, k1 U- r6 L2 m! J2 c/ J
),
! `. @7 U+ S* x7 i: e$ E, ?/ h' s2 P1 \! i! `
array( "name" => "</div></div>",& F+ N& T7 s8 y$ t
"type" => "close",# M: E$ i( Y) y/ d
),
3 @1 \# D: m; E& d( d8 J
# F( J% h. N5 U9 c& E" u + \% e( W, x# [- s. h4 {
" q7 o9 v! d. M' I: C
array( "name" => "YouTube Video Settings",5 l; g; x5 D3 R1 j& D7 b
"type" => "heading",
' v9 i& m$ ]: ^, Z ),% {( n8 m) [% a4 Y
4 j, a5 J% f/ s/ b; V" C array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",, @" N: q W& g* e
"id" => $shortname."_emvideo_activate",: S5 f+ Z1 z+ |1 A
"type" => "select",/ u: y% a2 s% h& `, I" h3 C
"std" => "No",; y1 R) U& Z. b4 ]- G; a& g+ D
"options" => array("No", "Yes")),
. K4 b9 B+ l. o: J) K3 C0 e. k
) v, K0 e& [0 {( u+ E W array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",% {; w6 l9 Q! o7 o7 y7 u) L
"id" => $shortname."_emvideo",
( {" i* _2 R5 @7 x: F3 x1 A "std" => "",# F9 \* {5 G! A9 |
"type" => "text"),
3 L* }( M6 ~2 n# ]0 J' b* l- u5 ^
array( "name" => "</div></div>",' I) g G4 Y# m- k4 H5 {8 }0 w5 W
"type" => "close",
$ t2 s4 d5 D1 e, T+ M3 H7 B ),' K3 D, d( P* W. l+ a( [
/ ^( i/ y& l4 z# T3 ~( l; t1 F
array( "name" => "Twitter Settings",
* w0 t) o T, v4 B [8 n) ~+ L "type" => "heading",9 L! {- y) @# i$ B' z2 P
),
' q; M9 W# ?; v2 A9 Z/ _
5 E1 }% |) K( u- ?: p9 E array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
z# m+ y9 `8 c' ? "id" => $shortname."_twitter_activate",' |5 I* Q. J$ o8 |
"type" => "select",
( _) f7 o) C7 J% f7 O$ ] "std" => "No",( N) e( `: U4 {) j* i
"options" => array("No", "Yes")),
/ M* m2 m q/ |8 s$ L
0 b9 _( ~, }' x1 r/ L array( "name" => "Insert Your Twitter ID here. I& C% |: e0 C' D& z
<br /><em>*leave blank if not necessary</em>
$ ] C; a6 v' A. s1 ? <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
( Z8 [4 k: \4 E/ k, J! f4 C7 I' |) F "id" => $shortname."_twitter",
' F, z3 S8 {; F1 O( |2 T "type" => "text",* w: {# k7 {$ Y# G$ a' d
"box" => "social",; s+ v) R) K6 D5 D p' }; c
"std" => ""," e9 a! g8 \( V2 M. n
),& r/ o3 Q' ?# _! Q$ y. E/ j' `
) S& |2 i! J, P
array( "name" => "Enter Twitter Feed Count here
2 g$ ~3 F* Y2 ]9 O <br /><em>*leave blank if not necessary</em>
- e6 x! j6 U1 E F0 M; C <br /><em>*Enter How Many Twitter Feed To Display</em>",
) E7 H4 k" k `# A6 l "id" => $shortname."_twitter_count",
# l2 A4 [" H8 }. O; V3 [8 l "type" => "text",; @) h" m" }& T, [; K3 T$ d
"box" => "social",
; a( M' S" Q" A- ]+ U" F( l "std" => ""," S5 S# K/ B ~2 P' |
),
5 v: v* j! G" f: b
, j5 n4 B- c: b array( "name" => "</div></div>",. S9 D5 w2 v9 u9 k) z# I- y' O
"type" => "close",
, ~* R* d6 R: t ),) w% h1 N+ M2 }: `" K( i% }
/ `4 H! Q; Z5 u x8 z% N2 _$ p6 w: [3 D9 y9 h" Q/ T a7 _- j
array( "name" => "125 x 125 Banners Advertisement Settings",) |! P* c& X- n+ V3 q. v r
"type" => "heading",
5 Q; ~; @* Q5 q7 p2 ~! | b+ b6 ?5 @ ),2 c2 Z* b. G: S
0 q. R: }. }" |' R1 a1 n" w. C array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
7 o; _( P8 R# M- T& q4 Z "id" => $shortname."_sponsor_activate",
; R8 x- }2 k$ }/ {$ z "type" => "select",
# }) _$ i7 _ @( `: {- T5 [ "std" => "No",: i e" Y3 f8 u( c5 r1 T9 v
"options" => array("No", "Yes")),
- v) L* f+ n5 L
% q ^5 t- |! d, ?, r+ [
: j8 N8 k: {! K array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",, K: O4 ]/ [0 s1 l
"id" => $shortname."_sponsor_banner_one",
& e% [! q+ _# ]8 m5 Z% U "type" => "textarea",6 p* X ]+ I$ y& i
"std" => "",7 ^6 n+ `; y" d
),
* A5 E$ Y1 I; C; c2 u9 _
- T# U, j, ]1 Y& d# F# w array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",, n$ t. J* x Z: k, _" ]
"id" => $shortname."_sponsor_banner_two",. D# W i2 G1 J5 d
"type" => "textarea",: L, l& Q5 F. _% j& x
"std" => "",+ H& h9 i) X, `4 w
)," A' o# L+ C4 e8 j& ~. L
( P8 j' ?6 `* J- E& o1 @ array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
, ?4 l2 p, f1 e8 M9 _ z "id" => $shortname."_sponsor_banner_three",
8 {; ` A; o2 E3 n R "type" => "textarea",- N4 n% A1 D$ ?0 p8 [3 D& M4 e! t
"std" => "",: P$ O: U0 x; y0 m+ Y- N
),
* m- [: W" Z, |' W$ y
+ [: `6 @& v1 m+ X4 j" O, ^ array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
; a4 m/ P* d7 k( X/ T1 ^# Z8 i "id" => $shortname."_sponsor_banner_four", n/ u F( [1 p5 {
"type" => "textarea",- C0 E2 E2 P3 q f+ G9 Z8 N& v
"std" => "",; f% f; [. V8 V, C
),2 V( ?9 \# j8 d* X3 w/ O
8 l& ]2 r$ p' `% C2 [ array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
3 j: j0 [# I4 ^: N0 R9 s% U "id" => $shortname."_sponsor_banner_five",8 `4 P4 A+ `2 J
"type" => "textarea",
5 E. a& W# O: x4 d "std" => "",' f6 X9 ?0 p+ Y* x4 ^
),
$ e5 i9 {( C W! c. k8 X5 u2 ^' k
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",6 P9 {% P9 v4 }" l- |$ {/ v; ?
"id" => $shortname."_sponsor_banner_six",
. `0 S7 X; C2 N" k+ ^, { "type" => "textarea",
, h( j: C1 Z; b$ y7 ?- p "std" => "",; \7 g+ O0 ^; L* e3 b3 [& ^) D
),4 z+ K, k7 _" w: L, r X
1 a9 S9 w8 k6 g6 s9 F4 S array( "name" => "</div></div>",; _4 O) t1 H6 |' M0 T
"type" => "close",
( m% d0 A8 ]- r) t0 |; t ),, t; C) X& [" u% Y5 _& b/ p
' y& G# M6 w1 c( s3 P* {0 _- T3 d8 q: W3 C
6 T' f+ F. C( W, q1 a2 b' D! E$ q
);
) I5 e% N+ i& n3 W1 q; \, l3 M' x+ s% f
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {7 D8 a3 i8 ?% l7 m3 Q1 L
& e! A- ]9 r- n7 [! c& m3 F7 d
echo "<div id=\"admin-options\"> ";% u- M+ u) ]: W* s0 k# W6 J( O- }
7 K. V; y$ T. {) I5 q0 m
global $themename, $shortname, $options;
0 O, f( G* l7 s% m3 ^( mif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';6 R9 _( X9 y# T" `0 {" o
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>'; J1 R) w1 Q& j# R( X& ?' k) p5 B& V
?>7 i4 S6 V1 \& T! u, v) s
! c9 Z$ r5 G- B/ v
<h4><?php echo "$themename"; ?> Theme Options</h4>/ S. L' W" u+ p0 m3 S6 h2 c% W. t* b
$ M' t g* e, C. y
<div class="annouce">0 G3 C9 }: t2 d# b5 ^* v
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>, b5 a& {$ [* t- I' U( I4 T
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>' I, e8 c( {0 A; Y5 u5 P
</div>6 s% u& L# R7 ]7 [
1 k$ v# p0 ?4 q+ L& q0 w) m<form action="" method="post">
4 ^. }3 b( f8 b* \& t
. o D, b' i% }) n<?php foreach ($options as $value) { ?>
: Y- ]2 h2 y, g& R+ R, K( W* ?* u# u. L6 k. L5 q% v
<?php switch ( $value['type'] ) { case 'heading': ?>
+ c' Z0 n) t$ }% r4 q8 W( [+ s. \/ ]) t" u$ m
<div class="get-option">. ?2 ~% U) h/ |$ A% B: A( Q5 F) h
9 T5 k& [7 e6 o: `5 |
<h2><?php echo $value['name']; ?></h2>
4 N6 [7 P) D0 h! G. J5 Z: E
. Q) v1 S4 j" h<div class="option-save">
' l) e: |7 S' V6 b
$ B2 j: W6 l1 m5 K5 n8 p. @6 M<?php
4 R' m2 ]7 V7 A/ g* C9 Q. jbreak;
" m- s H/ t* y, q0 `case 'text':
# F/ R6 y. l. L6 R m?>
: R t/ t5 c$ D
# N9 U+ k8 N0 I4 Z5 D% L" R7 R( h0 N<div class="description"><?php echo $value['name']; ?></div>9 N& R5 w/ ?; ?2 u; f9 Z9 e
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (# ]* I* d; c C; E
/ I Y% c! a- R3 _/ xget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
) _( y; H& |# f4 Z
! V8 k, d& A1 ?1 i<?php
$ D6 a8 s; s0 X: ybreak;) `* [% Z% M" N! q7 j: }
case 'select':4 s0 j( b/ }4 X7 z& F* {2 k
?>& U4 Q8 |7 @7 h# b3 ?6 _
! Y. E7 A! ?: g6 z/ ~' B<div class="description"><?php echo $value['name']; ?></div>4 {+ ]; I) q7 A# p, j" S/ p
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
|, k; @. g1 m" r( }<?php foreach ($value['options'] as $option) { ?>
S9 S- M d: `+ C e3 M; J0 T; y<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
- m/ a t. G4 e% h<?php } ?>
1 O0 n5 z% q2 K3 k2 G' @: V' O</select>% m/ U- v2 m% A# \1 [7 N. @8 Q6 V, U
</p>
2 w+ z) h) o! S. R* z; r( {% g% f/ I' a
<?php1 ?7 u0 m: y! {; Z) p4 }
break;6 }* Z& j6 J0 T; _2 ]( \' ]
case 'textarea':
/ l! b+ U4 w4 u) {) S r2 R$valuex = $value['id'];
. N F. W4 ^& `3 o$valuey = stripslashes($valuex);( J* w2 s# ]$ |( F0 j) F
$video_code = get_settings($valuey);
0 w0 ~0 L! v1 c- s2 }$ N6 h. Z1 ??>
7 O7 C6 \! C/ j4 j% o
3 z* y0 O* Q$ G w7 P<div class="description"><?php echo $value['name']; ?></div>
. g, t4 I Z6 K' J<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }$ I+ R* @# m) M* m: W
, k+ ^2 G9 A: z" I4 oelse { echo $value['std']; } ?></textarea></p>- R r+ c6 W1 Y3 V( v5 u; T' P6 U
4 j6 c9 j( q9 N. l( m, @<?php
) g8 x! x& U$ Xbreak;2 J, f# ~( R# c
case 'close':' c0 U0 W' Y; E/ A" w
?>
) i9 [, K4 p* w; w/ C; i7 X' D7 M' {8 h% T
<div class="clearfix"></div>
# T+ `# O2 x/ M J" Z/ h+ A d</div><!-- OPTION SAVE END -->& `9 E6 \% Z9 e
3 X1 t6 h0 i3 ?/ I' c) q<div class="clearfix"></div>0 y* |; U+ K; \" x6 v& t2 l# g
</div><!-- GET OPTION END -->
7 o; A/ U ~% g) |: |2 G7 y5 e
# _, [5 w9 h1 v9 Q<?php" f% t* l+ C4 i# n; k
break;
" T' }- U( ]+ a* {default;/ Z" S, j* c7 e- p" L+ T
?>8 L8 y; w8 H2 Z( R
) ~+ N$ q) N( U- J+ w! r; E* }& Y! ^ K+ G
<?php
- F. ^9 ^$ R9 ?break; } ?> L9 n' C9 J3 w+ V: p
& h Y# k1 T7 n! S/ I3 ]6 `( Z! @<?php } ?>
& d9 f# f# l' P
+ ?- b/ {% O. I<p class="save-p">
& |2 E( J9 F. v2 ~( a<input name="save" type="submit" class="sbutton" value="Save Options" />8 F1 h& |) `' _" U
<input type="hidden" name="action" value="save" />
' y6 V+ }: J5 l! V( j6 V1 L$ ?</p>2 r I/ X$ x! g
</form>. A& X8 u! ?8 ?& ^2 R8 H
5 f$ y! o* [' n, R# B+ A
<form method="post">
0 }- Q" c/ ?5 p6 G5 C- X$ N<p class="save-p">
0 _! V* o0 `* h1 X q3 O) U<input name="reset" type="submit" class="sbutton" value="Reset Options" />
) q" E1 ~2 w7 u! T C<input type="hidden" name="action" value="reset" />
6 V- H( l/ t' t8 i% b</p>
7 g( |" ]0 o% @: `8 {6 Q</form>2 j5 ?& @+ C% E% w; P8 C) j: Z
) v, `6 z% {$ M; G</div><!-- ADMIN OPTIONS END -->
i$ M/ ], I4 [+ S- P9 e `6 F
) Y' o Q0 B1 ?% d% L<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }! G' B2 f- j4 m2 x4 y: U
& u* z/ i) u% G2 }& w" G; m# H7 \function mytheme_admin_register() {
R7 y; ] h& E# K) i8 ^5 hglobal $themename, $shortname, $options;
+ x4 m7 |0 V1 |: Z2 y! kif ( $_GET['page'] == basename(__FILE__) ) {
' p3 \: v) f, u; Eif ( 'save' == $_REQUEST['action'] ) {( w( C$ ~/ K- \& o
foreach ($options as $value) {! A) l/ z. H) u/ q8 s3 y; j
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
1 N3 r/ ]: n* E3 F& _foreach ($options as $value) {
, r' Y {. |; b4 iif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
7 ]* A0 O% y1 |+ @- {% a7 theader("Location: themes.php?page=functions.php&saved=true");. t# A2 o+ e9 o, A5 V X
die;
, x7 k# G- Z: M) t6 T) Z. i} else if( 'reset' == $_REQUEST['action'] ) {
! y/ |+ Q9 t5 N) g! U# R! @0 fforeach ($options as $value) {
i# R+ t% U; C! \7 ?delete_option( $value['id'] ); }
+ X( t1 ^4 t' F- w) g7 X' ~2 pheader("Location: themes.php?page=functions.php&reset=true");
% \; M! f* ]( U8 T& B8 W& N0 Jdie;
2 W1 K) J" X. R8 w l2 @}% [1 c- z. @# s4 Z+ a# |
}7 h9 D8 l5 q6 p1 {
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
# z5 C9 x) p. R8 D}4 U7 X9 a+ E1 w$ u; N% [
) X; z0 T9 d1 z+ d8 O! y+ G% gfunction mytheme_admin_head() { ?>
; W$ c" Z0 x9 T# V: ^9 K7 `<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
- U: @# F7 e0 M: V o8 }<?php }
) d6 D5 D! ?; h, ^ T |
|