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