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