Kont Forum Asistanı
Mesaj Sayısı : 1984 Yer : ChatLaq.FoRuM.St Yaş : 28 Lakap : Ayıboğan
| Konu: VBullettin Gibi Konu Önizleme Ptsi Mayıs 11, 2009 2:30 pm | |
| Bu Mod Sayesinde Sitenizde Konular?n Üstüne Gelince Size Ba?l?g?n ?lk Mesaj?n?n Ön?zlemesini Gösterir. Demo : [tr][td]Al?nt?:[/td][/tr]
############################################################## ## MOD Title: display first message as hover title ## MOD Author: emrag < emrah987@hotmail.com > (Emrah Türkmen) www.canver.net (TURKEY) ## MOD Description: with this hack when you hover the mouse on topic link you ## will see first message as hover title like vBulletin Boards ## ## MOD Version: 1.1.0 ## ## Installation Level: Easy ## Installation Time : ~5 minutes ## Files to Edit: viewforum.php ## templates/subsilver/viewforum_body.tpl ## ## Included Files: n/a ############################################################## ## ## Author Note: ## ## - The javascript you will add to viewforum_body.tpl comes from Mojavlinux's MyCalendar 2.2.6 ## ( http://www.mojavelinux.com/ ) ## ############################################################## ## ## 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 ## ## 01.03.2005 - 1.1.0 ## - compitable with bbcodes ## - now hover title show smilies ## - compitable with MODE "HIDE" - author: Philiweb ## - now using a javascript code for hover title - author: MojavLinux ## - fixed a bug about single and double quotes - ", ' ## - i think this version is compitable with EasyMod but i didn't test it ## ############################################################## ## ## Before Adding This Hack To Your Forum, You Should Back Up All Files Related To This Hack ## ############################################################## # #-----[ OPEN ]------------------------------------------ #
viewforum.php
# #----[ FIND ]------------------------------------------ #
include($phpbb_root_path . 'common.'.$phpEx);
# #----[ AFTER, ADD ]------------------------------------------ #
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
# #----[ 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 //
// // character limit for hover title // $chr_limit = '1000';
$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, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql); }
$row = $db->sql_fetchrow($result); $first_post = $row['post_text']; $first_post_bbcode_uid = $row['bbcode_uid'];
// // if message is longer than character limit break message // and add "..." at the last of message // if (strlen($first_post) > $chr_limit) { $first_post = substr($first_post, 0, $chr_limit); $first_post .= '...'; }
// // 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'] ) { if ( $first_post_bbcode_uid != '' ) { $first_post = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($first_post, $first_post_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $first_post); } }
// // Parse smilies // if ( $board_config['allow_smilies'] ) { if ( $row['enable_smilies'] ) { $first_post = smilies_pass($first_post); } }
// // replace \n with
// $first_post = preg_replace("/[\n\r]{1,2}/", ' ', $first_post);
// // escape from double and/or single quotes // $first_post = str_replace(array('"', '\''), array('"', '\\\''), $first_post);
// // if message have tags // there will be an error message instead of normal message // if ( preg_match("/\[hide\]/i", $first_post) && preg_match("/\[\/hide\]/i", $first_post)) { $first_post = 'Protected message: If you are a *registered user* : you must post a reply to this topic to see the message'; }
// // 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 ]------------------------------------------ # # at the top of the page
# #----[ BEFORE, ADD ]------------------------------------------ # # at the top of the page |
| | | | VBullettin Gibi Konu Önizleme | |
| Similar topics | |
|
| Bu forumun müsaadesi var: | Bu forumdaki mesajlara cevap veremezsiniz
| |
| |
| |
|