Kommentare bei den Downloads mit Spamschutz

Eingetragen von Revolution am Do, 25. Feb 2010 - 18:18


Dateiname: include/contents/downloads.php
Suchen nach:
$erg = db_query("SELECT prefix_downloads.cat,ssurl,surl,url,hits,vote_klicks,vote_wertung,prefix_downloads.name,version,creater,downs,descl,prefix_downloads.id,DATE_FORMAT(time,'%d.%m.%Y') as datum FROM prefix_downloads LEFT JOIN prefix_downcats ON prefix_downcats.id = prefix_downloads.cat WHERE prefix_downloads.id = ".$fid." AND (".$_SESSION['authright']." <= prefix_downcats.recht OR (prefix_downloads.cat = 0 AND prefix_downcats.recht IS NULL))");
if (@db_num_rows($erg) <> 1) {
$title = $allgAr['title'].' :: Downloads ';
$hmenu = '<a class="smalfont" href="index.php?downloads">Downloads</a>';
$design = new design ( $title , $hmenu );
$design->header();
echo 'Der Download wurde nicht gefunden';
$design->footer(1);
}


Davor folgendes einfügen:
# kommentar add
if ((loggedin() OR chk_antispam ('downloads')) AND !empty($_POST['name']) AND !empty($_POST['text']) ) {
$_POST['text'] = escape($_POST['text'],'textarea');
$_POST['name'] = escape($_POST['name'],'string');
db_query("INSERT INTO `prefix_koms` VALUES ('',".$fid.",'dloads','".$_POST['name']."','".$_POST['text']."')");
}
# kommentar loeschen
if ($menu->getA(3) == 'd' AND is_numeric($menu->getE(3)) AND has_right(-9, 'archiv-downloads')) {
$kommentar_id = escape($menu->getE(3),'integer');
db_query("DELETE FROM `prefix_koms`WHERE uid = ".$fid." AND cat = 'dloads' AND id = ".$kommentar_id)OR die('dl22');
}


Suchen nach:
$design = new design ( $title , $hmenu );
$design->header();
$tpl->set_ar_out($row,0);


Ersetzen mit:
$design = new design ( $title , $hmenu );
$design->header();
$row['uname'] = get_n($_SESSION['authid']);
$row['ANTISPAM'] = (loggedin()?'':get_antispam ('downloads', 0));
$tpl->set_ar_out($row,0);
# kommentar show
$erg2 = db_query("SELECT text, name, id FROM `prefix_koms` WHERE uid = ".$row['id']." AND cat = 'dloads' ORDER BY id DESC");
$ergAnz1 = db_num_rows($erg2);
if ( $ergAnz1 == 0 ) {
echo '<br /><br /> <b>'.$lang['nocomments'].'</b><br />';
$tpl->out(1);
} else {
$tpl->out(1);
$zahl = $ergAnz1;
while ($row2 = db_fetch_assoc($erg2)) {
$row2['text'] = bbcode(trim($row2['text']));
if (has_right(-9, 'archiv-downloads')) {
$row2['text'] .= '<a href="index.php?downloads-show-'.$row['id'].'-d'.$row2['id'].'"><img src="include/images/icons/del.gif" alt="löschen" border="0" title="löschen" /></a>';
}
$tpl->set_ar_out(array('name' => $row2['name'], 'text' => $row2['text'], 'zahl' => $zahl ),2);
$zahl--;
}
}
$tpl->out(3);
# kommentar show ende





Dateiname: include/templates/downloads_show.htm
Suchen nach:
<table width="100%" class="border" border="0" cellspacing="1" cellpadding="3">
<tr>
<th class="Cdark">{_lang_desc}</th>
</tr>
<td class="Cnorm">{ssurl}{descl}</td>
</tr>
</table>


Ersetzen mit:
<table width="100%" class="border" border="0" cellspacing="1" cellpadding="3">
<tr>
<th class="Cdark">{_lang_desc}</th>
</tr>
<td class="Cnorm">{ssurl}{descl}</td>
</tr>
<tr>
<td class="Cnorm">
<form action="index.php?downloads-show-{id}" method="POST">
<fieldset>
<legend>{_lang_writecomment}</legend>
<input type="text" name="name" value="{uname}" /> <input type="submit" value="{_lang_enter}"><br />
<textarea cols="50" rows="2" name="text"></textarea><br />
{ANTISPAM}
</fieldset>
</form>
</td>
</tr>
<tr>
<td class="Cnorm">
{EXPLODE}
{EXPLODE}
<span class="Cmite" style="width:100%;display:block;"><span style="display:block;padding:2px 2px 2px 5px;"># <b>{zahl}</b> von {name}</span> </span>
<span class="Cdark" style="width:100%;display:block;"><span style="display:block;padding:4px 4px 4px 6px;">{text}</span> </span>
<br />
{EXPLODE}
</td>
</tr>

</table>