Display First Message on Topic Title Hover (Hilfe)

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
AzadKing
Mitglied
Beiträge: 71
Registriert: 28.01.2007 15:11

Beitrag von AzadKing »

bump :cookie:

4000 Views und keiner hat ne Lösung... das kann doch nicht sein ?? :o
AzadKing
Mitglied
Beiträge: 71
Registriert: 28.01.2007 15:11

Beitrag von AzadKing »

Hmm habe es heute mal selbst angegriffen und es hat geklappt eigentlich gant easy

Habe einfach das eingebaut

if ( in_array($forum_id,array('15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','31')) )
{
$first_post = 'Keine Vorschau für Flashmovies und Flashgames';
}


Hier nochmal der geänderte Code-Snippet. Habe alle Forennummern eingeben wo es nicht erscheinen soll und es wird dafür ein Text ausgegben. man kann den text auch weglassen

Code: Alles auswählen

//
// 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 ( in_array($forum_id,array('15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','31')) )
                                {
                                  $first_post = 'Keine Vorschau für Flashmovies und Flashgames';
                                 }


	//
	// 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 ;)
//
Antworten

Zurück zu „phpBB 2.0: Mod Support“