Hallo Brauche hilfe??
Ich Habe null Ahnung von PHP....
Ich brauche aber ein kleines script....
Wer könnte mir dies erstellen da es nicht dies im netz so zu finden ist.....
1. Möchte ich aus eine Mysql Tabelle aus einer Kategorie ID den gesamten inhalt darstellen aber nur von jeweiligen Aktuellsten Tages..Also Servertime Datum...
die sich in der Tabelle/id/date/ befindet....
Geht dies???
und könnte mir dies einer erstellen????
Danke!!
DIES iST DAS SCRIPT ICH MÖCHTE ABER DAS DIES IMMER NUR DEN HEUTIGEN TAG ANZEIGT......
Ich Habe null Ahnung von PHP....
Ich brauche aber ein kleines script....
Wer könnte mir dies erstellen da es nicht dies im netz so zu finden ist.....
1. Möchte ich aus eine Mysql Tabelle aus einer Kategorie ID den gesamten inhalt darstellen aber nur von jeweiligen Aktuellsten Tages..Also Servertime Datum...
die sich in der Tabelle/id/date/ befindet....
Geht dies???
und könnte mir dies einer erstellen????
Danke!!
DIES iST DAS SCRIPT ICH MÖCHTE ABER DAS DIES IMMER NUR DEN HEUTIGEN TAG ANZEIGT......
PHP-Code:
<?
global $CURUSER;
if (!$CURUSER || $CURUSER["view_torrents"]=="no")
{
// do nothing
}
else
{
global $BASEURL, $STYLEPATH, $dblist;
block_begin(LAST_TORRENTS);
?>
<table cellpadding="4" cellspacing="1" width="100%">
<?
$sql = "SELECT summary.info_hash as hash, summary.seeds, summary.leechers, summary.dlbytes AS dwned, format(summary.finished,0) as finished, namemap.filename, namemap.url, namemap.info, UNIX_TIMESTAMP(namemap.data) AS added, categories.image, categories.name AS cname, namemap.category AS catid, namemap.size, namemap.external, namemap.uploader FROM summary LEFT JOIN namemap ON summary.info_hash = namemap.info_hash LEFT JOIN categories ON categories.id = namemap.category WHERE summary.leechers + summary.seeds > 0 ORDER BY namemap.data DESC LIMIT " .
$GLOBALS["block_last10limit"];
$row = mysql_query($sql) or err_msg(ERROR,CANT_DO_QUERY.mysql_error());
?>
<tr>
<td colspan="2" align="center" class="header"> <? echo TORRENT_FILE; ?> </td>
<td align="center" class="header"> <? echo CATEGORY; ?> </td>
<?
if (max(0,$CURUSER["WT"])>0)
print("<td align=\"center\" class=\"header\"> WT </td>");
?>
<td align="center" class="header"> <? echo ADDED; ?> </td>
<td align="center" class="header"> <? echo SIZE; ?> </td>
<td align="center" class="header"> S </td>
<td align="center" class="header"> L </td>
<td align="center" class="header"> C </td>
</tr>
<?
if ($row)
{
while ($data=mysql_fetch_array($row))
{
echo "<tr>\n";
if ( strlen($data["hash"]) > 0 )
{
echo "\t<td NOWRAP align=\"center\" class=\"lista\">";
// edit and delete picture/link
if ( $CURUSER["uid"] == $data["uploader"] || $CURUSER["delete_torrents"] == "yes" )
{
print("<a href='delete.php?info_hash=" . $data["hash"] . "&returnto=" . urlencode("index.php") . "'>".image_or_link("$STYLEPATH/delete.png","",DELETE)."</a> ");
}
echo "<a href=download.php?id=".$data["hash"]."&f=" . rawurlencode($data["filename"]) . ".torrent><img src='images/torrent.gif' border='0' alt='".DOWNLOAD_TORRENT."' title='".DOWNLOAD_TORRENT."' /></a>";
if ( $CURUSER["uid"] == $data["uploader"] || $CURUSER["edit_torrents"] == "yes" )
{
print(" <a href='edit.php?info_hash=" . $data["hash"] . "&returnto=" . urlencode("index.php") . "'>".image_or_link("$STYLEPATH/edit.png","",EDIT));
}
echo "</td>";
if ($GLOBALS["usepopup"])
echo "\t<td width=60% class=\"lista\"><a href=\"javascript:popdetails('details.php?id=" . $data['hash'] . "');\" title=\"" . VIEW_DETAILS . ": " . $data["filename"] . "\">" . $data["filename"] . "</a>".($data["external"]=="no"?"":" (<span style=\"color:red\">EXT</span>)")."</td>";
else
echo "\t<td width=60% class=\"lista\"><a href=\"details.php?id=" . $data['hash'] . "\" title=\"" . VIEW_DETAILS . ": " . $data["filename"] . "\">" . $data["filename"] . "</a>".($data["external"]=="no"?"":" (<span style=\"color:red\">EXT</span>)")."</td>";
echo "\t<td align=\"center\" class=\"lista\"><a href=torrents.php?category=$data[catid]>" . image_or_link( ($data["image"] == "" ? "" : "" . $data["image"]), "", $data["cname"]) . "</td>";
//waitingtime
// only if current user is limited by WT
if (max(0,$CURUSER["WT"])>0)
{
$wait=0;
$resuser=mysql_query("SELECT * FROM users WHERE id=".$CURUSER["uid"]);
$rowuser=mysql_fetch_array($resuser);
if (max(0,$rowuser['downloaded'])>0) $ratio=number_format($rowuser['uploaded']/$rowuser['downloaded'],2);
else $ratio=0.0;
$res2 =mysql_query("SELECT * FROM namemap WHERE info_hash='".$data["hash"]."'");
$added=mysql_fetch_array($res2);
$vz = sql_timestamp_to_unix_timestamp($added["data"]);
$timer = floor((time() - $vz) / 3600);
if($ratio<1.0 && $rowuser['id']!=$added["uploader"]){
$wait=$CURUSER["WT"];
}
$wait -=$timer;
if ($wait<=0)$wait=0;
echo "\t<td align=\"center\" class=\"lista\">".$wait." h</td>";
}
//end waitingtime
echo "\t<td nowrap=\"nowrap\" class=\"lista\" align='center'>" . get_elapsed_time($data["added"]) . " ago</td>";
echo "\t<td nowrap=\"nowrap\" class=\"lista\" align='center'>" . makesize($data["size"]) . "</td>";
if ( $data["external"] == "no" )
{
if ($GLOBALS["usepopup"])
{
echo "\t<td align=\"center\" class=\"".linkcolor($data["seeds"])."\"><a href=\"javascript:poppeer('peers.php?id=".$data["hash"]."');\" title=\"".PEERS_DETAILS."\">" . $data["seeds"] . "</a></td>\n";
echo "\t<td align=\"center\" class=\"".linkcolor($data["leechers"])."\"><a href=\"javascript:poppeer('peers.php?id=".$data["hash"]."');\" title=\"".PEERS_DETAILS."\">" .$data["leechers"] . "</a></td>\n";
if ($data["finished"]>0)
echo "\t<td align=\"center\" class=\"lista\"><a href=\"javascript:poppeer('torrent_history.php?id=".$data["hash"]."');\" title=\"History - ".$data["filename"]."\">" . $data["finished"] . "</a></td>";
else
echo "\t<td align=\"center\" class=\"lista\">---</td>";
}
else
{
echo "\t<td align=\"center\" class=\"".linkcolor($data["seeds"])."\"><a href=\"peers.php?id=".$data["hash"]."\" title=\"".PEERS_DETAILS."\">" . $data["seeds"] . "</a></td>\n";
echo "\t<td align=\"center\" class=\"".linkcolor($data["leechers"])."\"><a href=\"peers.php?id=".$data["hash"]."\" title=\"".PEERS_DETAILS."\">" .$data["leechers"] . "</a></td>\n";
if ($data["finished"]>0)
echo "\t<td align=\"center\" class=\"lista\"><a href=\"torrent_history.php?id=".$data["hash"]."\" title=\"History - ".$data["filename"]."\">" . $data["finished"] . "</a></td>";
else
echo "\t<td align=\"center\" class=\"lista\">---</td>";
}
}
else
{
// linkcolor
echo "\t<td align=\"center\" class=\"".linkcolor($data["seeds"])."\">" . $data["seeds"] . "</td>";
echo "\t<td align=\"center\" class=\"".linkcolor($data["leechers"])."\">" .$data["leechers"] . "</td>";
if ($data["finished"]>0)
echo "\t<td align=\"center\" class=\"lista\">" . $data["finished"] . "</td>";
else
echo "\t<td align=\"center\" class=\"lista\">---</td>";
}
echo "</tr>\n";
}
}
}
else
{
echo "<tr><td class=\"lista\" colspan=9 align=center>" . NO_TORRENTS . "</td></tr>";
}
print("</table>");
block_end();
} // end if user can view
?>
Kommentar