|
|

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