Having issues with tables.

Anti-spam MOD for phpBB3, extension for phpbb3.1
redmanuy
Posts: 11
Joined: 14 Aug 2014, 17:49
Has thanked: 2 times
Been thanked: 2 times

Re: Having issues with tables.

Unread post by redmanuy » 18 Aug 2014, 11:41

Do I just run Alter or a specific command?

User avatar
shagimuratov
Administrator
Posts: 1115
Joined: 16 Mar 2011, 12:51
Has thanked: 158 times
Been thanked: 67 times
Contact:

Re: Having issues with tables.

Unread post by shagimuratov » 18 Aug 2014, 12:22

Just alter please.

Code: Select all

ALTER TABLE `phpbb_users` DROP `ct_request_id`;
ALTER TABLE `phpbb_posts` DROP `ct_request_id`;
WBR
Denis Shagimuratov
Project leader

redmanuy
Posts: 11
Joined: 14 Aug 2014, 17:49
Has thanked: 2 times
Been thanked: 2 times

Re: Having issues with tables.

Unread post by redmanuy » 18 Aug 2014, 15:20

SQL query:

ALTER TABLE `phpbb_posts` DROP `ct_request_id` ;


MySQL said: Documentation

#1091 - Can't DROP 'ct_request_id'; check that column/key exists


I think those tables dont contain the ct_* columns.... so I am assuming the installation is failing to create them.

User avatar
shagimuratov
Administrator
Posts: 1115
Joined: 16 Mar 2011, 12:51
Has thanked: 158 times
Been thanked: 67 times
Contact:

Re: Having issues with tables.

Unread post by shagimuratov » 18 Aug 2014, 16:54

Yes, you are right. The tables didn't patched by Automod/UMIL.

I don't know why, but Automod can't execute SQL code for your webiste. Google has several same cases,

https://www.google.com/search?client=sa ... 8&oe=UTF-8

Any way, lets try patch database from command line. Please follow this steps,

1. Execute this code,

Code: Select all

ALTER TABLE `phpbb_users` ADD `ct_request_id` CHAR(32) NULL ;
ALTER TABLE `phpbb_posts` ADD `ct_request_id` CHAR(32) NULL ;
2. Create dummy new user/new post.

3. Delete new user/post.

Does it help? The error gone?
WBR
Denis Shagimuratov
Project leader

redmanuy
Posts: 11
Joined: 14 Aug 2014, 17:49
Has thanked: 2 times
Been thanked: 2 times

Re: Having issues with tables.

Unread post by redmanuy » 18 Aug 2014, 18:09

Will do and let u know. Thks for the prompt replies!
These users thanked the author redmanuy for the post:
shagimuratov (18 Aug 2014, 18:22)
Rating: 50%

redmanuy
Posts: 11
Joined: 14 Aug 2014, 17:49
Has thanked: 2 times
Been thanked: 2 times

Re: Having issues with tables.

Unread post by redmanuy » 18 Aug 2014, 20:42

ALTER TABLE `phpbb_posts` ADD `ct_request_id` CHAR(32) NULL ;

This one is timing out. I dont have access to my.ini or my.cfg to raise time out limit or package sizes.... godaddy sucks (if you know how to do this with phpbadmin in godaddy let me know pls).

Thanks,

Gabe

User avatar
shagimuratov
Administrator
Posts: 1115
Joined: 16 Mar 2011, 12:51
Has thanked: 158 times
Been thanked: 67 times
Contact:

Re: Having issues with tables.

Unread post by shagimuratov » 19 Aug 2014, 09:39

Well, it's better than before :)

I don't way how to rise mysql timeouts via phpbb source code. So, we can try depatch some phpbb files to resolve issue with posts. Please follow this steps,

1. Delete code from PHPBB_ROOT/posting.php,

Code: Select all

            // Begin : Cleantalk. Spam protect
            if (isset($ct_result->id))
            {
                $sql = 'UPDATE ' . POSTS_TABLE . '
                            SET ct_request_id = \'' . $db->sql_escape($ct_result->id) . '\'
                            WHERE post_id = ' . $db->sql_escape($data['post_id']);
                $db->sql_query($sql);
            }
            // End: Cleantalk. Spam protect

Code: Select all

            // Begin: Cleantalk. Spam protect
            $sql = 'SELECT ct_request_id
			FROM ' . POSTS_TABLE . '
			WHERE post_id = ' . (int) $post_id;

            $result	= $db->sql_query($sql);
            $row = $db->sql_fetchrow($result);
            $ct_request_id = $row['ct_request_id'];

            if (!empty($ct_request_id))
            {
                if (!class_exists('Cleantalk'))
                {
                    include($phpbb_root_path . 'includes/cleantalk.class.' . $phpEx);
                }
                if (!function_exists('ct_error_mail'))
                {
                    include($phpbb_root_path . 'includes/cleantalk.' . $phpEx);
                }
				$ct					 = new Cleantalk();
				$ct->work_url		 = $config['ct_work_url'];
				$ct->server_url		 = $config['ct_server_url'];
				$ct->server_ttl		 = $config['ct_server_ttl'];
				$ct->server_changed	 = $config['ct_server_changed'];

				$ct_request				 = new CleantalkRequest();
				$ct_request->auth_key	 = $config['ct_auth_key'];
				$ct_request->feedback	 = $ct_request_id . ':0';

				$ct_result = $ct->sendFeedback($ct_request);
				if ($ct->server_change)
				{
					set_config('ct_work_url', $ct->work_url);
					set_config('ct_server_ttl', $ct->server_ttl);
					set_config('ct_server_changed', time());
				}

				if ($ct_result->errno > 0)
				{
					ct_error_mail($ct_result->errstr);
				}
			}
			// End: Cleantalk. Spam protect
2. Delete code from PHPBB_ROOT/includes/mcp/mcp_main.php,

Code: Select all

		// Begin: Cleantalk. Spam protect
		if ($config['ct_enable'])
		{
            if (!class_exists('Cleantalk'))
            {
                include($phpbb_root_path . 'includes/cleantalk.class.' . $phpEx);
            }
            $ct = new Cleantalk();
            $ct->work_url = $config['ct_work_url'];
            $ct->server_url = $config['ct_server_url'];
            $ct->server_ttl = $config['ct_server_ttl'];
            $ct->server_changed = $config['ct_server_changed'];

            $ct_request = new CleantalkRequest();
            $ct_feedback_moderate = null;

            $ct_post_ids = implode(',', $post_ids);
            $sql = 'SELECT ct_request_id
                FROM ' . POSTS_TABLE . '
                WHERE ' . $db->sql_in_set('post_id', $ct_post_ids);


            $result	 = $db->sql_query($sql);
            while ($row	= $db->sql_fetchrow($result))
            {
                if (!empty($row['ct_request_id']))
                {
                    $ct_feedback_moderate .= $row['ct_request_id'] . ':0;';
                }
            }

            $ct_request->feedback = $ct_feedback_moderate;
            $ct_request->auth_key = $config['ct_auth_key'];

            $ct_result = $ct->sendFeedback($ct_request);

            if ($ct->server_change)
            {
                set_config('ct_work_url', $ct->work_url);
                set_config('ct_server_ttl', $ct->server_ttl);
                set_config('ct_server_changed', time());
            }
        }
		// End: Cleantalk. Spam protect
3. Do dummy post under Newly registered account.
4. Remove dummy post under moderatro/admin account. You shouldn't get any errors.

Does it help?

PS
Registrations works well. My dummy account cleantalk passed.
WBR
Denis Shagimuratov
Project leader

redmanuy
Posts: 11
Joined: 14 Aug 2014, 17:49
Has thanked: 2 times
Been thanked: 2 times

Re: Having issues with tables.

Unread post by redmanuy » 25 Aug 2014, 03:13

Havent forgotten, just a little sick, will change that as soon as I back on my feet and will let you know.

User avatar
shagimuratov
Administrator
Posts: 1115
Joined: 16 Mar 2011, 12:51
Has thanked: 158 times
Been thanked: 67 times
Contact:

Re: Having issues with tables.

Unread post by shagimuratov » 25 Aug 2014, 08:27

It's ok, thank you for keeping me updated.
WBR
Denis Shagimuratov
Project leader

Locked