[ABD] Latest Posts

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
TheUniqueTiger
Registered User
Posts: 303
Joined: Wed Sep 05, 2007 7:57 pm
Location: India
Contact:

Re: [RC] Latest Posts

Post by TheUniqueTiger » Sat Dec 22, 2007 10:16 pm

Its meant to look like the text in the birthday list and whos online list... as shown in the screenshot. It shows each post on just a single line, so the rounded corners display won't look that good for just some 5 lines of text, isn't it... However you may customize your installation as you wish.
You have only One Life... So before you are History, make sure you make it to the History books! - TheUniqueTiger

User avatar
GurlzLubme
Registered User
Posts: 880
Joined: Wed Sep 01, 2004 11:21 am
Location: New York

Re: [RC] Latest Posts

Post by GurlzLubme » Sat Dec 22, 2007 11:06 pm

I'd like to learn how. Could you show me? I'd appreciate it. Thanks.
1,000,000 Thank Yous to everyone who's been helping me on phpbb.com!

User avatar
TheUniqueTiger
Registered User
Posts: 303
Joined: Wed Sep 05, 2007 7:57 pm
Location: India
Contact:

Re: [RC] Latest Posts

Post by TheUniqueTiger » Sun Dec 23, 2007 7:22 am

GurlzLubme wrote:I'd like to learn how. Could you show me? I'd appreciate it. Thanks.
What I meant to say was having the latest posts displayed like the topics list in a forum would not look good as its only the post title and link, the forum link, the username-link and the post time... There are other MODs which show the latest posts like you want (like Recent Topics etc...)
You have only One Life... So before you are History, make sure you make it to the History books! - TheUniqueTiger

User avatar
simple12
Registered User
Posts: 84
Joined: Fri Jun 01, 2007 7:39 am
Location: Varanasi, India

Re: [RC] Latest Posts

Post by simple12 » Sun Dec 23, 2007 3:22 pm

I tried the new release candidate {1.0.0.RC2} and still getting theses errors on my localhost. I have only installed this mod on the fresh installation of phpbb3.

Code: Select all

[phpBB Debug] PHP Notice: in file /index.php on line 98: Undefined index: 0
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3391: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3393: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3394: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3395: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)

Line no. 98 of index.php goes as....

Code: Select all

$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';

//MOD Latest Posts
//check whether all conditions are met before proceeding to show latest posts
if ($config['latest_posts'] && ($config['allow_guests_latest_posts'] || $user->data['is_registered']) && $config['num_posts'])
{		
	//get in an array all the readable forums
	$forum_ary = array();

	// include those forums the user is having read access to...
	$forum_read_ary = $auth->acl_getf('f_read');

	foreach ($forum_read_ary as $forum_id => $is_allowed)
	{
		if ($is_allowed['f_read'])
		{
			$forum_ary[] = (int) $forum_id;
		}
	}
	$forum_ary = array_unique($forum_ary);
	$forum_ary[] = 0; //for global topics
	$first_readable_forum = isset($forum_ary[0]) ? $forum_ary[0] : false; //again for global topics
	$forum_sql = ' AND ' . $db->sql_in_set("p.forum_id", $forum_ary, false, true);	
	
	//free some memory
	unset($forum_ary);
	unset($forum_read_ary);
	
	//the sql query... we combine data from the 3 tables (for data about post subject, poster, time ... username, user colour ... 
	//and forum name)
	//only approved posts from readable forums are chosen
	//user can view the subject, username, forum name and post time along with appropriate links...	
	if ($first_readable_forum)
	{
		$sql = 'SELECT p.post_id, p.topic_id, p.forum_id, p.poster_id, p.icon_id, p.post_time, p.post_subject, u.username, u.user_colour, f.forum_name
			FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u, ' . FORUMS_TABLE . ' f 
			WHERE p.post_approved = 1
				AND p.poster_id = u.user_id ' . '			
				AND (p.forum_id = f.forum_id OR (p.forum_id = 0 AND f.forum_id = ' . $first_readable_forum . ')) ' . $forum_sql .
		' ORDER BY p.post_id DESC';
		
		//query the db
		$result = $db->sql_query_limit($sql, $config['latest_posts']);
		
		$latest_posts = array();
		while ($latest_post = $db->sql_fetchrow($result))
		{		
			$latest_posts[] = $latest_post;
		}
		$db->sql_freeresult($result);
		if (sizeof($latest_posts))
		{
			$template->assign_var('S_SHOW_LATEST_POSTS', true); //assign the template to show latest posts section
			//get the post icons
			$post_icons = $cache->obtain_icons();
			//loop to display each of the latest posts			
			foreach ($latest_posts as $latest_post)
			{
				$template->assign_block_vars('latest_post_row', array(
				'POST_TIME' => $user->format_date($latest_post['post_time']),
				'POST_SUBJECT' => $latest_post['post_subject'] != '' ? $latest_post['post_subject'] : '(No Subject)',
// Line 98 is this	   'POST_ICON_IMG' => $post_icons[$latest_post['icon_id']]['img'],
     				'POST_AUTHOR_FULL' => get_username_string('full', $latest_post['poster_id'], $latest_post['username'], $latest_post['user_colour']),				
				'U_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", (($latest_post['forum_id']) ? 'f=' . $latest_post['forum_id'] . '&' : '') . 't=' . $latest_post['topic_id'] . '&p=' . $latest_post['post_id']) . '&#p' . $latest_post['post_id'],
				'FORUM_NAME' => $latest_post['forum_name'],
				'U_FORUM' => ($latest_post['forum_id']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $latest_post['forum_id']) : '',
				'IS_GLOBAL'	=> (!$latest_post['forum_id']),
				));		
			}
			unset($post_icons);
			unset($latest_posts);
			unset($latest_post);
		}
	}
}
//end MOD


// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
	$sql = 'SELECT group_id, group_name, group_colour, group_type
		FROM ' . GROUPS_TABLE . '
		WHERE group_legend = 1
		ORDER BY group_name ASC';
}
else
{
Thanks for the help.

User avatar
TheUniqueTiger
Registered User
Posts: 303
Joined: Wed Sep 05, 2007 7:57 pm
Location: India
Contact:

Re: [RC] Latest Posts

Post by TheUniqueTiger » Sun Dec 23, 2007 4:05 pm

Aaargh how did I forget that... Please do the following edit... I have in fact copy pasted most of the things from the first version... Its actually fixed over here...

Replace that line with... (its actually a single line)

Code: Select all

'POST_ICON_IMG' => ($latest_post['icon_id']) ? $post_icons[$latest_post['icon_id']]['img'] : '',
You have only One Life... So before you are History, make sure you make it to the History books! - TheUniqueTiger

User avatar
simple12
Registered User
Posts: 84
Joined: Fri Jun 01, 2007 7:39 am
Location: Varanasi, India

Re: [RC] Latest Posts

Post by simple12 » Sun Dec 23, 2007 6:01 pm

Haa, NIce to see that good programmer also forget some things. I am not the single one.

ok done,

Now working as smooth as knife cut butter.

User avatar
GurlzLubme
Registered User
Posts: 880
Joined: Wed Sep 01, 2004 11:21 am
Location: New York

Re: [RC] Latest Posts

Post by GurlzLubme » Mon Dec 24, 2007 12:56 am

TheUniqueTiger wrote:Aaargh how did I forget that... Please do the following edit... I have in fact copy pasted most of the things from the first version... Its actually fixed over here...

Replace that line with... (its actually a single line)

Code: Select all

'POST_ICON_IMG' => ($latest_post['icon_id']) ? $post_icons[$latest_post['icon_id']]['img'] : '',


Wait, replace which line with this?

And is this the reason why I don't see my Delete or Report Topic icons? :(
1,000,000 Thank Yous to everyone who's been helping me on phpbb.com!

User avatar
simple12
Registered User
Posts: 84
Joined: Fri Jun 01, 2007 7:39 am
Location: Varanasi, India

Re: [RC] Latest Posts

Post by simple12 » Mon Dec 24, 2007 5:20 am

GurlzLubme wrote:
TheUniqueTiger wrote:Aaargh how did I forget that... Please do the following edit... I have in fact copy pasted most of the things from the first version... Its actually fixed over here...

Replace that line with... (its actually a single line)

Code: Select all

'POST_ICON_IMG' => ($latest_post['icon_id']) ? $post_icons[$latest_post['icon_id']]['img'] : '',


Wait, replace which line with this?
Till the pacakage is updated you can do this..

After installing the mod open

index.php

find

Code: Select all

'POST_ICON_IMG' => $post_icons[$latest_post['icon_id']]['img'],
Replace that line with the one you mentioned.

User avatar
TheUniqueTiger
Registered User
Posts: 303
Joined: Wed Sep 05, 2007 7:57 pm
Location: India
Contact:

Re: [RC] Latest Posts

Post by TheUniqueTiger » Mon Dec 24, 2007 6:59 am

GurlzLubme wrote:
TheUniqueTiger wrote:Aaargh how did I forget that... Please do the following edit... I have in fact copy pasted most of the things from the first version... Its actually fixed over here...

Replace that line with... (its actually a single line)

Code: Select all

'POST_ICON_IMG' => ($latest_post['icon_id']) ? $post_icons[$latest_post['icon_id']]['img'] : '',


Wait, replace which line with this?

And is this the reason why I don't see my Delete or Report Topic icons? :(
Replace the line having POST_ICON_IMG with the one above.

This MOD is not the reason why you are not seeing those icons... This only edits the index.php file and not the viewtopic.php file which shows those icons.
You have only One Life... So before you are History, make sure you make it to the History books! - TheUniqueTiger

Bilo1000
Registered User
Posts: 11
Joined: Sun Jun 01, 2003 7:15 pm
Location: Normandie
Contact:

Re: [RC] Latest Posts

Post by Bilo1000 » Mon Dec 24, 2007 1:21 pm

Whaooooooooooo
I've just followed your instructions on my fresh phpbb3 gold installation , and everythings look great !!!!!)

Hey , you've showed us how such master you are :)

Good work , and as we say in france : "Maintenant tu peux te la raconter :)"

User avatar
TheUniqueTiger
Registered User
Posts: 303
Joined: Wed Sep 05, 2007 7:57 pm
Location: India
Contact:

Re: [RC] Latest Posts

Post by TheUniqueTiger » Mon Dec 24, 2007 3:42 pm

Bilo1000 wrote:Whaooooooooooo
I've just followed your instructions on my fresh phpbb3 gold installation , and everythings look great !!!!!)

Hey , you've showed us how such master you are :)

Good work , and as we say in france : "Maintenant tu peux te la raconter :)"
Well, thanks for the compliments!
You have only One Life... So before you are History, make sure you make it to the History books! - TheUniqueTiger

emupaul
Registered User
Posts: 9
Joined: Sun Dec 23, 2007 1:31 am

Re: [RC] Latest Posts

Post by emupaul » Mon Dec 24, 2007 4:46 pm

thank u for such a woderfull mod, just installed and put on top of forum just above first forum topics and it looks so good! just what i needed... no problems found yet.

jimcarrel
Registered User
Posts: 671
Joined: Fri Jul 27, 2007 10:49 pm
Location: Oklahoma City, Oklahoma

Re: [RC] Latest Posts

Post by jimcarrel » Mon Dec 24, 2007 5:15 pm

emupaul, how did you get it above the forum lists (this is on the index page, I assume)
I tried that and it looked horrible, can you supply the edit where you put it, Please?
Grace--Getting what I don't deserve
Mercy--Not getting what I do deserve

User avatar
TheUniqueTiger
Registered User
Posts: 303
Joined: Wed Sep 05, 2007 7:57 pm
Location: India
Contact:

Re: [RC] Latest Posts

Post by TheUniqueTiger » Mon Dec 24, 2007 5:45 pm

I think he placed the block (in index.php) before the line

Code: Select all

<!-- INCLUDE forumlist_body.html -->
instead of its intended location.
You have only One Life... So before you are History, make sure you make it to the History books! - TheUniqueTiger

jimcarrel
Registered User
Posts: 671
Joined: Fri Jul 27, 2007 10:49 pm
Location: Oklahoma City, Oklahoma

Re: [RC] Latest Posts

Post by jimcarrel » Mon Dec 24, 2007 6:49 pm

TheUniqueTiger wrote:I think he placed the block (in index.php) before the line

Code: Select all

<!-- INCLUDE forumlist_body.html -->
instead of its intended location.
I'm a little confused now, I have no <!--xxx--> whatsoever in my index.php
I do in the viewforum_body.html under styles.
Tis okay tho, cause I did find something while digging, (an edit i misplaced for another mod) that I needed to fix.
Cheers and thanks
Grace--Getting what I don't deserve
Mercy--Not getting what I do deserve

Locked

Return to “[3.0.x] Abandoned MODs”