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