|
|

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