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