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