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