|
|

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