|
|

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