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