|
|

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