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