|
|

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