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