Quantcast

Maximum PC

It is currently Wed Sep 17, 2014 2:38 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Request for a thread preview function.
PostPosted: Mon Aug 08, 2005 9:38 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000

Joined: Wed Aug 11, 2004 2:37 pm
Posts: 32
Location: Katy/Houston, TX
It's a nice feature, lots of ofther bulletin boards have it.

Here's the code for it:

Code:
##############################################################
## MOD Title: display first message as title
## MOD Author: emrag < emrah987@hotmail.com > (Emrah Türkmen)  www.canver.net
## MOD Description: with this hack when you hover the mouse on topic link you
##          will see first message as title like vBulletin Boards ;)
##
## MOD Version: 1.0.2
##
## Installation Level: Easy
## Installation Time : ~3 minutes
## Files to Edit: viewforum.php
##        templates/subsilver/viewforum_body.tpl
##
## Included Files: n/a
##############################################################
##
## Author Note: -
##
##############################################################
##
## MOD History: 25.09.2004 - 1.0.0
##      - First release
##
##      07.10.2004 - 1.0.1
##      - Fixed a bug - thanx to Clock
##
##      25.11.2004 - 1.0.2
##      - added a character limit for hover title - you can change this value ;)
##      (before if message is too long hover title won't be display. Now fixed)
##       
##      - EasyMod compitable
##
##############################################################
##
## Before Adding This Hack To Your Forum, You Should Back Up All Files Related To This Hack 
##
##############################################################
#
#-----[ OPEN ]------------------------------------------
#

viewforum.php

#
#----[ FIND ]------------------------------------------
#

      $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
      $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

#
#-----[ AFTER, ADD ]------------------------------------------
#

//
// display first message as title by emrag ;)
//
      $chr_limit = '1000'; // character limit for hover title

      $sql = "SELECT p.*,  pt.post_text, pt.post_id
         FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt
         WHERE p.topic_id = $topic_id
            AND pt.post_id = p.post_id
         ORDER BY p.post_time
         LIMIT 1";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
      }

      $row = $db->sql_fetchrow($result);
      $first_post = $row['post_text'];
      $first_post = str_replace('"', "''", $first_post);

      if (strlen($first_post) > $chr_limit)
      {
         $first_post = substr($first_post, 0, $chr_limit);
         $first_post .= '.......';
      }
//
// display first message as title by emrag ;)
//


#
#----[ FIND ]------------------------------------------
#

         'TOPIC_FOLDER_IMG' => $folder_image,
         'TOPIC_AUTHOR' => $topic_author,

#
#-----[ BEFORE, ADD ]------------------------------------------
#

         'FIRST_POST' => $first_post,

#
#-----[ OPEN ]------------------------------------------
#

templates/subsilver/viewforum_body.tpl

#
#----[ FIND ]------------------------------------------
#

<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle"

#
#----[ AFTER ADD ]------------------------------------------
#

title="{topicrow.FIRST_POST}"

#
#-----[ SAVE ALL FILES/CLOSE ]------------------------------------------
#
# EoM


8)


Top
  Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 10:55 am 
iron colbinator
iron colbinator
User avatar

Joined: Tue May 25, 2004 2:25 pm
Posts: 2761
Location: Washington, the state
Can you give us an example of what it'd look like (or a link)?


Top
  Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 11:38 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000

Joined: Wed Aug 11, 2004 2:37 pm
Posts: 32
Location: Katy/Houston, TX
colby wrote:
Can you give us an example of what it'd look like (or a link)?


http://www.howardforums.com/forumdispla ... 77ccf&f=39

Just mouseover the thread titles. :)

I'm pretty sure they are using vBB3, but the concept is the same. Let me do some digging to find a phpBB board that has it implemented. :)


Top
  Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 2:54 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000

Joined: Wed Aug 11, 2004 2:37 pm
Posts: 32
Location: Katy/Houston, TX
colby wrote:
Can you give us an example of what it'd look like (or a link)?


Here is a phpBB message board: http://kansas.no-ip.com/folding/viewfor ... e36fdec12c

The only difference is that one shows the last post, not the first, but the idea is the same. :)


Top
  Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 4:34 pm 
Clawhammer
Clawhammer
User avatar

Joined: Sun Oct 10, 2004 12:14 pm
Posts: 4956
Location: Kitchener, Ontario
It would be nice to preview the first post...


Top
  Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 7:58 am 
Sharptooth
Sharptooth
User avatar

Joined: Tue Aug 03, 2004 9:23 am
Posts: 383
Location: Chesapeake, VA
that's pretty nifty. I'd make browsing the new threads much easier and faster.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 12:35 pm 
Monkey Federation (Top 10)*
Monkey Federation (Top 10)*
User avatar

Joined: Thu Jun 24, 2004 1:22 pm
Posts: 27370
Location: In a cage, dumbass.
I think that's el lame-o.

So you get to see the first 50 characters. WHOOPITY DO.

Click the link, if you don't like the feature, then use the Backspace button.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 1:01 pm 
Team Member Top 500
Team Member Top 500

Joined: Thu Aug 05, 2004 11:11 am
Posts: 953
well itd be nice for dialup users at the very least. i like it, using it i dont have to load the thread/page just to find out a bit more info. just mouse over.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 6:01 pm 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000

Joined: Wed Aug 11, 2004 2:37 pm
Posts: 32
Location: Katy/Houston, TX
Spider Monkey wrote:
I think that's el lame-o.

So you get to see the first 50 characters. WHOOPITY DO.

Click the link, if you don't like the feature, then use the Backspace button.


You can edit the hack to change the amount you see. ;)


Top
  Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 9:04 pm 
Maximum PC Editor
Maximum PC Editor
User avatar

Joined: Tue May 25, 2004 1:13 pm
Posts: 2308
Those types of plugins work reasonably well on low-traffic forums. Adding the stuff to make that work could make the forum painfully slow, especially for modem-based visitors. I'd prefer to keep the site lean and mean.

Besides, that kind of preview functionality discourages people from making concise thread titles. I like people to name their threads in such a way that everyone will know what the topic is, and whether they want to look at it or not.

///Will


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group