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