|
|

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