Seite 1 von 1

[erledigt] Abfrage / Anzeige im Portal ändern.

Verfasst: 05.09.2007 23:17
von marino
Hallo @ all

ich würde gern eine Abfrage/Anzeige in der "Forums-Vorschau" bei meinem Portal ändern ..

die Abfrage die derzeit drin ist :

Code: Alles auswählen

	//
// Recent hot topics
//
$sql = 'SELECT topic_title, forum_id, topic_id
	FROM ' . TOPICS_TABLE . '
	WHERE topic_approved = 1 
		AND topic_replies >=' . $config['hot_threshold'] . '
		' . $sql_where . '
	ORDER BY topic_time DESC';

$result = $db->sql_query_limit($sql, $CFG['max_topics']);

while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title'] != '') )
{
	// auto auth
	if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
	{
		$template->assign_block_vars('latest_hot_topics', array(
			'TITLE'	 		=> character_limit($row['topic_title'], $CFG['recent_title_limit']),
			'FULL_TITLE'	=> censor_text($row['topic_title']),
			'U_VIEW_TOPIC'	=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
			)
		);
	}
}
$db->sql_freeresult($result);
statt den " Hot Topics" würde ich dort gern Beiträge anzeigen lassen welche als " wichtig " gekennzeichnet sind . Weiss jemand wie die Abfragen dafür heissen ?

Link zum bessren Verständniss: http://diebadener2.di.funpic.de/
unten ist die "Vorschau"

edit: mir is a fehler unterlaufen .. jetzt ist der code da , der gebraucht wird

und ich hab noch einen code.. mit dem das warscheinlich nocht besser , noch leichter geht :

Code: Alles auswählen

//
// Recent announcements
//
$sql = 'SELECT topic_title, forum_id, topic_id
	FROM ' . TOPICS_TABLE . '
	WHERE topic_status <> 2 
		AND topic_approved = 1 
		AND ( topic_type = 2 OR topic_type = 3 )
		' . $sql_where . '
	ORDER BY topic_time DESC';

$result = $db->sql_query_limit($sql, $CFG['max_topics']);

while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title'] != '') )
{
	// auto auth
	if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
	{
		$template->assign_block_vars('latest_announcements', array(
			'TITLE'	 		=> character_limit($row['topic_title'], $CFG['recent_title_limit']),
			'FULL_TITLE'	=> censor_text($row['topic_title']),
			'U_VIEW_TOPIC'	=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
			)
		);
	}
}
$db->sql_freeresult($result);
hmm so wie ich mir das denk musste hier eigentlich nur der topic-status
geändert werden
also hier :

Code: Alles auswählen

WHERE topic_status <> 2 
		AND topic_approved = 1 
		AND ( topic_type = 2 OR topic_type = 3 )
das ich das die zeile auch ändern muss:

Code: Alles auswählen

		$template->assign_block_vars('latest_announcements', array(
is mir scho klar, da wird wohl festgelegt wo / wie die ausgabe im template erfolgt

erledigt... bin durch den zweiten code selbst auf die lösung gekommen ( mal in die datenbank zu guggen und dann zu testen welcher topicstatus/topictyp der richtige ist)