Ich nutze die Kommentar Funktion für den Download Bereich
Ich habe alles übernommen wie es hier steht.
externer Link
Jedoch würde ich aber gerne das nur eingeloggte Komms schreiben dürfen keine gäste wie setzte ich dies um?
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
# kommentar add if ((loggedin() AND 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']."')"); }
<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>
{_if_SESSION_AUTHRIGHT<='0'} <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> {_else_} <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"> {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> </table> {/_endif}
{_if_{SESSION_AUTHRIGHT}<='-1'}
<select size="1" name="jumpit" onchange="document.location.href=this.value"> <option value="index.php?downloads-{cid}-name" selected="selected">Name</option> <option value="index.php?downloads-{cid}-add">Eingetragen</option> <option value="index.php?downloads-{cid}-last">Zuletzt aktualisiert</option> <option value="index.php?downloads-{cid}-downs">Downloads</option> <option value="index.php?downloads-{cid}-hit">Hits</option> </select>
$DownloadKatSelect = dblistee($_POST['DownloadKatSelected']],"SELECT id,name FROM prefix_downcats ORDER BY id ASC"); echo '<select name="DownloadKatSelected">'.$DownloadKatSelect.'</select>';
# sortierung festlegen $sortierung = 'name ASC'; switch ($menu->get(3)) { case 'name' : $sortierung = 'name ASC'; break; case 'downs' : $sortierung = 'downs DESC'; break; case 'news' : $sortierung = 'time DESC'; break; case 'last' : $sortierung = '`update` DESC'; break; case 'add' : $sortierung = 'time DESC'; break; case 'hit' : $sortierung = 'hits DESC'; break; } $limit = '16'; // Limit $page = ($menu->getA(2) == 'p' ? $menu->getE(2) : 1); $sort = ($menu->getA(3) == '' ? $menu->getE(3) : 1); $MPL = db_make_sites ($page , "WHERE cat = ".$cid."" , $limit , "?downloads-".$cid."" , 'downloads' ); $anfang = ($page - 1) * $limit; $erg = db_query("select id,name,version,surl,`desc`,downs,hits,DATE_FORMAT(time,'%d.%m.%Y') as datum,DATE_FORMAT(`update`,'%d.%m.%Y') as `update` from prefix_downloads WHERE cat = ".$cid." ORDER BY ".$sortierung." LIMIT ".$anfang.",".$limit);
<b>Sortieren:</b> <select size="1" name="jumpit" onchange="document.location.href=this.value"> <option value="index.php?downloads-{cid}-p1-name" selected="selected">Name</option> <option value="index.php?downloads-{cid}-p1-add">Eingetragen</option> <option value="index.php?downloads-{cid}-p1-last">Zuletzt aktualisiert</option> <option value="index.php?downloads-{cid}-p1-downs">Downloads</option> <option value="index.php?downloads-{cid}-p1-hit">Hits</option> </select>
$sortOptions = array( 'name' => 'Name', 'add' => 'Eingetragen' ); $preselected = $menu->get(3); if (empty($preselected) || !isset($sortOptions[$preselected])) { $preselected = 'name'; } //sql sort auswahl auswahl $selectOptions = arlistee($preselected, $sortOptions); $tpl->set('selectOptions', $selectOptions);
<select onchange="window.location.href = 'index.php?downloads-{cid}-p1-' + value;">{selectOptions}</select>
# sortierung festlegen $sortOptions = array( 'name' => 'Name', 'add' => 'Eingetragen', 'last' => 'Zuletzt aktualisiert', 'downs' => 'Downloads', 'hit' => 'Hits' ); $preselected = $menu->get(3); if (empty($preselected) || !isset($sortOptions[$preselected])) { $preselected = 'name'; } //sql sort auswahl auswahl $selectOptions = arlistee($preselected, $sortOptions); $tpl->set('selectOptions', $selectOptions); $sortierung = 'name ASC'; switch ($menu->get(3)) { case 'name' : $sortierung = 'name ASC'; break; case 'downs' : $sortierung = 'downs DESC'; break; case 'news' : $sortierung = 'time DESC'; break; case 'last' : $sortierung = '`update` DESC'; break; case 'add' : $sortierung = 'time DESC'; break; case 'hit' : $sortierung = 'hits DESC'; break; } $limit = '16'; // Limit $page = ($menu->getA(3) == 'p' ? $menu->getE(3) : 1); $sort = ($menu->getA(2) == '' ? $menu->getE(2) : 1); $MPL = db_make_sites ($page , "WHERE cat = ".$cid."" , $limit , "?downloads-".$cid."-".$preselected."" , 'downloads' ); $anfang = ($page - 1) * $limit; $erg = db_query("select id,name,version,surl,`desc`,downs,hits,DATE_FORMAT(time,'%d.%m.%Y') as datum,DATE_FORMAT(`update`,'%d.%m.%Y') as `update` from prefix_downloads WHERE cat = ".$cid." ORDER BY ".$sortierung." LIMIT ".$anfang.",".$limit);
<select onchange="window.location.href = 'index.php?downloads-{cid}-p1-' + value;">{selectOptions}</select>
// sortierung festlegen $sortOptions = array( 'name' => 'Name', 'add' => 'Eingetragen', 'last' => 'Zuletzt aktualisiert', 'downs' => 'Downloads', 'hit' => 'Hits' ); $preselected = $menu->get(2); if (empty($preselected) || !isset($sortOptions[$preselected])) { $preselected = 'name'; } $selectOptions = arlistee($preselected, $sortOptions); $tpl->set('selectOptions', $selectOptions); switch ($preselected) { case 'name' : $sortierung = 'name ASC'; break; case 'downs' : $sortierung = 'downs DESC'; break; case 'news' : $sortierung = 'time DESC'; break; case 'last' : $sortierung = '`update` DESC'; break; case 'add' : $sortierung = 'time DESC'; break; case 'hit' : $sortierung = 'hits DESC'; break; } $limit = '16'; // Limit $page = ($menu->getA(3) == 'p' ? $menu->getE(3) : 1); $MPL = db_make_sites($page, "WHERE cat = " . $cid . "", $limit, "?downloads-" . $cid . "-" . $preselected . "", 'downloads'); $anfang = ($page - 1) * $limit; $erg = db_query("select id,name,version,surl,`desc`,downs,hits,DATE_FORMAT(time,'%d.%m.%Y') as datum,DATE_FORMAT(`update`,'%d.%m.%Y') as `update` from prefix_downloads WHERE cat = " . $cid . " ORDER BY " . $sortierung . " LIMIT " . $anfang . "," . $limit);
Geschlossen | ||
Zurück zu Module und Modifikationen |