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