1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
| 1. / 2. / ...
php
system/core/tolls.php
function cs_pages($mod, $action, $records, $start, $where = 0, $sort = 0, $limit = 0, $small = 0, $more = 0) {
global $account;
settype($sort, 'integer');
settype($start, 'integer');
settype($limit, 'integer');
if(empty($limit))
$limit = empty($account['users_limit']) ? 20 : $account['users_limit'];
$add_where = empty($where) ? '' : '&where=' . $where;
$add_where .= empty($more) ? '' : '&' . $more;
$add_sort = empty($sort) ? '' : '&sort=' . $sort;
$pages = $records / $limit;
if(round($pages) < $pages OR round($pages) < 1) {
$pages++;
}
$pages = round($pages);
$actual = empty($start) ? 1 : round($start / $limit) + 1;
$maxpages = $pages >= 9 ? 9 : $pages;
$last = $actual <= 2 ? 0 : $start - $limit;
$next = $actual >= $pages ? ($pages - 1) * $limit : $start + $limit;
$more = 'start=' . $last . $add_where . $add_sort;
$result = (empty($small) AND $actual != 1) ? cs_link('<c class="button"><span><</span></c>',$mod,$action,$more) . ' ' : '';
$run = 0;
while($maxpages > 0) {
$run++;
if($pages > 9 AND $maxpages == 6 AND $actual > 5) {
$result .= ' <a class="button"><span>...</span></a> ';
$run = $actual > $pages - 4 ? $pages - 5 : $actual - 1;
}
if($pages > 9 AND $maxpages == 3 AND ($actual + 4) < $pages) {
$result .= '<a class="button"><span>...</span></a> ';
$run = $pages - 2;
}
if($run == $actual AND empty($small)) {
$result .= '<b class="button"><span>' . $run . '</span></b>';
}
else {
$more = 'start=' . ($run - 1) * $limit . $add_where . $add_sort;
$syf = cs_link($run,$mod,$action,$more);
$result .= "<c class=\"button\"><span>$syf</span></c>";
}
$maxpages--;
}
$more = 'start=' . $next . $add_where . $add_sort;
$result .= (empty($small) AND $actual != $pages) ? ' ' . cs_link('<c class="button"><span>></span></c>',$mod,$action,$more): '';
$cs_lang = cs_translate($mod);
$result = $cs_lang['page'] .' ' . $result;
return $result;
}
________________________________________________________
templates/..$$$../layout.css
.pagination{
background:#ffffff;
text-align:right;
background-color:WhiteText;
float:none;
padding:10px;
padding-left:100px;
}
a.button {
background-color:transparent;
background-image: url(../images/btn_right.png);
background-repeat:no-repeat ;
background-position:top right;
color: #fff;
display:block; /*opera*/
display:inline-block; /*ie*/
display:-moz-inline-box; /*ff*/ /*font: bold 12px arial, sans-serif;*/
font: normal 13px arial, sans-serif;
height: 32px;
margin-right: 0px;
padding-right: 10px;
text-decoration: none;
}
a.button span {
background-color:transparent;
background-image: url(../images/btn.png );
background-repeat:no-repeat ;
display: inline-block;
line-height: 21px;
padding: 3px 0 8px 3px;
}
a.button span img{
margin-left:-5px;
margin-top:-2px;
padding-right:5px;
}
a.button:hover {
background-image: url(../images/btn_hover_right.png);
color: #fff;
outline: none;
}
a.button:hover span {
background-image:url( ../images/btn_hover.png);
}
a.orange {
background-image: url(../images/btn_right.png);
display:block; /*opera*/
display:inline-block; /*ie*/
display:-moz-inline-box; /*ff*/}
a.orange span {
background-image: url(../images/btn.png);
}
a.orange:hover {
background-image: url(../images/btn_hover_right.png);
}
a.orange:hover span {
background-image: url(../images/btn_hover.png);
}
c.button {
background-color:transparent;
background-image: url(../images/btn_right.png);
background-repeat:no-repeat ;
background-position:top right;
color: #fff;
display:block; /*opera*/
display:inline-block; /*ie*/
display:-moz-inline-box; /*ff*/ /*font: bold 12px arial, sans-serif;*/
font: normal 13px arial, sans-serif;
height: 32px;
margin-right: 0px;
padding-right: 10px;
text-decoration: none;
}
c.button span {
background-color:transparent;
background-image: url(../images/btn.png );
background-repeat:no-repeat ;
display: inline-block;
line-height: 21px;
padding: 3px 0 8px 10px;
}
c.button span img{
margin-left:-5px;
margin-top:-2px;
padding-right:5px;
}
c.button:hover {
background-image: url(../images/btn_hover_right.png);
color: #fff;
outline: none;
}
c.button:hover span {
background-image:url( ../images/btn_hover.png);
}
c.orange {
background-image: url(../images/btn_right.png);
display:block; /*opera*/
display:inline-block; /*ie*/
display:-moz-inline-box; /*ff*/}
c.orange span {
background-image: url(../images/btn.png);
}
c.orange:hover {
background-image: url(../images/btn_hover_right.png);
}
c.orange:hover span {
background-image: url(../images/btn_hover.png);
}
b.button {
background-color:transparent;
background-image: url(../images/btn_hover_right.png);
background-repeat:no-repeat ;
background-position:top right;
color: #fff;
display:block; /*opera*/
display:inline-block; /*ie*/
display:-moz-inline-box; /*ff*/ /*font: bold 12px arial, sans-serif;*/
font: normal 13px arial, sans-serif;
height: 32px;
margin-right: 0px;
padding-right: 10px;
text-decoration: none;
}
b.button span {
background-color:transparent;
background-image: url(../images/btn_hover.png );
background-repeat:no-repeat ;
display: inline-block;
line-height: 21px;
padding: 3px 0 8px 10px;
}
b.button span img{
margin-left:-5px;
margin-top:-2px;
padding-right:5px;
}
|