Downloads nicht anzeigen lassen...

  • Themenstarter Themenstarter FortunaFan
  • Beginndatum Beginndatum
F

FortunaFan

Hallo,

ich habe ein kleines Problem. Ich habe ein Download Script. Die einzeknen Downloads, haben sogenannte Seeder / Leecher Werte. Das heißt es wird angezeigt wieviel Seeder (Leite die, die Datei fertig haben und Uploaden) und Leecher (Die gerade am Laden sind und zu Seedern werden). So leider können manche Downloads diese Werte nicht anzeigen. Sie Seeder / Leecher Werte werden in einer MySQL Datenbank gespeichert. Ist es möglich, alle Downloads, die keine Seeder / Leecher Werte anzeigen automatisch zu löschen? Wenn ja wie?

Ich habe euch mal die PHP Dateiu angehangen, womit die Seeder / Leecher Werte gesucht und angezeigt werden.

Bin leider noch in der PHP Anfangsphase und hoffe das ihr mir helfen könnt.

MfG, FortunaFan
 
Teil 1 (show.php)

PHP:
<?php

if(getenv("HTTP_X_FORWARDED_FOR")){			// Ip des Users einlesen
  $ips=explode(";",getenv("HTTP_X_FORWARDED_FOR"));
}else{
  $ips= explode(";",getenv("REMOTE_ADDR"));
}

$ip    = $ips[0];
$jetzt = time();

mysql_query("DELETE FROM cm_dl_ipsperre WHERE zeit < '$jetzt'");

if (isset($_GET['do']) && $_GET['do'] == "rat" && isset($_GET['show'])) {
  $rated = checkUserRat($_GET['show'], $ip);
  if (!$rated) {
    $rat = $_POST['rating'];
    $pid = $_GET['show'];
    $getbewerter = mysql_query("SELECT bewerter FROM cm_dl_info WHERE id = '$pid'");
    $dat = mysql_fetch_row($getbewerter);
    $nbewerter = $dat[0] + 1;
    if (mysql_query("UPDATE cm_dl_info SET bewertung = bewertung + '$rat', bewerter = '$nbewerter' WHERE id = '$pid'")) {
      setcookie ("rated[$pid]", "1", time() + 100 * 24 * 60 * 60);
      $then = $jetzt + 24*60*60;
      mysql_query("INSERT INTO cm_dl_ipsperre (ip, pid, zeit) VALUES ('$ip', '$pid', '$then')");
    }
  }
}

$getsett  = mysql_query("SELECT * FROM cm_dl_settings WHERE setting = 'umbruch'");               //Settings einlesen
$numsett  = mysql_num_rows($getsett);
$settings = mysql_fetch_row($getsett);
$sumbru   = $settings[2];
$group    = $_GET['group'];
$gruppedb = mysql_query("SELECT * FROM cm_dl_gruppen WHERE id = '$group' ");
$part     = mysql_fetch_row($gruppedb);

if(!isset($_GET['page']) && !isset($_GET['show'])){                           //testen ob eine bestimmte Seite verlangt wird
  $infodb = mysql_query("SELECT * FROM cm_dl_info WHERE gruppeid = '$group' ORDER BY name");
  $numinfos = mysql_num_rows($infodb);
  $main = str_replace("{part}", strtolower($part[1]), $main);
  if($numinfos == 0){                              //Testen ob Daten vorhanden sind
    $posts = '<center>NOCH keine Daten vorhanden</center>';
  }else{
    $posts = "";
    $max   = $numinfos;
    if($numinfos > $sumbru){
      $posts .= join('',file("html/seiten.htm"));
      $max = $sumbru;
      $maxs = ceil($numinfos / $sumbru);
      $posts = str_replace("{page}", "1 von ".$maxs, $posts);
      $pages = '';
      for($i = 1; $i <=$maxs; $i++){
        if ($i == 1){
          $pages .= $i.' ';
        }else{
          $pages .= '<a href = "?site=main.php&group='.$group.'&page='.$i.'">'.$i.'</a> ';
        }
      }
      $posts = str_replace("{pages}", $pages, $posts);
    }
    for($i=0;$i<$max;$i++){                 //Infos einlesen
      $info = mysql_fetch_array($infodb);
      $id = $info[0];
      $lastupdate = $info[lastupdate];
      $rated = checkUserRat($id, $ip);
      if ($rated) {
        $posts .= join('', file("html/postwor.htm"));
      } else {
        $posts .= join('', file("html/post.htm"));
      }
      $name      = $info[2];
      $lang      = $info[3];
      $pic       = $info[4];
      $text      = $info[5];
      $poster    = $info[6];
      $downloads = $info[7];
      $pswd = $info['pswd'];

      if ($info[10] == 0) { $info[10] = 1; }

      $rating = round($info[8]/$info[10],0);
      $posts = str_replace("{title}", stripslashes($name), $posts);
      $posts = str_replace("{lang}", 'gfx/'.$lang.'.gif', $posts);
      $posts = str_replace("{pic}", $pic, $posts);
      $posts = str_replace("{id}", $id, $posts);
      $posts = str_replace("{pswd}", $pswd, $posts);
      $posts = str_replace("{show}", "", $posts);

      if( $info[11] == "")
        $posts = str_replace("{quality}", '<i>Unbekannt</i>', $posts);
      else
        $posts = str_replace("{quality}", $info[11], $posts);

      if( $info[13] == "")
        $posts = str_replace("{genre}", '<i>Unbekannt</i>', $posts);
      else
        $posts = str_replace("{genre}", $info[13], $posts);

      $posts = str_replace("{info}",  '<i>Unbekannt</i>', $posts);
      $posts = str_replace("{poster}", $poster, $posts);
      $posts = str_replace("{downloads}", $downloads, $posts);
      $stars = '';
      $a = 0;

      while($a < $rating){
        if($a + 2 <= $rating){
          $a += 2;
          $stars .= '<img src="gfx/star.gif">';
        }else{
          $a += 1;
          $stars .= '<img src="gfx/hstar.gif">';
        }
      }

      if ($rating == 0) { $stars = "-"; }

      $posts = str_replace("{stars}", $stars, $posts);
      $linksdb = mysql_query("SELECT * FROM cm_dl_links WHERE infoid = '$id' ORDER BY name");
      $anzlinks = mysql_num_rows($linksdb);
      if($anzlinks == 0){                      //Testen ob Links vorhanden sind
        $links = '              <center>Keine Links vorhanden</center>';
      }else{
        $links = '';

        for($d=0;$d<$anzlinks;$d++){
          $getlinks = mysql_fetch_array($linksdb);    //Links einlesen und speicherm

// 05/05 - check for valid http link to torrentfile and get seeder/leecher
          if(strpos($getlinks[link], "http://") !== FALSE) {
            if($getlinks['lastupdate'] != date("HdmY")) {
              if(($getlinks['tracker'] == "") || ($getlinks['infohash'] == "") || ($getlinks['tracker'] == "http://")) {
                $src = encodeurl($getlinks[link]);
                include "t_dectorrent.php";
                echo "<!-- DEBUG: added missing tracker/infohash to database! -->\n";
                @mysql_query("UPDATE cm_dl_links SET tracker='$tracker' , infohash='$infohash' WHERE id = '".$getlinks[id]."' LIMIT 2;");
              }
              if($getlinks[infohash] != "") { $infohash = $getlinks[infohash]; }
              if($getlinks[tracker]  != "") { $tracker  = $getlinks[tracker]; }
              include "t_asktracker.php";
              echo "<!-- DEBUG: updated seeder/leecher in database! -->\n";

// 24/05
              if(($seeder > 0) || ($leecher > 0)) {
                @mysql_query("UPDATE cm_dl_links SET deadsince='' WHERE id = '".$getlinks[id]."' LIMIT 1;");
              }

              @mysql_query("UPDATE cm_dl_links SET lastupdate='".date("HdmY")."' , seeder=$seeder , leecher=$leecher WHERE id = '".$getlinks[id]."' LIMIT 2;");

              $getlinks[seeder]  = $seeder+0;
              $getlinks[leecher] = $leecher+0;
            }
          } else {
            if($getlinks[deadsince] == "") {
              @mysql_query("UPDATE cm_dl_links SET deadsince='".date("HdmY")."' WHERE id = '".$getlinks[id]."' LIMIT 1;");
            }
          }

          $add = "";

// 05/05 - add up all found seeder/leecher for global seeder/leecher info
          $leecher_ges += $getlinks[leecher]+0;
          $seeder_ges  += $getlinks[seeder]+0;

          if($getlinks[5] != ""){ $add = stripslashes("&nbsp;&nbsp;&nbsp;[$getlinks[5]]"); }

// 05/05 - add seeder/leecher to link
          if(($getlinks[seeder] > 0) || ($getlinks[leecher] > 0)) {
            $add .= "&nbsp; &nbsp;<font color='orange'><b>".$getlinks[seeder]."/".$getlinks[leecher]."</b></font>";
          }

          if($getlinks[4] == ""){
            $links .= '<a onclick = "javascript:window.open(\'main.php?iid='.$id.'&dl='.$getlinks[0].'\',\'Fenster2\',\'width=300,height=200,scrollbars=0,left=0,top=0\');return false"  href = "main.php?iid='.$id.'&dl='.$getlinks[0].'" target = "_blanc">'.stripslashes($getlinks[1]).'</a> ('.$getlinks[2].' klicks)'.$add.'<br>'."\n";
          }else{
            $links .= '<a onclick = "javascript:window.open(\'main.php?iid='.$id.'&dl='.$getlinks[0].'\',\'Fenster2\',\'width=300,height=200,scrollbars=0,left=0,top=0\');return false"  href = "main.php?iid='.$id.'&dl='.$getlinks[0].'" target = "_blanc">'.stripslashes($getlinks[4]).'</a> ('.$getlinks[2].' klicks)'.$add.'<br>'."\n";
          }
        }
 
Teil 2 (show.php)

PHP:
// 05/05 - add global seeder/leecher info to DB
        if($lastupdate != date("HdmY")) {
          echo "<!-- DEBUG: updated leecher/seeder info in main-db-entry (S:";
          echo $seeder_ges."/L:".$leecher_ges.") -->\n";

// 24/05
          if(($leecher_ges > 0) || ($seeder_ges > 0)) {
            @mysql_query("UPDATE cm_dl_info SET deadsince='' WHERE id = '".$id."' LIMIT 1;");
          } else if($info[deadsince] == "") {
            @mysql_query("UPDATE cm_dl_info SET deadsince='".date("HdmY")."' WHERE id = '".$id."' LIMIT 1;");
          }

          @mysql_query("UPDATE cm_dl_info SET lastupdate='".date("HdmY")."' , seeder=".($seeder_ges+0)." , leecher=".($leecher_ges+0)." WHERE id = '".$id."' LIMIT 1;");
        }

      }
      $posts = str_replace("{links}", $links, $posts);
    }
  }
}elseif(isset($_GET['page']) && !isset($_GET['show'])){
  $main = str_replace("{part}", strtolower($part[1]), $main);
  $infodb = mysql_query("SELECT * FROM cm_dl_info WHERE gruppeid = '$group' ORDER BY name");
  $numinfos = mysql_num_rows($infodb);
  if($numinfos < $sumbru * $_GET['page'] - $sumbru){                              //Testen ob Daten vorhanden sind
    $posts = '<center>Keine Daten vorhanden</center>';
  }else{
    $posts = "";
    $bis = $sumbru * $_GET['page'];
    $von = $bis - $sumbru;
    $posts .= join('',file("html/seiten.htm"));
    $maxs = ceil($numinfos / $sumbru);
    $posts = str_replace("{page}", $_GET['page']." von ".$maxs, $posts);
    $pages = '';

    for($i = 1; $i <=$maxs; $i++){
      if ($i == $_GET['page']){
        $pages .= $i.' ';
      }else{
        $pages .= '<a href = "?site=main.php&group='.$group.'&page='.$i.'">'.$i.'</a> ';
      }
    }

    $posts = str_replace("{pages}", $pages, $posts);
    if($bis > $numinfos){ $bis = $numinfos; }

    for($i=0;$i<$bis;$i++){                 //Infos einlesen
      $info = mysql_fetch_array($infodb);
      if($i >= $von){
        $id = $info[0];
        $lastupdate = $info[lastupdate];
        $rated = checkUserRat($id, $ip);
        if ($rated) {
          $posts .= join('', file("html/postwor.htm"));
        } else {
          $posts .= join('', file("html/post.htm"));
        }
        $name      = $info[2];
        $lang      = $info[3];
        $pic       = $info[4];
        $text      = $info[5];
        $poster    = $info[6];
        $downloads = $info[7];
        $pswd      = $info['pswd'];


        if ($info[10] == 0) { $info[10] = 1; }
        $rating = round($info[8]/$info[10],0);
        $posts = str_replace("{title}", stripslashes($name), $posts);
        $posts = str_replace("{lang}", 'gfx/'.$lang.'.gif', $posts);
        $posts = str_replace("{pic}", $pic, $posts);
        $posts = str_replace("{id}", $id, $posts);
        $posts = str_replace("{show}", "", $posts);
        $posts = str_replace("{pswd}", $pswd, $posts);

        if( $info[11] == "")
          $posts = str_replace("{quality}", '<i>Unknown</i>', $posts);
        else
          $posts = str_replace("{quality}", $info[11], $posts);

        if( $info[13] == "")
          $posts = str_replace("{genre}", '<i>Unknown</i>', $posts);
        else
          $posts = str_replace("{genre}", $info[13], $posts);

        $posts = str_replace("{info}", stripslashes(nl2br($text)), $posts);
        $posts = str_replace("{poster}", $poster, $posts);
        $posts = str_replace("{downloads}", $downloads, $posts);
        $stars = '';
        $a = 0;

        while($a < $rating){
          if($a + 2 <= $rating){
            $a += 2;
            $stars .= '<img src="gfx/star.gif">';
          }else{
            $a += 1;
            $stars .= '<img src="gfx/hstar.gif">';
          }
        }

        if ($rating == 0) { $stars = "-"; }

        $posts = str_replace("{stars}", $stars, $posts);
        $linksdb = mysql_query("SELECT * FROM cm_dl_links WHERE infoid = '$id' ORDER BY name");
        $anzlinks = mysql_num_rows($linksdb);
        if($anzlinks == 0){                      //Testen ob Links vorhanden sind
          $links = '              <center>Keine Links vorhanden</center>';
        }else{
          $links = '';
          for($d=0;$d<$anzlinks;$d++){
            $getlinks = mysql_fetch_array($linksdb);    //Links einlesen und speicherm

// 05/05 - check for valid http link to torrentfile and get seeder/leecher
            if(strpos($getlinks[link], "http://") !== FALSE) {
                if($getlinks['lastupdate'] != date("HdmY")) {
                if(($getlinks['tracker'] == "") || ($getlinks['infohash'] == "") || ($getlinks['tracker'] == "http://")) {
                    $src = encodeurl($getlinks[link]);
                    include "t_dectorrent.php";
                    echo "<!-- DEBUG: added missing tracker/infohash to database! -->\n";
                    @mysql_query("UPDATE cm_dl_links SET tracker='$tracker' , infohash='$infohash' WHERE id = '".$getlinks[id]."' LIMIT 1;");
                  }
                  if($getlinks[infohash] != "") { $infohash = $getlinks[infohash]; }
                  if($getlinks[tracker]  != "") { $tracker  = $getlinks[tracker]; }
                  include "t_asktracker.php";
                  echo "<!-- DEBUG: updated seeder/leecher in database! -->\n";

// 24/05
                  if(($seeder > 0) || ($leecher > 0)) {
                    @mysql_query("UPDATE cm_dl_links SET deadsince='' WHERE id = '".$getlinks[id]."' LIMIT 1;");
                  }

                  @mysql_query("UPDATE cm_dl_links SET lastupdate='".date("HdmY")."' , seeder=$seeder , leecher=$leecher WHERE id = '".$getlinks[id]."' LIMIT 1;");

                  $getlinks[seeder]  = $seeder+0;
                  $getlinks[leecher] = $leecher+0;
                }
              } else {
                if($getlinks[deadsince] == "") {
                  @mysql_query("UPDATE cm_dl_links SET deadsince='".date("HdmY")."' WHERE id = '".$getlinks[id]."' LIMIT 1;");
                }
              }

              $add = "";

// 05/05 - add up all found seeder/leecher for global seeder/leecher info
              $leecher_ges += $getlinks[leecher]+0;
              $seeder_ges  += $getlinks[seeder]+0;

              if($getlinks[5] != ""){ $add = stripslashes("&nbsp;&nbsp;&nbsp;[$getlinks[5]]"); }

// 05/05 - add seeder/leecher to link
              if(($getlinks[seeder] > 0) || ($getlinks[leecher] > 0)) {
                $add .= "&nbsp; &nbsp;(S:".$getlinks[seeder]."/L:".$getlinks[leecher].")";
              }

              if($getlinks[4] == ""){
                $links .= '<a onclick = "javascript:window.open(\'main.php?iid='.$id.'&dl='.$getlinks[0].'\',\'Fenster2\',\'width=300,height=200,scrollbars=0,left=0,top=0\');return false"  href = "main.php?iid='.$id.'&dl='.$getlinks[0].'" target = "_blanc">'.stripslashes($getlinks[1]).'</a> ('.$getlinks[2].' klicks)'.$add.'<br>'."\n";
              }else{
                $links .= '<a onclick = "javascript:window.open(\'main.php?iid='.$id.'&dl='.$getlinks[0].'\',\'Fenster2\',\'width=300,height=200,scrollbars=0,left=0,top=0\');return false"  href = "main.php?iid='.$id.'&dl='.$getlinks[0].'" target = "_blanc">'.stripslashes($getlinks[4]).'</a> ('.$getlinks[2].' klicks)'.$add.'<br>'."\n";
              }
            }

// 05/05 - add global seeder/leecher info to DB
            if($lastupdate != date("HdmY") || ($info[seeder] <> $seeder_ges) || ($info[leecher] <> $leecher_ges)) {
              echo "<!-- DEBUG: updated leecher/seeder info in main-db-entry -->";

// 24/05
              if(($leecher_ges > 0) || ($seeder_ges > 0)) {
                @mysql_query("UPDATE cm_dl_info SET deadsince='' WHERE id = '".$id."' LIMIT 1;");
              } else if($info[deadsince] == "") {
                @mysql_query("UPDATE cm_dl_info SET deadsince='".date("HdmY")."' WHERE id = '".$id."' LIMIT 1;");
              }

              @mysql_query("UPDATE cm_dl_info SET lastupdate='".date("HdmY")."' , seeder=".($seeder_ges+0)." , leecher=".($leecher_ges+0)." WHERE id = '".$id."' LIMIT 1;");
            }

          }
        $posts = str_replace("{links}", $links, $posts);
      }
    }
  }
}else{
  $showid = $_GET['show'];
  $id = $showid;
  $infodb = mysql_query("SELECT * FROM cm_dl_info WHERE id = '$showid'");
  $numinfos = mysql_num_rows($infodb);
  if($numinfos == 0){                              //Testen ob Daten vorhanden sind
    $posts = 'Der Download existiert nicht';
  }else{
    $info = mysql_fetch_array($infodb);       //Infos einlesen
    $lastupdate = $info[lastupdate];
    $main = str_replace("{part}", strtolower(stripslashes($info[2])), $main);
    $rated = checkUserRat($id, $ip);
    if ($rated) {
      $posts .= join('', file("html/postwor.htm"));
    } else {
      $posts .= join('', file("html/post.htm"));
    }
    $posts = str_replace("{title}", stripslashes($info[2]), $posts);
    $posts = str_replace("{lang}", 'gfx/'.$info[3].'.gif', $posts);
    $posts = str_replace("{pic}", $info[4], $posts);
    $posts = str_replace("{id}", $id, $posts);
    $posts = str_replace("{show}", "show=$id&", $posts);

    $posts = str_replace("{pswd}", $info['pswd'], $posts);


    if( $info[11] == "")
      $posts = str_replace("{quality}", '<i>Unknown</i>', $posts);
    else
      $posts = str_replace("{quality}", $info[11], $posts);

    if( $info[13] == "")
      $posts = str_replace("{genre}", '<i>Unknown</i>', $posts);
    else
      $posts = str_replace("{genre}", $info[13], $posts);

    $posts = str_replace("{info}", stripslashes(nl2br($info[5])), $posts);
    $posts = str_replace("{poster}", $info[6], $posts);
    $posts = str_replace("{downloads}", $info[7], $posts);
    $stars = '';

    if ($info[10] == 0) { $info[10] = 1; }

    $rating = round($info[8]/$info[10],0);
    $a = 0;

    while($a < $rating){
      if($a + 2 <= $rating){
        $a += 2; $stars .= '<img src="gfx/star.gif">';
      }else{
        $a += 1; $stars .= '<img src="gfx/hstar.gif">';
      }
    }

    if ($rating == 0) { $stars = "-"; }
    $posts = str_replace("{stars}", $stars, $posts);
    $linksdb = mysql_query("SELECT * FROM cm_dl_links WHERE infoid = '$showid' ORDER BY name");
    $anzlinks = mysql_num_rows($linksdb);
    if($anzlinks == 0){                      //Testen ob Links vorhanden sind
      $links = '              Keine Links vorhanden';
    }else{
      $links = '';
      $seeder_ges  = 0;
      $leecher_ges = 0;
      for($d=0;$d<$anzlinks;$d++){
        $getlinks = mysql_fetch_array($linksdb);    //Links einlesen und speicherm

// 05/05 - check for valid http link to torrentfile and get seeder/leecher
        if(strpos($getlinks[link], "http://") !== FALSE) {
            if($getlinks['lastupdate'] != date("HdmY")) {
                if(($getlinks['tracker'] == "") || ($getlinks['infohash'] == "") || ($getlinks['tracker'] == "http://")) {
                $src = encodeurl($getlinks[link]);
                include "t_dectorrent.php";
                echo "<!-- DEBUG: added missing tracker/infohash to database! -->\n";
                @mysql_query("UPDATE cm_dl_links SET tracker='$tracker' , infohash='$infohash' WHERE id = '".$getlinks[id]."' LIMIT 1;");
              }
              if($getlinks[infohash] != "") { $infohash = $getlinks[infohash]; }
              if($getlinks[tracker]  != "") { $tracker  = $getlinks[tracker]; }
              include "t_asktracker.php";
              echo "<!-- DEBUG: updated seeder/leecher in database! -->\n";

// 24/05
              if(($seeder > 0) || ($leecher > 0)) {
                @mysql_query("UPDATE cm_dl_links SET deadsince='' WHERE id = '".$getlinks[id]."' LIMIT 1;");
              }

              @mysql_query("UPDATE cm_dl_links SET lastupdate='".date("HdmY")."' , seeder=$seeder , leecher=$leecher WHERE id = '".$getlinks[id]."' LIMIT 1;");
              $getlinks[seeder]  = $seeder+0;
              $getlinks[leecher] = $leecher+0;
            }
          } else {
            if($getlinks[deadsince] == "") {
              @mysql_query("UPDATE cm_dl_links SET deadsince='".date("HdmY")."' WHERE id = '".$getlinks[id]."' LIMIT 1;");
            }
          }

        $add = "";

// 05/05 - add up all found seeder/leecher for global seeder/leecher info
        $leecher_ges += $getlinks[leecher]+0;
        $seeder_ges  += $getlinks[seeder]+0;

        if($getlinks[5] != ""){
          $add = stripslashes("&nbsp;&nbsp;&nbsp;[$getlinks[5]]");
        }

// 05/05 - add seeder/leecher to link
        if(($getlinks[seeder] > 0) || ($getlinks[leecher] > 0)) {
          $add .= "&nbsp; &nbsp;» <font color='orange'><b>".$getlinks[seeder]."/".$getlinks[leecher]."</b></font>";
        }

        if($getlinks[4] == ""){
          $links .= '<a href = "?site=main.php&show='.$id.'&iid='.$id.'&dl='.$getlinks[0].'">'.stripslashes($getlinks[1]).'</a> ('.$getlinks[2].' klicks)'.$add.'<br>'."\n";
        }else{
          $links .= '<a href = "?site=main.php&show='.$id.'&iid='.$id.'&dl='.$getlinks[0].'">'.stripslashes($getlinks[4]).'</a> ('.$getlinks[2].' klicks)'.$add.'<br>'."\n";
        }
      }

// 05/05 - add global seeder/leecher info to DB
      if($lastupdate != date("HdmY") || ($info[seeder] <> $seeder_ges) || ($info[leecher] <> $leecher_ges)) {
        echo "<!-- DEBUG: updated leecher/seeder info in main-db-entry (S:";
        echo $seeder_ges."/L:".$leecher_ges.") -->\n";

// 24/05
        if(($leecher_ges > 0) || ($seeder_ges > 0)) {
          @mysql_query("UPDATE cm_dl_info SET deadsince='' WHERE id = '".$id."' LIMIT 1;");
        } else if($info[deadsince] == "") {
          @mysql_query("UPDATE cm_dl_info SET deadsince='".date("HdmY")."' WHERE id = '".$id."' LIMIT 1;");
        }

?>
 
Mit einer Datenbankabfrage sollte das recht einfach gehn:
Code:
DELETE 
    `download_name` 
FROM 
    `tabellen_name`
WHERE
    `seeder` = ''
AND
    `leecher` = ''
So ungefähr könnte der aussehen.

//edit: huch...wo kommen die ganzen dateien her? :suspekt:

greetz
daddz
 
Zuletzt bearbeitet:
Teil 3 (show.php)

PHP:
        @mysql_query("UPDATE cm_dl_info SET lastupdate='".date("HdmY")."' , seeder=".($seeder_ges+0)." , leecher=".($leecher_ges+0)." WHERE id = '".$id."' LIMIT 1;");
      }

    }
    $posts = str_replace("{links}", $links, $posts);
  }
}

$main = str_replace("{input}", $posts, $main);

//   ###  ## ##  ####    ###  ####  ##   ###   ####    ###
//  ##    ## ##  ## ##  ##     ##       ## ##  ## ##  ##
//  ###   ## ##  ## ##  ##     ##   ##  ## ##  ## ##    ##
//  ##     ####  ## ##   ###   ##   ##   ###   ## ##  ###
function checkUserRat($pid, $ip) {
  $rated = false;
  if (isset($_COOKIE['rated'][$pid])) { $rated = true; }
  $testuser = mysql_query("SELECT count(id) FROM cm_dl_ipsperre WHERE ip = '$ip' AND pid = '$pid'");
  $data = mysql_fetch_row($testuser);
  if ($data[0] != 0) { $rated = true; }
  return $rated;
}

function encodeurl($url) {
//  $parts = explode('/', $url);
//  for($i=1;$i<count($parts);$i++) { $parts[$i] = rawurlencode($parts[$i]); }
//  return implode('/', $parts);
  return str_replace(" ", "%20", $url);
}
 
Zurück