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