I agree, but I'm only going by the guidelines that MG has requested people follow to ensure that bad code is not uploaded to where others could apply it without considering that it may be faulty. Or would shove it into a live forum and then scream that it's crashed something.
The MOD has been sent to Artie for vetting - but I suppose one could put the code here so that other experienced ip-coders could also check it for anomalies.
Here it is. And other people please note that this is ONLY the code and not the complete MOD.
##############################################################
##
## The Original MOD has been modified by < lopalong@iinet.net.au > http://www.forum-styles.com on 16th Feb 2008 for IcyPhoenix v1.1.10.25 RC3. - Patches applied.
## This MOD should also work on earlier versions of IcyPhoenix. :-)
##
## MOD Title: Advanced Mouse Hover Preview
## MOD Author: dESiLVer < desilverx@gmail.com > (Kemal Guner) http://www.techsilver.gen.tr
## MOD Description: Last or first post mouse hover preview. (Java Support)
## Message preview options configurable Admin Control Panel.
## (Preview options: first, last or none and character limit)
## MOD Version: 1.0.2
##
## Installation Level: (Easy)
## Installation Time: 5 Minutes
## Files To Edit: root/viewforum.php
## /includes/constants.php
## /adm/admin_board.php
## /language/lang_english/lang_admin.php
## /templates/mg_themes/viewforum_body.tpl
## /templates/mg_themes/style_ice.css
## /templates/common/acp/board_config_body.tpl
## Included Files: /templates/common/js/preview.js
## root/db_update.php
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.icyphoenix.com
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.icyphoenix.com
##############################################################
##
## Author Notes: Thanks to ALEXIS for support to me on my work .
## Javascript author Travis Beckham, modified dESiLVer
##
##############################################################
## MOD History:
##
## 2005-10-02 - Version 1.0.2
## - Fixed some bugs
##
## 2005-09-15 - Version 1.0.1
## - Fixed some bugs
##
## 2005-09-03 - Version 1.0.0
## - First release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
INSERT INTO ip_config (config_name, config_value) VALUES ('char_limit','775');
INSERT INTO ip_config (config_name, config_value) VALUES ('display_first', '0');
## OR ## COPY db_update.php to root/db_update.php and log in as Admin and then browse to the file to run it. ## DO NOT DO BOTH! ##
#
#-----[ COPY ]------------------------------------------------
#
copy templates/common/js/preview.js to /templates/common/js/preview.js
#
#-----[ 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 ]-------------------------------------------
#
// Advanced mouse hover preview
if ($board_config['display_first'] != MSG_DISPLAY_NONE)
{
if ($board_config['display_first'] == MSG_DISPLAY_FIRST)
{
$display_msg = $topic_rowset[$i]['topic_first_post_id'];
}
else
{
$display_msg = $topic_rowset[$i]['topic_last_post_id'];
}
$sql = "SELECT post_text FROM " . POSTS_TEXT_TABLE . " WHERE post_id=" . $display_msg;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$last_post = $row['post_text'];
if (strlen($last_post) > $board_config['char_limit'])
{
$last_post=substr($last_post, 0, $board_config['char_limit']) . "...";
}
$last_post = preg_replace("/[.+]/iU",'',$last_post);
}
// End Advanced mouse hover preview
#
#-----[ FIND ]-----------------------------------
#
'LAST_POST_TIME' => $last_post_time,
#
#-----[ AFTER, ADD ]-------------------------------------------
#
// Advanced mouse hover preview
'LAST_POST_RESULT' => $last_post,
// End Advanced mouse hover preview
#
#-----[ OPEN ]------------------------------
#
includes/constants.php
#
#-----[ FIND ]-----------------------------------
#
define('POST_GLOBAL_ANNOUNCE', 3);
#
#-----[ AFTER, ADD ]-------------------------------------------
#
// Advanced mouse hover preview
define('MSG_DISPLAY_NONE', 0);
define('MSG_DISPLAY_FIRST', 1);
define('MSG_DISPLAY_LAST', 2);
// End Advanced mouse hover preview
#
#-----[ OPEN ]------------------------------
#
adm/admin_board.php
#
#-----[ FIND ]-----------------------------------
#
$prune_no = ( !$new['prune_enable'] ) ? 'checked="checked"' : '';
#
#-----[ AFTER, ADD ]-------------------------------------------
#
// Advanced mouse hover preview
$display_first_msg = ( $new['display_first'] == MSG_DISPLAY_FIRST ) ? "checked="checked"" : "";
$display_last_msg = ( $new['display_first'] == MSG_DISPLAY_LAST ) ? "checked="checked"" : "";
$display_none = ( $new['display_first'] == MSG_DISPLAY_NONE ) ? "checked="checked"" : "";
// End Advanced mouse hover preview
#
#-----[ FIND ]-----------------------------------
#
'L_MAX_POLL_OPTIONS' => $lang['Max_poll_options'],
#
#-----[ AFTER, ADD ]-------------------------------------------
#
// Advanced mouse hover preview
'L_CHAR_LIMIT' => $lang['Char_limit'],
'L_MSG_DISPLAY' => $lang['Msg_display'],
'L_MSG_DISPLAY_EXPLAIN' => $lang['Msg_display_exp'],
'L_MSG_FIRST' => $lang['Msg_first'],
'L_MSG_LAST' => $lang['Msg_last'],
// End Advanced mouse hover preview
#
#-----[ FIND ]-----------------------------------
#
'MAX_POLL_OPTIONS' => $new['max_poll_options'],
#
#-----[ AFTER, ADD ]-------------------------------------------
#
// Advanced mouse hover preview
'CHAR_LIMIT' => $new['char_limit'],
'DISPLAY_NONE_MSG' => MSG_DISPLAY_NONE,
'DISPLAY_NONE_CHECKED' => $display_none,
'DISPLAY_FIRST_MSG' => MSG_DISPLAY_FIRST,
'DISPLAY_FIRST_CHECKED' => $display_first_msg,
'DISPLAY_LAST_MSG' => MSG_DISPLAY_LAST,
'DISPLAY_LAST_CHECKED' => $display_last_msg,
// End Advanced mouse hover preview
#
#-----[ OPEN ]------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]-----------------------------------
#
?>
#
#-----[ BEFORE, ADD ]-------------------------------------------
#
// Advanced mouse hover preview
$lang['Msg_display'] = 'Message Summary';
$lang['Msg_display_exp'] = 'Message preview options';
$lang['Msg_first'] = 'First post';
$lang['Msg_last'] = 'Last post';
$lang['Char_limit'] = 'Character limit (max 775)';
// End Advanced mouse hover preview
#
#-----[ OPEN ]------------------------------
#
templates/mg_themes/viewforum_body.tpl
#
#-----[ FIND ]-----------------------------------
#
<form method="post" action="{S_POST_DAYS_ACTION}" style="display:inline;">
#
#-----[ BEFORE, ADD ]-------------------------------------------
#
<script type="text/javascript" src="{FULL_SITE_PATH}{T_COMMON_TPL_PATH}js/preview.js"></script>
#
#-----[ FIND ]-----------------------------------
#
{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_ATTACHMENT_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="{topicrow.TOPIC_CLASS}" title="{topicrow.LAST_POST_RESULT}">{topicrow.TOPIC_TITLE}</a>{topicrow.CALENDAR_TITLE}
#
#
#-----[ IN-LINE FIND ]-----------------------------------
#
class="{topicrow.TOPIC_CLASS}"
#
#-----[ IN-LINE AFTER, ADD ]-------------------------------------------
#
title="{topicrow.LAST_POST_RESULT}"
#
#-----[ OPEN ]------------------------------
#
templates/common/acp/board_config_body.tpl
#
#-----[ FIND ]-----------------------------------
#
<tr>
<td class="row1">{L_SAVEBOX_LIMIT}</td>
<td class="row2"><input class="post" type="text" maxlength="4" size="4" name="max_savebox_privmsgs" value="{SAVEBOX_LIMIT}" /></td>
</tr>
#
#-----[ AFTER, ADD ]-------------------------------------------
#
<tr>
<th class="thHead" colspan="2">{L_MSG_DISPLAY}</th>
</tr>
<tr>
<td class="row1">{L_CHAR_LIMIT}</td>
<td class="row2"><input type="text" maxlength="10" size="10" name="char_limit" value="{CHAR_LIMIT}" /></td>
</tr>
<tr>
<td class="row1">{L_MSG_DISPLAY}<br /><span class="gensmall">{L_MSG_DISPLAY_EXPLAIN}</span></td>
<td class="row2">
<input type="radio" name="display_first" value="{DISPLAY_NONE_MSG}" {DISPLAY_NONE_CHECKED} />{L_NONE}
<input type="radio" name="display_first" value="{DISPLAY_FIRST_MSG}" {DISPLAY_FIRST_CHECKED} />{L_MSG_FIRST}
<input type="radio" name="display_first" value="{DISPLAY_LAST_MSG}" {DISPLAY_LAST_CHECKED} />{L_MSG_LAST}
</td>
</tr>
#
#-----[ OPEN ]------------------------------
#
templates/mg_themes/style_ice.css
#
#-----[ FIND AT THE BOTTOM]-----------------------------------
#
}
#
#-----[ AFTER, ADD ]-------------------------------------------
#
div#tooltipDiv {
padding: 3px;
border: solid 1px #000000;
display: none;
background: #FFF;
color: #000000;
font: 10px Verdana, Arial, Helvetica, sans-serif;
text-align: left;
position: absolute;
left: 0;
top: 0;
width:auto;
max-width: 300px;
z-index: 1000;
filter: alpha(opacity=85);
-moz-opacity: .85;
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM