|
|

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