Download-Counter
Posted: Mon 9. Aug 2004, 16:03
Hallo,
ich habe mal ein kleinen Counter-Hack (für 1.1-RC4) gemacht:
- Füge in phpMyAdmin das Feld f_counts zur Tabelle phpwcms_file hinzu, als Typ habe ich bigint verwendet
- Füge folgendes in download.php ab Zeile 66 ein:
- In /include/inc_tmpl/files.private.editfile.tmpl.php füge folgendes ein:
unterhalb von: $file_longinfo = slweg(trim($_POST["file_longinfo"]));
unterhalb von: "f_keywords='".$file_keys."', ".
unterhalb von: $file_keys = $row["f_keywords"];
13 Zeilen unterhalb von: //Wenn passende Extension, dann Thumbnail Creation anbieten
- In /include/inc_lib/files.private-functions.inc.php
Für einen Tooltip Zeile 128 ändern in:
Für eine Darstellung direkt in der Liste vor dieser Zeile folgende einfügen:
Gruß, Tekl
ich habe mal ein kleinen Counter-Hack (für 1.1-RC4) gemacht:
- Füge in phpMyAdmin das Feld f_counts zur Tabelle phpwcms_file hinzu, als Typ habe ich bigint verwendet
- Füge folgendes in download.php ab Zeile 66 ein:
Code: Select all
// begin download-counter (by Tekl)
$download["f_counts"]++;
$sql = "UPDATE ".DB_PREPEND."phpwcms_file SET ".
"f_counts='".$download["f_counts"]."' ".
"WHERE f_kid=1 AND f_id=".$fid." AND f_uid=".$uid;
$result = mysql_query($sql, $db) or die ("error while updating file info");
// end download-counter
unterhalb von: $file_longinfo = slweg(trim($_POST["file_longinfo"]));
Code: Select all
$file_counts = intval($_POST["file_counts"]); // Tekl
Code: Select all
"f_counts='".$file_counts."', ". // Tekl
Code: Select all
$file_counts = $row["f_counts"]; // Tekl
Code: Select all
<td> <input name="file_counts" type="text" id="file_counts" size="8" value="<?php echo $file_counts; ?>"></td>
<td class="v10"><strong><?php echo "Counts" ?></strong></td>
Für einen Tooltip Zeile 128 ändern in:
Code: Select all
echo "<a href=\"fileinfo.php?fid=".$file_row["f_id"]."\" title=\"download-counter: ".$file_row["f_counts"];
Code: Select all
if ($file_row["f_counts"]>0) echo "<div style=\"float:right\">(".$file_row["f_counts"].")</div>";