|
|

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