|
|

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