Welcome, Guest. Please Login or Register.
May 15, 2025, 12:03:35 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Recent TOPICS on board index « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Recent TOPICS on board index  (Read 1436 times)
alura
Noobie
*
Posts: 18


www.ilpistone.com webmaster

WWW
Recent TOPICS on board index
« on: September 09, 2003, 08:11:26 AM »
Reply with quote

A lot of my users (www.ilpistone.com) ask a way to simple follow new discussions.

My Idea is to modify the board index adding for each forum the list of last "n" (selectable in forum setup, as I have forum more active than other) TOPICS with "new" indicator.

This will allow user to follow interesting discussion without navigating in every forum.

Someone interested to develope this (for yabbse 1.5.4) ?


This is a sample of what I mean (maked with Paint ;D)
« Last Edit: September 11, 2003, 07:17:53 AM by alura » Logged
alura
Noobie
*
Posts: 18


www.ilpistone.com webmaster

WWW
Re:Recent Topics on board index - Thanks Spaceman-Spiff
« Reply #1 on: September 11, 2003, 07:17:34 AM »
Reply with quote

Ok..ok... no interesting  ;D

However, thank's to Headlines.pl from YaBB Gold to Yabbse post and to the great Spaceman-Spiff I was able to implement what I need.

Just imported RecentTopics() to boardIndex.php and modified a bit the code.

It works fine... Just some little request for spaceman (always for ssi.php modified as requested by hprod):
1) I show the first topic description and the right date, but the user is the last who has updated the topic. I would like to have both.
2) Add a var with the last post descrition and the date

Thank's in advance

I have no time to make a mod, if you are interested in my boardIndex.php just request.

If you want to look the result go to www.ilpistone.com
« Last Edit: September 11, 2003, 12:58:54 PM by alura » Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:Recent Topics on board index
« Reply #2 on: September 11, 2003, 09:09:05 PM »
Reply with quote

quite a unique boardindex you got there
http://www.ilpistone.com/yabbse/

my suggestion: maybe you shouldn't remove the on/off image
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
alura
Noobie
*
Posts: 18


www.ilpistone.com webmaster

WWW
Re:Recent Topics on board index
« Reply #3 on: September 12, 2003, 07:08:59 AM »
Reply with quote

Quote from: Spaceman-Spiff on September 11, 2003, 09:09:05 PM
quite a unique boardindex you got there
http://www.ilpistone.com/yabbse/

Thank's... also my user are very-very happy of changes ;D

Quote from: Spaceman-Spiff on September 11, 2003, 09:09:05 PM
my suggestion: maybe you shouldn't remove the on/off image

Yes... I will put back on/off image...


I known that I'am a little encrypted when I write in English ;D

My boardindex works fine but I need to add some stuff to the query. As I integrated your modified RecentTopics in boardIndex with your suggestion to hprod (http://www.yabbse.org/community/index.php?thread=23792) you are the right man ;)

Here is my needed:

1) First topic subject (DONE by spacemane)
2) First topic date (to be done)
3) First topic user (to be done)
4) Last topic subject (to be done)
5) Last topic date (to be done)
6) Last topic user (DONE by spacemane)

Here is my RecentTopic()

function recentTopics ($template = "rTopics_template.php")
{
   global $settings, $scripturl, $txt, $censored, $db_prefix, $num_recentTopics, $username;
   global $imagesdir, $img, $ID_MEMBER;
   global $recentBoard;

   define('YaBBSE_ssi', 1);
   $recent_counter = 0;
   $count = 4;

   if ($recentBoard == 58) $count = 5;
   if ($recentBoard == 51) $count = 10;
   if ($recentBoard == 57) $count = 10;

   //echo $recentBoard;

   //Limit recent topics to 24 hours. Uncomment the following line for more speed
   //$timeLimit = 24 * 60 * 60;
   $request = mysql_query("
      SELECT m.ID_MSG
      FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b,{$db_prefix}categories AS c
      WHERE m.ID_MSG = t.ID_LAST_MSG AND (t.ID_BOARD=$recentBoard)
         AND b.ID_BOARD=t.ID_BOARD
         AND c.ID_CAT=b.ID_CAT
         AND (FIND_IN_SET('$settings[7]', c.memberGroups) != 0 OR c.memberGroups='' OR '$settings[7]' LIKE 'Administrator' OR '$settings[7]' LIKE 'Global Moderator')
         " . ($timeLimit > 0 ? 'AND m.posterTime>' . (time() - $timeLimit) : '') . "
         AND m.icon != 'moved.gif'
      ORDER BY posterTime DESC
      LIMIT 0, $count;") or database_error(__FILE__, __LINE__);
   $messages = array();
   while ($row = mysql_fetch_array($request))
      $messages[] = $row['ID_MSG'];

   if (count($messages))
   {
     $request = mysql_query("
        SELECT m.posterTime, m2.subject, m.ID_TOPIC, m.posterName, m.ID_MEMBER, IFNULL(mem.realName, m.posterName) AS posterDisplayName, m.icon, t.numReplies, t.ID_BOARD, t.ID_FIRST_MSG, b.name AS bName, IFNULL(lt.logTime, 0) AS isRead, IFNULL(lmr.logTime, 0) AS isMarkedRead
        FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards as b, {$db_prefix}messages AS m2
           LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER=m.ID_MEMBER)
           LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC=t.ID_TOPIC AND lt.ID_MEMBER=$ID_MEMBER)
           LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD=t.ID_BOARD AND lmr.ID_MEMBER=$ID_MEMBER)
        WHERE m.ID_MSG IN (" . implode(',', $messages) . ")
           AND t.ID_TOPIC=m.ID_TOPIC
           AND b.ID_BOARD=t.ID_BOARD
           AND m2.ID_MSG=t.ID_FIRST_MSG
        ORDER BY m.posterTime DESC;") or database_error(__FILE__, __LINE__);
   if (mysql_num_rows($request) > 0)
      {
         echo '<table border="0">';

         while ($row = mysql_fetch_array($request))
         {
            $new = ($row['isRead'] >= $row['posterTime'] || $row['isMarkedRead'] >= $row['posterTime'] ? false : true);
            if (!$new || $username == 'Guest')
               $new = '';
            else
               $new = '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . ';action=display;threadid=' . $row['ID_TOPIC'] . ';start=new">' . $img['new'] . '</a>';

            if ($row['ID_MEMBER'] != -1)
            {
               $euser = urlencode($row['posterName']);
               $dummy = "<a href=\"$scripturl?action=viewprofile;user=$euser\">$row[posterDisplayName]</a>";
            }
            else
               $dummy = $row['posterName'];

            $sub = $row['subject'];
            if (strlen($sub) > 45)
                  $sub = substr($sub, 0, 45) . '...';

            $recent_board = '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . '">' . $row['bName'] . '</a>';
            $recent_icon = '<img src="' . $imagesdir . '/' . $row[icon] . '.gif" alt="' . $row['icon'] . '" border="0" />';
            $recent_topic = '<a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . ';action=display;threadid=' . $row['ID_TOPIC'] . ';start=' . $row['numReplies'] . '">' . $sub . '</a>';
            $recent_poster = $dummy;
            $recent_new = $new;
            $recent_time = timeformat($row['posterTime']);
            $recent_counter++;

            //CensorTxt($recent_topic);
            
            if (is_file($template))
               include($template);
            else
               echo "Error reading template file.";
         }
         echo '</table>';
      }
      else
         echo '---';
   }
   else
      echo '---';
}



Thank's
« Last Edit: September 12, 2003, 07:09:37 AM by alura » Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:Recent Topics on board index
« Reply #4 on: September 12, 2003, 04:02:53 PM »
Reply with quote

Quote2) First topic date (to be done)
3) First topic user (to be done)
4) Last topic subject (to be done)
5) Last topic date (to be done)
i dont really understand those...
do you mean you want to show both the topic starter and the last poster in that topic?
if that's what you mean, it can be done, but I don't know how to make the look good, I mean your boardindex can get pretty big/long...
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
alura
Noobie
*
Posts: 18


www.ilpistone.com webmaster

WWW
Re:Recent Topics on board index
« Reply #5 on: September 12, 2003, 04:07:23 PM »
Reply with quote

Quote from: Spaceman-Spiff on September 12, 2003, 04:02:53 PM
Quote2) First topic date (to be done)
3) First topic user (to be done)
4) Last topic subject (to be done)
5) Last topic date (to be done)
i dont really understand those...
do you mean you want to show both the topic starter and the last poster in that topic?
if that's what you mean, it can be done, but I don't know how to make the look good, I mean your boardindex can get pretty big/long...

I like to have something like this:

<topic_title> (by <user_name> <date>, <xxx> posts, updated <last_post_date>)

I like to add also the last post title, but where !!! ;D
« Last Edit: September 12, 2003, 04:07:49 PM by alura » Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:Recent Topics on board index
« Reply #6 on: September 12, 2003, 05:01:40 PM »
Reply with quote

i think about  99% of post titles are the same with their topic titles, with the addition of Re:
so i dont know if that's important to include or not
btw, don't you think if you add too much information the BoardIndex will look bad?

anyway, I don't think i have the time to help you with this right now, been quite busy...
i haven't coded anything yse-related for weeks >_<
i can offer advises atm, but not a lot of codes
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:Recent Topics on board index
« Reply #7 on: September 13, 2003, 02:53:40 AM »
Reply with quote

so in other words, you want a bit of each messageindex under the matching board in boardindex?
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
alura
Noobie
*
Posts: 18


www.ilpistone.com webmaster

WWW
Re:Recent Topics on board index
« Reply #8 on: September 15, 2003, 06:49:09 AM »
Reply with quote

Quote from: Anguz on September 13, 2003, 02:53:40 AM
so in other words, you want a bit of each messageindex under the matching board in boardindex?

Yes... thank's to RecentTopics() by s-spiff i've done it. But is no complete as I wish.

Quote from: Spaceman-Spiff on September 12, 2003, 05:01:40 PM
i think about  99% of post titles are the same with their topic titles, with the addition of Re:
so i dont know if that's important to include or not
btw, don't you think if you add too much information the BoardIndex will look bad?

anyway, I don't think i have the time to help you with this right now, been quite busy...
i haven't coded anything yse-related for weeks >_<
i can offer advises atm, but not a lot of codes

No problem.... I'm a "C" programmers for years but I'm new in mysql so I think I will able to implement by myself the modification when I become to understand querys ;D

Anyway If you found the time the topic is here ;)

Bye and thank's !
« Last Edit: September 15, 2003, 07:58:36 AM by alura » Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Recent TOPICS on board index « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.125 seconds with 21 queries.