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