|
|

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