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