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