|
|

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