|
|

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