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