|
|

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