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