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