Page 1 of 1

Soft Delete Mod and Board3?

Posted: 6. January 2009 08:57
by rudolfpietersma
Your Portal Version: 1.0.2
Your phpBB Type: 3.0.4
MODs installed: Yes
Your knowledge: Basic Knowledge
Boardlink: http://prikbord.ilovebrasil.com

Description and Message
Hi,
I recently installed the Soft Delete Mod from http://www.lithiumstudios.org.
The problem is on the Portal these Soft Deleted messages are still visible.
Can somebody please help to solve this issue?

Rudolf.

Re: Soft Delete Mod and Board3?

Posted: 6. January 2009 14:25
by Ice
The portal would have to be modified to check for the new "deleted" check mark in the database, have a look through /portal/includes/functions.php in the phpbb_fetch_posts() function and see what you can find. I'll take a look after work.

Re: Soft Delete Mod and Board3?

Posted: 7. January 2009 13:39
by rudolfpietersma
Ice wrote:The portal would have to be modified to check for the new "deleted" check mark in the database, have a look through /portal/includes/functions.php in the phpbb_fetch_posts() function and see what you can find. I'll take a look after work.
Hi Ice,
I don't have that much knowledge. My experience is basic.
Would be great if you can check it for me!!

Cheers,
Rudolf.

Re: Soft Delete Mod and Board3?

Posted: 26. January 2009 08:17
by rudolfpietersma
Can somebody help me with this issue?

Re: Soft Delete Mod and Board3?

Posted: 5. March 2009 15:22
by rudolfpietersma
I'm still struggling with this issue, please help me :o

Re: Soft Delete Mod and Board3?

Posted: 5. March 2009 18:05
by Kevin
Not tested:

Open portal/includes/functions.php

search:

Code: Select all

            p.bbcode_bitfield,
            p.bbcode_uid, 
add after:

Code: Select all

            p.post_deleted, 

search:

Code: Select all

        'WHERE' => $topic_type . '
                ' . $post_time . '
                AND t.topic_status <> ' . ITEM_MOVED . '
                AND t.topic_approved = 1
                AND t.topic_moved_id = 0
                ' . $str_where,
                
        'ORDER_BY' => $topic_order, 
replace with:

Code: Select all

        'WHERE' => $topic_type . '
                ' . $post_time . '
                AND t.topic_status <> ' . ITEM_MOVED . '
                AND t.topic_approved = 1
                AND t.topic_moved_id = 0
                AND p.post_deleted = 0
                ' . $str_where,
                
        'ORDER_BY' => $topic_order, 
Dunno if this is enough, but it should keep the soft deleted topics away.

Re: Soft Delete Mod and Board3?

Posted: 5. March 2009 18:19
by rudolfpietersma
Kevin wrote:

Code: Select all

            p.post_deleted
Great stuff Kevin, it seems to work :-)

Though it needs a comma behind p.post_deleted
So:

Code: Select all

p.post_deleted,
Thanks a lot!

Re: Soft Delete Mod and Board3?

Posted: 5. March 2009 18:33
by Kevin
Ah, forgot that. Thanks, corrected. ;)

Re: Soft Delete Mod and Board3?

Posted: 5. March 2009 19:09
by rudolfpietersma
Hi Kevin,
I now do see in the "Recent Topics" block a soft deleted topic. Is there a same kind of way to hide it?

Rudolf.

Re: Soft Delete Mod and Board3?

Posted: 5. March 2009 22:05
by Kevin
Yes, open portal/block/recent.php

*edit*
removed wrong code - see a few posts further

Re: Soft Delete Mod and Board3?

Posted: 6. March 2009 08:28
by rudolfpietersma
Kevin,
I'm getting a SQL error.

Code: Select all

SQL ERROR [ mysqli ]

Unknown column 'p.post_deleted' in 'where clause' [1054]

SQL

SELECT topic_title, forum_id, topic_id FROM phpbb_topics WHERE topic_status <> 2 AND topic_approved = 1 AND topic_type = 0 AND topic_moved_id = 0 AND p.post_deleted = 0 ORDER BY topic_time DESC LIMIT 10

Re: Soft Delete Mod and Board3?

Posted: 6. March 2009 12:46
by Kevin
Yar, wrong edit, as i thought about it.
I'll provide a correct code this evening.

Re: Soft Delete Mod and Board3?

Posted: 8. March 2009 18:28
by rudolfpietersma
Hi Kevin,
Did you have some time to think about the correct code?

Cheers,
Rudolf.

Re: Soft Delete Mod and Board3?

Posted: 8. March 2009 23:01
by Kevin
Hi Rudolf,

sorry - forgot about that. Now the code, that should work:
Open portal/block/recent.php

search:

Code: Select all

//
// Recent topic (only show normal topic)
//
$sql = 'SELECT topic_title, forum_id, topic_id
    FROM ' . TOPICS_TABLE . '
    WHERE topic_status <> ' . ITEM_MOVED . '
        AND topic_approved = 1 
        AND topic_type = ' . POST_NORMAL . '
        AND topic_moved_id = 0
        ' . $sql_where . '
    ORDER BY topic_time DESC';  
replace with:

Code: Select all

//
// Recent topic (only show normal topic)
//
$sql = 'SELECT topic_title, forum_id, topic_id
    FROM ' . TOPICS_TABLE . '
    WHERE topic_status <> ' . ITEM_MOVED . '
        AND topic_approved = 1 
        AND topic_type = ' . POST_NORMAL . '
        AND topic_moved_id = 0
        AND topic_deleted = 0
        ' . $sql_where . '
    ORDER BY topic_time DESC';  

You can add the line

Code: Select all

AND topic_deleted = 0
to the "recent hot topics" and "recent announcements" too.

Cheers

Kevin

Re: Soft Delete Mod and Board3?

Posted: 9. March 2009 21:25
by rudolfpietersma
Kevin,
Tnx a lot, that worked just great!