YourWBB


yourWBB » yourWBB Misc * » Das Proggen » MySQL und PHP » Probleme mit Favoriten-Anzeige » Hallo Gast [Anmelden|Registrieren]
Letzter Beitrag | Erster ungelesener Beitrag 2.043 Views | | Thema zu Favoriten hinzufügen

Neues Thema erstellen Antwort erstellen

Zum Ende der Seite springen Probleme mit Favoriten-Anzeige
Autor
Beitrag « Vorheriges Thema | Nächstes Thema »
ipaqman ipaqman ist männlich
Mitglied


Dabei seit: 23.01.04
Beiträge: 64
Forenversion: Lite 1.0

 Probleme mit Favoriten-Anzeige Antworten Zitieren Editieren Melden       UP

Hallo Leute,

ich möchte die Favoriten-Anzeige auf einer neuen Seite implementieren - benutzte ein wbblite.

Klappt auch alles bisher sehr gut, ausser das mir nicht der letzte (von Datum her) der Favoriten angeziegt wird. Mein Code sieht soweit erstmal so aus:

php:
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:
/** threads **/
  if($wbbuserdata['umaxposts']) $postsperpage=$wbbuserdata['umaxposts'];
 elseif($board['postsperpage']) $postsperpage=$board['postsperpage'];
 else $postsperpage=$default_postsperpage;

 if($board['hotthread_reply']==0$board['hotthread_reply']=$default_hotthread_reply;
 if($board['hotthread_view']==0$board['hotthread_view']=$default_hotthread_view;
 
 $ownuserid="";
 $ownjoin="";
 $threadids="";
 
 $result $db->query("SELECT t.threadid FROM bb".$n."_subscribethreads s LEFT JOIN bb".$n."_threads t USING(threadid) WHERE s.userid='$wbbuserdata[userid]' AND t.visible = 1 ORDER BY t.lastposttime DESC");
 while($row=$db->fetch_array($result)) $threadids .= ",".$row['threadid'];
  $result $db->query("SELECT
    t.*,
    i.*
  FROM bb".$n."_threads t
  LEFT JOIN bb".$n."_icons i USING (iconid)
    WHERE t.threadid IN (0$threadids)
  ORDER BY t.lastposttime DESC Limit 6");

 $threadbit="";
 while($threads=$db->fetch_array($result)) {
  $firstnew="";
  $multipages="";
  $prefix="";
  if(strlen($threads[topic])>27$threads[topic] = "".substr($threads[topic], 024)."...";  
  if($threads['pollid']!=0) eval ("\$prefix .= \"".$tpl->get("board_thread_poll")."\";");

 if($threads['pollid']!=0$foldericon="poll";
  
  else $foldericon=ifelse($threads['userid'],"dot").ifelse($wbbuserdata['lastvisit']<$threads['lastposttime'] && $threadvisit[$threads['threadid']]<$threads['lastposttime'],"new").ifelse($threads['replycount']>=$board['hotthread_reply'] || $threads['views']>=$board['hotthread_view'],"hot").ifelse($threads['closed']!=0,"lock")."folder";
  
  if($wbbuserdata['lastvisit']<$threads['lastposttime'] && $threadvisit[$threads['threadid']]<$threads['lastposttime']) eval ("\$firstnew = \"".$tpl->get("board_threadbit_firstnew")."\";");
  
  if($threads['iconid']) $threadicon=makeimgtag($threads['iconpath'],$threads['icontitle']);
  else $threadicon="&nbsp;";
  
  if($threads['starterid']!=0) eval ("\$threads['starter'] = \"".$tpl->get("board_threadbit_starter")."\";");
  
  if($threads['lastposterid']!=0) eval ("\$threads['lastposter'] = \"".$tpl->get("board_threadbit_lastposter")."\";");
   

  $lastpostdate=formatdate($dateformat,$threads['lastposttime'],1);
  $lastposttime=formatdate($timeformat,$threads['lastposttime']);
  
  if($threads['replycount']+1>$postsperpage && $showmultipages!=0) {
   unset($multipage);
   unset($multipages_lastpage);
   $xpages=ceil(($threads['replycount']+1)/$postsperpage);
   if($xpages>$showmultipages) {
    eval ("\$multipages_lastpage = \"".$tpl->get("board_threadbit_multipages_lastpage")."\";");
    $xpages=$showmultipages;
   }
   for($i=1;$i<=$xpages;$i++) $multipage.=" ".makehreftag("thread.php?threadid=$threads[threadid]&page=$i&sid=$session[hash]",$i);
   eval ("\$multipages = \"".$tpl->get("board_threadbit_multipages")."\";");
  }
  
  
if(!$wbbuserdata['userid']) {
 eval ("\$profil_favorites = \"".$tpl->get("")."\";");
 }
else {
  eval ("\$profil_favorites = \"".$tpl->get("profil_favorites")."\";");
  eval ("\$threadbit .= \"".$tpl->get("overview_threadbit")."\";");
 }
 if($threadbit) eval ("\$threadheader = \"".$tpl->get("overview_threadheader")."\";");
 else eval ("\$threadheader = \"".$tpl->get("overview_nothreads")."\";");
}


Und die overview_threadbit.tpl sieht so aus:
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
<tr align="center">
  <td><img src="{imagefolder}/$foldericon.gif" border=0></td>
  <td>&nbsp;&raquo;&nbsp;</td>
  <td  width="75%" align="left">$firstnew<a href="thread.php?threadid=$threads[threadid]&sid=$session[hash]">$prefix$threads[topic]</a>$multipages<br><smallfont><a href="addreply.php?threadid=$threads[threadid]&sid=$session[hash]">Antworten</a> | <a href="overview.php?action=removesubscription&threadid=$threads[threadid]&sid=$session[hash]">Abbestellen</a></font></td>
   <td align="left"><table cellpadding="0" cellspacing="0" border="0" width="100%">
   <tr align="left">
    <td align="left" nowrap><smallfont>$lastpostdate <font color="{timecolor}">$lastposttime</font><br>
    von $threads[lastposter]</font></td>
       </tr>
       <br>
  </table></td>
 </tr>


Was ist falsch?

Da ich ja auf die Favoriten zugreife, sie ich ja normal im UserCP welche Favoriten ich gewählt habe....
Bei meiner Anzeige fehlt immer der letzte... verwirrt

__________________
checker-forum.de
27.02.07 17:52 ipaqman ist offline E-Mail WWW Finden Als Freund hinzufügen
Baumstruktur | Brettstruktur
Gehe zu:

Neues Thema erstellen Antwort erstellen

yourWBB » yourWBB Misc * » Das Proggen » MySQL und PHP » Probleme mit Favoriten-Anzeige