Beu mir so.
Links.php
Zeile 94 und 103 geändert bzw hinzugefügt.
<?php
# Copyright by: Manuel
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
function get_cats_title ( $catsar ) {
$l = '';
foreach($catsar as $k => $v) {
if ( $k != '' AND $v != '' ) {
$l = $v.' :: '.$l;
}
}
return ($l);
}
function get_cats_urls ( $catsar ) {
$l = '';
foreach($catsar as $k => $v) {
if ( $k != '' AND $v != '' ) {
$l = '<a class="smalfont" href="?links-'.$k.'">'.$v.'</a><b> » </b>'.$l;
}
}
return ($l);
}
function count_files ($cid) {
$zges = 0;
$e = db_query("SELECT id FROM prefix_linkcats WHERE cat = ".$cid);
if ( db_num_rows($e) > 0 ) {
while ($r = db_fetch_assoc($e) ) {
$zges = $zges + count_files ( $r['id'] );
}
}
$zges = $zges + db_count_query("SELECT COUNT(*) FROM prefix_links WHERE cat = ".$cid);
return ( $zges );
}
function get_cats_array ( $cid , $ar ) {
if ( empty($cid) ) {
return ($ar);
} else {
$erg = db_query("SELECT cat,id,name FROM prefix_linkcats WHERE id = ".$cid);
$row = db_fetch_assoc($erg);
$ar[$row['id']] = $row['name'];
return ( get_cats_array($row['cat'],$ar) );
}
if ( $r ) {
return ($l);
}
}
switch ( $menu->getA(1) ) {
default :
$cid = ( $menu->get(1) ? escape($menu->get(1), 'integer') : 0 );
$erg = db_query("SELECT cat,name FROM prefix_linkcats WHERE id = ".$cid);
if ( db_num_rows($erg) > 0 ) {
$row = db_fetch_assoc($erg);
$array = get_cats_array($row['cat'],'');
if ( !empty($array) ) {
$titelzw = get_cats_title($array);
$namezw = get_cats_urls($array);
} else {
$titelzw = '';
$namezw = '';
}
$cattitle = ':: '.$titelzw.$row['name'];
$catname = '<b> » </b>'.$namezw.$row['name'];
$catname2 = ' - '.$row['name'];
} else {
$cattitle = '';
$catname = '';
$catname2 = '';
}
$title = $allgAr['title'].' :: links '.$cattitle;
$hmenu = '<a class="smalfont" href="?links">Links</a>'.$catname;
$design = new design ( $title , $hmenu );
$design->header();
$tpl = new tpl ('links' );
$erg = db_query("SELECT id,name,`desc` FROM prefix_linkcats WHERE cat = $cid ORDER BY pos");
if ( db_num_rows($erg) > 0 ) {
$tpl->out(1); $class = 'Cnorm';
while ($row = db_fetch_assoc($erg) ) {
$row['links'] = count_files ($row['id']);
$class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' );
$row['class'] = $class;
$tpl->set_ar_out($row,2);
}
$tpl->out(3);
}
$erg = db_query("select id,name,link,banner,`desc`,hits,date from prefix_links WHERE cat = $cid ORDER BY pos");
if ( db_num_rows($erg) > 0 ) {
$tpl->set_out('catname',$catname2,4); $class = 'Cnorm';
while($row = db_fetch_assoc($erg) ) {
$class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' );
$row['class'] = $class;
$row['desc'] = ( !empty($row['desc']) ? '<br /><span class="smalfont">» '.$row['desc'].'</span>' : '' );
if ( !empty($row['banner'] ) ) {
$row['name'] = '<img src="'.$row['banner'].'" border="0" alt="'.$row['name'].'" title="'.$row['name'].'">';
$row['time'] = date ('d.m.Y - H:i:s', $row['date'] );
}
$tpl->set_ar_out($row,5);
}
$tpl->out(6);
}
$design->footer();
break;
case 's' :
$lid = $menu->getE(1);
db_query("UPDATE prefix_links SET hits = hits +1 WHERE id = ".$lid);
$row = db_fetch_assoc(db_query("SELECT link FROM prefix_links WHERE id = ".$lid));
header('location: '.$row['link']);
break;
}
?>
Links.html
{EXPLODE}
<table width="100%" class="border" border="0" cellspacing="1" cellpadding="3">
<tr class="Chead">
<td width="80%" align="center"><b>{_lang_category}</b></td>
<td width="20%" align="center">{_lang_links}</td>
</tr>
{EXPLODE}
<tr class="{class}">
<td><a href="index.php?links-{id}">{name}</a><br /><span class="smalfont">» {desc}</span></td>
<td align="center">{links}</td>
</tr>
{EXPLODE}
</table>
<br /><br />
{EXPLODE}
<table width="100%" class="border" border="0" cellspacing="1" cellpadding="3">
<tr class="Chead">
<td width="90%" align="center"><b>{_lang_links}{catname}</b></td>
<td width="10%" align="center">{_lang_hits}</td>
</tr>
{EXPLODE}
<tr class="{class}">
<td><a target="_blank" href="index.php?links-s{id}">{name}</a>{desc}</td>
<td align="center">{hits}</td>
<td align="center">{time}</td>
</tr>
{EXPLODE}
</table>
Musst du sehen wie es für dich passt, ich weiss jetzt nicht was du verändert hast.
Ps habe es auch nicht getestet xD
Zuletzt modifiziert von corian am 29.09.2014 - 13:49:01