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