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.
| 1. / 2. / ...
<?php
// ClanSphere 2009 - www.clansphere.net
// $Id: index.php 2343 2009-03-22 18:42:12Z hajo $
$cs_lang = cs_translate('links');
$data = array();
require_once 'mods/categories/functions.php';
$links_count = cs_sql_count(__FILE__,'links');
$data['head']['body'] = sprintf($cs_lang['body_list'], $links_count);
$select = 'categories_name, categories_id, categories_text, categories_subid';
$cats = cs_catsort( cs_sql_select(__FILE__,'categories',$select,"categories_mod = 'links'",'categories_name',0,0) );
$categories_loop = count($cats);
for($run=0; $run<$categories_loop; $run++) {
$data['categories'][$run]['name'] = cs_secure($cats[$run]['categories_name']);
$data['categories'][$run]['url'] = cs_url('links','listcat','where=' .$cats[$run]['categories_id']);
$count_links = cs_sql_count(__FILE__,'links','categories_id = ' .$cats[$run]['categories_id']);
$data['categories'][$run]['count_links'] = $count_links;
$data['categories'][$run]['text'] = cs_secure($cats[$run]['categories_text'],1,1);
$data['categories'][$run]['if']['subcats'] = false;
if (!empty($cats[$run+1]['layer'])) {
$data['categories'][$run]['if']['subcats'] = true;
$data['categories'][$run]['subcats'] = '';
for ($i = $run+1; $i < $categories_loop; $i++) {
if (empty($cats[$i]['layer'])) break;
$data['categories'][$run]['subcats'] .= cs_link(cs_secure($cats[$i]['categories_name']),'links','listcat','where=' . $cats[$i]['categories_id']) . ', ';
}
$data['categories'][$run]['subcats'] = substr($data['categories'][$run]['subcats'],0,-2);
$run = $i - 1;
}
}
echo cs_subtemplate(__FILE__,$data,'links','list'); |