|
|

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