4images Forum & Community

General / Allgemeines => Programming => Topic started by: Sunny C. on August 02, 2011, 11:15:15 PM

Title: - delete -
Post by: Sunny C. on August 02, 2011, 11:15:15 PM
- delete -
Title: Re: Externe News innerhalb von 4images anzeigen (header.html)
Post by: Rembrandt on August 03, 2011, 07:01:30 AM
*puh*

versuchs mal so:
  $sql = "SELECT c.content_id, c.content_title, c.content_cat, c.content_status, c.content_option, c.content_expire, c.content_time  
          FROM pk__content c
          LEFT JOIN pk__contentcat y ON (y.contentcat_id = c.content_cat)
          WHERE c.content_option = 1 AND
              c.content_status = 1 AND
             (c.content_expire > '".time()."' OR c.content_expire='0') AND
              c.content_time < '".time()."'
          ORDER by c.content_time DESC
          LIMIT 11";
  $result = $site_db->query($sql);
  
  $header_dl="";
  while ($row = $site_db->fetch_array($result)){
  
    $title = $row['content_title'];
    $title_cutted=TextAbschneiden($title, 30);
    $header_dl.="&raquo; <a href=\"include.php?path=article&amp;contentid= ".$row['content_id']."\" onmouseover=\"Tip('$title')\" onmouseout=\"UnTip()\">$title_cutted</a><br />";
  }


die restriction: "pk__contentcat.contentcat_rights" habe ich mal weg gelassen weil ich denke die wird so nicht funtionieren, und das mit ".time()." , bist du dir da sicher das in ".pkTIME." der aktuelle zeitstempel drinnen steht?

hm.. ob du den left join überhaupt benötigst... b.z.w. auch die "zeit" in der WHERE abfrage...
wenn nicht kannst du es ja mal so versuchen:

    $sql = "SELECT content_id, content_title, content_status, content_option, content_time
          FROM pk__content
          WHERE content_option = 1 AND content_status = 1
          ORDER by content_time DESC
          LIMIT 11";
  $result = $site_db->query($sql);