|
|

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