[ezportal] recente topics2

Hulp nodig bij een modificaties of op zoek naar een MOD? Bekijk ons archief. Support wordt helaas niet meer verleend.
Forumregels

Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
phpBB2.0.x
Gesloten
Gebruikersavatar
LazyTiger
Berichten: 2000
Lid geworden op: 21 okt 2003, 18:21

[ezportal] recente topics2

Bericht door LazyTiger » 30 mar 2004, 19:34

zoals gewoonlijk ben ik nu weer iets wazigs in elkaar aan het steken.

mijn portal moet nu 2x recente topics weergeven, maar dan van 2 verschillende fora.

nu heb ik bij de code gewoon overal een "2" toegevoegd:

Code: Selecteer alles

//
// Recent Topics2
//
$sql = "SELECT * FROM ". phpbb_forums . " ORDER BY forum_id";
if (!$result = $db->sql_query($sql))
{
	message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
	$forum_data[] = $row;
}

$is_auth_ary = array();
$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);

if( $CFG['exceptional_forums2'] == '' )
{
	$except_forum_id2 = '\'start\'';
}
else
{
	$except_forum_id2 = $CFG['exceptional_forums2'];
}

for ($i = 0; $i < count($forum_data); $i++)
{
	if ((!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_read']) or (!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_view']))
	{
		if ($except_forum_id2 == '\'start\'')
		{
			$except_forum_id2 = $forum_data[$i]['forum_id'];
		}
		else
		{
			$except_forum_id2 .= ',' . $forum_data[$i]['forum_id'];
		}
	}
}
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
		FROM phpbb_topics AS t,  phpbb_posts AS p, " . USERS_TABLE . " AS u
		WHERE t.forum_id NOT IN (" . $except_forum_id2 . ")
			AND t.topic_status <> 2
			AND p.post_id = t.topic_last_post_id
			AND p.poster_id = u.user_id
		ORDER BY p.post_id DESC
		LIMIT " . $CFG['number_recent_topics2'];
if (!$result = $db->sql_query($sql))
{
	message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
}
$number_recent_topics2 = $db->sql_numrows($result);
$recent_topic_row2 = array();
while ($row = $db->sql_fetchrow($result))
{
	$recent_topic_row2[] = $row;
}
for ($i = 0; $i < $number_recent_topics2; $i++)
{
	$template->assign_block_vars('recent_topic_row2', array(
		'U_TITLE2' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row2[$i]['post_id']) . '#' .$recent_topic_row2[$i]['post_id'],
		'L_TITLE2' => $recent_topic_row2[$i]['topic_title'],
		'U_POSTER2' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $recent_topic_row2[$i]['user_id']),
		'S_POSTER2' => $recent_topic_row2[$i]['username'],
		'S_POSTTIME2' => create_date($board_config['default_dateformat'], $recent_topic_row2[$i]['post_time'], $board_config['board_timezone'])
		)
	);
}
//
// END - Recent Topics2
//
toch werkt dit niet.
terwijl een aantal dingen goed staan ingevuld bovenaan de portal.php en in portal_body.tpl

dus de fout zit hierboven ergens.
wie ziet hem?
de 2tjes zijn allemaal door mij toegevoegd als ik me niet vergis.

Gebruikersavatar
Luuk
Berichten: 7311
Lid geworden op: 22 okt 2003, 10:07
Locatie: Delft

Bericht door Luuk » 30 mar 2004, 20:48

En zo? Weet het niet zeker :roll:

Code: Selecteer alles

// 
// Recent Topics2 
// 
$sql = "SELECT * FROM ". phpbb_forums . " ORDER BY forum_id"; 
if (!$result = $db->sql_query($sql)) 
{ 
   message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql); 
} 
$forum_data2 = array(); 
while( $row = $db->sql_fetchrow($result) ) 
{ 
   $forum_data2[] = $row; 
} 

$is_auth_ary2 = array(); 
$is_auth_ary2 = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data2); 

if( $CFG['exceptional_forums2'] == '' ) 
{ 
   $except_forum_id2 = '\'start\''; 
} 
else 
{ 
   $except_forum_id2 = $CFG['exceptional_forums2']; 
} 

for ($i = 0; $i < count($forum_data2); $i++) 
{ 
   if ((!$is_auth_ary[$forum_data2[$i]['forum_id']]['auth_read']) or (!$is_auth_ary[$forum_data2[$i]['forum_id']]['auth_view'])) 
   { 
      if ($except_forum_id2 == '\'start\'') 
      { 
         $except_forum_id2 = $forum_data2[$i]['forum_id']; 
      } 
      else 
      { 
         $except_forum_id2 .= ',' . $forum_data2[$i]['forum_id']; 
      } 
   } 
} 
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username 
      FROM phpbb_topics AS t,  phpbb_posts AS p, " . USERS_TABLE . " AS u 
      WHERE t.forum_id NOT IN (" . $except_forum_id2 . ") 
         AND t.topic_status <> 2 
         AND p.post_id = t.topic_last_post_id 
         AND p.poster_id = u.user_id 
      ORDER BY p.post_id DESC 
      LIMIT " . $CFG['number_recent_topics2']; 
if (!$result = $db->sql_query($sql)) 
{ 
   message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql); 
} 
$number_recent_topics2 = $db->sql_numrows($result); 
$recent_topic_row2 = array(); 
while ($row = $db->sql_fetchrow($result)) 
{ 
   $recent_topic_row2[] = $row; 
} 
for ($i = 0; $i < $number_recent_topics2; $i++) 
{ 
   $template->assign_block_vars('recent_topic_row2', array( 
      'U_TITLE2' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row2[$i]['post_id']) . '#' .$recent_topic_row2[$i]['post_id'], 
      'L_TITLE2' => $recent_topic_row2[$i]['topic_title'], 
      'U_POSTER2' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $recent_topic_row2[$i]['user_id']), 
      'S_POSTER2' => $recent_topic_row2[$i]['username'], 
      'S_POSTTIME2' => create_date($board_config['default_dateformat'], $recent_topic_row2[$i]['post_time'], $board_config['board_timezone']) 
      ) 
   ); 
} 
// 
// END - Recent Topics2 
//
Afbeelding

Gebruikersavatar
LazyTiger
Berichten: 2000
Lid geworden op: 21 okt 2003, 18:21

Bericht door LazyTiger » 31 mar 2004, 13:18

nee.. werkt ook niet.

wat dan?

Hans Kamp
Berichten: 470
Lid geworden op: 17 jan 2004, 08:39
Locatie: Enschede

Bericht door Hans Kamp » 31 mar 2004, 14:02

Wat dacht je van:

Code: Selecteer alles

# OPEN: portal.php
#
# FIND:
//
// Set configuration for ezPortal
//

// Welcome Text: note that we are in PHP file, so use \' instead of ' and use \\ instead of \ (HTML enabled)
$CFG['welcome_text'] = 'Welcome to <b>My Community</b><br /><br />Thanks for using ezPortal,<br /><br />Have a good time! ^_^';

// Number of news on portal
$CFG['number_of_news'] = '5';

// Length of news
$CFG['news_length'] = '200';

// News Forum ID: separate by comma for multi-forums, eg. '1,2,5'
$CFG['news_forum'] = '1';

// Poll Forum ID: separate by comma for multi-forums, eg. '3,8,14'
$CFG['poll_forum'] = '1';

Gebruikersavatar
LazyTiger
Berichten: 2000
Lid geworden op: 21 okt 2003, 18:21

Bericht door LazyTiger » 31 mar 2004, 14:05

euh.. dat heeft er niks mee te maken..
die dingen heb ik er allang staan of verwijderd omdat ik het niet gebruik..

Gebruikersavatar
LazyTiger
Berichten: 2000
Lid geworden op: 21 okt 2003, 18:21

Bericht door LazyTiger » 31 mar 2004, 14:22

opgelost

Gesloten