|
|

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