|
|

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