|
|

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