[ABD] Topic preview [/]

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Emanuele
Registered User
Posts: 9
Joined: Wed Jun 02, 2004 10:29 pm
Location: Italy

[ABD] Topic preview [/]

Post by Emanuele » Wed Jun 02, 2004 11:07 pm

MOD Description: This mod adds a pop-up window that shows the first 255 characters of a topic message when user moves the cursor over the title on the forum view

Installation Level: Easy
Installation Time: ~5 Minutes

Hi, this is my first MOD. I've tested it a bit, and seems to work.

Code: Select all

############################################################## 
## MOD Title: Topic preview 
## MOD Author: Emanuele < manu75@libero.it > (Emanuele Iannone) n/a 
## MOD Description: This mod adds a pop-up window that shows the first 255 characters 
##                     of a topic message when user moves the cursor over the title on the forum view 
## MOD Version: 1.0.1 
## 
## Installation Level: Easy 
## Installation Time: ~5 Minutes 
## Files To Edit: 
##               /includes/functions_post.php, 
##               /viewforum.php, 
##               /templates/subSilver/viewforum_body.tpl, 
## 
## Included Files: n/a 
## 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
##   NOTE: The preview will appear only for topics posted/edited AFTER the mod installation 
############################################################## 
## MOD History: 
##   2004-09-27 - Version 1.0.1
##      - Corrected the \' bug
##   2004-06-06 - Version 1.0.0 
##      - First release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ SQL ]------------------------------------------------- 
# 
ALTER TABLE phpbb_topics ADD summary VARCHAR(255); 
# 
#-----[ OPEN ]------------------------------------------------ 
# 
includes/functions_post.php 
# 
#-----[ FIND ]------------------------------------------------ 
# 
<?php 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length) 
{ 
   global $board_config, $lang, $db, $phpbb_root_path, $phpEx; 
   global $userdata, $user_ip; 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
//-- add 
   global $bbcode_tpl; 
//-- end mod : topic preview ----------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
   if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 
   { 
      $topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0; 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
//-- add 
      // 
      // Generate summary from message 
      // 
      $summary=substr(str_replace("''", "'", $post_message),0,1024); 
       
      // Remove last incomplete word 
      if (strlen($summary) == 1024) $summary = preg_replace("/[\s][\S]+$/"," ",$summary); 

      // If the board has HTML off but the post has HTML on then we process it, else leave it alone 
      if ( !$board_config['allow_html'] && $html_on ) 
      { 
         $summary = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $summary); 
      } 
    
      // Parse message and/or sig for BBCode if reqd 
      if ( $board_config['allow_bbcode'] && $bbcode_uid != '' ) 
      { 
         $summary = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($summary, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $summary); 
      } 
    
      // Parse smilies 
      if ( $board_config['allow_smilies'] && $smilies_on ) 
      { 
         $summary = smilies_pass($summary); 
      } 
    
      // Replace naughty words 
      $orig_word = array(); 
      $replacement_word = array(); 
      obtain_word_list($orig_word, $replacement_word); 
      if (count($orig_word)) 
      { 
         $summary = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $summary . '<'), 1, -1)); 
      } 
    
      // Replace newlines (we use this rather than nl2br because till recently it wasn't XHTML compliant) 
      $summary = str_replace("\n", "\n<br />\n", $summary); 
          
      // Remove newlines and quotes (for javascript) 
      $cerca=array("/(\r|\n)/","/\"/","/[`‘’´]/"); $sost=array("",""","'"); 
      $summary=preg_replace($cerca,$sost,$summary); 
       
      $summary=addslashes(addslashes($summary)); 
      if (strlen($summary) > 252) { 
         $summary=substr($summary,0,252); 
         $tronca = true; 
      } 
       
      // Remove last word if incomplete 
      if (strlen($summary)==252) { 
         $summary=preg_replace("/[\s][\S]+$/","",$summary); 
         while (preg_match("/<[^>]+$/",$summary)) $summary=preg_replace("/[\s]*<[^>]+$/","",$summary); 
      } 
       
      if (strlen($post_message) > 1024 || $tronca) $summary.="..."; 
//-- end mod : topic preview ----------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
      $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id"; 
# 
#-----[ REPLACE WITH ]---------------------------------------- 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
//-- del 
//      $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id"; 
//-- add: 
      $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote, summary) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote, '".str_replace("\'", "''", $summary)."')" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . ", summary = '".str_replace("\'", "''", $summary)."' WHERE topic_id = $topic_id"; 
//-- end mod : topic preview ----------------------------------------------------------------------- 
#-----[ OPEN ]------------------------------------------------ 
# 
viewforum.php 
# 
#-----[ FIND ]------------------------------------------------ 
# 
<?php 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
         'TOPIC_TITLE' => $topic_title, 
         'TOPIC_TYPE' => $topic_type, 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
//-- add 
         'TOPIC_SUMMARY' => $topic_rowset[$i]['summary'], 
//-- end mod : topic preview ----------------------------------------------------------------------- 
# 
#-----[ OPEN ]------------------------------------------------ 
# 
templates/subSilver/viewforum_body.tpl 
# 
#-----[ FIND ]------------------------------------------------ 
# 
# at top of the file 
# 
<form method="post" action="{S_POST_DAYS_ACTION}"> 
# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 
<!-- mod : topic preview --> 
<DIV ID=dek style="position: absolute; visibility: hidden; Z-INDEX:200; top: 0px; left: 0px"></DIV> 
<SCRIPT TYPE="text/javascript"><!-- 
var old,yyy=-1000,Xoffset=-60,Yoffset= 20; 
if (!document.getElementById) old=true; 
else { 
   var skn=document.getElementById('dek'); 
   if(!document.all) document.captureEvents(Event.MOUSEMOVE); 
   document.onmousemove=get_mouse; 
} 
function popup(msg,bak){ 
   var content="<TABLE  WIDTH=350 BORDER=1 BORDERCOLOR=#664500 CELLPADDING=2 CELLSPACING=0 "+"BGCOLOR="+bak+"><tr><TD><FONT COLOR=black SIZE=2 face=verdana>"+msg+"</FONT></TD></tr></TABLE>"; 
   if(!old){ yyy=Yoffset; skn.innerHTML=content; skn.style.visibility="visible"} 
} 
function get_mouse(e){ 
   var x=(document.all)?event.x+document.body.scrollLeft:e.pageX; 
   var y=(document.all)?event.y+document.body.scrollTop:e.pageY; 
   skn.style.left=x+Xoffset; skn.style.top=y+yyy; 
} 
function kill(){ if(!old){yyy=-1000;skn.style.visibility="hidden";} } 
//--></SCRIPT> 
# 
#-----[ FIND ]------------------------------------------------ 
# 
     <td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br /> 
# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle" 
# 
#-----[ IN-LINE AFTER, ADD ]-------------------------------- 
# 
 ONMOUSEOVER="popup('{topicrow.TOPIC_SUMMARY}','#FFCC66')" ONMOUSEOUT="kill()" 
# 
#-----[ SAVE/CLOSE ALL FILES ]-------------------------------- 
# 
# EoM
Last edited by Emanuele on Mon Sep 27, 2004 9:05 pm, edited 1 time in total.

niksa
Registered User
Posts: 612
Joined: Mon Sep 08, 2003 7:20 pm
Location: Future birthplace of James T. Kirk
Contact:

Post by niksa » Thu Jun 03, 2004 12:09 am

This works really well. :D

Here's a modification of this mod so people who have Categories Hierarchy can use it.. hope Emanuele doesn't mind, I thought it would be helpful since it's not immediately compatible with the Categories MOD. :D

I am just reposting the whole thing with all the changes instead of the individual changes.. Emanuele, if you want to use this in your mod docs, feel free! I just love the categories mod, and I know it's popular.. so anyway, thanks for this preview mod, I love it. :)

Code: Select all

#-----[ OPEN ]------------------------------------------------ 
# 
includes/functions_post.php 
# 
#-----[ FIND ]------------------------------------------------ 
# 
<?php 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length) 
{ 
   global $board_config, $lang, $db, $phpbb_root_path, $phpEx; 
   global $userdata, $user_ip; 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
//-- add 
   global $bbcode_tpl; 
//-- end mod : topic preview ----------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
   if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 
   { 
      $topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0; 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
//-- add 
      // 
      // Generate summary from message 
      // 
      $summary=substr(str_replace("''", "\'", $post_message),0,1024); 
       
      // Remove last incomplete word 
      if (strlen($summary) == 1024) $summary = preg_replace("/[\s][\S]+$/"," ",$summary); 

      // If the board has HTML off but the post has HTML on then we process it, else leave it alone 
      if ( !$board_config['allow_html'] && $html_on ) 
      { 
         $summary = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $summary); 
      } 
    
      // Parse message and/or sig for BBCode if reqd 
      if ( $board_config['allow_bbcode'] && $bbcode_uid != '' ) 
      { 
         $summary = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($summary, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $summary); 
      } 
    
      // Parse smilies 
      if ( $board_config['allow_smilies'] && $smilies_on ) 
      { 
         $summary = smilies_pass($summary); 
      } 
    
      // Replace naughty words 
      $orig_word = array(); 
      $replacement_word = array(); 
      obtain_word_list($orig_word, $replacement_word); 
      if (count($orig_word)) 
      { 
         $summary = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $summary . '<'), 1, -1)); 
      } 
    
      // Replace newlines (we use this rather than nl2br because till recently it wasn't XHTML compliant) 
      $summary = str_replace("\n", "\n<br />\n", $summary); 
          
      // Remove newlines and quotes (for javascript) 
      $cerca=array("/(\r|\n)/","/\"/","/[`‘’´]/"); $sost=array("",""","'"); 
      $summary=preg_replace($cerca,$sost,$summary); 
       
      $summary=addslashes(addslashes($summary)); 
      if (strlen($summary) > 252) { 
         $summary=substr($summary,0,252);  
         $tronca = true; 
      } 
       
      // Remove last word if incomplete 
      if (strlen($summary)==252) { 
         $summary=preg_replace("/[\s][\S]+$/","",$summary); 
         while (preg_match("/<[^>]+$/",$summary)) $summary=preg_replace("/[\s]*<[^>]+$/","",$summary); 
      } 
       
      if (strlen($post_message) > 1024 || $tronca) $summary.="..."; 
//-- end mod : topic preview ----------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
      $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id"; 
# 
#-----[ BEFORE, ADD ]---------------------------------------- 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
      $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id"; 
# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
) VALUES ('$post_subject'
# 
#-----[ IN-LINE BEFORE, ADD ]-------------------------------- 
# 
, summary
# 
#-----[ FIND ]------------------------------------------------ 
# same line as previous action
      $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id"; 
# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
)" : "UPDATE " . TOPICS_TABLE
# 
#-----[ IN-LINE BEFORE, ADD ]-------------------------------- 
# 
, '".str_replace("\'", "''", $summary)."'
# 
#-----[ FIND ]------------------------------------------------ 
# same line as previous action
      $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id"; 
# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
 WHERE topic_id = $topic_id";
# 
#-----[ IN-LINE BEFORE, ADD ]-------------------------------- 
# 
, summary = '".str_replace("\'", "''", $summary)."'

#-----[ OPEN ]------------------------------------------------ 
# 
includes/functions_topics_list.php 
# 
#-----[ FIND ]------------------------------------------------ 
# 
<?php 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
         'TOPIC_TITLE'			=> $topic_title,
         'TOPIC_TYPE'			=> $topic_type,
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
//-- add 
         'TOPIC_SUMMARY' => $topic_rowset[$i]['summary'], 
//-- end mod : topic preview ----------------------------------------------------------------------- 
# 
#-----[ OPEN ]------------------------------------------------ 
# 
templates/subSilver/viewforum_body.tpl 
# 
#-----[ FIND ]------------------------------------------------ 
# 
# at top of the file 
# 
<form method="post" action="{S_POST_DAYS_ACTION}"> 
# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 
<!-- mod : topic preview --> 
<DIV ID=dek style="position: absolute; visibility: hidden; Z-INDEX:200; top: 0px; left: 0px"></DIV> 
<SCRIPT TYPE="text/javascript"><!-- 
var old,yyy=-1000,Xoffset=-60,Yoffset= 20; 
if (!document.getElementById) old=true; 
else { 
   var skn=document.getElementById('dek'); 
   if(!document.all) document.captureEvents(Event.MOUSEMOVE); 
   document.onmousemove=get_mouse; 
} 
function popup(msg,bak){ 
   var content="<TABLE  WIDTH=350 BORDER=1 BORDERCOLOR=#664500 CELLPADDING=2 CELLSPACING=0 "+"BGCOLOR="+bak+"><tr><TD><FONT COLOR=black SIZE=2 face=verdana>"+msg+"</FONT></TD></tr></TABLE>"; 
   if(!old){ yyy=Yoffset; skn.innerHTML=content; skn.style.visibility="visible"} 
} 
function get_mouse(e){ 
   var x=(document.all)?event.x+document.body.scrollLeft:e.pageX; 
   var y=(document.all)?event.y+document.body.scrollTop:e.pageY; 
   skn.style.left=x+Xoffset; skn.style.top=y+yyy; 
} 
function kill(){ if(!old){yyy=-1000;skn.style.visibility="hidden";} } 
//--></SCRIPT> 
# 
#-----[ OPEN ]------------------------------------------------ 
# 
templates/subSilver/topics_list_box.tpl 
# 
#-----[ FIND ]------------------------------------------------ 
# Whole line is longer.
	<span class="topictitle">{topics_list_box.row.NEWEST_POST_IMG}
# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
<a href="{topics_list_box.row.U_VIEW_TOPIC}"
# 
#-----[ IN-LINE AFTER, ADD ]-------------------------------- 
# 
 ONMOUSEOVER="popup('{topics_list_box.row.TOPIC_SUMMARY}','#FFCC66')" ONMOUSEOUT="kill()" 
# 
#-----[ SAVE/CLOSE ALL FILES ]-------------------------------- 
# 
# EoM
[Edited to include changes made by Emanuele later:

Code: Select all

$summary=addslashes(addslashes($summary)); 
      if (strlen($summary) > 252) { 
         $summary=substr($summary,0,252);  
         $tronca = true; 
      }
Last edited by niksa on Sun Jul 04, 2004 1:46 am, edited 1 time in total.

XSportSeeker
Registered User
Posts: 39
Joined: Fri May 28, 2004 10:04 pm

Post by XSportSeeker » Fri Jun 04, 2004 8:49 am

So.. I´ve just tested this, it looks great buuut....
From what I´ve understood... there´s only preview when the topic is less or equal to 255 characters length?
At least this is how it seemed to work...
Is there an easy way to just don´t mind the length of the text and just put up the 255 first characters with the (...) in the end?

XSportSeeker
Registered User
Posts: 39
Joined: Fri May 28, 2004 10:04 pm

Post by XSportSeeker » Fri Jun 04, 2004 9:09 am

Ok!
Analyzed the code and found out something here:

on Includes/functions_post.php

on the third [ AFTER, ADD ] instruction... the big code... starts with

Code: Select all

//-- mod : topic preview --------------------------------------------------------------------------- 
//-- add 
      // 
      // Generate summary from message 
      // 


Later on, on the same [ AFTER, ADD ] you have

Code: Select all

      // Remove newlines and quotes (for javascript) 
      $cerca=array("/(\r|\n)/","/\"/","/[`‘’´]/"); $sost=array("",""","'"); 
      $summary=preg_replace($cerca,$sost,$summary); 
       
      $summary=addslashes(addslashes($summary)); 


You can add this right after (I think it was missing...)
$sumslash=$summary;
Then proceed the code normally:

Code: Select all

      if (strlen($summary) > 252) { 
         $summary=substr($sumslash,0,252); 
         $tronca = true; 
      } 
       
      // Remove last word if incomplete 
      if (strlen($summary)==252) { 
         $summary=preg_replace("/[\s][\S]+$/","",$summary); 
         while (preg_match("/<[^>]+$/",$summary)) $summary=preg_replace("/[\s]*<[^>]+$/","",$summary); 
      } 
      if (strlen($post_message) > 1024 || $tronca) $summary.="..."; 
       
//-- end mod : topic preview ----------------------------------------------------------------------- 
Just added what´s in bold... seemed to solve the problem, but since I only gave a quick glance, if you guys do find something wrong in the quick fix, just post a reply... or else I´ll have problems later on! :P It just seemed like getting a substring from a variable that wasn´t initialized seemed something wrong... just don´t know if I made the correct choice... :P
Posted this way for the mod author to see it more clearly... I´ll just attatch the mod with the change already made here:

Code: Select all

############################################################## 
## MOD Title: Topic preview 
## MOD Author: Emanuele < manu75@libero.it > (Emanuele Iannone) n/a 
## MOD Description: This mod adds a pop-up window that shows the first 255 characters 
##                     of a topic message when user moves the cursor over the title on the forum view 
## MOD Version: 0.9beta 
## 
## Installation Level: Easy 
## Installation Time: ~5 Minutes 
## Files To Edit: 
##               /includes/functions_post.php, 
##               /viewforum.php, 
##               /templates/subSilver/viewforum_body.tpl, 
## 
## Included Files: n/a 
## 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
##   NOTE: The preview will appear only for topics posted/edited AFTER the mod installation 
############################################################## 
## MOD History: 
## 
##   2004-06-03 - Version 0.9beta 
##      - First release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ SQL ]------------------------------------------------- 
# 
ALTER TABLE phpbb_topics ADD summary VARCHAR(255); 
# 
#-----[ OPEN ]------------------------------------------------ 
# 
includes/functions_post.php 
# 
#-----[ FIND ]------------------------------------------------ 
# 
<?php 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length) 
{ 
   global $board_config, $lang, $db, $phpbb_root_path, $phpEx; 
   global $userdata, $user_ip; 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
//-- add 
   global $bbcode_tpl; 
//-- end mod : topic preview ----------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
   if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 
   { 
      $topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0; 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
//-- add 
      // 
      // Generate summary from message 
      // 
      $summary=substr(str_replace("''", "\'", $post_message),0,1024); 
       
      // Remove last incomplete word 
      if (strlen($summary) == 1024) $summary = preg_replace("/[\s][\S]+$/"," ",$summary); 

      // If the board has HTML off but the post has HTML on then we process it, else leave it alone 
      if ( !$board_config['allow_html'] && $html_on ) 
      { 
         $summary = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $summary); 
      } 
    
      // Parse message and/or sig for BBCode if reqd 
      if ( $board_config['allow_bbcode'] && $bbcode_uid != '' ) 
      { 
         $summary = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($summary, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $summary); 
      } 
    
      // Parse smilies 
      if ( $board_config['allow_smilies'] && $smilies_on ) 
      { 
         $summary = smilies_pass($summary); 
      } 
    
      // Replace naughty words 
      $orig_word = array(); 
      $replacement_word = array(); 
      obtain_word_list($orig_word, $replacement_word); 
      if (count($orig_word)) 
      { 
         $summary = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $summary . '<'), 1, -1)); 
      } 
    
      // Replace newlines (we use this rather than nl2br because till recently it wasn't XHTML compliant) 
      $summary = str_replace("\n", "\n<br />\n", $summary); 
          
      // Remove newlines and quotes (for javascript) 
      $cerca=array("/(\r|\n)/","/\"/","/[`‘’´]/"); $sost=array("",""","'"); 
      $summary=preg_replace($cerca,$sost,$summary); 
       
      $summary=addslashes(addslashes($summary)); 
      if (strlen($summary) > 252) { 
         $summary=substr($sumslash,0,252); 
         $tronca = true; 
      } 
       
      // Remove last word if incomplete 
      if (strlen($summary)==252) { 
         $summary=preg_replace("/[\s][\S]+$/","",$summary); 
         while (preg_match("/<[^>]+$/",$summary)) $summary=preg_replace("/[\s]*<[^>]+$/","",$summary); 
      } 
       
      if (strlen($post_message) > 1024 || $tronca) $summary.="..."; 
//-- end mod : topic preview ----------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
      $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id"; 
# 
#-----[ REPLACE WITH ]---------------------------------------- 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
//-- del 
//      $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id"; 
//-- add: 
      $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote, summary) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote, '".str_replace("\'", "''", $summary)."')" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . ", summary = '".str_replace("\'", "''", $summary)."' WHERE topic_id = $topic_id"; 
//-- end mod : topic preview ----------------------------------------------------------------------- 
#-----[ OPEN ]------------------------------------------------ 
# 
viewforum.php 
# 
#-----[ FIND ]------------------------------------------------ 
# 
<?php 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
# 
#-----[ FIND ]------------------------------------------------ 
# 
         'TOPIC_TITLE' => $topic_title, 
         'TOPIC_TYPE' => $topic_type, 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//-- mod : topic preview --------------------------------------------------------------------------- 
//-- add 
         'TOPIC_SUMMARY' => $topic_rowset[$i]['summary'], 
//-- end mod : topic preview ----------------------------------------------------------------------- 
# 
#-----[ OPEN ]------------------------------------------------ 
# 
templates/subSilver/viewforum_body.tpl 
# 
#-----[ FIND ]------------------------------------------------ 
# 
# at top of the file 
# 
<form method="post" action="{S_POST_DAYS_ACTION}"> 
# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 
<!-- mod : topic preview --> 
<DIV ID=dek style="position: absolute; visibility: hidden; Z-INDEX:200; top: 0px; left: 0px"></DIV> 
<SCRIPT TYPE="text/javascript"><!-- 
var old,yyy=-1000,Xoffset=-60,Yoffset= 20; 
if (!document.getElementById) old=true; 
else { 
   var skn=document.getElementById('dek'); 
   if(!document.all) document.captureEvents(Event.MOUSEMOVE); 
   document.onmousemove=get_mouse; 
} 
function popup(msg,bak){ 
   var content="<TABLE  WIDTH=350 BORDER=1 BORDERCOLOR=#664500 CELLPADDING=2 CELLSPACING=0 "+"BGCOLOR="+bak+"><tr><TD><FONT COLOR=black SIZE=2 face=verdana>"+msg+"</FONT></TD></tr></TABLE>"; 
   if(!old){ yyy=Yoffset; skn.innerHTML=content; skn.style.visibility="visible"} 
} 
function get_mouse(e){ 
   var x=(document.all)?event.x+document.body.scrollLeft:e.pageX; 
   var y=(document.all)?event.y+document.body.scrollTop:e.pageY; 
   skn.style.left=x+Xoffset; skn.style.top=y+yyy; 
} 
function kill(){ if(!old){yyy=-1000;skn.style.visibility="hidden";} } 
//--></SCRIPT> 
# 
#-----[ FIND ]------------------------------------------------ 
# 
	  <td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_ATTACHMENT_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />
# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle" 
# 
#-----[ IN-LINE AFTER, ADD ]-------------------------------- 
# 
 ONMOUSEOVER="popup('{topicrow.TOPIC_SUMMARY}','#FFCC66')" ONMOUSEOUT="kill()" 
# 
#-----[ SAVE/CLOSE ALL FILES ]-------------------------------- 
# 
# EoM 
[/code]

XSportSeeker
Registered User
Posts: 39
Joined: Fri May 28, 2004 10:04 pm

Post by XSportSeeker » Fri Jun 04, 2004 9:47 am

Sorry for doubleposting but I think this will be best for understanding...

The
$sumslash=$summary;
code might as well be inserted after the
if (strlen($summary) > 252) {
statement also... since it won´t be used if the execution don´t validate the if...
:P Sorry for my awful technical english...

User avatar
anor
Registered User
Posts: 48
Joined: Mon Apr 29, 2002 11:18 pm
Location: The Netherlands

Post by anor » Sat Jun 05, 2004 8:29 pm

Hmm anybody can make a script so that older topics (topics made before this mod was installed) also have the description?

XSportSeeker
Registered User
Posts: 39
Joined: Fri May 28, 2004 10:04 pm

Post by XSportSeeker » Sat Jun 05, 2004 9:41 pm

With this one it´s kinda hard, since it´s based on DB entries... you know, when you post a topic, it automaticaly saves the first 225 or whatever characters on another field...
But there seems to be another preview topics around that doesn´t use DB... don´t know how it works and if it works ok...
I found out after I already had installed this version (with DB modification), so I didn't even bother trying and just deleted it... but it may be better to your case...
Sorry, don't remember the author, the page or the name of it, but I'm shure there is one out there... probably on phpbbhacks page...

addit
Registered User
Posts: 39
Joined: Wed Apr 14, 2004 5:02 pm
Location: UK

Here ya go!

Post by addit » Sat Jun 05, 2004 10:14 pm

You betta be darned happy anor!!! I made this just for you hehehe. Doesn't need to change db or use javascript. It will work on ALL posts.

Enjoy!

Code: Select all

############################################################## 
## MOD Title: Topic Preview 
## MOD Author: Addit < adam_marcus@btinternet.com > (Adam Marcus) N/A 
## MOD Description: This mod adds a alt that shows the first 255 characters of a topic 
##                  when user moves the cursor over the topic title in forum view.
## MOD Version: 1
## 
## Installation Level: Easy 
## Installation Time: ~5 Minutes 
## Files To Edit: 
##               /viewforum.php, 
##               /templates/subSilver/viewforum_body.tpl
## 
## Included Files: N/A
## 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
##    A simple solution without reverting to javascript.
############################################################## 
## MOD History: 
## 
##   2004-06-05 - Version 1
##      - First release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
#
#----------[ OPEN ]-------------------------------------------
#
viewforum.php
#
#----------[ FIND ]-------------------------------------------
#
		$views = $topic_rowset[$i]['topic_views'];
#---------[ BEFORE, ADD ]-------------------------------------
		// topic preview mod start -------->

		// get first post of topic
		$sql = "SELECT post_text FROM " . POSTS_TEXT_TABLE . " WHERE post_id=" . $topic_rowset[$i]['topic_first_post_id'];
		$post_result = $db->sql_query($sql);
		$post_row = $db->sql_fetchrow($post_result); 
		$db->sql_freeresult($post_result);

		// replace html tags and trim length to 255
		$summary = $post_row['post_text'];
		if (strlen($summary) > 252) $summary=substr($summary,0,252) . "...";
		$summary = preg_replace("/\[.+\]/iU",'',$summary); 
		$summary = htmlspecialchars(strip_tags($summary));

		// <--------- topic preview mod end

#
#----------[ FIND ]-------------------------------------------
#
        		 'TOPIC_TITLE' => $topic_title, 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
         		'TOPIC_SUMMARY' => $summary, 
#
#----------[ OPEN ]-------------------------------------------
#
templates/subSilver/viewforum_body.tpl 
# 
#-----[ FIND ]------------------------------------------------ 
# 
     <td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />
# 
#-----[ REPLACE WITH ]---------------------------------------- 
# 
     <td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" title="{topicrow.TOPIC_SUMMARY}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />
# 
#-----[ SAVE/CLOSE ALL FILES ]-------------------------------- 
# 
# EoM
Ow, hands hurting... :lol: try it and tell em if it works or not lol. Also, you think I should submit this?

Adam

addit
Registered User
Posts: 39
Joined: Wed Apr 14, 2004 5:02 pm
Location: UK

Here ya go!

Post by addit » Sat Jun 05, 2004 10:14 pm

You betta be darned happy anor!!! I made this just for you hehehe. Doesn't need to change db or use javascript. It will work on ALL posts.

Enjoy!

Code: Select all

############################################################## 
## MOD Title: Topic Preview 
## MOD Author: Addit < adam_marcus@btinternet.com > (Adam Marcus) N/A 
## MOD Description: This mod adds an alt that shows the first 255 characters of a topic 
##                  when user moves the cursor over the topic title in forum view.
## MOD Version: 1
## 
## Installation Level: Easy 
## Installation Time: ~5 Minutes 
## Files To Edit: 
##               /viewforum.php, 
##               /templates/subSilver/viewforum_body.tpl
## 
## Included Files: N/A
## 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
##    A simple solution without reverting to javascript.
############################################################## 
## MOD History: 
## 
##   2004-06-05 - Version 1
##      - First release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
#
#----------[ OPEN ]-------------------------------------------
#
viewforum.php
#
#----------[ FIND ]-------------------------------------------
#
		$views = $topic_rowset[$i]['topic_views'];
#---------[ BEFORE, ADD ]-------------------------------------
		// topic preview mod start -------->

		// get first post of topic
		$sql = "SELECT post_text FROM " . POSTS_TEXT_TABLE . " WHERE post_id=" . $topic_rowset[$i]['topic_first_post_id'];
		$post_result = $db->sql_query($sql);
		$post_row = $db->sql_fetchrow($post_result); 
		$db->sql_freeresult($post_result);

		// replace html tags and trim length to 255
		$summary = $post_row['post_text'];
		if (strlen($summary) > 252) $summary=substr($summary,0,252) . "...";
		$summary = preg_replace("/\[.+\]/iU",'',$summary); 
		$summary = htmlspecialchars(strip_tags($summary));

		// <--------- topic preview mod end

#
#----------[ FIND ]-------------------------------------------
#
        		 'TOPIC_TITLE' => $topic_title, 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
         		'TOPIC_SUMMARY' => $summary, 
#
#----------[ OPEN ]-------------------------------------------
#
templates/subSilver/viewforum_body.tpl 
# 
#-----[ FIND ]------------------------------------------------ 
# 
     <td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />
# 
#-----[ REPLACE WITH ]---------------------------------------- 
# 
     <td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" title="{topicrow.TOPIC_SUMMARY}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />
# 
#-----[ SAVE/CLOSE ALL FILES ]-------------------------------- 
# 
# EoM
Ow, hands hurting... :lol: try it and tell em if it works or not lol. Also, you think I should submit this?

Adam

User avatar
amedee
Registered User
Posts: 12
Joined: Sat Jun 05, 2004 5:49 pm
Location: Paris, France

Post by amedee » Sat Jun 05, 2004 10:29 pm

This preview features looks really great! But shouldn't it be better if instead of being in a "mouse-over" window, the preview appeard as a text under the topc's title?

Yours,

A.

XSportSeeker
Registered User
Posts: 39
Joined: Fri May 28, 2004 10:04 pm

Post by XSportSeeker » Sat Jun 05, 2004 11:09 pm

I guess it would crowd too much the Topics Table... but it's easily implementable.
Thing is, it would not be very mutch good for the appearance of the View Forum Body... 'cuz like, imagine preview with 50 characters, than previews with 225 characters... and so on... would make a real mess... :P
But I guess, if you put in really minuscule font size, after the topic title, it may (or may not) be useful...
The only thing you have to change is... removing the title="{topicrow.TOPIC_SUMMARY}"
off the <a> tag and putting it out as a continuation to the title... with some formating, for it to be small... or you could create separate cells on the Forums table specially for the preview, which is not that much complicated, but keep in mind that this might give you some hard time when installing other mods related to view forum...

XSportSeeker
Registered User
Posts: 39
Joined: Fri May 28, 2004 10:04 pm

Post by XSportSeeker » Sat Jun 05, 2004 11:19 pm

Sorry about the double posting, but it is a different subject, so if you allow me to...
About the other mod I've found... it was very similar to this one addit posted... great job addit! I didn't try it, but still, great job for the effort at least..
I'd really like to try it, but since I've already installed the DB version, it would mess everything up here, and I don't have the time to analyse all the code again... o_O
Anyways, with a minor change, you can also make the preview show part of the last topic posted.
And also, you can do something like: When the user never read the topic, it shows a preview of the first post. If he already read it, it shows the preview of the last post. This would be a little more trickier, cuz the code would have to evaluate if the user has or has not opened the topic once (don't confuse it with new posts), but can be done.
More advanced stuff would be putting some options on usercp.

User avatar
amedee
Registered User
Posts: 12
Joined: Sat Jun 05, 2004 5:49 pm
Location: Paris, France

Post by amedee » Sat Jun 05, 2004 11:28 pm

XSportSeeker wrote: The only thing you have to change is... removing the title="{topicrow.TOPIC_SUMMARY}"
off the <a> tag and putting it out as a continuation to the title...


Thanks for your message. I'll give it a try, since my forum is private and does not have that much messages.

So if I understand well, first I implement the last MOD above and then change the TOPIC_SUMMARY label like you explaines in the quote, and then I load the file(s)?

Yours,

A.

XSportSeeker
Registered User
Posts: 39
Joined: Fri May 28, 2004 10:04 pm

Post by XSportSeeker » Sat Jun 05, 2004 11:58 pm

Hmm.. I was kinda hopping you knew something about php and html.... is that the case? If not, better not to mess with the code...
If yes, then I think you can try the last mod posted (remember to backup everything first), and see how it works. The adjustments on how to show it on the ViewForum tables will be easy to see... just analyse the structure of the mod. The part of the code that deals with the table, and the link that was added the preview, is what you'll have to change.

Maybe it's best for you to change the mod BEFORE applying it, but this is really up to you. I usually install the original MOD then modify later because I don't have my forum on the net yet... I´m building it at home (locally) before publishing on the net. Also, it's best to analyse first what the original mod do before messing with it... sometimes the mod isn't useful at all to you, sometimes there are errors or the original mods plain don't work, and sometimes it works so well that you don´t even have to adapt it to your own necessities....
Problem is, when you install a mod directly on your on-line forum, and the original forum don´t do what you want it to do, your users will probably have to bare with it 'till you do the necessary changes on the code... and this may (or may not) be real bad, depending on the users.

Anyways, plain answer to what you answer: It´s up to you! :D
Hope this helped!

User avatar
amedee
Registered User
Posts: 12
Joined: Sat Jun 05, 2004 5:49 pm
Location: Paris, France

Post by amedee » Sun Jun 06, 2004 9:05 am

I'm not familiar wih PHP, but quite good at HTML! :wink:

After a good night's sleep, I came with a more subtle idea : And if the previews only appeard for those messages that haven't been read (a bit like in Outlook). That would limit the amount of space of each message, while providng usefull info to members (BTW, my forum is a small community of friends, so they don't mind small testings). I'm a newbie, and I haven' used a MOD before, that's why I'm a bit naive! I guess this should require a change in where the code is inserted... I didn't test it yet, just wanted to share my bright idea! :lol:

A.

Locked

Return to “[2.0.x] MODs in Development”