|
|

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