phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

[Patch|Rejected] Dotted Topics showing unapproved posts

These RFCs were either rejected or have been replaced by an alternative proposal. They will not be included in phpBB.

[Patch|Rejected] Dotted Topics showing unapproved posts

Postby Comkid » Sat Mar 27, 2010 9:22 pm

Here is a link to the bug tracker: http://tracker.phpbb.com/browse/PHPBB3-9175

OPEN: includes/functions_display.php

FIND:

Code: Select all
global $user, $config; 


ADD AFTER:

Code: Select all
global $db; 


FIND:

Code: Select all
// Posted image?
        if (!empty($topic_row['topic_posted']) && $topic_row['topic_posted'])
        {
            $folder_img .= '_mine';
        } 


REPLACE WITH:

Code: Select all
$sql = 'SELECT *
                FROM '
 . POSTS_TABLE . "
                WHERE post_approved = 0 AND poster_id = '"
 . $user->data['user_id'] . "' AND topic_id = '" . $topic_row['topic_id'] . "'";
        
        $result 
= $db->sql_query($sql);
        
        if 
($result === false)
        {
            // Posted image?
            if (!empty($topic_row['topic_posted']) && $topic_row['topic_posted'])
            {
                $folder_img .= '_mine';
            }
        } 
Last edited by Comkid on Sat Mar 27, 2010 10:02 pm, edited 1 time in total.
Comkid
Registered User
 
Posts: 9
Joined: Tue Dec 15, 2009 10:30 am

Re: Dotted Topics showing unapproved posts

Postby bantu » Sat Mar 27, 2010 9:29 pm

Your suggestion is not going to work because the topic_status() function is called in a loop from viewforum.php

It would run n extra queries, where n is the number of topics being displayed.
User avatar
bantu
3.0 Release Manager
3.0 Release Manager
 
Posts: 439
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany

Re: Dotted Topics showing unapproved posts

Postby Comkid » Sat Mar 27, 2010 10:01 pm

What do you mean? Do you mean it will do too many excess SQL queries or it won't work literally?
Comkid
Registered User
 
Posts: 9
Joined: Tue Dec 15, 2009 10:30 am

Re: Dotted Topics showing unapproved posts

Postby bantu » Sat Mar 27, 2010 10:56 pm

Comkid wrote:What do you mean? Do you mean it will do too many excess SQL queries or it won't work literally?

Yeah, too many SQL queries. It does work, but it's nothing that should go into phpBB product.
User avatar
bantu
3.0 Release Manager
3.0 Release Manager
 
Posts: 439
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany

Re: Dotted Topics showing unapproved posts

Postby nickvergessen » Sun Mar 28, 2010 6:48 pm

This would also cause a topic were you have an approved and an unapproved post in, viewing as not replied.
cheers nickvergessen :geek:
Member of phpBB Development-Team
No Support via PM — My MODs for phpBB 3.0.x
User avatar
nickvergessen
Development Team
Development Team
 
Posts: 357
Joined: Sun Oct 07, 2007 11:54 am
Location: Esslingen, Germany


Return to [3.x] Rejected RFCs

Who is online

Users browsing this forum: No registered users and 0 guests