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