display_first_message_as_title_v.1.1.0

phpBB 2.0.x sürümleri için MODlar hakkında ihtiyacınız olan desteği buradan sorarak alabilirsiniz.
Kilitli
Kullanıcı avatarı
nuhsalih
Kayıtlı Kullanıcı
Mesajlar: 108
Kayıt: 28.02.2006, 14:00
İletişim:

display_first_message_as_title_v.1.1.0

Mesaj gönderen nuhsalih »

[ resmi görüntülemek için tıklayın ]

Bu Mod Sayesinde viewforum da konu başlıklarınının üzerine gelerek o mesajın içerigini görebilirsiniz

Kod: Tümünü seç

############################################################## 
## MOD Title: display first message as hover title
## MOD Author: emrag < emrah987@hotmail.com > (Emrah Türkmen)  www.**********  (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 <br />
	//
	$first_post = preg_replace("/[\n\r]{1,2}/", '<br />', $first_post);

	//
	// escape from double and/or single quotes
	//
	$first_post = str_replace(array('"', '\''), array('"', '\\\''), $first_post);

	//
	// if message have [hide] [/hide] 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 = '<b>Protected message:</b><br>If you are a <b>*registered user*</b> :<br>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

<form method="post" action="{S_POST_DAYS_ACTION}">
  <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">

#
#----[ BEFORE, ADD ]------------------------------------------ 
#
# at the top of the page

<!-- The javascript presents here comes from MyCalendar 2.2.6 from MojavLinux -->
<script language="Javascript" type="text/javascript">
<!--
var agt = navigator.userAgent.toLowerCase();
var originalFirstChild;

function createTitle(which, string, x, y)
{
	// record the original first child (protection when deleting)
	if (typeof(originalFirstChild) == 'undefined')
	{
		originalFirstChild = document.body.firstChild;
	}

	x = document.all ? (event.clientX + document.body.scrollLeft) : x;
	y = document.all ? (event.clientY + document.body.scrollTop) : y;
	element = document.createElement('div');
	element.style.position = 'absolute';
	element.style.zIndex = 1000;
	element.style.visibility = 'hidden';
	excessWidth = 0;
	if (document.all)
	{
		excessWidth = 50;
	}
	excessHeight = 20;
	element.innerHTML = '<div class="bodyline"><table width="300" cellspacing="0" cellpadding="0" border="0"><tr><td><table width="100%"><tr><td><span class="gen">' + string + '</span></td></tr></table></td></tr></table></div>';
	renderedElement = document.body.insertBefore(element, document.body.firstChild);
	renderedWidth = renderedElement.offsetWidth;
	renderedHeight = renderedElement.offsetHeight;

	// fix overflowing off the right side of the screen
	overFlowX = x + renderedWidth + excessWidth - document.body.offsetWidth;
	x = overFlowX > 0 ? x - overFlowX : x;

	// fix overflowing off the bottom of the screen
	overFlowY = y + renderedHeight + excessHeight - window.innerHeight - window.pageYOffset;
	y = overFlowY > 0 ? y - overFlowY : y;

	renderedElement.style.top = (y + 15) + 'px';
	renderedElement.style.left = (x + 15) + 'px';

	// windows versions of mozilla are like too fast here...we have to slow it down
	if (agt.indexOf('gecko') != -1 && agt.indexOf('win') != -1)
	{
		setTimeout("renderedElement.style.visibility = 'visible'", 1);
	}
	else
	{
		renderedElement.style.visibility = 'visible';
	}
}

function destroyTitle()
{
	// make sure we don't delete the actual page contents (javascript can get out of alignment)
	if (document.body.firstChild != originalFirstChild)
	{
		document.body.removeChild(document.body.firstChild);
	}
}
//-->
</script>

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

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

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

 onmouseover="createTitle(this, '{topicrow.FIRST_POST}', event.pageX, event.pageY);" onmouseout="destroyTitle();"

#
#-----[ SAVE ALL FILES/CLOSE ]------------------------------------------ 
#
# EoM
www.islamday.info İslam Bilgi Paylaşım Platformu Destek için Üye olun
http://www.islamday.info
Kullanıcı avatarı
CaN_BaKıR
Kayıtlı Kullanıcı
Mesajlar: 459
Kayıt: 17.03.2006, 01:16

Mesaj gönderen CaN_BaKıR »

Kodda hata var sayfa düzenini bozuyor...
[ resmi görüntülemek için tıklayın ]
phpBB Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=35
Mod Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=108

Lütfen Özel Mesaj Atıp Soru Sormayınız !!!
tankaya61
Kayıtlı Kullanıcı
Mesajlar: 4
Kayıt: 13.02.2006, 12:52
İletişim:

Mesaj gönderen tankaya61 »

ılk ıkı satırı gostermek ıstıyorum
nereyı duzeltmelıyım
Kullanıcı avatarı
NEFRİT
Uzaklaştırıldı
Mesajlar: 1404
Kayıt: 28.01.2006, 04:15
Konum: DarkKingdom
İletişim:

MODDA

Mesaj gönderen NEFRİT »

Modda şu kısım dikkatimi çekti sanırım buradaki değer değştirilirse mesajda çıkacak maksimum karakter limiti ayarlanıyor buradaki ayarı değiştirerek yani mesela 1000 yerine 300 filan yazarsan daha kısa bir mesaj çıkacaktır.

Kod: Tümünü seç

      // 
      // character limit for hover title 
      // 
      $chr_limit = '1000'; 
Enazından denemesi bedava :D
Özellerden kullanıcılara reklam yaptığım için sayın yöneticim beni uzaklaştırdı.
Kullanıcı avatarı
NEFRİT
Uzaklaştırıldı
Mesajlar: 1404
Kayıt: 28.01.2006, 04:15
Konum: DarkKingdom
İletişim:

AYRICA

Mesaj gönderen NEFRİT »

Ayrıca bu mod PHP PLUS ta çalışmamaktadır 8) . Açılan kutucukların içi boş çıkmaktadır.
Özellerden kullanıcılara reklam yaptığım için sayın yöneticim beni uzaklaştırdı.
Kullanıcı avatarı
CaN_BaKıR
Kayıtlı Kullanıcı
Mesajlar: 459
Kayıt: 17.03.2006, 01:16

Mesaj gönderen CaN_BaKıR »

Plus değil benimki ama sayfayı alla kbullak etti yazılar karman çorban oldu... Üzerine gelince önizleme yapabilmek için önce başlığın yerini bulmak lazım labirent gibi oldu valla :D
[ resmi görüntülemek için tıklayın ]
phpBB Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=35
Mod Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=108

Lütfen Özel Mesaj Atıp Soru Sormayınız !!!
Kullanıcı avatarı
nuhsalih
Kayıtlı Kullanıcı
Mesajlar: 108
Kayıt: 28.02.2006, 14:00
İletişim:

Mesaj gönderen nuhsalih »

CaN_BaKıR yazdı:Kodda hata var sayfa düzenini bozuyor...
hocam kodda hata yok kodları düzgün eklersen yapabilirsin ben şu asn kullanıyorum
www.islamday.info İslam Bilgi Paylaşım Platformu Destek için Üye olun
http://www.islamday.info
somee
Kayıtlı Kullanıcı
Mesajlar: 90
Kayıt: 04.04.2006, 08:53
İletişim:

Mesaj gönderen somee »

lütfen emeğe saygılı olalım baska sitelerden alıntı yapmıyalım
somee
Kayıtlı Kullanıcı
Mesajlar: 90
Kayıt: 04.04.2006, 08:53
İletişim:

Mesaj gönderen somee »

Kod: Tümünü seç

############################################################## 
## MOD Title: display first message as hover title
## MOD Author: emrag < emrah987@hotmail.com > (Emrah Türkmen)  www.**********  (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 <br />
	//
	$first_post = preg_replace("/[\n\r]{1,2}/", '<br />', $first_post);

	//
	// escape from double and/or single quotes
	//
	$first_post = str_replace(array('"', '\''), array('"', '\\\''), $first_post);

	//
	// if message have [hide] [/hide] 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 = '<b>Protected message:</b><br>If you are a <b>*registered user*</b> :<br>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

<form method="post" action="{S_POST_DAYS_ACTION}">
  <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">

#
#----[ BEFORE, ADD ]------------------------------------------ 
#
# at the top of the page

<!-- The javascript presents here comes from MyCalendar 2.2.6 from MojavLinux -->
<script language="Javascript" type="text/javascript">
<!--
var agt = navigator.userAgent.toLowerCase();
var originalFirstChild;

function createTitle(which, string, x, y)
{
	// record the original first child (protection when deleting)
	if (typeof(originalFirstChild) == 'undefined')
	{
		originalFirstChild = document.body.firstChild;
	}

	x = document.all ? (event.clientX + document.body.scrollLeft) : x;
	y = document.all ? (event.clientY + document.body.scrollTop) : y;
	element = document.createElement('div');
	element.style.position = 'absolute';
	element.style.zIndex = 1000;
	element.style.visibility = 'hidden';
	excessWidth = 0;
	if (document.all)
	{
		excessWidth = 50;
	}
	excessHeight = 20;
	element.innerHTML = '<div class="bodyline"><table width="300" cellspacing="0" cellpadding="0" border="0"><tr><td><table width="100%"><tr><td><span class="gen">' + string + '</span></td></tr></table></td></tr></table></div>';
	renderedElement = document.body.insertBefore(element, document.body.firstChild);
	renderedWidth = renderedElement.offsetWidth;
	renderedHeight = renderedElement.offsetHeight;

	// fix overflowing off the right side of the screen
	overFlowX = x + renderedWidth + excessWidth - document.body.offsetWidth;
	x = overFlowX > 0 ? x - overFlowX : x;

	// fix overflowing off the bottom of the screen
	overFlowY = y + renderedHeight + excessHeight - window.innerHeight - window.pageYOffset;
	y = overFlowY > 0 ? y - overFlowY : y;

	renderedElement.style.top = (y + 15) + 'px';
	renderedElement.style.left = (x + 15) + 'px';

	// windows versions of mozilla are like too fast here...we have to slow it down
	if (agt.indexOf('gecko') != -1 && agt.indexOf('win') != -1)
	{
		setTimeout("renderedElement.style.visibility = 'visible'", 1);
	}
	else
	{
		renderedElement.style.visibility = 'visible';
	}
}

function destroyTitle()
{
	// make sure we don't delete the actual page contents (javascript can get out of alignment)
	if (document.body.firstChild != originalFirstChild)
	{
		document.body.removeChild(document.body.firstChild);
	}
}
//-->
</script>

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

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

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

 onmouseover="createTitle(this, '{topicrow.FIRST_POST}', event.pageX, event.pageY);" onmouseout="destroyTitle();"

#
#-----[ SAVE ALL FILES/CLOSE ]------------------------------------------ 
#
# EoM
bunda hiçbir sorun yoktur denendi.
Kullanıcı avatarı
cerkiner
Kayıtlı Kullanıcı
Mesajlar: 120
Kayıt: 10.10.2006, 10:34
İletişim:

Mesaj gönderen cerkiner »

Bu kodları nasıl kullanıcaz.
Kullanıcı avatarı
Mirach
Destek Ekibi Lideri
Destek Ekibi Lideri
Mesajlar: 1664
Kayıt: 27.03.2006, 01:06
Konum: İstanbul

Mesaj gönderen Mirach »

Profilinde phpBB forumunun adresini girmemiş üyelere ve kurallara aykırı şekilde açılmış başlıklara destek verilmez.
Resim Resim Resim
Kilitli

“2.0.x MOD Destek” sayfasına dön

Kimler çevrimiçi

Bu forumu görüntüleyen kullanıcılar: Hiç bir kayıtlı kullanıcı yok ve 0 misafir