|
|

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