|
|

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