[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.
Post Reply
Comkid
Registered User
Posts: 9
Joined: Tue Dec 15, 2009 10:30 am

[Patch|Rejected] Dotted Topics showing unapproved posts

Post by Comkid »

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.

User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 557
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany
Contact:

Re: Dotted Topics showing unapproved posts

Post by bantu »

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.

Comkid
Registered User
Posts: 9
Joined: Tue Dec 15, 2009 10:30 am

Re: Dotted Topics showing unapproved posts

Post by Comkid »

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

User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 557
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany
Contact:

Re: Dotted Topics showing unapproved posts

Post by bantu »

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
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: Dotted Topics showing unapproved posts

Post by nickvergessen »

This would also cause a topic were you have an approved and an unapproved post in, viewing as not replied.
Member of the Development-TeamNo Support via PM

Post Reply