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