Menü

  Login

  Shoutbox

  Forum » Fragen zu Ilch » Andere Dinge » Dows - Kommentare


Dows - Kommentare
sCar
Mitglied

User Pic

Posts: 53
# 23.06.2010 - 12:27:41
    zitieren



Hi,

habe leider das Problem dass ich auf meiner Seite zugespamt werde, gibt es eine möglichkeit bei den downloads die kommentare nur für user zugänglich zu machen?

Ich hoffe auf baldige Antword, denn habe jeden Tag ca 100 Posts in den Kommentaren die da nicht hinsollten Traurig

MFG

sCAr
Mairu
Administrator

User Pic

Posts: 1908
# 23.06.2010 - 13:22:35
    zitieren



http://www.ilch.de/texts-s95-kommen...i-den-downloads-mit-spamschutz.html

Hier ist ein FAQ Beitrag für Kommentare mit Spamschutz.
sCar
Mitglied

User Pic

Posts: 53
# 23.06.2010 - 23:51:03
    zitieren



hi danke für deine schnelle antwort, leider bekomm ichs nicht gebacken..

hier ma meine contents downs

<?php
# Script Copyright by: Manuel Staechele
# Support: www.ilch.de

# Ueberarbeitung copyright by honklords.de
# erstellt von Topolino
# seite: www.honklords.de

# Support auf www.honklords.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="?downloads-'.$k.'">'.$v.'</a><b> &raquo; </b>'.$l;
}
}
return ($l);
}

function get_cats_array ( $cid , $ar ) {
if ( empty($cid) ) {
return ($ar);
} else {
$erg = db_query("SELECT cat,id,name FROM prefix_downcats WHERE id = ".$cid);
$row = db_fetch_assoc($erg);
$ar[$row['id']] = $row['name'];
return ( get_cats_array($row['cat'],$ar) );
}
if ( $r ) {
return ($l);
}
}

function get_download_size($file) {
$sizes = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"Zwinker;
$size = @filesize($file); if ($size == 0) { return('n/a'); } else {
return (round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $sizes[$i]); }
}

function count_files ($cid) {
$zges = 0;
$e = db_query("SELECT id FROM prefix_downcats 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_downloads WHERE cat = ".$cid);
return ( $zges );
}

function icUpload () {

$name = escape($_POST['name'],'string');
$version = escape($_POST['version'],'string');
$autor = escape($_POST['autor'],'string');
$surl = escape($_POST['surl'],'string');
$ssurl = escape($_POST['ssurl'],'string');
$url = ( empty($_POST['url']) ? '' : escape($_POST['url'],'string') );
$desc = escape($_POST['desc'],'string');
$descl = escape($_POST['descl'],'textarea');

if (empty($name)) {
return ('keinen Namen angegeben.');
}

if (empty($desc) or empty($descl)) {
return ('kein langer oder/und kein kurzer Text angegeben.');
}

if (empty($url) AND empty($_FILES['file']['name'])) {
return ('Keine Datei oder Link angegeben.');
}

if (!empty ($_FILES['file']['name']) ) {

$rtype = trim(ic_mime_type ($_FILES['file']['tmp_name']));
$fname = escape($_FILES['file']['name'],'string');
$fende = preg_replace("/.+\.([a-zA-Z]+)$/", "\\1", $fname);
$fende = strtolower($fende);

if ( $_FILES['file']['size'] > 2097000 ) { # 2 mb (2 097 152)
return ('Die Datei darf NICHT gr&ouml;sser als 2 MBytes sein.');
}

if (
($fende != 'rar' AND $fende != 'zip' AND $fende != 'tar')

OR (
$rtype != 'application/x-rar' AND
$rtype != 'application/x-zip' AND
$rtype != 'application/x-tar')

) {
return ('Die Datei darf nur die Endungen: .zip, .tar oder .rar haben.');
}

$fname = str_replace ('.'.$fende, '', $fname);
$fname = preg_replace("/[^a-zA-Z0-9]/", "", $fname);
$fname = $fname.'.'.$fende;

if (file_exists( 'include/downs/downloads/user_upload/'.$fname ) ) {
return ('Die Datei existiert bereits und kann nicht &uuml;berschrieben werden.');
}

if ( move_uploaded_file($_FILES['file']['tmp_name'], 'include/downs/downloads/user_upload/'.$fname) ) {
$url = 'include/downs/downloads/user_upload/'.$fname;
@chmod($url, 0777);
}
}

if (empty($url)) {
return ('Keine Datei oder Link angegeben');
}

db_query("INSERT INTO prefix_downloads (`time`,`cat`,`creater`,`version`,`...,`ssurl`,`name`,`desc`,`descl`,pos) VALUES (NOW(),-1,'".$autor."','".$version....','".$desc."','".$descl."','0')"Zwinker;

return (true);
}

switch ( $menu->get(1) ) {
default :
$cid = ( $menu->get(1) ? escape($menu->get(1), 'integer') : 0 );
$erg = db_query("SELECT cat,name FROM prefix_downcats WHERE id = ".$cid." ORDER BY pos"Zwinker;
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> &raquo; </b>'.$namezw.$row['name'];
} else {
$cattitle = '';
$catname = '';
}
$title = $allgAr['title'].' :: Downloads '.$cattitle;
$hmenu = '<a class="smalfont" href="?downloads">Downloads</a>'.$catname;
$design = new design ( $title , $hmenu );
$design->header();
$tpl = new tpl ('downloads' );
require_once('include/contents/downloadsinfo.php');
$tpl->set('cid', $cid);
$erg = db_query("SELECT id,name,`desc` FROM prefix_downcats WHERE cat = ".$cid." AND recht >= ".$_SESSION['authright']." ORDER BY pos"Zwinker;
if ( db_num_rows($erg) > 0 ) {
$tpl->out(1); $class = 'Cnorm';
while ($row = db_fetch_assoc($erg) ) {
$row['files'] = count_files($row['id']);
$class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' );
$row['class'] = $class;
$tpl->set_ar_out($row,2);
}
$tpl->out(3);
}

# sortierung festlegen
$sortierung = 'pos ASC';
$DOM = 'ASC';
$POM = 'ASC';
$DAM = 'ASC';

switch ($menu->get(2)) {
case 'positionDESC' : $sortierung = 'pos DESC'; break;
case 'positionASC' : $sortierung = 'pos ASC'; $POM = 'DESC'; break;
case 'downsDESC' : $sortierung = 'downs DESC'; break;
case 'downsASC' : $sortierung = 'downs ASC'; $DOM = 'DESC'; break;
case 'dateDESC' : $sortierung = 'time DESC'; break;
case 'dateASC' : $sortierung = 'time ASC'; $DAM = 'DESC'; break;
}

$tpl->set ('POM', $POM);
$tpl->set ('DOM', $DOM);
$tpl->set ('DAM', $DAM);

$erg = db_query("select id,name,version,ssurl,`desc`,downs,DATE_FORMAT(time,'%d.%m.%Y') as datum from prefix_downloads WHERE cat = ".$cid." ORDER BY ".$sortierung);
if ( db_num_rows($erg) > 0 ) {
$tpl->out(4); $class = 'Cnorm';
while($row = db_fetch_assoc($erg) ) {
# smal screenshot url
$row['ssurl'] = ( (file_exists($row['ssurl']) AND $row['ssurl'] != '') ? '<img src="'.$row['ssurl'].'" alt="'.$row['name'].' '.$row['version'].'" title="'.$row['name'].' '.$row['version'].'" style="float:left; border: none; padding-right:3px;" />' : '' );
$class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' );
$row['class'] = $class;
$tpl->set_ar_out($row,5);
}
$tpl->out(6);
}

if ( $cid == 0 AND $allgAr['archiv_down_userupload'] == 1 AND loggedin() AND is_writeable ( 'include/downs/downloads/user_upload' ) ) {
$tpl->out(7);
}

$design->footer();
break;
case 'show' :

$fid = escape($menu->get(2), 'integer');
$erg = db_query("SELECT prefix_downloads.cat,ssurl,surl,url...ads.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))"Zwinker;
if (@db_num_rows($erg) <> 1) {
$title = $allgAr['title'].' :: Downloads ';
$hmenu = '<a class="smalfont" href="?downloads">Downloads</a>';
$design = new design ( $title , $hmenu );
$design->header();
echo 'Der Download wurde nicht gefunden';
$design->footer(1);
}

# kommentar add
if (!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']."')"Zwinker;
}
# 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');
}


$row = db_fetch_assoc($erg);

# umfrage einen hoch zaehlen ...
if ( $menu->getA(3) == 'z' AND is_numeric($menu->getE(3)) AND !isset ($_SESSION['downDoVote'][$row['id']]) AND loggedin() ) {
$_SESSION['downDoVote'][$row['id']] = 'o';
$row['vote_wertung'] = round ( ( ( $row['vote_wertung'] * $row['vote_klicks'] ) + $menu->getE(3) ) / ( $row['vote_klicks'] + 1 ) , 3 );
$row['vote_klicks']++;
db_query("UPDATE prefix_downloads SET vote_wertung = ".$row['vote_wertung'].", vote_klicks = ".$row['vote_klicks']." WHERE id = ".$row['id']);
}
if ( !isset ($_SESSION['downDoKlick'][$row['id']]) ) {
$_SESSION['downDoKlick'][$row['id']] = 'o';
db_query("UPDATE prefix_downloads SET hits = hits +1 WHERE id = ".$fid);
}

$cid = $row['cat'];
$erg1 = db_query("SELECT id,cat,name FROM prefix_downcats WHERE id = ".$cid);
if ( db_num_rows($erg1) > 0 ) {
$row1 = db_fetch_assoc($erg1);
$array = get_cats_array($row1['cat'],'');
if ( !empty($array) ) {
$titelzw = get_cats_title($array);
$namezw = get_cats_urls($array);
} else {
$titelzw = '';
$namezw = '';
}
$cattitle = ':: '.$titelzw.$row1['name'].' :: '.$row['name'].' '.$row['version'];
$catname = '<b> &raquo; </b>'.$namezw.'<a class="smalfont" href="?downloads-'.$row1['id'].'">'.$row1['name'].'</a><b> &raquo; </b>'.$row['name'].' '.$row['version'];
} else {
$cattitle = '';
$catname = '';
}
$tpl = new tpl ('downloads_show' );
$drecht = $row['drecht'];
if ( $_SESSION['authright'] <= $drecht ) {
$row['downlink'] = '<a href="index.php?downloads-down-'.$row['id'].'"><img src="include/images/buttons/download.gif" alt="Download" border="0"></a>';
} else {
$row['downlink'] = '<a href="index.php?downloads-error"><img src="include/images/buttons/download.gif" alt="Download" border="0"></a>';
}
$row['ssurl'] = ( $row['ssurl'] != '' ? '<img src="'.$row['ssurl'].'" alt="'.$row['name'].' '.$row['version'].'" title="'.$row['name'].' '.$row['version'].'" style="float:left; border: none; padding-right:5px;" />' : '' );

$row['surl'] = ( empty($row['surl']) ? '' : '&nbsp;&nbsp;&nbsp; <a href="'.$row['surl'].'" target="_blank"><img src="include/images/buttons/demo.gif" alt="Demo/Screenshot" border="0"></a>' );

$row['size'] = get_download_size($row['url']);
$row['descl'] = bbcode($row['descl']);
$row['version_kl'] = (empty($row['version'])?''Weinen'.$row['version'].')');
$title = $allgAr['title'].' :: Downloads '.$cattitle;
$hmenu = '<a class="smalfont" href="?downloads">Downloads</a>'.$catname;
$design = new design ( $title , $hmenu );
$design->header();
$row['uname'] = get_n($_SESSION['authid']);
$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"Zwinker;
$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
$design->footer();
break;
case 'down' :
$fid = $menu->get(2);
$erg = db_query("SELECT drecht FROM prefix_downloads LEFT JOIN prefix_downcats ON prefix_downcats.id = prefix_downloads.cat WHERE prefix_downloads.id = ".$fid." AND (".$_SESSION['authright']." <= prefix_downloads.drecht OR (prefix_downloads.cat = 0 AND prefix_downcats.recht IS NULL))"Zwinker;
if (@db_num_rows($erg) <> 1) {
$title = $allgAr['title'].' :: Downloads ';
$hmenu = '<a class="smalfont" href="?downloads">Downloads</a>';
$design = new design ( $title , $hmenu );
$design->header();
echo $lang['nopermission'];
$design->footer(1);
}

$recht = @db_result(db_query("SELECT `recht` FROM `prefix_downcats` LEFT JOIN `prefix_downloads` ON `prefix_downcats`.`id` = `prefix_downloads`.`cat` WHERE `prefix_downloads`.`id` = $fid"Zwinker,0);
$recht = (is_int($recht)?$recht:0);
if (has_right($recht)) {
$row = db_fetch_assoc(db_query("SELECT url FROM prefix_downloads WHERE id = ".$fid));
$url = iurlencode($row['url']);
} else {
$url = 'http://'.$_SERVER["HTTP_HOST"].dir...PT_NAME"]).'/index.php?downloads';
}
db_query("UPDATE prefix_downloads SET downs = downs +1 WHERE id = ".$fid);
header('location: '.$url);
break;
case 'upload' :
if ( $allgAr['archiv_down_userupload'] == 1 AND loggedin() AND is_writeable ( 'include/downs/downloads/user_upload' ) ) {
$title = $allgAr['title'].' :: Downloads :: User - Upload';
$hmenu = '<a class="smalfont" href="?downloads">Downloads</a><b> &raquo; </b>User - Upload';
$design = new design ( $title , $hmenu );
$design->header();

$re = icUpload();
if ($re === true) {
echo 'Erfolgreich eingetragen! ... ein Moderator oder Admin dieser Seite wird den Download in n&auml;chster Zeit freischalten.';
} else {
echo '<b>Error:</b><br />'.$re;
}

$design->footer();
}
break;
case 'error' :
$title = $allgAr['title'].' :: Downloads Error';
$hmenu = '<a class="smalfont" href="?downloads">Downloads Error</a>';
$design = new design ( $title , $hmenu );
$design->header();
echo '<table width="100%" class="border" border="0" cellspacing="2" cellpadding="3" align="center">
<tr><td class="Chead" align="center"><b>Sie haben leider nicht die n&ouml;tigen Rechte um diesen Download nutzen zu k&ouml;nnen.</b></td>
</tr><tr class="Cdark"><td align="center"><a href="javascript:history.back();"><u>Zurück</u></a> oder <a href="/index.php"><u>Auf die Startseite</u></a></td></tr></table>';
$design->footer();
break;
}
?>
mobi
Eroberer

User Pic

Posts: 110
# 24.06.2010 - 09:02:47
    zitieren



Ich hab dir mal meine Php datei und html. Nach der anleitung gebaut
 Php von Datei download
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:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
  <?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="?downloads-'.$k.'">'.$v.'</a><b> &raquo; </b>'.$l;
        }
    }
    return (
$l);
}

function 
get_cats_array $cid $ar ) {
    if ( empty(
$cid) ) {
      return (
$ar);
    } else {
      
$erg db_query("SELECT cat,id,name FROM prefix_downcats WHERE id = ".$cid);
        
$row db_fetch_assoc($erg);
        
$ar[$row['id']] = $row['name'];
      return ( 
get_cats_array($row['cat'],$ar) );
    }
    if ( 
$r ) {
      return (
$l);
    }
}

function 
get_download_size($file) {
  
$sizes = array(" Bytes"" KB"" MB"" GB"" TB"" PB"" EB"" ZB"" YB");
  
$size = @filesize($file); if ($size == 0) { return('n/a'); } else {
  return (
round($size/pow(1024, ($i floor(log($size1024)))), 2) . $sizes[$i]); }
}

function 
count_files ($cid) {
  
$zges 0;
    
$e db_query("SELECT id FROM prefix_downcats WHERE cat = ".$cid);
    if ( 
db_num_rows($e) > ) {
      while (
$r db_fetch_assoc($e) ) {
        
$zges $zges count_files $r['id'] );
      }
    }
    
$zges $zges db_count_query("SELECT COUNT(*) FROM prefix_downloads WHERE cat = ".$cid);
    return ( 
$zges );
}

function 
icUpload () {

      
$name escape($_POST['name'],'string');
        
$version escape($_POST['version'],'string');
        
$autor escape($_POST['autor'],'string');
        
$surl escape($_POST['surl'],'string');
        
$ssurl escape($_POST['ssurl'],'string');
      
$url = ( empty($_POST['url']) ? '' escape($_POST['url'],'string') );
        
$desc escape($_POST['desc'],'string');
        
$descl escape($_POST['descl'],'textarea');

      if (empty(
$name)) {
        return (
'keinen Namen angegeben.');
      }

      if (empty(
$desc) or empty($descl)) {
        return (
'kein langer oder/und kein kurzer Text angegeben.');
      }

      if (empty(
$url) AND empty($_FILES['file']['name'])) {
        return (
'Keine Datei oder Link angegeben.');
      }

        if (!empty (
$_FILES['file']['name']) ) {

            
$rtype trim(ic_mime_type ($_FILES['file']['tmp_name']));
        
$fname escape($_FILES['file']['name'],'string');
        
$fende preg_replace("/.+\.([a-zA-Z]+)$/""\\1"$fname);
        
$fende strtolower($fende);

            if ( 
$_FILES['file']['size'] > 2097000 ) { # 2 mb (2 097 152)
          
return ('Die Datei darf NICHT gr&ouml;sser als 2 MBytes sein.');
        }

        if (
              (
$fende != 'rar' AND $fende != 'zip' AND $fende != 'tar')

          OR (
          
$rtype != 'application/x-rar' AND
          
$rtype != 'application/x-zip' AND
          
$rtype != 'application/x-tar')

            ) {
          return (
'Die Datei darf nur die Endungen: .zip, .tar oder .rar haben.');
        }

        
$fname str_replace ('.'.$fende''$fname);
        
$fname preg_replace("/[^a-zA-Z0-9]/"""$fname);
        
$fname $fname.'.'.$fende;

        if (
file_exists'include/downs/downloads/user_upload/'.$fname ) ) {
          return (
'Die Datei existiert bereits und kann nicht &uuml;berschrieben werden.');
        }

        if ( 
move_uploaded_file($_FILES['file']['tmp_name'], 'include/downs/downloads/user_upload/'.$fname) ) {
          
$url 'include/downs/downloads/user_upload/'.$fname;
          @
chmod($url0777);
              }
      }

      if (empty(
$url)) {
        return (
'Keine Datei oder Link angegeben');
      }

      
db_query("INSERT INTO prefix_downloads (`time`,`cat`,`creater`,`version`,`url`,surl,`ssurl`,`name`,`desc`,`descl`,pos) VALUES (NOW(),-1,'".$autor."','".$version."','".$url."','".$surl."','".$ssurl."','".$name."','".$desc."','".$descl."','0')");

      return (
true);
}

switch ( 
$menu->get(1) ) {
  default :
        
$cid = ( $menu->get(1) ? escape($menu->get(1), 'integer') : );
        
$erg db_query("SELECT cat,name FROM prefix_downcats WHERE id = ".$cid." ORDER BY pos");
        if ( 
db_num_rows($erg) > ) {
          
$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> &raquo; </b>'.$namezw.$row['name'];
        } else {
          
$cattitle '';
            
$catname '';
        }
        
$title $allgAr['title'].' :: Downloads '.$cattitle;
    
$hmenu '<a class="smalfont" href="?downloads">Downloads</a>'.$catname;
    
$design = new design $title $hmenu );
      
$design->header();
        
$tpl = new tpl ('downloads' );
    
$tpl->set('cid'$cid);
    
$erg db_query("SELECT id,name,`desc` FROM prefix_downcats WHERE cat = ".$cid." AND recht >= ".$_SESSION['authright']." ORDER BY pos");
    if ( 
db_num_rows($erg) > ) {
          
$tpl->out(1); $class 'Cnorm';
            while (
$row db_fetch_assoc($erg) ) {
              
$row['files'] = count_files($row['id']);
              
$class = ( $class == 'Cmite' 'Cnorm' 'Cmite' );
                
$row['class'] = $class;
              
$tpl->set_ar_out($row,2);
      }
          
$tpl->out(3);
        }

    
# sortierung festlegen
    
$sortierung 'pos ASC';
    
$DOM 'ASC';
    
$POM 'ASC';
    
$DAM 'ASC';

    switch (
$menu->get(2)) {
      case 
'positionDESC' $sortierung 'pos DESC'; break;
      case 
'positionASC' $sortierung 'pos ASC';  $POM 'DESC'; break;
      case 
'downsDESC' $sortierung 'downs DESC'; break;
      case 
'downsASC' $sortierung 'downs ASC'$DOM 'DESC'; break;
      case 
'dateDESC' $sortierung 'time DESC'; break;
      case 
'dateASC' $sortierung 'time ASC'$DAM 'DESC'; break;
    }

    
$tpl->set ('POM'$POM);
    
$tpl->set ('DOM'$DOM);
    
$tpl->set ('DAM'$DAM);

        
$erg db_query("select id,name,version,ssurl,`desc`,downs,DATE_FORMAT(time,'%d.%m.%Y') as datum from prefix_downloads WHERE cat = ".$cid." ORDER BY ".$sortierung);
        if ( 
db_num_rows($erg) > ) {
          
$tpl->out(4); $class 'Cnorm';
            while(
$row db_fetch_assoc($erg) ) {
        
# smal screenshot url
                
$row['ssurl'] = ( (file_exists($row['ssurl']) AND $row['ssurl'] != '') ? '<img src="'.$row['ssurl'].'" alt="'.$row['name'].' '.$row['version'].'" title="'.$row['name'].' '.$row['version'].'" style="float:left; border: none; padding-right:3px;" />' '' );
        
$class = ( $class == 'Cmite' 'Cnorm' 'Cmite' );
                
$row['class'] = $class;
              
$tpl->set_ar_out($row,5);
            }
            
$tpl->out(6);
        }

    if ( 
$cid == AND $allgAr['archiv_down_userupload'] == AND loggedin() AND is_writeable 'include/downs/downloads/user_upload' ) ) {
      
$tpl->out(7);
    }

        
$design->footer();
      break;
    case 
'show' :

    
$fid escape($menu->get(2), 'integer');
    
# 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');
}
    
$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="?downloads">Downloads</a>';
      
$design = new design $title $hmenu );
      
$design->header();
      echo 
'Der Download wurde nicht gefunden';
      
$design->footer(1);
    }

        
$row db_fetch_assoc($erg);

    
# umfrage einen hoch zaehlen ...
    
if ( $menu->getA(3) == 'z' AND is_numeric($menu->getE(3)) AND !isset ($_SESSION['downDoVote'][$row['id']]) AND loggedin() ) {
      
$_SESSION['downDoVote'][$row['id']] = 'o';
      
$row['vote_wertung'] = round ( ( ( $row['vote_wertung'] * $row['vote_klicks'] ) + $menu->getE(3) ) / ( $row['vote_klicks'] + ) , );
      
$row['vote_klicks']++;
      
db_query("UPDATE prefix_downloads SET vote_wertung = ".$row['vote_wertung'].", vote_klicks = ".$row['vote_klicks']." WHERE id = ".$row['id']);
    }
    if ( !isset (
$_SESSION['downDoKlick'][$row['id']]) ) {
      
$_SESSION['downDoKlick'][$row['id']] = 'o';
      
db_query("UPDATE prefix_downloads SET hits = hits +1 WHERE id = ".$fid);
    }

        
$cid $row['cat'];
        
$erg1 db_query("SELECT id,cat,name FROM prefix_downcats WHERE id = ".$cid);
        if ( 
db_num_rows($erg1) > ) {
          
$row1 db_fetch_assoc($erg1);
            
$array get_cats_array($row1['cat'],'');
            if ( !empty(
$array) ) {
              
$titelzw get_cats_title($array);
              
$namezw get_cats_urls($array);
            } else {
              
$titelzw '';
                
$namezw '';
            }
          
$cattitle ':: '.$titelzw.$row1['name'].' :: '.$row['name'].' '.$row['version'];
            
$catname '<b> &raquo; </b>'.$namezw.'<a class="smalfont" href="?downloads-'.$row1['id'].'">'.$row1['name'].'</a><b> &raquo; </b>'.$row['name'].' '.$row['version'];
        } else {
          
$cattitle '';
            
$catname '';
        }
        
$tpl = new tpl ('downloads_show' );
        
$row['ssurl'] = ( $row['ssurl'] != '' '<img src="'.$row['ssurl'].'" alt="'.$row['name'].' '.$row['version'].'" title="'.$row['name'].' '.$row['version'].'" style="float:left; border: none; padding-right:5px;" />' '' );
    
$row['surl']  = ( empty($row['surl']) ? '' '&nbsp;&nbsp;&nbsp; <a href="'.$row['surl'].'" target="_blank">Demo/Screenshot</a>' );
        
$row['size']  = get_download_size($row['url']);
        
$row['descl'] = bbcode($row['descl']);
        
$row['version_kl'] = (empty($row['version'])?'':'('.$row['version'].')');
    
$title $allgAr['title'].' :: Downloads '.$cattitle;
    
$hmenu '<a class="smalfont" href="?downloads">Downloads</a>'.$catname;
    
$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 == ) {
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
    
$design->footer();
        
//Download erlauben
        
$_SESSION['download'][$fid] = true;
      break;
    case 
'down' :
        
$fid intval($menu->get(2));
        if (!isset(
$_SESSION['download'][$fid])) {
            
header('Location: ' 'http://' $_SERVER["HTTP_HOST"] . dirname($_SERVER["SCRIPT_NAME"]) . '/index.php?downloads');
            break;
        }
        
$qry db_query("SELECT d.`url`, IFNULL(c.`recht`,0) AS recht FROM `prefix_downloads` d LEFT JOIN `prefix_downcats` c ON c.`id` = d.`cat` WHERE d.`id` = $fid");
        
$row db_fetch_assoc($qry);
        
$url 'http://' $_SERVER["HTTP_HOST"] . dirname($_SERVER["SCRIPT_NAME"]) . '/index.php?downloads';
        if (
$qry !== false and has_right($row['recht'])) {
            
db_query("UPDATE prefix_downloads SET downs = downs +1 WHERE id = " $fid);
            if (
file_exists($row['url'])) {
                
header('Content-type: application/octet-stream');
                
header('Content-Disposition: attachment; filename="' basename($row['url']) . '"');
                
readfile($row['url']);
                exit;
            } else {
                
$url iurlencode($row['url']);
            }
            
$error false;
        }
        
header('Location: ' $url);
        break;
  case 
'upload' :
    if ( 
$allgAr['archiv_down_userupload'] == AND loggedin() AND is_writeable 'include/downs/downloads/user_upload' ) ) {
      
$title $allgAr['title'].' :: Downloads :: User - Upload';
      
$hmenu '<a class="smalfont" href="?downloads">Downloads</a><b> &raquo; </b>User - Upload';
      
$design = new design $title $hmenu );
        
$design->header();

      
$re icUpload();
        if (
$re === true) {
        echo 
'Erfolgreich eingetragen! ... ein Moderator oder Admin dieser Seite wird den Download in n&auml;chster Zeit freischalten.';
      } else {
        echo 
'<b>Error:</b><br />'.$re;
      }

      
$design->footer();
    }
    break;
}
?>


und hier die Tempalte Html
 HTML von Datei download show
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:
 <script language="JavaScript" type="text/javascript">
<!--
function doVote(n1,did) {
  document.location.href="index.php?downloads-show-" + did + "-z"+n1;
}
//-->
</script>


<table width="100%" class="border" border="0" cellspacing="1" cellpadding="3">
  <tr class="Chead">
      <th colspan="4" align="center"><b>{name} {version}</b></th>
   </tr><tr>
     <td class="Cmite">
{_lang_name} (Version)</td>
      <td class="Cnorm">{name} {version_kl}</td>
    <td class="Cmite" colspan="2" valign="top">{_lang_voting} {vote_wertung}
  </tr><tr>
     <td class="Cmite">
{_lang_author}</td>
      <td class="Cnorm">{creater}</td>
    <td class="Cnorm" rowspan="2" colspan="2" align="center">
    <table class="border" border="0" cellspacing="1" cellpadding="0">
      <tr>
        <td class="Cdark" onClick="doVote(1,{id})" style="cursor:pointer";>
&nbsp;1&nbsp;</td>
        <td class="Cmite" onClick="doVote(2,{id})" style="cursor:pointer";>&nbsp;2&nbsp;</td>
        <td class="Cdark" onClick="doVote(3,{id})" style="cursor:pointer";>&nbsp;3&nbsp;</td>
        <td class="Cmite" onClick="doVote(4,{id})" style="cursor:pointer";>&nbsp;4&nbsp;</td>
        <td class="Cdark" onClick="doVote(5,{id})" style="cursor:pointer";>&nbsp;5&nbsp;</td>
        <td class="Cmite" onClick="doVote(6,{id})" style="cursor:pointer";>&nbsp;6&nbsp;</td>
        <td class="Cdark" onClick="doVote(7,{id})" style="cursor:pointer";>&nbsp;7&nbsp;</td>
        <td class="Cmite" onClick="doVote(8,{id})" style="cursor:pointer";>&nbsp;8&nbsp;</td>
        <td class="Cdark" onClick="doVote(9,{id})" style="cursor:pointer";>&nbsp;9&nbsp;</td>
        <td class="Cmite" onClick="doVote(10,{id})" style="cursor:pointer";>&nbsp;10&nbsp;</td>
      </tr>
    </table>
    </td>
   </tr><tr>
     <td class="Cmite">
{_lang_date}</td>
      <td class="Cnorm">{datum}</td>
  </tr><tr>
     <td class="Cmite" width="110">
{_lang_size}</td>
      <td class="Cnorm">{size}</td>
    <td class="Cmite" width="110">{_lang_voter}</td>
      <td class="Cnorm">{vote_klicks}</td>
   </tr><tr>
     <td class="Cmite">
{_lang_downloads}</td>
      <td class="Cnorm">{downs}</td>
     <td class="Cmite">{_lang_seenfrom}</td>
      <td class="Cnorm">{hits}</td>
   </tr>
</table>
<p></p>
<b><center><a href="index.php?downloads-down-{id}">{_lang_download}</a>{surl}</center></b>
<p></p>
<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>


Hoffe es klappt damit bei dir Smilie
Bei mir klappt es damit einwandfrei Smilie


Zuletzt modifiziert von mobi am 25.06.2010 - 22:32:34