[MODDB] Prime Trash Bin - Keep deleted topics & posts

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning
Locked
Kharon
Registered User
Posts: 235
Joined: Thu Oct 26, 2006 5:27 pm

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by Kharon »

I updated 1.0.5 to 1.0.6 .. some errors

viewforum.php

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/prime_trash_bin.php on line 225: Undefined index: PRIME_TOPIC_DELETED_TITLE
[phpBB Debug] PHP Notice: in file /includes/prime_trash_bin.php on line 225: Undefined index: PRIME_TOPIC_DELETED_TITLE_SEP
line 225

Code: Select all

$title = $user->lang['PRIME_TOPIC_DELETED_TITLE'] . (empty($title) ? '' : $user->lang['PRIME_TOPIC_DELETED_TITLE_SEP']) . $title;
viewtopic.php

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/prime_trash_bin.php on line 351: Undefined index: PRIME_POST_DELETED_TITLE
[phpBB Debug] PHP Notice: in file /includes/prime_trash_bin.php on line 351: Undefined index: PRIME_POST_DELETED_TITLE_SEP
line 351

Code: Select all

$title = $user->lang['PRIME_POST_DELETED_TITLE'] . (empty($title) ? '' : $user->lang['PRIME_POST_DELETED_TITLE_SEP']) . $title;

thanks
User avatar
zkaraca
Registered User
Posts: 139
Joined: Wed Jan 30, 2008 7:52 pm

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by zkaraca »

I have version 0.2.18 of this mod installed. Now i'd like to update, but there is no update starting from this version in the contrib folder. There is an update from 0.2.16 to 0.2.17 and the next one is 0.2.20 to 1.0.0

What should i do? Undo all changes and install new version? I hope not :D
Asira.nl * Zeki.nl Just having some fun!
User avatar
zkaraca
Registered User
Posts: 139
Joined: Wed Jan 30, 2008 7:52 pm

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by zkaraca »

*Bump*

Please, could someone help me with this problem?
Asira.nl * Zeki.nl Just having some fun!
User avatar
primehalo
Former Team Member
Posts: 2903
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by primehalo »

Kharon wrote:I updated 1.0.5 to 1.0.6 .. some errors

viewforum.php

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/prime_trash_bin.php on line 225: Undefined index: PRIME_TOPIC_DELETED_TITLE
[phpBB Debug] PHP Notice: in file /includes/prime_trash_bin.php on line 225: Undefined index: PRIME_TOPIC_DELETED_TITLE_SEP
line 225

Code: Select all

$title = $user->lang['PRIME_TOPIC_DELETED_TITLE'] . (empty($title) ? '' : $user->lang['PRIME_TOPIC_DELETED_TITLE_SEP']) . $title;
viewtopic.php

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/prime_trash_bin.php on line 351: Undefined index: PRIME_POST_DELETED_TITLE
[phpBB Debug] PHP Notice: in file /includes/prime_trash_bin.php on line 351: Undefined index: PRIME_POST_DELETED_TITLE_SEP
line 351

Code: Select all

$title = $user->lang['PRIME_POST_DELETED_TITLE'] . (empty($title) ? '' : $user->lang['PRIME_POST_DELETED_TITLE_SEP']) . $title;

thanks
Sounds like you need to copy over the latest versions of the language files.
zkaraca wrote:I have version 0.2.18 of this mod installed. Now i'd like to update, but there is no update starting from this version in the contrib folder. There is an update from 0.2.16 to 0.2.17 and the next one is 0.2.20 to 1.0.0

What should i do? Undo all changes and install new version? I hope not :D
You would use update 0.2.20 to 1.0.0.xml, then update 1.0.4 to 1.0.5.xml, and finally update 1.0.5 to 1.0.6.xml. Or do like you said and remove everything then start over.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
XToF.be
Registered User
Posts: 61
Joined: Thu Jun 28, 2007 10:52 am
Contact:

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by XToF.be »

When installing this mod on my board, I can't find the following line in the search.php file:

Code: Select all

'U_VIEW_POST'		=> (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . (($u_hilit) ? '&hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '')
			));
I can only find the following line instead:

Code: Select all

'U_VIEW_POST'        => format_url($topic_title, "t$result_topic_id")
What could be the reason for this?
User avatar
Sunka
Registered User
Posts: 566
Joined: Wed Mar 26, 2008 2:48 pm
Location: Croatia, Zvoneca

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by Sunka »

Primehalo, please look this topic...

Could you help?
User avatar
primehalo
Former Team Member
Posts: 2903
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by primehalo »

Sunka wrote:OK, I create test user...set him as Moderator and try to delete post through MCP...

This SQL error show

Code: Select all

General Error
SQL ERROR [ mysqli ]

[0]

SQL

No values specified for SQL IN comparison

BACKTRACE


FILE: includes/db/dbal.php
LINE: 385
CALL: dbal->sql_error()

FILE: includes/prime_trash_bin_2.php
LINE: 699
CALL: dbal->sql_in_set()

FILE: includes/prime_trash_bin_2.php
LINE: 839
CALL: can_posts_be_stifled()

FILE: includes/mcp/mcp_main.php
LINE: 144
CALL: mcp_stifle_post()

FILE: includes/functions_module.php
LINE: 471
CALL: mcp_main->main()

FILE: mcp.php
LINE: 252
CALL: p_master->load_active()

Your error is saying that $post_ids is empty inside the can_posts_be_stifled() function:

Code: Select all

            $sql = 'SELECT post_id'
                    . ' FROM ' . POSTS_TABLE
                    . ' WHERE (post_deleted_time = 0 AND post_approved > 0)'
                    . ' AND ' . $db->sql_in_set('post_id', $post_ids);
 
That function is only every called by the mcp_stifle_post() function:

Code: Select all

        if (empty($post_ids))
        {
            trigger_error($user->lang['NO_POST_SELECTED']);
        }
        $user->add_lang('mcp');
        $post_ids = is_array($post_ids) ? $post_ids : array($post_ids);
        $can_full_delete = check_ids($post_ids, POSTS_TABLE, 'post_id', array('a_', 'm_delete_forever'));

        // Check if posts are already marked as deleted or if the delete forever checkbox was selected.
        if (!($can_be_stifled = can_posts_be_stifled($post_ids)) || request_var('delete_forever', false))
        { 
However, as you can see, before it calls the function it checks to see if $post_ids is empty, and if it is then it returns with a message. Thus, I have no idea how you could be getting that SQL error. But here's an attempted fix if you like. In includes/prime_trash_bin_2.php, find:

Code: Select all

        $post_ids = !is_array($post_ids) ? array($post_ids) : $post_ids;
        $sql = 'SELECT post_id'
                . ' FROM ' . POSTS_TABLE
                . ' WHERE (post_deleted_time = 0 AND post_approved > 0)'
                . ' AND ' . $db->sql_in_set('post_id', $post_ids);
        $result = $db->sql_query($sql);
        $safe_deletable_count = $db->sql_affectedrows();
        $db->sql_freeresult($result);
        return(($safe_deletable_count === count($post_ids)) ? true : $safe_deletable_count); 
Replace with:

Code: Select all

        $post_ids = !is_array($post_ids) ? array($post_ids) : $post_ids;
        $post_ids_count = sizeof($post_ids);
        $safe_deletable_count = 0;
        if ($post_ids_count > 0)
        {
            $sql = 'SELECT post_id'
                    . ' FROM ' . POSTS_TABLE
                    . ' WHERE (post_deleted_time = 0 AND post_approved > 0)'
                    . ' AND ' . $db->sql_in_set('post_id', $post_ids);
            $result = $db->sql_query($sql);
            $safe_deletable_count = $db->sql_affectedrows();
            $db->sql_freeresult($result);
        }
        return(($safe_deletable_count === $post_ids_count) ? true : $safe_deletable_count); 
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
Sunka
Registered User
Posts: 566
Joined: Wed Mar 26, 2008 2:48 pm
Location: Croatia, Zvoneca

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by Sunka »

Now it is OK...
Thank you Primehalo
chris666uk1
Registered User
Posts: 28
Joined: Wed Mar 23, 2005 9:28 pm

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by chris666uk1 »

1.0.6 error with php 3.0.2

Code: Select all

Fatal error: Unknown function: get_trash_forum() in /home/warezaao/public_html/includes/acp/acp_board.php on line 93
any ideas please
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by IPB_Refugee »

Hello,

that means, that you have either not included the file where function get_trash_forum() is defined in includes/acp/acp_board.php (or you haven't uploaded acp_board.php) or you didn't upload the file prime_trash_bin_2.php to the correct folder on your webspace (it should be the includes folder).

So please check your edits of includes/acp/acp_board.php and your uploaded files.

Regards
Wolfgang
chris666uk1
Registered User
Posts: 28
Joined: Wed Mar 23, 2005 9:28 pm

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by chris666uk1 »

redone the mod from scratch now it woks my bad thanks for help
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by IPB_Refugee »

Hello Ken,

I have a feature request:

It would be nice to be able to delete all "soft" deleted posts at once. (let's say when you are a founder).

During the last months soft deleted posts accumulated all over my board and after deleting the moderator log it would be rather hard for me to find the soft deleted posts and to delete them one by one.

Regards
Wolfgang
User avatar
primehalo
Former Team Member
Posts: 2903
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by primehalo »

I would agree with you there, but since the next release of phpbb is going to get a Trash Bin style feature, I think I'm going to wait and see how that goes. No sense in spending a lot of time writing code that won't matter shortly time down the road.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by IPB_Refugee »

You are absolutely right. We shouldn't waste our time.
Let's see what phpbb 3.0.3 has to offer. If I read your words correctly, the new version of phpBB will not be released in a far-off future. 8-)

Regards
Wolfgang
User avatar
spaceace
Registered User
Posts: 1994
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: [BETA] Prime Trash Bin - Keep deleted topics & posts

Post by spaceace »

i just hope that the phpbb version works as good as yours does :roll:
Locked

Return to “[3.0.x] MODs in Development”