|
|

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