[2.0.15] Latest active topics on index

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
80
54%
Very Good
41
28%
Good
14
10%
Fair
7
5%
Poor
5
3%
 
Total votes: 147

Lucky13MN
Registered User
Posts: 6
Joined: Wed Nov 22, 2006 3:07 pm

Re: [2.0.15] Latest active topics on index

Post by Lucky13MN » Wed Mar 28, 2007 6:00 pm

That profile fix worked like a charm, thank you!

Krank
Registered User
Posts: 179
Joined: Wed Sep 06, 2006 4:50 pm

Re: [2.0.15] Latest active topics on index

Post by Krank » Thu Mar 29, 2007 6:35 am

i just installed that mod today, and i have the Simple SubForums mod installed, when i add the part in index.php

Code: Select all

// 
// Obtain new post information for marquee 
// of new posts 
// 
// 
// Get Viewable Forums 
// 
// function to merge two auth arrays to one 
function array_merge_replace($array, $newValues)
{ 
	foreach ($newValues as $key => $value)
		{ 
		if ( is_array($value) )
		{ 
			if ( !isset($array[$key]) )
			{ 
				$array[$key] = array(); 
			} 
			$array[$key] = array_merge_replace($array[$key], $value); 
		}
		else
		{ 
			if ( isset($array[$key]) && is_array($array[$key]) )
			{ 
				$array[$key][0] = $value; 
			}
			else
			{ 
				if ( isset($array) && !is_array($array) )
				{ 
					$temp = $array; 
					$array = array(); 
					$array[0] = $temp; 
				} 
				$array[$key] = $value; 
			} 
		} 
	} 
	return $array; 
} 
$ary = array(); 
$ary2 = array(); 
$ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data); 
$ary2 = auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data); 
$is_auth_ary = array_merge_replace($ary, $ary2); 
$auth_view_forum_sql = ''; 
for($i = 0; $i < $total_categories; $i++) 
{ 
	$cat_id = $category_rows[$i]['cat_id']; 
	$display_forums = false; 
	for($j = 0; $j < $total_forums; $j++) 
	{ 
		if ( $is_auth_ary[$forum_data[$j]['forum_id']]['auth_view'] && $is_auth_ary[$forum_data[$j]['forum_id']]['auth_read'] && $forum_data[$j]['cat_id'] == $cat_id ) 
		{ 
			$display_forums = true; 
			$auth_view_forum_sql .= ($auth_view_forum_sql == '' ? '' : ', ' ) . $forum_data[$j]['forum_id']; 
		} 
	} 
} 
$auth_view_forum_sql = ($auth_view_forum_sql == '' ? '(0)' : '(' . $auth_view_forum_sql . ')'); 

// 
// Get The Data 
// 
$template->assign_vars(array(
	'MARQUEE_TOPIC' => str_replace("%s",$board_config['topics_on_index'],$lang['marquee_topic']) ) 
);

$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, t.topic_type, t.topic_status, p.post_id, p.poster_id, 
	p.post_time, u.user_id, u.username, u.user_lastvisit 
	FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u 
	WHERE t.forum_id IN " . $auth_view_forum_sql . " AND t.topic_id = p.topic_id 
	AND f.forum_id = t.forum_id 
	AND t.topic_status <> 2 
	AND p.post_id = t.topic_last_post_id 
	AND p.poster_id = u.user_id 
	ORDER BY t.topic_last_post_id DESC"; 

if ( !($result = $db->sql_query($sql)) ) 
{ 
	message_die(GENERAL_ERROR, 'Could not query recent posts marquee information', '', __LINE__, __FILE__, $sql); 
} 

if ($row = $db->sql_fetchrowset($result)) 
{ 
	$db->sql_freeresult($result); 
} 

if( count($row) <= $board_config['topics_on_index'] ) 
{ 
	$topics = count($row); 
} 
else 
{ 
	$topics = $board_config['topics_on_index']; 
} 

for($i = 0; $i < $topics; $i++) 
{ 
	$mar_title = $row[$i]["topic_title"]; 
	$mar_url = $phpbb_root_path . 'viewtopic.'.$phpEx.'?'.POST_TOPIC_URL.'='.$row[$i]["topic_id"]; 
	$mar_user = $row[$i]["username"]; 
	if ( $row[$i]["topic_status"] == TOPIC_LOCKED )
	{
		if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
		{
			$pic = $images['folder_locked_new'];
		}
		else
		{
			$pic = $images['folder_locked'];
		}
	}
	else
	{
		if ( $row[$i]["topic_type"] == POST_GLOBAL_ANNOUNCE )
		{
			if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
			{
				$pic = $images['folder_global_announce_new'];
			}
			else
			{
				$pic = $images['folder_global_announce'];
			}
		} 
		else if ( $row[$i]["topic_type"] == POST_ANNOUNCE )
		{
			if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
			{
				$pic = $images['folder_announce_new'];
			}
			else
			{
				$pic = $images['folder_announce'];
			}
		} 
		else if ( $row[$i]["topic_type"] == POST_STICKY )
		{
			if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
			{
				$pic = $images['folder_sticky_new'];
			}
			else
			{
			$pic = $images['folder_sticky'];
			}
		} 
		else { if ( $row[$i]["post_time"] > $userdata['user_lastvisit'] )
		{
			$pic = $images['folder_new']; }else{ $pic = $images['folder'];
		}
	}
}
$template->assign_block_vars('marqueerow', array( 
	'FOLD_URL' => $pic, 
	'TOPIC_TITLE' => $row[$i]["topic_title"], 
	'TOPIC_URL' => append_sid($phpbb_root_path . 'viewtopic.'.$phpEx.'?'.POST_TOPIC_URL.'='.$row[$i]["topic_id"]), 
	'USERNAME' => $row[$i]["username"], 
	'USER_PROF' => append_sid($phpbb_root_path . 'profile.'.$phpEx.'?mode=viewprofile$amp;u='.$row[$i]["user_id"]), 
	'POST_DATE' => create_date($board_config['default_dateformat'], $row[$i]["post_time"], $board_config['board_timezone']))
	); 
} 
it gives an error, not loading error, when you browse the forum with Internet Explorer at the status bar, it says "done with error" when i view the error its "all.documents.recent_topics is null" or something like that. anyone knows how to fix that?

[when i remove the latest topics mod, the error poof disappears, same thing if i remove the simple subforums and keep the latest topics mod, error gone, one of them installed, good, both gives error]
Image
phpBB3 Je t'adore: subSilver2 Based styles fan
proSilver, good, but too .... I don't know just too... :P

pikazu
Registered User
Posts: 1
Joined: Fri Mar 23, 2007 1:01 pm

Re: [2.0.15] Latest active topics on index

Post by pikazu » Thu Mar 29, 2007 12:22 pm

Remote_Control wrote: I noticed an issue where if you clicked on the posters name in the last 10 topics table, it wouldnt take you to that users profile. I found the error in the code and fixed it. This fixed error is posted below. The error is in the index.php page.
Change this:

Code: Select all

	'USER_PROF' => append_sid($phpbb_root_path . 'profile.'.$phpEx.'?mode=viewprofile$amp;u='.$row[$i]["user_id"]), 
To this:

Code: Select all

	'USER_PROF' => append_sid($phpbb_root_path . 'profile.'.$phpEx.'?mode=viewprofile&u='.$row[$i]["user_id"]), 


Remote_Control", why not change viewprofile$amp;u= to viewprofile&u=
Can any of HTML/php guru comment what is better?

Lucky13MN
Registered User
Posts: 6
Joined: Wed Nov 22, 2006 3:07 pm

Re: [2.0.15] Latest active topics on index

Post by Lucky13MN » Thu Mar 29, 2007 12:55 pm

If anyone can figure this one out I'll send you a virtual beer...

I would 'love' for it to take you to the last resply in the thread when you click on the thread title, or at least have an icon to do so, how difficult would this be?

Nefarrio Malevolent
Registered User
Posts: 10
Joined: Thu Jul 08, 2004 6:55 pm

Categories Hierarchy Fix for Latest Active Topics on Index

Post by Nefarrio Malevolent » Thu Mar 29, 2007 7:57 pm

Here's a suggestion to reduce the load of the query:

REPLACE: (index.php)

Code: Select all

	ORDER BY t.topic_last_post_id DESC"; 
WITH:

Code: Select all

	ORDER BY t.topic_last_post_id DESC
	LIMIT 0," . $board_config['topics_on_index'];
REPLACE: (index.php)

Code: Select all

if( count($row) <= $board_config['topics_on_index'] ) 
{ 
	$topics = count($row); 
} 
else 
{ 
	$topics = $board_config['topics_on_index']; 
} 

for($i = 0; $i < $topics; $i++) 
WITH:

Code: Select all

for($i = 0; $i < count($row); $i++) 
For those with Categories Hierarchy installed, and are getting a blank marquee table, this change should get you working:

REPLACE: (index.php)

Code: Select all

// 
// Obtain new post information for marquee 
// of new posts 
// 
// 
// Get Viewable Forums 
// 
// function to merge two auth arrays to one 
function array_merge_replace($array, $newValues)
{ 
	foreach ($newValues as $key => $value)
		{ 
		if ( is_array($value) )
		{ 
			if ( !isset($array[$key]) )
			{ 
				$array[$key] = array(); 
			} 
			$array[$key] = array_merge_replace($array[$key], $value); 
		}
		else
		{ 
			if ( isset($array[$key]) && is_array($array[$key]) )
			{ 
				$array[$key][0] = $value; 
			}
			else
			{ 
				if ( isset($array) && !is_array($array) )
				{ 
					$temp = $array; 
					$array = array(); 
					$array[0] = $temp; 
				} 
				$array[$key] = $value; 
			} 
		} 
	} 
	return $array; 
} 
$ary = array(); 
$ary2 = array(); 
$ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data); 
$ary2 = auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data); 
$is_auth_ary = array_merge_replace($ary, $ary2); 
$auth_view_forum_sql = ''; 
for($i = 0; $i < $total_categories; $i++) 
{ 
	$cat_id = $category_rows[$i]['cat_id']; 
	$display_forums = false; 
	for($j = 0; $j < $total_forums; $j++) 
	{ 
		if ( $is_auth_ary[$forum_data[$j]['forum_id']]['auth_view'] && $is_auth_ary[$forum_data[$j]['forum_id']]['auth_read'] && $forum_data[$j]['cat_id'] == $cat_id ) 
		{ 
			$display_forums = true; 
			$auth_view_forum_sql .= ($auth_view_forum_sql == '' ? '' : ', ' ) . $forum_data[$j]['forum_id']; 
		} 
	} 
} 
$auth_view_forum_sql = ($auth_view_forum_sql == '' ? '(0)' : '(' . $auth_view_forum_sql . ')'); 
WITH:

Code: Select all

$keys = array();
$keys = get_auth_keys('Root', true, -1, -1, 'auth_read');
$s_flist = '';
for ($i=0; $i < count($keys['id']); $i++)
{
	if ( ($tree['type'][ $keys['idx'][$i] ] == POST_FORUM_URL) && $tree['auth'][ $keys['id'][$i] ]['auth_read'] )
	{
		$s_flist .= (($s_flist != '') ? ', ' : '') . $tree['id'][ $keys['idx'][$i] ];
	}
}

$auth_view_forum_sql = ($s_flist == '' ? '(0)' : '(' . $s_flist . ')'); 

S-p-h-i-n-X
Registered User
Posts: 18
Joined: Tue Mar 20, 2007 1:18 am

Re: [2.0.15] Latest active topics on index

Post by S-p-h-i-n-X » Wed Apr 04, 2007 6:51 am

please help me out guys

I installed the mod but the block is blank and no scrolling text.

Ive run the sql

i dont see any thing in the acp :(

I cant add the index.php file because the forums disapear totally if i do.

I should say i have color mod cash mod and photo album and attachment mod all ready installed.

Please advise what i need to change or do thanx alot pros
Last edited by S-p-h-i-n-X on Wed Apr 04, 2007 11:43 am, edited 1 time in total.

S-p-h-i-n-X
Registered User
Posts: 18
Joined: Tue Mar 20, 2007 1:18 am

Re: [2.0.15] Latest active topics on index

Post by S-p-h-i-n-X » Wed Apr 04, 2007 7:08 am

Please give me some clue

Sauron_cro
Registered User
Posts: 4
Joined: Thu Apr 05, 2007 1:45 pm

Re: [2.0.15] Latest active topics on index

Post by Sauron_cro » Thu Apr 05, 2007 1:55 pm

can anyone reupload this mode, because main link is broken :roll:

thx

User avatar
Raimon
Former Team Member
Posts: 12088
Joined: Tue May 30, 2006 5:31 pm
Location: Netherlands
Name: Raimon Meuldijk
Contact:

Re: [2.0.15] Latest active topics on index

Post by Raimon » Thu Apr 05, 2007 10:02 pm

Need phpBB installation, extenstions, Styles or integrate phpBB with you website?
Contact me for fair prices and good service!

S-p-h-i-n-X
Registered User
Posts: 18
Joined: Tue Mar 20, 2007 1:18 am

Re: [2.0.15] Latest active topics on index

Post by S-p-h-i-n-X » Tue Apr 10, 2007 2:14 am

Any one please ?

User avatar
Raimon
Former Team Member
Posts: 12088
Joined: Tue May 30, 2006 5:31 pm
Location: Netherlands
Name: Raimon Meuldijk
Contact:

Re: [2.0.15] Latest active topics on index

Post by Raimon » Tue Apr 10, 2007 7:51 am

S-p-h-i-n-X wrote: please help me out guys

I installed the mod but the block is blank and no scrolling text.

Ive run the sql

i dont see any thing in the acp :(

I cant add the index.php file because the forums disapear totally if i do.

I should say i have color mod cash mod and photo album and attachment mod all ready installed.

Please advise what i need to change or do thanx alot pros


Its sounds that you not successful edited your administration template file
Have you a link to your board where you have install this mod, so we can take a closer look into it :)
Need phpBB installation, extenstions, Styles or integrate phpBB with you website?
Contact me for fair prices and good service!

S-p-h-i-n-X
Registered User
Posts: 18
Joined: Tue Mar 20, 2007 1:18 am

Re: [2.0.15] Latest active topics on index

Post by S-p-h-i-n-X » Wed Apr 11, 2007 10:30 am

Ok thanx for the reply i will check the editd for the admin panel and try again then once ive reinstalled it and if it doesnt work again i can post a link to the site thank you.

Krank
Registered User
Posts: 179
Joined: Wed Sep 06, 2006 4:50 pm

Re: [2.0.15] Latest active topics on index

Post by Krank » Fri Apr 13, 2007 8:53 am

[REMOVED]
Image
phpBB3 Je t'adore: subSilver2 Based styles fan
proSilver, good, but too .... I don't know just too... :P

S-p-h-i-n-X
Registered User
Posts: 18
Joined: Tue Mar 20, 2007 1:18 am

Re: [2.0.15] Latest active topics on index

Post by S-p-h-i-n-X » Fri Apr 13, 2007 4:01 pm

ok amin file is edited correctly but still no scrolling text. I am using a dark theme would that matter?

onicdesigns
Registered User
Posts: 20
Joined: Sat Sep 30, 2006 10:53 pm

Re: [2.0.15] Latest active topics on index

Post by onicdesigns » Fri Apr 20, 2007 10:43 pm

Hi, I am looking for a MOD similiar to this one, but will allow the posts to be shown outside the phpBB templating system. i have a website that has the forum under a sub-domain of the main domain that is running a different software. i am basicly looking to paste a include(''); into php file into the main site and will show the latest posts in the phpBB forum area of the website.

Could someone PM a link to a MOD or HACk like that, please.

Post Reply

Return to “[2.0.x] MOD Database Cleanup”