|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////) e& T0 u; |- j. ]
// Theme Option
3 M" T+ q2 R. @0 L////////////////////////////////////////////////////////////////////////////////
i/ y( b9 J; C Q) ?1 M2 G8 ^
S( s0 j; x/ Q; r9 s$themename = "Zenx";8 r% ^: s$ a" k8 _- {/ f% X
$shortname = str_replace(' ', '_', strtolower($themename));
9 ~2 q) h: j4 k n' i7 S7 Y$ u* ] W* Y5 T7 D- t" _- g
function get_theme_option($option)# m+ }% u- o8 v9 d
{2 A. M0 E* a; Y- c4 @- z" q
global $shortname;' H! f# \- j3 _+ l: U$ a7 V
return stripslashes(get_option($shortname . '_' . $option));
. h4 k& c$ R4 h8 k}
( p' p/ B0 p- E1 \/ V9 v) L; Y& s; K% D( P A0 a+ _
function get_theme_settings($option)
3 ?8 A, F, ~1 M# r+ T{' ^1 R- V) x7 k- _1 D$ b7 f6 Q! a
return stripslashes(get_option($option));* ?# l) ?5 `% ^
}# l* ?6 N4 Y9 L
$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");
9 v) x5 }# N% r$ h3 p N. K$wp_getcat = array();
6 B, P2 S( I& p" wforeach ($wp_dropdown_rd_admin as $category_list) {1 {: d- d5 r2 |# ^' A* n% S
$wp_getcat[$category_list->term_id] = $category_list->name;% [$ c+ O' P; I3 Q, f8 c1 Q
}
! p, i4 l3 d1 |5 @; S$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
, E1 S/ X. O# T% @; u, j1 E& l, T$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
: y% W1 X: B' Y6 Q( a$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
# E7 c- @' S3 b! q, `5 R& I2 j* c% W- O: L9 O7 b
$options = array (; R1 K1 N4 h/ E" w, V" e
! t! w- L/ O1 |9 x9 N* V8 q" @- ]+ W4 ?& A
" f0 T y3 d o( D; o6 z. K N
array( "name" => "Blog Header Settings",+ u% p* X& Z# B, _5 \+ E
"type" => "heading",
) R, J$ L/ N5 G; @( R9 c) `- g ),- x m+ z$ e/ j
. i* g# f+ M& u1 v5 x8 D array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",6 g j) {: n" o( g% |
"id" => $shortname."_header_logo_activate",
" R6 M9 i3 i( G "type" => "select",
% ?2 S8 b3 F5 ? "std" => "No",4 n6 t" i0 o, r) q
"options" => array("No", "Yes")),; ?: p3 P; c, B% K
- E1 F- g: O) z5 C+ m array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
- n' [8 K1 F! E "id" => $shortname."_logo_url",6 c6 F7 K( ~$ g8 g% [) `; ]
"type" => "text",, G% A8 W% k- E F p' O
"box" => "social",
/ O$ v [: I' u "std" => "",
" ~0 ]$ a" x7 T/ Y ),
) I1 a; s& v( G$ z* u, i ' G7 F5 S" \ O3 i
array( "name" => "Insert Header Banner HTML Code (Header)
0 D1 J8 i p7 F4 E2 l' F <br /><em>*Recommended Size 468 x 60</em>0 _3 N+ c, \" S/ E8 L1 _
<br /><em>*leave blank if not use</em>",, q" K- j: Z$ O( s; c4 i1 l
"id" => $shortname."_header_banner",& Z G. T8 ]: K6 i
"type" => "textarea",1 X) ~ m! d3 h' ?
"std" => "",9 v8 o8 `& H) K$ R4 N% P
),
7 x* `. \; c& W
" _5 J" f- x( L, L array( "name" => "</div></div>",+ K2 H' b$ T8 O
"type" => "close",
2 q5 l. T$ L ]" g5 j; u: J) s$ ` ),) b/ \ Q& d* M3 y8 v% g
( w, N- H" v* [5 v$ K- ]
+ {1 [/ D' c: I5 r5 K. D array( "name" => "Header Navigation Settings",& o7 w# N/ E7 _! ?; \" d3 ]% o+ |' O
"type" => "heading",
% k3 E r) v5 N ),
* x1 R+ g- F6 F
* [2 [ r1 d1 d# o+ j% K array( "name" => "Insert Page ID To Exclude On Header Navigation<br />& X! x' E7 o9 \
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
8 C m8 M6 J$ N$ r# q <em>*Enter the page post ID number only</em><br />/ i; I& f% ^) o9 \8 G. B- G8 M
<em>*separate by comma</em><br />
# L# K0 f5 b/ J/ q: Q/ b <em>*Exclude pages which you don't want to show on the header navigation</em>",
3 ?2 x- c! F9 `+ u: k' @* B "id" => $shortname."_header_page_navigation",$ u( M' N, o5 G L% Y9 W& d
"type" => "text",
8 y) x% \" v$ I "std" => "",
! Z, f5 `- b* L/ U, N, |4 J( b. x ),
* u" N+ A$ p" N
0 N7 v' W3 M% Y6 R" g ]+ O* b8 U; V" u* A array( "name" => "</div></div>",
0 x# s9 f( E7 I" w* E- ~4 B( W& t "type" => "close",
# r* F( o* h3 x. V' ~) @ ),6 G# x) ]. _5 j6 E+ Q6 y4 `$ P
0 h r5 [4 Y% v) m# i# f* L5 o
8 p8 L8 e% e7 d' S9 f* R, l array( "name" => "Post Auto Thumbnails Settings",7 ~! {0 m; r" y
"type" => "heading",' `: s/ e- d) Z# {) U
),
. W( g( H, L5 L: H & _# J7 U4 J+ J
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>"," r% X% P+ T5 ^, @: |" X, _
"id" => $shortname."_timthumb_activate",+ a8 {! ~# b. w
"type" => "select",
9 Q2 t/ }- j- c, ?4 F$ V "std" => "No",1 a% A/ ^1 n+ n/ a w: O5 Y0 P
"options" => array("No", "Yes")),' e- |1 ~0 r8 _3 p
: O# N4 i4 z( z8 S8 T6 Q8 b array( "name" => "If Timthumb is enabled, Please choose its cropping method",. {- F# M. T& M5 } H3 b
"id" => $shortname."_timthumb_cropping",
+ _8 `, a6 R# f- k, l& P "type" => "select",6 s c" I w4 ]7 D
"std" => "",& j1 q% T2 y0 [9 z% F/ @" V
"options" => $crop_position),
2 w, x/ J5 V1 C0 B+ ]6 y2 F7 u# b
array( "name" => "Insert Width Of Thumbnail Image<br />/ O! T3 G$ t- o5 r9 E {" h
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
/ w# j+ w, z O+ ]. S: Q <em>*Leave Blank To Use Default: 250</em><br />",
, r E* G4 V- j2 U1 B+ T- i "id" => $shortname."_thumb_width",4 V) j6 |! C! }
"type" => "text",4 N4 p9 A, ]# L7 N* _) ?6 N
"std" => "",* Z4 \8 y; p: R5 ?$ k1 j; R
),
6 t( i& C: j3 Z1 i( _( H
4 l. j3 W$ E( q v0 j& c array( "name" => "Insert Height Of Thumbnail Image<br />/ Y# n: Q, b% S- Y6 v
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
3 `* S; v& \' q; u8 K: F# k <em>*Leave Blank To Use Default: 200</em><br />",+ F7 `7 q( t& Q
"id" => $shortname."_thumb_height",1 Y) E; \; d/ A" e: E2 i7 U5 z
"type" => "text",
2 ]2 X) p; `$ N& a "std" => "",' o' r. E# w$ r8 ]3 N& J# e: @
),
7 o. C1 Q" R9 X1 Y& }5 c! o' Z9 i8 f+ m6 M0 l
array( "name" => "</div></div>",5 n) @9 S# E6 d4 h
"type" => "close",
: `+ H/ h7 {( T9 M1 f5 ^" G' e ),
2 c! o7 k) @7 y' m/ i3 v" v- G
array( "name" => "Featured Content Slider Settings",% s7 a; S/ N$ O2 ^$ q
"type" => "heading",
: l2 h0 Z. Q- w: ]0 S$ v. ~ ),
0 R5 x; m' W4 q1 [3 F) N$ D; o; L1 I
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",9 N6 ?1 i3 @) _4 V$ T1 u7 ^
"id" => $shortname."_featured_activate",
, e# Q7 }- C- X/ S8 r5 C+ e "type" => "select",. H( [0 y4 Z- a% G" t
"std" => "No",1 Q3 G& N! m7 p9 D6 J
"options" => array("No", "Yes")),
4 @- ]& ?) ?% [; c) k, l1 r! A, o2 x- M: o1 y/ g
9 b+ o2 f* N8 |4 q5 y* W array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",% h6 {; [0 S1 v0 h/ x
"id" => $shortname."_featured_category",
7 q) Q; P9 m9 F8 `5 m# m2 P "type" => "select",
W- C: } ?' G1 \ "std" => "Choose a category:",
* A: D0 |6 ?, w8 j0 |- @- \ "options" => $wp_getcat),
: n7 J- u# D" m( f# z! |$ Y" X1 J1 t7 O: m+ A7 ?
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
- G& K& P* u+ g. I6 @9 I "id" => $shortname."_featured_number",
7 s5 S6 C9 @/ B x "type" => "select",) }; B& B. @9 j( v# x+ V( B- A
"std" => "Number of post:",
. b9 y' J, i& Z1 V0 z4 l "options" => $number_entries),
/ H) Y& l3 Q; n6 c: W8 s- D( T' V: \4 H& F/ h* H
array( "name" => "</div></div>",1 }8 r$ H; ]' m$ r: e' u
"type" => "close",
3 r( {3 |9 N0 w- F% o# M$ [ ),* K, r9 W5 D+ f, E
: J8 z* W' b' w$ t+ F4 [8 P+ V array( "name" => "Featured Category Settings",
?# T5 k4 D; G2 |) U "type" => "heading",
$ p T: a: L! B4 R8 }/ d# M ),
E7 a u" W! Z
l9 v, c, U9 R0 m9 G/ P array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
- c/ y$ i, T6 B% `1 ], d- e "id" => $shortname."_featured_category_activate",
# }3 Z' }8 x8 w$ @* X2 @9 l5 Y( p7 P "type" => "select",
9 c, p6 ^# h9 @3 @. C3 I2 J "std" => "No",
0 x7 J! Y% u8 _/ M& S "options" => array("No", "Yes")),
- U7 w& T% a! Z/ n ! u& P) M% E0 X* f# l0 z
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
& h: d1 L+ M6 Y4 t4 Q- G4 b. l "id" => $shortname."_featured_category_id1",
" N& a: @/ {! E( V- t "type" => "select",3 g: P! w1 m3 B& W" L- ^2 R q1 }
"std" => "Choose a category:",
8 L# H1 U! J& k" Y4 V; @ "options" => $wp_getcat),
& U6 _) L9 Y" s& S0 M, H# _6 j
* C0 F- M, R! Z, a1 a: B array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
* @3 T1 p1 d0 u' H5 E% R c "id" => $shortname."_featured_number1",; p: ~ d5 |3 ~8 l
"type" => "select",
; B8 O! f& Z$ d/ X# f% z1 @9 e "std" => "Number of post:",* ~5 W9 T2 g& g9 G. C+ q* U4 n7 e3 O
"options" => $number_entries),; c6 Q/ L* T' u' ^& a- V) t
+ w6 {* N2 ?6 h- B/ k
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
3 Y! w z# J. J "id" => $shortname."_featured_category_id2",
& @9 R% R0 _! | "type" => "select",
7 @5 {+ y, Q4 t "std" => "Choose a category:",7 y! z9 t6 Z2 t' M
"options" => $wp_getcat),0 w' a7 J8 M; ?9 Y+ k
l* p* F; T& P; Z8 x% k% b
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",. o9 M) w) |5 v3 \6 S6 k. a
"id" => $shortname."_featured_number2",2 m; o- g5 {5 H1 a" L
"type" => "select",
" J4 {, l: \1 D+ A1 r "std" => "Number of post:",
( b* y, F/ D4 a% m* w "options" => $number_entries),7 y2 V0 r* L+ D) w8 h% _
( {4 z+ A f) ?! G3 ?
; h3 r' Y/ A+ j" ^* C array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",( P! m8 O/ R% _- u H
"id" => $shortname."_featured_category_id3",
) {2 A" ~5 b, u' j7 |7 F t "type" => "select",% x) s5 d* i9 b+ r5 g( i0 h( Q$ @
"std" => "Choose a category:",2 P2 M3 C. Q* d7 i
"options" => $wp_getcat),
2 O1 T: x9 P8 \3 `
: a6 }9 G4 Q: U) a& r5 R0 b5 P array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",) z! ` m0 S: [; P( z( U% ~
"id" => $shortname."_featured_number3",
/ q: L" z; T; y! p1 S5 }9 ~' w. u' e2 F% s "type" => "select",
" L+ p0 M9 p% q% D4 V; |2 y; \ "std" => "Number of post:",) A3 G4 g: d5 Q+ N2 n: z9 D2 w
"options" => $number_entries),6 h, y$ Z) N! M, @3 A8 |
# N5 R" F+ C+ l8 {2 \3 }- t. Q w9 P1 `
array( "name" => "</div></div>",* L" L6 C6 r: G# Q+ E
"type" => "close",
/ P$ E/ v1 j, P4 } Z: W3 P ),
% e% g5 L' p8 @; V5 b
. p9 a2 t2 W& n- V4 x. t% K8 i" k3 `: k* n( R% E* N0 w" b
array( "name" => "Google Adsense & Analytics Settings",
2 g+ {7 c7 ?& V ^5 _0 w "type" => "heading",
! y. S7 X/ m6 K8 E+ h4 d Q9 g ),
, h# h6 t# M1 S, f0 Z& k+ F: Y) h& I0 R2 {. V; J1 q% Y
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
/ Y& V! V% B. ?2 r! @6 y7 S" ? "id" => $shortname."_adsense_loop_activate",
6 k w3 Y# f/ A T- L0 [+ ~4 R "type" => "select"," i3 U; G# b/ f+ P
"std" => "Disable",( f- H% b8 \& ~* ~$ w/ u9 Z' D
"options" => array("Disable", "Enable")),7 M0 z) U4 J% B9 a6 s6 d4 G
Q4 B% Y3 j& U: u! Q$ V$ X
array( "name" => "Insert Google Adsense Code For Loops Here<br />" ?: Z$ u7 x, f1 s- c: y h3 D! v0 L
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",6 x8 C/ ]3 o+ y2 j& a; Z1 g' K
"id" => $shortname."_adsense_loop",! G1 s9 @' _5 M% f9 i, Q
"type" => "textarea",
0 N' d& ?2 W. u "std" => "",8 A1 U6 J: ?1 m/ r
),
& O' A; G$ Y( k8 k& v! y4 \7 `( Z7 }# a# u
! W; n2 y& _6 O& ]# f array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
; X# K' d+ L- G- b. B "id" => $shortname."_adsense_single_activate",
) g& B C1 b( o3 G( n9 ^ "type" => "select",$ `; ?0 M8 Z% k- [
"std" => "Disable",0 o7 z% Y% r/ J n# ~" R7 b" F
"options" => array("Disable", "Enable")),( b% p" b# ]2 v8 t
* z! ~$ _5 S m$ k4 Q/ l/ d
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
8 c* k: Z1 e& x5 |- h- f: D) i7 J$ q <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
- V1 r3 v P9 ~$ e$ a# R$ ^( k: _ "id" => $shortname."_adsense_single",
1 I4 y/ ^& |% D; e4 G2 R "type" => "textarea",
( l# b7 W, Q0 ]+ E "std" => "",3 F6 D) S5 A0 T7 A3 \
),
! M0 L5 K5 W5 m- G7 h; l' @+ L% e" P
& u0 f5 A K7 e
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
" s7 o7 \" M: E2 h "id" => $shortname."_google_analytics",0 O5 A* a6 ?# ~2 P H* y
"type" => "textarea",
n4 w/ B8 i& l" I8 j "std" => "",
( }* x" z$ f4 G7 ^8 l* y ),; z+ `4 y2 S! @ V8 |
3 X/ A! y0 E+ i8 z3 {. c7 y6 U+ G! h& J
array( "name" => "</div></div>", L3 U. `. i3 E" ^
"type" => "close",. j+ x2 ~! ?1 w2 L+ i! V' c
),
# a. O+ |" [, k% L
$ [% U7 ?' f$ l( }# C
# g& v3 h- ~; g# c! j+ l* Q array( "name" => "AddThis Social Bookmarking Settings",
1 @5 m* V( O1 Q- S7 S3 ]" i4 Z "type" => "heading",
3 F. o, u d* n* B1 F ),
/ q0 g2 B; ^6 G) y8 s1 b
+ B( L/ P# q! ~7 d1 D array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
5 I$ l2 m' C# @" j3 [5 ~ <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",) w+ `1 a9 @' d1 L$ x
"id" => $shortname."_addthis",
2 l' a+ ^% O9 T "type" => "text",, B; h9 N/ G* q1 B/ @! ]4 q
"box" => "social",5 V( e9 S% o1 A0 s* t
"std" => "",
& v B, C$ Q4 |4 A" j ),, v% }+ W5 s T3 E
# y; V8 F! w/ u# l3 E* m
array( "name" => "</div></div>",- j! u5 J; i1 W0 C! s) Y
"type" => "close",
( t4 Z; ]+ ~' b8 n: K ),
6 `2 g7 W1 s4 g$ _' u& p' A M * w9 f, z( o6 G% w' k1 b' _
8 w/ u1 O# u; J& \9 W O4 ` : J+ m7 {6 l& R" }& y
array( "name" => "YouTube Video Settings",
" I ^' W4 J! [( j5 R& R "type" => "heading",# K8 @1 C5 S/ [5 h
),; @7 L' Q9 M2 j7 Z) y( g
3 b8 C# p+ d: l' @) Z' k/ _, U
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",' z9 ?6 i2 w0 t) q/ [5 ~3 w
"id" => $shortname."_emvideo_activate",- }5 n. ~4 ~! b3 X7 j% g; y( X% T
"type" => "select",
% ~# w+ c% c |6 b" v: R$ O "std" => "No",0 B8 U7 s) Q% |" ]8 B
"options" => array("No", "Yes")),
6 j7 t }; [8 o, L+ F% W( M
( m& S3 V! `& m; {$ k0 |, B6 a 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>",# ]2 R" c: A+ ~4 w
"id" => $shortname."_emvideo",
. {, {; V ]: c9 S "std" => "",6 R: ~% ]; J( \
"type" => "text"), l, P- f" N- G* L
. ~# y; N4 Q! i$ |( G; Q. }
array( "name" => "</div></div>",$ d! D' ~4 l- ~/ g7 [
"type" => "close",
. y: @3 x# g% \ ),1 s0 w4 _0 r* \0 E. ` n) l' l
' d: w4 b% ~/ O: C array( "name" => "Twitter Settings",) \8 G$ X2 y5 o% k- s; r
"type" => "heading",+ j4 [1 y& L. ~# \0 T
)," p- X$ |# X7 O$ J
7 B+ Z5 Y$ p- s4 W; b8 P array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",9 m6 @2 Q" c$ w) I& ~* M( \+ E
"id" => $shortname."_twitter_activate",( L, ?4 X% V6 Q4 ?" e- }; G
"type" => "select",
6 m D4 z, S: [' m7 E& }" Q: d) W! n3 | "std" => "No",4 I: `+ N& _( s2 }3 L; Z0 c, m
"options" => array("No", "Yes")),
* \# D7 b- y1 B8 D. t6 ?; J1 m; Z: j* W- \% I, |9 w( e1 m3 E
array( "name" => "Insert Your Twitter ID here8 }7 q8 o6 e+ t# z. G
<br /><em>*leave blank if not necessary</em>, N1 E5 s. ~/ c# n2 N6 n) @& b9 P
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
+ \3 ~) v) z- T: M% q "id" => $shortname."_twitter",
1 w' `1 _% U1 L "type" => "text",
9 S( e' b5 J/ l M0 g0 K* M" X "box" => "social", A5 \; X# O% [) N
"std" => "",0 u9 ]; ~( s! B0 t; m0 @
)," H+ e- } C# f: r+ [7 F0 s
b' m, |- M& b& x' ?! ? array( "name" => "Enter Twitter Feed Count here
! ?) l# F* R3 y( V: C <br /><em>*leave blank if not necessary</em>
) l8 r2 w K8 c1 h <br /><em>*Enter How Many Twitter Feed To Display</em>",
9 P M, y. d7 y "id" => $shortname."_twitter_count",) Z6 J3 A9 Q) }" z. Y
"type" => "text",
# D" v' U5 y" y% [" ]: O& {2 B "box" => "social",( F( a3 w- Q& [- q9 r0 p
"std" => "",
8 e5 j+ o- K7 ?. a' l ),1 A+ {$ p% q, g6 N. z: x0 Y$ ~
! z! c5 r! ?. j# X1 `% a array( "name" => "</div></div>",
2 b$ O% ^/ {" T, P3 Z- v* x* v( C/ R "type" => "close",# e$ @0 B* N9 e* s( w: r7 s
),! ^- u- G9 n& b3 k G
0 F" K! D6 f' |1 q& I
# o1 o+ x9 s2 _4 s6 d array( "name" => "125 x 125 Banners Advertisement Settings",
% q- f' r, q$ e0 t$ B( z. e "type" => "heading",
( X# n i% M' z2 K" _1 T" f/ N ),
0 Y# Q, i! |5 l0 X9 V . d( L/ x, \* I& O4 f ^
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
4 o- i) y6 z( D9 [+ i( H8 ` "id" => $shortname."_sponsor_activate",, X4 M* E* k( F
"type" => "select",
8 f( V0 N- m0 e* D; z "std" => "No",& n* n) }" R6 T& M: S0 ^
"options" => array("No", "Yes")),
6 H( c0 O- J4 D3 n% u
6 ^$ J* s2 }* `4 {" j. `) g/ B. `4 W; d: b
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
6 ? s. x3 `+ J: D "id" => $shortname."_sponsor_banner_one",4 n9 ^, |' }) C% h3 O/ S% E7 I; d7 v& {
"type" => "textarea",
$ j" F2 \8 Q, K6 N. x6 h' t "std" => "",0 T7 o7 e# Q3 x" Z/ @1 Y) A
),
: g4 k& p r+ c8 U `
- S4 }- Y, o& r. m' I array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",8 y# v6 W' J! | m4 H' d5 ]5 Q
"id" => $shortname."_sponsor_banner_two",: Q5 B+ U) T5 r' \/ v0 B0 h) t$ X
"type" => "textarea",8 c" {" Y4 Q; b! M3 J# t9 d
"std" => "",2 V' }) C/ O( E9 y; \
),; c/ I: d" s5 d
. O0 T4 f0 N2 y" ^: n0 b5 a array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",5 G, j) j5 |/ p% J1 j
"id" => $shortname."_sponsor_banner_three",
& A0 e" }# n, A6 K8 ]1 T2 ` "type" => "textarea",
& c8 K, l0 m6 o7 p/ J$ s3 t "std" => "",0 d7 |. r$ o) _" R
),* L( r& u: S4 a$ m
3 r( m) t1 Y# e5 N& ~ array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",2 X# x3 l' u4 _% c; M9 H; I: K3 u1 @# x J
"id" => $shortname."_sponsor_banner_four",% v, a% H9 M, P/ E' v8 M
"type" => "textarea",
' ?. B( c6 g E( p% ~! s "std" => "",! |" g7 x" k8 {+ B
),
% g4 u5 Z1 W( \# p$ H) V p E+ N9 R
: c4 ^% d z: c- y% ]8 x array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",) K7 Z; X0 S* V5 { h! H* R
"id" => $shortname."_sponsor_banner_five",* o% F* G" L2 B$ _3 B
"type" => "textarea",( Q- j" V* ]% T @
"std" => "",8 q& k _% [" h3 E8 N1 W
),7 h1 v+ b( W: |- c; ]
( D- j3 x/ p1 T6 T array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",! J( R# q' {# ~( U1 B7 O
"id" => $shortname."_sponsor_banner_six",+ h4 T5 T3 G9 }& r" F( m
"type" => "textarea",/ ? j6 ~7 j& y& A d h
"std" => "",
0 Q8 `. T* ?. W, a3 u# M, v1 P+ B ),! A3 ^0 V, E2 ^) w6 t
# N8 K0 H3 E" q+ B s
array( "name" => "</div></div>",7 E8 A$ x2 d" J# k+ s
"type" => "close",
; R( e( D/ Q3 N ),
. c% I% |0 _* b/ [
" v" Y' w- ?9 Y, x; b# E0 N# E! v- [% Y; u
; A; [$ q2 s2 t, B, N( c2 @5 s
);
$ }0 B2 J0 ^+ x; U q6 y; C$ I8 u+ {2 u
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
" K f7 L' F9 z. A6 W" W$ t5 z
" Z: W' J: J' uecho "<div id=\"admin-options\"> ";# a! v. w, l6 u" i* ^2 }2 S
/ k: W! H( u( `
global $themename, $shortname, $options;- r2 |% @5 S' R7 Q
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';! ]) t, X$ D4 U
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>'; C6 D8 n! s/ W! c, f: O
?>
7 }' ]- a5 _; p9 A4 N) K; k" E$ H
7 ~/ h7 n: v/ E: _. O/ y# h6 q<h4><?php echo "$themename"; ?> Theme Options</h4>
d0 @7 p) `- h B1 |( i2 f: g& @0 K9 f6 v1 S* q6 y6 a
<div class="annouce">
0 S. k. V1 q0 c% M) ~+ D<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>1 B) Y3 k! B3 P j" S6 A7 Z8 i5 e
<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>6 V4 }+ ^9 H+ {3 |: _4 P: x% ~
</div>! W& v/ D( v9 Q+ Q, L
0 o$ A, E; m. x+ g3 k6 y2 s<form action="" method="post">
* D2 c0 U( J, p& z( `% n3 M) ^: H# r! x# W' P# E
<?php foreach ($options as $value) { ?>
6 r+ o! M: j5 u9 y4 @
5 s, i" Q9 u- {+ N: }6 t- w& l<?php switch ( $value['type'] ) { case 'heading': ?>
4 r- E; [2 I; \' Y+ t0 z- b9 V! A" m% S1 d5 E
<div class="get-option">8 a7 m& V, x1 g8 u
. {; y. ~9 z6 Z! ]- e; u( }3 a<h2><?php echo $value['name']; ?></h2>
8 t+ T# E5 I/ a8 G( t& e9 g
[9 q9 S# U6 r& ] s. H( }& S |' h<div class="option-save">9 _; E3 m8 _! q% r
. @7 d: _0 W9 {4 c
<?php9 Y' _, {) e8 b6 D
break;
0 W' T8 T! q5 E9 q% N+ s, _case 'text':# B9 K5 F# u% s; I: N
?># m! m8 _. ~/ Z' P) X+ [1 b. |
; ?& e/ C( x4 u' h+ [. v, q
<div class="description"><?php echo $value['name']; ?></div>
0 H/ J* y8 `+ x5 y<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (1 h. D: _$ C: B
! d& T) S( U' E7 e& rget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>/ @2 J8 b9 e. X3 W
6 |2 h" M' U6 Y$ v<?php5 a6 R9 m: y5 L% Y, H: |5 d
break;& O* i) L8 u$ x6 u; _8 M
case 'select':& N% i6 y; T, @' {- j# |9 F
?>. i# }) W- T* O& a% a
( N2 n: e+ z! v; {9 b5 z% u9 K<div class="description"><?php echo $value['name']; ?></div>% L- o# z a( C, H$ I
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">: n7 @* |( p) i' n# b
<?php foreach ($value['options'] as $option) { ?>
9 _4 g9 c$ e) J+ D<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
- p- C. R9 F- F5 w% d0 ?- H3 q<?php } ?>
" M7 W. ~4 N8 E2 @4 s2 @5 K: \</select>
' ?0 X! U. z* ~' w</p>' h% g' b# L- v8 [
2 w7 Z+ c. b7 L f9 O3 H
<?php5 \" P; ?1 o1 c& x4 h/ B; d+ O
break;
3 _& o' f- L/ m$ w/ O2 D- Dcase 'textarea':; p4 z* \3 g6 v% ?8 G% p8 I& U* d+ v
$valuex = $value['id'];+ ]3 d7 c9 `2 E( H; _ P
$valuey = stripslashes($valuex);: }1 f& h; k( {
$video_code = get_settings($valuey);
0 M* A3 M- c; @( F+ s v V; X?>" {1 o; M- i% _0 d: T) U! k' ]
9 E1 w6 |+ W# V* Q1 A9 d$ F
<div class="description"><?php echo $value['name']; ?></div>
2 q2 }0 b" _# @8 N% ?<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
' {5 l; R! J0 B. Y& R% r2 ^: y' Q7 Z1 B
else { echo $value['std']; } ?></textarea></p>- a- P# z2 @7 X8 V/ Y/ {( n `8 R
* i8 G% N% L5 y: i" {% o; R, s
<?php
) ^$ a* h/ ~' Cbreak;
: t2 C) u$ z- L* `2 Fcase 'close':
7 Y/ P* \* m8 p) B?>
! s# o* l& }- z) ?2 Q5 i' ^7 y. m! a' Y, s4 ?
<div class="clearfix"></div>9 W+ B% Y1 d5 ?' }6 a+ O' b- ~0 v9 B: l
</div><!-- OPTION SAVE END -->
, B) M, K5 O7 G& T" r
- G/ I8 S4 ^ ~<div class="clearfix"></div>6 v2 j+ r; a2 X0 Q1 U
</div><!-- GET OPTION END -->
! C% Z6 w8 d7 B+ T4 M8 l
1 r L- z- ], x9 n% m* d<?php4 M0 P, ~3 ]) v! i/ ^& ~ o' e
break;+ N6 y0 k/ v& r, x
default;
1 I; k9 D6 Q! ? ^% O; A l?>0 t6 x5 c' |& i, \- C
! x6 s, U7 w( b1 E$ S8 Z0 q4 ^) E. N7 B
/ h# {' o" z5 k9 _% T; T& p
<?php b N3 N' j s) H
break; } ?>
$ ?$ }( p' T; d7 e' o9 ?: q
9 w8 U. f" }$ R: W' o& y1 O<?php } ?>; R1 P. w7 D1 f7 q A4 c
0 G% J: L" P% ?6 N<p class="save-p">
* g* Y, {; W6 C. b) o0 U<input name="save" type="submit" class="sbutton" value="Save Options" />
! {1 e5 G( f' g. E) e3 v<input type="hidden" name="action" value="save" />
! w0 V# N7 ` J5 m9 V</p>3 \0 D% \0 O$ t" {- ^
</form>6 _) C) E1 j0 v3 e, z# W! ~
/ V6 X( v. y+ Z0 i" J<form method="post">
7 Q- e1 d* {: \ l<p class="save-p">2 l4 s1 W! B( D
<input name="reset" type="submit" class="sbutton" value="Reset Options" />0 H. p% y8 V+ O% U; D7 E
<input type="hidden" name="action" value="reset" />
0 @- h( o9 W1 C5 |& z9 r</p>
2 J9 v0 e$ V" I& f/ ^</form>
6 z i c' a- `/ K x$ y4 v
9 Y8 I9 ~9 W( Z0 l f</div><!-- ADMIN OPTIONS END -->
, S/ g+ z3 P8 {9 j( e- M6 [3 o" _4 Z$ Z* {
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
f z# A: \+ s
4 O+ d% l1 s: h+ e6 R0 lfunction mytheme_admin_register() {% A7 U* t. H' m: V H
global $themename, $shortname, $options;
3 L9 ~% _7 R$ w& h; ]+ Vif ( $_GET['page'] == basename(__FILE__) ) {" s, }) V. }% O* |
if ( 'save' == $_REQUEST['action'] ) {
1 I! \1 P! J& Rforeach ($options as $value) {! h+ V d' T9 p) s4 E3 p8 Q) {
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
- Q. u1 c) n% {. L Sforeach ($options as $value) {, D; q, @4 O8 U
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }, e0 K0 c9 k9 `+ L* ~9 x
header("Location: themes.php?page=functions.php&saved=true");
4 V% u3 O5 d5 C8 Y" odie;+ Y+ }5 v; ]: O4 j
} else if( 'reset' == $_REQUEST['action'] ) {3 x* S4 y4 d' h6 ^/ `' t% d
foreach ($options as $value) {
+ G1 f: ^ ~- m4 f1 Edelete_option( $value['id'] ); }, [$ q+ R0 I6 E) F6 o2 a
header("Location: themes.php?page=functions.php&reset=true");
! Z8 ]; n. I8 C: odie;7 h- f7 d% ~. a
}/ S- }6 }# h, D1 b, `1 M d
}0 c0 ? c: V/ b8 x% z
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
5 ~0 V) o- Z8 |, U0 P7 A" V* y. ?! L}0 H2 T& p M4 \2 z, R
( U4 h/ y& n$ }1 p* Zfunction mytheme_admin_head() { ?> f# ?+ I% T$ ^, V) \6 W
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />1 E# g4 S5 p+ A) o
<?php }
3 q; m3 B& s- s( z" W$ M8 S |
|