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