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