|
|

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