|
|

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