Welcome, Guest. Please Login or Register.
May 14, 2025, 09:34:16 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Recent topics / new marker « previous next »
Pages: [1] 2 Reply Ignore Print
Author Topic: Recent topics / new marker  (Read 2828 times)
HighBoy
Jr. Member
**
Posts: 72


I love it !

Recent topics / new marker
« on: November 17, 2002, 02:59:51 PM »
Reply with quote

Hi !
I have converted to Yabbse from Yabb Gold, and there is one feature that my members miss very much.

It's the "new" indicator on the recent topics....
When using it on my frontpage, it used to display a "new" marker, but since i installed YabbSE it don't do that anymore.

Is there any way of implementing it ?

I know that it should be done in the SSI.php file but that's all i know  ;D

I think the feature is from yabb Gold/headlines mod.

/H

Logged
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:Recent topics / new marker
« Reply #1 on: November 18, 2002, 02:47:21 AM »
Reply with quote

I don't think there is a public mod of this but I think Nemisis has gotten it to work.
Logged

HighBoy
Jr. Member
**
Posts: 72


I love it !

Re:Recent topics / new marker
« Reply #2 on: November 18, 2002, 06:41:27 AM »
Reply with quote

Quote from: David on November 18, 2002, 02:47:21 AMI don't think there is a public mod of this but I think Nemisis has gotten it to work.
:'( :'( I really need it !!!!!
Logged
Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:Recent topics / new marker
« Reply #3 on: November 18, 2002, 08:01:09 AM »
Reply with quote


*** Edited ***

Deleting codes in this post.

They did not work.

See post below where I made a diffrent version.
« Last Edit: November 20, 2002, 07:39:30 AM by Nemesis » Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:Recent topics / new marker
« Reply #4 on: November 18, 2002, 06:32:12 PM »
Reply with quote

Guys let me know if this worked, if so I'll make it into a small mod.
Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
HighBoy
Jr. Member
**
Posts: 72


I love it !

Re:Recent topics / new marker
« Reply #5 on: November 18, 2002, 06:56:58 PM »
Reply with quote

Well the New showed up but even if i read the post it would stay on.....

It will also show up even if i am a guest....

Btw. is there a way to exclude a certain board from being listed in the recent topics ??
My News (announcement board) don't belong there...

If you can get this thing working you will be a very popular man on my site  ;D ;D
« Last Edit: November 18, 2002, 07:43:40 PM by HighBoy » Logged
Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:Recent topics / new marker
« Reply #6 on: November 19, 2002, 08:21:25 AM »
Reply with quote

Sorry, Trying to get my store ready for x-mas so I been very busy, working many hours, plus all my web projects I am trying to do. I will get to it hopefully tommorrow if I can. I forgot abit of codes to make it work.
Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
HighBoy
Jr. Member
**
Posts: 72


I love it !

Re:Recent topics / new marker
« Reply #7 on: November 19, 2002, 08:25:29 AM »
Reply with quote

Quote from: Nemesis on November 19, 2002, 08:21:25 AMSorry, Trying to get my store ready for x-mas so I been very busy, working many hours, plus all my web projects I am trying to do. I will get to it hopefully tommorrow if I can. I forgot abit of codes to make it work.
No problems m8... ;)
Logged
Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:Recent topics / new marker
« Reply #8 on: November 19, 2002, 08:51:39 AM »
Reply with quote


*** Edited ***

Deleting codes in this post.

They did not work.

See post below where I made a diffrent version.
« Last Edit: November 20, 2002, 07:39:49 AM by Nemesis » Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
HighBoy
Jr. Member
**
Posts: 72


I love it !

Re:Recent topics / new marker
« Reply #9 on: November 19, 2002, 09:25:59 AM »
Reply with quote

The Snip thing is great 8)

But for some reason it leaves the "NEW" marker on after the thread is read.....
Logged
Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:Recent topics / new marker
« Reply #10 on: November 20, 2002, 07:57:30 AM »
Reply with quote

Okay here it is and I tested it to makes sure it works.

Made it into a two step install process.

  • Make sure the $full_yabbse_path is set right

  • When using SSI.php maker sure the file you are calling the functions from have the full path to the SSI.php file at the very top before the <html> tag. Line 1
Example: if your $full_yabbse_path is:
$full_yabbse_path = "/hsphere/local/home/yoursite/yoursite.com/forum";
//Notice: there is no trailing slash!

Then the top of the file you are showing recentTopics in should have this on line 1
<? require("/hsphere/local/home/yoursite/yoursite.com/forum/SSI.php"); ?>

Edit the following lines in SSI.php then upload to your server.


FIND:
   $showlatestcount = 10;
   $showBoard = 1;   // set to 1 to show the board the topic belongs to
   $showPoster = 1; // set to 1 to show the poster
   $showTime = 1;   // set to 1 to show the time of the post
/****************   DO NOT MODIFY ANYTHING BELOW THIS LINE!   ****************/
include_once ($full_yabbse_path."/Settings.php");
include_once ($full_yabbse_path."/".$language);
include_once ($full_yabbse_path."/Sources/Subs.php");
include_once ($full_yabbse_path."/Sources/Load.php");
$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db($db_name);

$types_to_register = array('GET','POST','COOKIE','SESSION','SERVER');
  foreach ($types_to_register as $type) {
    $arr = @${'HTTP_' . $type . '_VARS'};
    if (@count($arr) > 0) {
      extract($arr, EXTR_OVERWRITE);
    }
  }

/* ### Log this click ### */
ClickLog();

/* ### Load the user's cookie (or set to guest) ### */
LoadCookie();

/* ### Load user settings ### */
LoadUserSettings();

if ($function == 'topPoster' || $function == 'recentTopics' || $function == 'whosOnline' || $function == 'welcome' || $function == 'menubar' || $function == 'logout' || $function == 'login') {
   $function(); // Execute Function
   exit;
}

REPLACE:
/****************   DO NOT MODIFY ANYTHING BELOW THIS LINE!   ****************/
include_once ($full_yabbse_path."/QueryString.php");
include_once ($full_yabbse_path."/Settings.php");
include_once ($full_yabbse_path."/".$language);
include_once ($full_yabbse_path."/Sources/Subs.php");
include_once ($full_yabbse_path."/Sources/Load.php");
include_once ($full_yabbse_path."/Sources/Security.php");
$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db($db_name);

$types_to_register = array('GET','POST','COOKIE','SESSION','SERVER');
  foreach ($types_to_register as $type) {
    $arr = @${'HTTP_' . $type . '_VARS'};
    if (@count($arr) > 0) {
      extract($arr, EXTR_OVERWRITE);
    }
  }

ClickLog();
LoadCookie();
LoadUserSettings();
ob_end_clean();

if ($function == 'topPoster' || $function == 'recentTopics' || $function == 'whosOnline' || $function == 'welcome' || $function == 'menubar' || $function == 'logout' || $function == 'login') {
   $function(); // Execute Function
   exit;
}

FIND:
function recentTopics(){

   ob_end_clean();

   global $settings,$scripturl,$txt,$censored,$recentsender,$db_prefix, $post, $dummy,$showlatestcount,$showBoard,$showPoster,$showTime;

   # Load Censor List
   LoadCensorList();
   if (!isset($recentsender)) {$recentsender='';}

   $request = mysql_query("SELECT m.posterTime,m.subject,m.ID_TOPIC,t.ID_BOARD,m.posterName,m.ID_MEMBER,t.numReplies,t.ID_FIRST_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 && t.ID_BOARD=b.ID_BOARD && b.ID_CAT=c.ID_CAT && (FIND_IN_SET('$settings[7]',c.memberGroups)!=0 || c.memberGroups='' || '$settings[7]' LIKE 'Administrator' || '$settings[7]' LIKE 'Global Moderator')) ORDER BY m.posterTime DESC LIMIT 0,$showlatestcount");

   $thepost = "";

   if( mysql_num_rows($request) > "0" ) {

      $post = array();

      while ($row = mysql_fetch_array($request)) {

         $request3 = mysql_query ("SELECT name FROM {$db_prefix}boards WHERE (ID_BOARD=$row[ID_BOARD]) LIMIT 1");
         $temp = mysql_fetch_row($request3);
         $bname = $temp[0];

         if ($row['ID_MEMBER'] != -1) {                  
            $request4 = mysql_query ("SELECT realName FROM {$db_prefix}members WHERE ID_MEMBER=$row[ID_MEMBER] LIMIT 1");
            $temp2 = mysql_fetch_row($request4);
            $dummy = "<a href=\"$scripturl?action=viewprofile;user=$row[posterName]\">$temp2[0]</a>";
         } else {
            $dummy = $row['posterName'];
         }
         
         $request2 = mysql_query ("SELECT subject FROM {$db_prefix}messages WHERE ID_MSG=$row[ID_FIRST_MSG] LIMIT 1");
         $row2 = mysql_fetch_array($request2);
         
         $dummy1 = $showBoard?"$txt[yse88] <a href=\"$scripturl?board=$row[ID_BOARD]\">$bname</a> ":"";
         $dummy2 = $showPoster?"$txt[525] $dummy ":"";
         $dummy3 = $showTime?timeformat($row['posterTime']):"";

         $thepost .="ยป&nbsp;<a href=\"$scripturl?board=$row[ID_BOARD];action=display;threadid=$row[ID_TOPIC];start=$row[numReplies]\" class=\"t11\">$row2[subject]</a> $dummy1$dummy2$dummy3<br>\n";

      }
   
   }

   foreach ($censored as $tmpa=>$tmpb) {
      $thepost = str_replace($tmpa,$tmpb,$thepost );
   }
   
   print $thepost;
}

REPLACE:
// NEMESIS MODIFIED SSI HACK * NEW INDICATOR * SNIPE HEADLINES * //
function recentTopics (){

   global $settings,$scripturl,$txt,$censored,$recentsender,$db_prefix, $post, $dummy, $username;

   $showlatestcount = 10;

   $showBoard = 1;   // set to 1 to show the board the topic belongs to
   $showPoster = 1; // set to 1 to show the poster
   $showTime = 1;   // set to 1 to show the time of the post

   # Load Censor List
   LoadCensorList();
   if (!isset($recentsender)) {$recentsender='';}

   $request = mysql_query("SELECT m.posterTime,m.subject,m.ID_TOPIC,t.ID_BOARD,m.posterName,m.ID_MEMBER,t.numReplies,t.ID_FIRST_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 && t.ID_BOARD=b.ID_BOARD && b.ID_CAT=c.ID_CAT && (FIND_IN_SET('$settings[7]',c.memberGroups)!=0 || c.memberGroups='' || '$settings[7]' LIKE 'Administrator' || '$settings[7]' LIKE 'Global Moderator')) ORDER BY m.posterTime DESC LIMIT 0,$showlatestcount");

   $thepost = "";
   $linecounter = 0;
   
   if( mysql_num_rows($request) > 0 ) {

      $post = array();

      while ($row = mysql_fetch_array($request)) {

         $linecounter++;
         $topicEditedTime = $row['posterTime'];
         $mnum = $row['ID_TOPIC'];
         $currentboard = $row['ID_BOARD'];
         
         $request3 = mysql_query ("SELECT name FROM {$db_prefix}boards WHERE (ID_BOARD=$row[ID_BOARD]) LIMIT 1");
         $temp = mysql_fetch_row($request3);
         $bname = $temp[0];

         if ($row['ID_MEMBER'] != -1) {                  
            $request4 = mysql_query ("SELECT realName FROM {$db_prefix}members WHERE ID_MEMBER=$row[ID_MEMBER] LIMIT 1");
            $temp2 = mysql_fetch_row($request4);
            $dummy = "<a href=\"$scripturl?action=viewprofile;user=$row[posterName]\">$temp2[0]</a>";
         } else {
            $dummy = $row['posterName'];
         }
         
         $request2 = mysql_query ("SELECT subject FROM {$db_prefix}messages WHERE ID_MSG=$row[ID_FIRST_MSG] LIMIT 1");
         $row2 = mysql_fetch_array($request2);
         
         $dummy1 = $showBoard?"$txt[yse88] <a href=\"$scripturl?board=$row[ID_BOARD]\">$bname</a> ":"";
         $dummy2 = $showPoster?"$txt[525] $dummy ":"";
         $dummy3 = $showTime?timeformat($row['posterTime']):"";

         // Decide if thread should have the "NEW" indicator next to it.
         // Do this by reading the user's log for last read time on thread,
         // and compare to the last post time on the thread.
         $new = true;
         $request5 = mysql_query("SELECT logTime FROM {$db_prefix}log_topics WHERE (ID_TOPIC=$mnum && memberName='$username' && logTime>=$topicEditedTime) LIMIT 1");
         if (mysql_num_rows($request5) == 0)
         {
            $request6 = mysql_query("SELECT logTime FROM {$db_prefix}log_mark_read WHERE (ID_BOARD=$currentboard && memberName='$username' && logTime>=$topicEditedTime)");
            if (mysql_num_rows($request6) != 0)
               $new = false;
         }
         else
            $new = false;
   
         if (!$new || $username=='Guest')
            $new = '';
         else
            $new = "<font size=1 color=yellow face=verdana><i>NEW</i></font>";

         
         //Added Bonus for you... I am adding a snipe hack. I just know someone will request it anyways.
         $subjectline = $row2[subject];
         $snip_headlines_when_longer_than = 35;   # snip off a too long title, set 0 to always display the full title.

         if ($snip_headlines_when_longer_than) {
            if (strlen($subjectline) > $snip_headlines_when_longer_than)
            {
               $subjectline= substr($subjectline,0,$snip_headlines_when_longer_than);
               $subjectline .= "...";
            }
         }
            
         $thepost .=$linecounter.". <a href=\"$scripturl?board=$row[ID_BOARD];action=display;threadid=$row[ID_TOPIC];start=$row[numReplies]\">$subjectline</a> $dummy1$dummy2$dummy3".$new."<br>\n";

      }
   
   }

   foreach ($censored as $tmpa=>$tmpb) {
      $thepost = str_replace($tmpa,$tmpb,$thepost );
   }
   
   echo $thepost;
   
}
// NEMESIS MODIFIED SSI HACK * NEW INDICATOR * SNIPE HEADLINES * //

NOTICE:
$showlatestcount = 10;
$showBoard = 1;   // set to 1 to show the board the topic belongs to
$showPoster = 1; // set to 1 to show the poster
$showTime = 1;   // set to 1 to show the time of the post

Is now located in the recentTopic function. Make sure you change this to your likings.
Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
HighBoy
Jr. Member
**
Posts: 72


I love it !

Re:Recent topics / new marker
« Reply #11 on: November 20, 2002, 09:38:31 AM »
Reply with quote

Greeeeeeeeeeeeeeeeeat it works !
You are my hero  ;D

You can see it in action @ http://wolf.dehn.net

Only one request left......

I have an anouncement board that i use to post news in, and the news are then displayed on the same frontpage as the recent topics.

It would be nice to be able to exclude this bord from the recent topics..... is that possible....

Something like $noshow = <boardnumber>...

I REALLY APPRICIATE YOUR HELP...

btw.: Where in the world are you living... you always seem to go to bed when i go to work... (I live in Denmark GMT+1)
« Last Edit: November 20, 2002, 09:39:57 AM by HighBoy » Logged
Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:Recent topics / new marker
« Reply #12 on: November 20, 2002, 09:58:32 AM »
Reply with quote

Glad it worked, Think I will post in the completed mod board now...  ;)

I live in sacramento, California.

I'll look into your other request tommorrow, It is time for me to hit the sack now.  :P

LOL
« Last Edit: November 20, 2002, 10:02:45 AM by Nemesis » Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:Recent topics / new marker
« Reply #13 on: November 20, 2002, 09:59:57 AM »
Reply with quote

I see you have a game related site.

Check out my site http://www.gamerzalliance.com

P.S.
Thanks for the plug on your site.  ;D
Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
HighBoy
Jr. Member
**
Posts: 72


I love it !

Re:Recent topics / new marker
« Reply #14 on: November 20, 2002, 10:11:04 AM »
Reply with quote

Quote from: Nemesis on November 20, 2002, 09:59:57 AMI see you have a game related site.

Check out my site http://www.gamerzalliance.com
I will do that  8)

Quote.
Thanks for the plug on your site.  ;D
You are welcome !
Logged
Pages: [1] 2 Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Recent topics / new marker « 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.033 seconds with 16 queries.