|
|

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