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