|
|

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