|
|

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