https://www.icyphoenix.com/viewtopic.php?f=17&t=5268&p=35440#p35440 ----------------------------------- Lopalong Tue 06 Jan, 2009 21:21 Re: First & Last Post Hover Preview ----------------------------------- Update! :mrblue: It's 6am :P If I clean up the first sheet a little later on, and paste it here. Do you want to go on with modifying the rest of it - Or do you want me to do it. It probably only needs one "Instruction" sheet, "File" the .js and add 1 to 4 template options (or 10 - or 20 LOL!) or just make a default template etc. Either way I'll post something you can play with soon.! :P [b]Edit:[/b] Well Mate, I think I've got it right - but this MOD needs lang and template variables added to make it theme compatible and compliant with languages and IP. I mean who wants to edit viewforum.php to change the lang or style? :( I already have a mouse-over hover MOD, and I'm not really interested in the "Last Post" thing - so this is probably as far as I'll be going with it. ;) Install_onmouse_over_topic_title_En.txt. [color=green][size=12][b]Updated with Compliant html, .css .js and Language Vars.[/b][/size][/color] [color=red][b]Still working on the Hide function. [/b][/color] :( [spoiler][code linenumbers=false] Package Icy Phoenix Modifications File $Id: install_onmouse_over_topic_title_En.txt Version for Icy Phoenix: 0.0.1 Author: ShadowKnyght < forum@cyber-mag.com > (James B) http://forum.cyber-mag.com Original Author: emrag < emrah987@hotmail.com > (Emrah Türkmen) www.canver.net (TURKEY) Copyright: (c) 2004 Emrah Türkmen Email: < forum@cyber-mag.com > < emrah987@hotmail.com > License http://opensource.org/licenses/gpl-license.php GNU Public License Extra credits for this file: Modified for Icy Phoenix by Lopalong. < lopalong@iinet.net.au > 07 January 2009 Title: Onmouse Over Topic Title Display First And Last Post Description: When you hover the mouse on a topic link you will see first and last posted message as a hover title like vBulletin Files To Edit: 3 viewforum.php templates/mg_themes/viewforum_body.tpl languages/lang_english/lang_extend_icy_phoenix.php Included Files: None Disclaimer: There is no guarantee that there are no security problems within the MOD. Comments: Author Notes: The javascript added to viewforum_body.tpl comes from Mojavlinux's MyCalendar 2.2.6 ( http://www.mojavelinux.com/ ) WARNING - WARNING - WARNING: Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD # #-----[ BEGIN MODIFICATION ]------------------------------------------ # # #-----[ 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 ]------------------------------------------ # // START Onmouse Over Topic Title Display First And Last Post // display first message as title // character limit for hover title $chr_limit = '350'; $first_post = '
  ' . $lang['Firstpost'] . '

'; $sql = "SELECT p.*, pt.post_text, pt.post_id, pt.bbcode_uid 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, 'Cannot obtain topic information', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $post_test = $row['post_text']; $first_post .= $row['post_text']; // if message is longer than character limit break message // and add "......More" at the last of message if (strlen($first_post) > $chr_limit) { $first_post = substr($first_post, 0, $chr_limit); $first_post .= '' . $lang['More'] . ''; } // 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'] ) { if ( $row['enable_html'] ) { $first_message = preg_replace('#(<)([/]?.*?)(>)#is', "<\2>", $first_post); } } // Parse message for BBCode if required if ( $board_config['allow_bbcode'] ) { $first_post = $bbcode->parse( $board_config['allow_bbcode'] ) ? ($first_post) : preg_replace('/:[0-9a-z:]+]/si', ']', $first_post); } // Parse smilies if ( $board_config['allow_smilies'] ) { if ( $row['enable_smilies'] ) { $first_post = $bbcode->parse($first_post); } } // replace n with $first_post = preg_replace("/[nr]{1,2}/", '', $first_post); // escape from double and/or single quotes $first_post = str_replace(array('"', '''), array('"', '\''), $first_post); // if message have Hidden Message: Sorry, but you must be registered and also post a reply to view this message. tags // there will be an error message instead of normal message if ( preg_match("/Hidden Message: Sorry, but you must be registered and also post a reply to view this message. /i", $first_post)) { $first_post = '
' . $lang['Protected'] . '
'; } // display first message as title // Add last post to pop up text $char_limit = '350'; $last_post = '
  ' . $lang['Lastpost'] . '

'; $sql = "SELECT *, post_text, post_id, bbcode_uid FROM " . POSTS_TEXT_TABLE . " WHERE post_id=" . $topic_rowset[$i]['topic_last_post_id']; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Cannot obtain topic information', '', __LINE__, __FILE__, $sql); } $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); $post2_test = $row['post_text']; $last_post .= $row['post_text']; if (strlen($last_post) > $char_limit) { $last_post=substr($last_post, 0, $char_limit) . '' . $lang['More'] . ''; } // 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'] ) { if ( $row['enable_html'] ) { $last_message = preg_replace('#(<)([/]?.*?)(>)#is', "<\2>", $last_post); } } // Parse message for BBCode if required if ( $board_config['allow_bbcode'] ) { $last_post = $bbcode->parse( $board_config['allow_bbcode'] ) ? ($last_post) : preg_replace('/:[0-9a-z:]+]/si', ']', $last_post); } // Parse smilies $last_post = $bbcode->parse($last_post); // replace n with $last_post = preg_replace("/[nr]{1,2}/", '', $last_post); // escape from double and/or single quotes $last_post = str_replace(array('"', '''), array('"', '\''), $last_post); // if message has Hidden Message: Sorry, but you must be registered and also post a reply to view this message. tags // there will be an error message instead of normal message if ( preg_match("/Hidden Message: Sorry, but you must be registered and also post a reply to view this message. /i", $last_post)) { $last_post = '
' . $lang['Protected'] . '
'; } // Join first and last post text if (!($post_test == $post2_test)) { $first_post .= $last_post; } // END Adding last post to pop up text // END Onmouse Over Topic Title Display First And Last Post # #----[ FIND ]------------------------------------------ # 'TOPIC_FOLDER_IMG' => $topic_link['image'], 'L_TOPIC_FOLDER_ALT' => $topic_link['image_alt'], # #-----[ BEFORE, ADD ]------------------------------------------ # // START Onmouse Over Topic Title Display First And Last Post 'FIRST_POST' => $first_post, // END Onmouse Over Topic Title Display First And Last Post # #-----[ OPEN ]------------------------------------------ # templates/mg_themes/viewforum_body.tpl # #----[ FIND ]------------------------------------------ #

# #----[ BEFORE, ADD ]------------------------------------------ # # #----[ FIND ]------------------------------------------ # {topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_ATTACHMENT_IMG}{topicrow.TOPIC_TYPE}{topicrow.TOPIC_TITLE}{topicrow.CALENDAR_TITLE} # #----[ INLINE FIND ]------------------------------------------ # class="{topicrow.TOPIC_CLASS}" # #----[ INLINE AFTER, ADD ]---------[ AND Include The Leading Space ]--------------------------------- # onmouseover="createTitle(this, '{topicrow.FIRST_POST}', event.pageX, event.pageY);" onmouseout="destroyTitle();" # #-----[ OPEN ]------------------------------------------ # languages/lang_english/lang_extend_icy_phoenix.php # #----[ FIND ]------------------------------------------ # //$lang[''] = ''; # #----[ BEFORE, ADD ]------------------------------------------ # // START Onmouse Over Topic Title Display First And Last Post $lang['Firstpost'] = 'First Post'; $lang['Lastpost'] = 'Last Post'; $lang['More'] = ' ......More'; $lang['Protected'] = 'Protected message:
If you are a *registered user* :
you must post a reply to this topic to see the message '; // END Onmouse Over Topic Title Display First And Last Post # #-----[ SAVE ALL FILES/CLOSE ]------------------------------------------ # [/code][/spoiler]