|
|

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