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