Welcome, Guest. Please Login or Register.
April 30, 2025, 03:55:36 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  |  latest threads « previous next »
Pages: 1 [2] 3 Reply Ignore Print
Author Topic: latest threads  (Read 3725 times)
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:latest threads
« Reply #15 on: January 01, 2002, 03:08:57 PM »
Reply with quote

erm.. well it seems to be that virtual doesnt work! i've tried using virtual to include index.php and the same thing happens! what should I do!?
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
adams
Jr. Member
**
Posts: 80


http://outersurf.com http://jadz.com

WWW
Re:latest threads
« Reply #16 on: January 02, 2002, 02:38:18 AM »
Reply with quote

WHOOHOO..

Check out my recent posts on my frontpage....

http://www.outersurf.com/
Logged

tom2
Jr. Member
**
Posts: 64


www.FireFighterBoats.com set the water on fire

WWW
Re:latest threads
« Reply #17 on: January 02, 2002, 04:37:56 AM »
Reply with quote

i did my best to follow Enc0der's directions but it just feeds me a blank page???
Logged
Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:latest threads
« Reply #18 on: January 02, 2002, 06:23:36 AM »
Reply with quote

How can I make this work just for new post, not any reply's?
Logged


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


http://outersurf.com http://jadz.com

WWW
Re:latest threads
« Reply #19 on: January 02, 2002, 06:32:36 AM »
Reply with quote

Yeah. I think you have to modify the SQL statement so it only gets unique entries I think its this SQL query.

SELECT m.posterTime,m.subject,m.ID_TOPIC,t.ID_BOARD,m.posterName,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_TOPIC=t.ID_TOPIC && t.ID_BOARD=b.ID_BOARD && b.ID_CAT=c.ID_CAT && (FIND_IN_S
ET('$settings[7]',c.memberGroups)!=0 || c.memberGroups='' || '$settings[7]' LIKE 'Administrator' || '$settings[7]' LIKE 'Global Moderator')) ORDER BY m.posterTi
me DESC LIMIT 1


So that line needs to get modified so that it only shows unique threads rather then unique posts.
Logged

Enc0der
Jr. Member
**
Posts: 90


I love YaBB SE!

WWW
Re:latest threads
« Reply #20 on: January 02, 2002, 04:14:40 PM »
Reply with quote

yeah, this is really an important issue!
but your SQL query doesn't work.. :(

can someone please do this little change ? :)
Logged
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:latest threads
« Reply #21 on: January 02, 2002, 04:17:45 PM »
Reply with quote

I cant get it to work at all :(
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
rican5vl
Full Member
***
Posts: 120


I would do this girl for hours!

Re:latest threads
« Reply #22 on: January 02, 2002, 04:26:58 PM »
Reply with quote

If I add that???

Ummm....

Does that mean I just use the standard EXEC cgi="whatever.pl2--> SSI string???? to get it to work???

Rican

But you see, I just want to the top ten new posts to automatically update via SSI.   I dont want the whole PAGE to load up...When I call this index/recent or whatever I want only the list of the threads to show up on my shtml page...

GRRRRR please help

« Last Edit: January 02, 2002, 04:28:42 PM by rican5vl » Logged
adams
Jr. Member
**
Posts: 80


http://outersurf.com http://jadz.com

WWW
Re:latest threads
« Reply #23 on: January 02, 2002, 04:53:50 PM »
Reply with quote

The SQL I posted was the original. I have not modified it and was hoping someone more useful in SQL would show how we would need to.

http://outersurf.com  <<<< RECENT POSTS  :o ;D :D ;) :)
Logged

Enc0der
Jr. Member
**
Posts: 90


I love YaBB SE!

WWW
Re:latest threads
« Reply #24 on: January 03, 2002, 03:17:02 PM »
Reply with quote

weird...

mine is this:
   $request = mysql_query("SELECT m.smiliesEnabled,m.posterTime,m.ID_MEMBER,m.ID_MSG,m.subject,m.body,m.ID_TOPIC,t.ID_BOARD,b.name as bname,c.name as cname,m.posterName,t.numReplies FROM {$db_prefix}messages as m,{$db_prefix}topics as t,{$db_prefix}boards as b,{$db_prefix}categories as c WHERE (m.ID_TOPIC = t.ID_TOPIC AND t.ID_BOARD = b.ID_BOARD AND b.ID_CAT=c.ID_CAT AND (FIND_IN_SET('$settings[7]',c.memberGroups)!=0 OR c.memberGroups='' OR '$settings[7]'='Administrator' OR '$settings[7]'='Global Moderator')) ORDER BY m.posterTime DESC LIMIT $display");

and this:
      $request2 = mysql_query("SELECT m.posterName,m.ID_MEMBER FROM {$db_prefix}messages as m,{$db_prefix}topics as t WHERE (m.ID_MSG=t.ID_FIRST_MSG && t.ID_TOPIC=$row[ID_TOPIC])");

Logged
Jaxom
Noobie
*
Posts: 34


Damn llama ate my karma...

WWW
Re:latest threads
« Reply #25 on: January 06, 2002, 11:41:08 PM »
Reply with quote

Here's some alterations I've made to the latest topic scripts, to allow me to create 'latest by topic, but only show the first entry in the topic' and 'latest by category'

These allow me to create a 'news posts addin' and a 'latest jokes area' respectively.

To see the final results (and to see if you want what I got) check out www.theguildhouse.net, the new site I'm building. The relevent areas are entrance (for the news) and Jokes, for the jokes. The forum is unsurprisingly in the forum section.

Anyway, first things first. I'm using the code from the FAQ on how to embed the forum into php pages, so my index.php is actually called forum.php (index.php is an new file which has an include which pulls in forum.php, and my headers and stuff)

After the $action =='recent' line in my forum.php
   else if ($action == 'recentnews') { include_once "$sourcedir/Recent.php"; RecentPostsNews(); }
   else if ($action == 'recentjokes') { include_once "$sourcedir/Recent.php"; RecentPostsJokes(); }

After the function RecentPosts section, I've added two areas:


function RecentPostsNews (){

   global $settings,$txt,$yytitle,$censored,$scripturl,$enable_ubbc,$enable_notification,$menusep,$db_prefix;
   global $cgi,$img,$color,$imagesdir,$realNames;
   $display = 3;
   $news_board_id = 3;

function endhtml()
{
}

   $request = mysql_query("SELECT *
FROM {$db_prefix}messages as m,{$db_prefix}topics as t
WHERE (m.ID_TOPIC = t.ID_TOPIC AND t.ID_BOARD = $news_board_id AND t.ID_FIRST_MSG=m.ID_MSG)
ORDER BY m.posterTime
DESC LIMIT $display");

   $yytitle = $txt[214];

   LoadCensorList();
   $counter = 0;
   while ($row = mysql_fetch_array($request)) {
      $counter ++;

      $request2 = mysql_query("SELECT m.posterName,m.ID_MEMBER FROM {$db_prefix}messages as m,{$db_prefix}topics as t WHERE (m.ID_MSG=t.ID_FIRST_MSG && t.ID_TOPIC=$row[ID_TOPIC])");
      $row2 = mysql_fetch_array($request2);
      
      LoadRealName($row['posterName']);
      LoadRealName($row2['posterName']);
      if ($row['ID_MEMBER'] != '-1')
         $row['posterName'] = "<a href=\"$scripturl?action=viewprofile;user=$row[posterName]\">{$realNames[$row['posterName']]}</a>";
      if ($row2['ID_MEMBER'] != '-1')
         $row2['posterName'] = "<a href=\"$scripturl?action=viewprofile;user=$row2[posterName]\">{$realNames[$row2['posterName']]}</a>";

      $message = $row['body'];
      foreach ($censored as $tmpa => $tmpb) {
         $message = str_replace($tmpa,$tmpb,$message);
         $row['subject'] = str_replace($tmpa,$tmpb,$row['subject']);
      }
      if($enable_ubbc) { $message = DoUBBC($message,$row['smiliesEnabled']); }

      if($enable_notification)
         $notify = "$menusep<a href=\"$scripturl?board=$row[ID_BOARD];action=notify;threadid=$row[ID_TOPIC];start=$row[numReplies]\">$img[notify_sm]</a>";
      $row['posterTime'] = timeformat($row['posterTime']);

      print <<<EOT
<table border="0" width="100%" cellspacing="1" bgcolor="$color[bordercolor]" class="bordercolor">
<tr>
   <td valign="middle" bgcolor="$color[titlebg]" class="titlebg">&nbsp;<IMG SRC="$imagesdir/$row[icon].gif" alt="message icon"><font class="text1" color="$color[titletext]" size="2"> <b>$row[subject]</b></font>&nbsp;</td>
</tr>
<tr>
   <td bgcolor="$color[catbg]" class="catbg"><font class="catbg" size=2>Posted by $row[posterName] $txt[30] $row[posterTime] | <a href="$scripturl?board=$row[ID_BOARD];action=display;threadid=$row[ID_TOPIC];start=$row[numReplies]">Comments: $row[numReplies]</a>&nbsp;</font></td>
</tr>
<tr>
   <td bgcolor="$color[windowbg2]" valign=top height=30><font size=2>$message<BR></font></td>
</tr>

</table><br>
EOT;
}
   obExit();
}

and


function RecentPostsJokes (){

   global $settings,$txt,$yytitle,$censored,$scripturl,$enable_ubbc,$enable_notification,$menusep,$db_prefix;
   global $cgi,$img,$color,$imagesdir,$realNames;
   $display = 10;
   $jokes_cat_id = 5;

function endhtml()
{
}

   $request = mysql_query("SELECT m.icon,m.smiliesEnabled,m.posterTime,m.ID_MEMBER,m.ID_MSG,m.subject,m.body,m.ID_TOPIC,t.ID_BOARD,b.name as bname,m.posterName,t.numReplies
FROM {$db_prefix}messages as m,{$db_prefix}topics as t,{$db_prefix}boards as b
WHERE (m.ID_TOPIC = t.ID_TOPIC AND t.ID_BOARD = b.ID_BOARD AND b.ID_CAT=$jokes_cat_id)
ORDER BY m.posterTime
DESC LIMIT $display");

   $yytitle = $txt[214];

   LoadCensorList();
   $counter = 0;
   while ($row = mysql_fetch_array($request)) {
      $counter ++;

      $request2 = mysql_query("SELECT m.posterName,m.ID_MEMBER FROM {$db_prefix}messages as m,{$db_prefix}topics as t WHERE (m.ID_MSG=t.ID_FIRST_MSG && t.ID_TOPIC=$row[ID_TOPIC])");
      $row2 = mysql_fetch_array($request2);
      
      LoadRealName($row['posterName']);
      LoadRealName($row2['posterName']);
      if ($row['ID_MEMBER'] != '-1')
         $row['posterName'] = "<a href=\"$scripturl?action=viewprofile;user=$row[posterName]\">{$realNames[$row['posterName']]}</a>";
      if ($row2['ID_MEMBER'] != '-1')
         $row2['posterName'] = "<a href=\"$scripturl?action=viewprofile;user=$row2[posterName]\">{$realNames[$row2['posterName']]}</a>";

      $message = $row['body'];
      foreach ($censored as $tmpa => $tmpb) {
         $message = str_replace($tmpa,$tmpb,$message);
         $row['subject'] = str_replace($tmpa,$tmpb,$row['subject']);
      }
      if($enable_ubbc) { $message = DoUBBC($message,$row['smiliesEnabled']); }

      if($enable_notification)
         $notify = "$menusep<a href=\"$scripturl?board=$row[ID_BOARD];action=notify;threadid=$row[ID_TOPIC];start=$row[numReplies]\">$img[notify_sm]</a>";
      $row['posterTime'] = timeformat($row['posterTime']);

      print <<<EOT
<table border="0" width="100%" cellspacing="1" bgcolor="$color[bordercolor]" class="bordercolor">
<tr>
   <td valign="middle" bgcolor="$color[titlebg]" class="titlebg">&nbsp;<IMG SRC="$imagesdir/$row[icon].gif" alt="message icon"><font class="text1" color="$color[titletext]" size="2"><a href="$scripturl?board=$row[ID_BOARD];action=display;threadid=$row[ID_TOPIC];start=$row[numReplies]"> <b>$row[bname] / $row[subject]</b></a></font>&nbsp;</td>
</tr>
<tr>
   <td bgcolor="$color[catbg]" class="catbg"><font class="catbg" size=2>Posted by $row[posterName] $txt[30] $row[posterTime] &nbsp;</font></td>
</tr>
<tr>
   <td bgcolor="$color[windowbg2]" valign=top height=30><font size=2>$message<BR></font></td>
</tr>

</table><br>
EOT;
}
   obExit();
}



In both new functions, the
$display = 3; Defines how many topics are displayed

The
$news_board_id = 3;

Defines which board number is used for news. To find out which number you want, hover over the link for the board you want in your forum, and it should tell you which board number it is in the url which shows up at the bottom of the browser.

and
The $jokes_cat_id = 5;
Defines which category number is used for the jokes summary. To find that out, go into the admin area, edit categories, the hover your mouse over the ! icon that allows you to select membergroups for that category, and again the cat number should be in the url at the bottom of the browser.

I hope that helps somebody in what they want to do, cos I know it's taken me about 4 hours to do it. (I hate working out MYSql codes)

« Last Edit: January 06, 2002, 11:44:44 PM by James Gater » Logged

Linux is like wigwam - no windows, no gates, apache inside.

My wigwam - The Guildhouse
Jaxom
Noobie
*
Posts: 34


Damn llama ate my karma...

WWW
Re:latest threads
« Reply #26 on: January 06, 2002, 11:47:10 PM »
Reply with quote

Oh, and if it's any use, the relevent code in the jokes main page is

<?php
require("http://www.theguildhouse.net/forum/forum.php?action=recentjokes");
?>


Sorry guys, I don't use SSI, php is much better ;)
Logged

Linux is like wigwam - no windows, no gates, apache inside.

My wigwam - The Guildhouse
TalkingShite
Noobie
*
Posts: 6


I Love Talking crape!

WWW
Re:latest threads
« Reply #27 on: January 07, 2002, 10:19:01 AM »
Reply with quote

Has anyone made this into a mod yet?

If so...where can i get it from?

Cheers!
Logged
Jaxom
Noobie
*
Posts: 34


Damn llama ate my karma...

WWW
Re:latest threads
« Reply #28 on: January 08, 2002, 02:48:41 AM »
Reply with quote

I've nearly finished doing this as an encapsulated mod - i.e. you don't need to modify the YaBBSE source files, just copy a couple of new files into the YABBSE directory
and call them with an include.

I've finished the main mod, just got the templates to do. I should have it ready for release for manual install tomorrow. The advantage of doing it this way is that you'll be able to have multiple copies of it running, for different latest topics.

Features include:
Select your latest topics from the whole forum, a category, or a single board.

Show all latest messages, or only the first (oldest)message of a topic, or only the last(latest) message of a topic, up to a defined number.

Separated template file, so you can choose how the latest posts will look. Various sample templates for different looks will be provided.

So basically, it's a combination of the headlines mod and the news mod. It's not the best coded bit of kit in the world, but it's fairly reasonable for a first mod. I realise that other people are doing the 'official' news mods, but I needed this badly, so I figured I might as well do an 'interim' solution while waiting for them to come along!

So if i'm treading on anybody's toes, I'm sorry, i'm just trying to help ppl...

If you're lucky, I might even tackle how to include it in a page via ssi as well as via php includes in the instructions :)

Once it's finished, I'll obviously be looking for people to beta test it for me...

Anyway, till tomorrow hopefully.
Logged

Linux is like wigwam - no windows, no gates, apache inside.

My wigwam - The Guildhouse
Jaxom
Noobie
*
Posts: 34


Damn llama ate my karma...

WWW
Re:latest threads
« Reply #29 on: January 08, 2002, 11:35:44 PM »
Reply with quote

As promised, the mod is finished. Check
http://www.yabb.info/community/index.php?board=141;action=display;threadid=2706;start=15
for details.

Known problems:
If you select to display by board, or by category, it WILL display those messages, regardless of whether that category is flagged to be non-accessible for a guest user etc. The all topics version doesn't suffer this flaw though.

Planned improvements:
Making the template system more powerful and less clunky. don't hold your breath though...

Anyway. Enjoy...
Logged

Linux is like wigwam - no windows, no gates, apache inside.

My wigwam - The Guildhouse
Pages: 1 [2] 3 Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  latest threads « 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.128 seconds with 20 queries.