Advertisement
Guest User

Untitled

a guest
Aug 27th, 2014
224
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. #######letzten 10 Themen#######
  4. // get forums user cannot view
  5. $unviewable = get_unviewable_forums(true);
  6. if($unviewable)
  7. {
  8.         $unviewwhere = " AND fid NOT IN ($unviewable)";
  9. }
  10.  
  11.         $altbg = alt_trow();
  12.         $threadlist = '';
  13.         $query = $db->query("
  14.                SELECT t.*, u.username
  15.                FROM ".TABLE_PREFIX."threads t
  16.                LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
  17.                WHERE 1=1 $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
  18.                ORDER BY t.lastpost DESC
  19.                LIMIT 0, 10"
  20.         );
  21.         while($thread = $db->fetch_array($query))
  22.         {
  23.                 $lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
  24.                 $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
  25.                 // Don't link to guest's profiles (they have no profile).
  26.                 if($thread['lastposteruid'] == 0)
  27.                 {
  28.                         $lastposterlink = $thread['lastposter'];
  29.                 }
  30.                 else
  31.                 {
  32.                         $lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
  33.                 }
  34.                 if(my_strlen($thread['subject']) > 25)
  35.                 {
  36.                         $thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
  37.                 }
  38.                 $thread['subject'] = htmlspecialchars_uni($thread['subject']);
  39.                 $thread['threadlink'] = get_thread_link($thread['tid']);
  40.                 $thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
  41.                 eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";");
  42.                 $altbg = alt_trow();
  43.         }
  44.         if($threadlist)
  45.         {
  46.                 // Show the table only if there are threads
  47.                 eval("\$latestthreads = \"".$templates->get("portal_latestthreads")."\";");
  48.         }
  49.         echo $latestthreads;
  50. #######letzten 10 Themen ENDE#######
  51. ?>
Advertisement
RAW Paste Data Copied
Advertisement