|
|

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