Beiträge nach Topic Info filtern

Allgemeiner Support zum phpBB 2 Board und phpBB 2 Modifikationen
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Antworten
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beiträge nach Topic Info filtern

Beitrag von oxpus »

Code: Alles auswählen

#
#-----[ OPEN ]-----
#
viewforum.php

#
#-----[ FIND ]-----
#
//
// End initial var setup
//

#
#-----[ BEFORE, ADD ]-----
#
if ( isset($HTTP_GET_VARS['filter_topic']) || isset($HTTP_POST_VARS['filter_topic']) )
{
	$filter_topic = (isset($HTTP_POST_VARS['filter_topic'])) ? $HTTP_POST_VARS['filter_topic'] : $HTTP_GET_VARS['filter_topic'];
}
else
{
	$filter_topic = '';
}

#
#-----[ FIND ]-----
#
//
// set the sort menu

#
#-----[ BEFORE, ADD ]-----
#
//
// Set Topic Status filter
$sql = "SELECT topic_info
	FROM " . TOPICS_TABLE . "
	WHERE forum_id = $forum_id
	AND topic_type <> " . POST_ANNOUNCE . "
	AND topic_type <> " . POST_GLOBAL_ANNOUNCE . "
	GROUP BY topic_info ASC";
if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}

$topic_filter = array();
while( $row = $db->sql_fetchrow($result) )
{
	$topic_filter[] = $row['topic_info'];
}

$filter = '<select name="filter_topic"><option value="0">'.$lang['All'].'</option>';
$i = 0;
foreach ($topic_filter as $key)
{
	$filter .= ( $i != 0 ) ? '<option value="'.$key.'">'.$lang['Info_choice'][$key].'</option>' : '';
	$i++;
}
$filter .= '</select>';
$filter = str_replace('value="'.$filter_topic.'">', 'value="'.$filter_topic.'" SELECTED>', $filter);
$filter_sql = ( $filter_topic != '0' && !empty($filter_topic) ) ? ' AND topic_info = '.$filter_topic : '';

#
#-----[ FIND ]-----
#
//
// read topics
$sql = "SELECT t.*, u.username,

#
#-----[ IN-LINE FIND ]-----
#
		AND t.topic_type <> " . POST_ANNOUNCE . "

#
#-----[ IN-LINE AFTER, ADD]-----
#
$filter_sql

#
#-----[ FIND ]-----
#
$template->assign_vars(array(
	'L_SORT_METHOD' => $sort_list_desc,
	'S_SORT_METHOD' => $sort_list,
	'L_ORDER'	=> $order_list_desc,
	'S_ORDER'	=> $order_list,

#
#-----[ AFTER, ADD ]-----
#
	'L_FILTER'	=> 'Filter',
	'S_FILTER'	=> $filter,


#
#-----[ OPEN ]-----
#
templates/subSilver/viewforum_body.tpl

#
#-----[ FIND ]-----
#
{L_SORT_METHOD}:&nbsp;{S_SORT_METHOD}

#
#-----[ BEFORE, ADD ]-----
#
{L_FILTER}:&nbsp;{S_FILTER}&nbsp;&nbsp;


#
#-----[ SAVE / UPLOAD ALL FILES ]-----
#
# EoM
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Antworten