Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Lastpost icon for new messages on forums

Asked Modified Viewed 3,406 times
S
Structor
S
  • Member, joined since
  • Contributed 116 posts on the community forums.
  • Started 11 threads in the forums
  • Started this discussions
asked
Member

I made o little modification of the existing fangree_craig's mod on one of my sites. This modification shows an icon named lastpostnew.gif if there are new messages posted on forums. So, the codes are changed like this:


Open forum/index.php

if ($data['forum_lastpost'] == 0) {
echo $locale['405']."</td>\n</tr>\n";
} else {
echo showdate("forumdate", $data['forum_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406'].profile_link($data['forum_lastuser'], $data['user_name'], $data['user_status'])."</span></td>\n";
echo "</tr>\n";
}
}
} else {
echo "<tr>\n<td colspan='5' class='tbl1'>".$locale['407']."</td>\n</tr>\n";
}


Change to:

//vBulletin Style Last Post Info Mod Begin
   if ($data['forum_lastpost'] == 0) {
   echo $locale['405']."</td>\n</tr>\n";
        } else {
   $threadData = dbarray ( dbquery ( "select * from " . $db_prefix . "threads t
   left join " . $db_prefix . "posts p on p.post_id=t.thread_lastpostid
        where t.thread_lastpost='" . $data ['forum_lastpost'] . "'" ) );
   echo "<b><a href='viewthread.php?thread_id=".$threadData['thread_id']."' title= '".$threadData['thread_subject']."' style='text-decoration:none;' > ".trimlink($threadData['thread_subject'], 20)."</a></b> <a href='".FORUM."viewthread.php?thread_id=".$threadData['thread_id']."&amp;pid=".$threadData['thread_lastpostid']."#post_".$threadData['thread_lastpostid']."'>";

      if ($data['forum_lastpost'] > $lastvisited) {
         if (iMEMBER && preg_match("({$forum_match}\.|{$forum_match}$)", $userdata['user_threads'])) {
            $fim =  "<img src='".THEME."/forum/lastpost.gif' alt='' title='Last message'  style='border:0px;' />";
         } else {
            $fim = "<img src='".THEME."/forum/lastpostnew.gif' alt='' title='Last message'  style='border:0px;' />";
         }
      } else {
         $fim =  "<img src='".THEME."/forum/lastpost.gif' alt='' title='Last message'  style='border:0px;' />";
      }
      echo "$fim\n";
   
   echo "</a><br />";
         echo "<span class='small'>".$locale['406']."<a href='".BASEDIR."profile.php?lookup=".$data['forum_lastuser']."'>".$data['user_name']."</a></span>\n";
         echo"<div align='left'>";
         echo " <span class='small'>".showdate("forumdate", $data['forum_lastpost'])."</span></div>\n";
    echo "</td></tr>\n";
         }
     
   }
        } else {
   echo "<tr>\n<td colspan='5' class='tbl1'>".$locale['407']."</td>\n</tr>\n";
}
//vBulletin Style Last Post Info Mod End



Save


Open viewforum.php

Look for:


echo "<td width='1%' class='tbl1' style='white-space:nowrap'>".showdate("forumdate", $tdata['thread_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406'].profile_link($tdata['thread_lastuser'], $tdata['user_lastuser'], $tdata['status_lastuser'])."</span></td>\n";
      
echo "</tr>\n";


Change to:



//vBulletin Style Last Post Info Mod Begin
echo "<td width='2%' class='tbl1' style='white-space:nowrap'>".showdate("forumdate", $tdata['thread_lastpost'])."<br />\n";
echo "<span class='small'>".$locale['406'].profile_link($tdata['thread_lastuser'], $tdata['user_lastuser'], $tdata['status_lastuser'])." <a href='".FORUM."viewthread.php?thread_id=".$tdata['thread_id']."&amp;pid=".$tdata['thread_lastpostid']."#post_".$tdata['thread_lastpostid']."'>\n";
      if (iMEMBER) {
      if ($tdata['thread_locked']) {
         echo "".$locale['413']."";
      } elseif ($tdata['thread_sticky'] == 1) {
            if (($tdata['thread_lastpost'] > $lastvisited) && (preg_match("(^\.{$thread_match}$|\.{$thread_match}\.|\.{$thread_match}$)", $userdata['user_threads']))) {
               $lastpost =  "<img src='".THEME."/forum/lastpostnew.gif' alt='' title='Last message'  style='border:0px;' />\n";
            } else {
               $lastpost = "<img src='".THEME."/forum/lastpost.gif' alt='' title='Last message'  style='border:0px;' />\n";
            }
            echo "$lastpost";            

      } else  {
         if ($tdata['thread_lastpost'] > $lastvisited) {
            if (preg_match("(^\.{$thread_match}$|\.{$thread_match}\.|\.{$thread_match}$)", $userdata['user_threads'])) {
               $lastpost =  "<img src='".THEME."/forum/lastpost.gif' alt='' title='Last message'  style='border:0px;' />\n";
            } else {
               $lastpost = "<img src='".THEME."/forum/lastpostnew.gif' alt='' title='Last message'  style='border:0px;' />\n";
            }
}
            echo "$lastpost";
 }
 } else {
         echo "<img src='".THEME."/forum/lastpost.gif' alt='' title='Last message'  style='border:0px;' />\n";
 }
echo "</a></span></td>\n";
echo "</tr>\n";   
//vBulletin Style Last Post Info Mod End




Save


Upload and overwrite /forum/index.php, /forum/viewforum.php and the two images ([b]lastpost.gif and lastpostnew.gif) to the theme/your_theme/forum/

Done


This is tested on one single site, so please give feedback, thank you!

Edit: I made some modification so no longer needed to modify locales. Just put the images in your_theme/forum/ folder.
I also made some retouch on the codes, so try it now.
Edited by Structor on 04-02-2011 17:57,
0 replies

3 posts

E
emilife93
E
  • Member, joined since
  • Contributed 176 posts on the community forums.
  • Started 49 threads in the forums
answered
Member

can i see the demo?

or print screen picture?
0 replies
S
Structor
S
  • Member, joined since
  • Contributed 116 posts on the community forums.
  • Started 11 threads in the forums
  • Started this discussions
answered
Member

Yes of course, here it is:
www.doizecisti.ro/mafia

print screen is from viewforum, for index is the same thing.
Structor attached the following file:
demo_lastpstnew.png [No information available / 30 Downloads]
0 replies
— 1 year later —
G
G
  • Newbie, joined since
answered
Newbie

advocate for both womenas health and cancer patients. During her thenhusband John Edwardas run for Presidency in 2007 sexy wedding dressessexy wedding dresses . sexy prom dressessexy prom dresses , she revealed that her cancer had returned. She is currently battling Stage IV breast cancer, as well as tumors in her legs, spine and skull. . Michael C. Hall. Credit: (ABCKEVIN MAZUR) aDextera star Michael C. discount wedding dressesdiscount wedding dresses Hall confirmed in January 2010 that he was undergoing treatment for Hodgkinas lymphoma. Hallas cancer is currently in remission, cute dressescute dresses but his diagnosis came as a surprise to a number of people particularly his fellow castmates, sexy prom dressessexy prom dresses . who admitted they had no idea he was fighting for his life because he never showed signs of illness. lace dresseslace dresses . He has since returned for a fifth season on his Showtime series. Pictured left to right: Robin Roberts & Diane Lane. Credit: (ABCKEVIN MAZUR) aGood Morning Americaa anchor Robin Roberts got ahead of the headlines in
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 3 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

S
S
  • Member, joined since
  • Contributed 116 posts on the community forums.
  • Started 11 threads in the forums
  • Started this discussions
E
E
  • Member, joined since
  • Contributed 176 posts on the community forums.
  • Started 49 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet