|
|

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