|
|

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