vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Miscellaneous Hacks - PS - Delete All Visitor Messages Every 30 Days (https://vborg.vbsupport.ru/showthread.php?t=174737)

PaulSonny 03-31-2008 11:06 PM

Quote:

Originally Posted by Boofo (Post 1479521)
I was thinking more like a setting so you could run it at 180 days if you wanted to.

But, no biggie, I'll make a hack to do a setting for me. Good job, though. ;)

If you do manage to make a jack which will allow you to run the scheduled task every 180 days I would be eternally grateful if you would either help me improve this modification or show me the code you create?

Thanks, Paul.

Boofo 03-31-2008 11:08 PM

I will do that, sir. ;)

Jase2 03-31-2008 11:23 PM

adafsfs

PaulSonny 03-31-2008 11:28 PM

Quote:

Originally Posted by Jase2 (Post 1479540)
Just been testing this Paul, and received the following error:

Database error in vBulletin 3.7.0 Release Candidate 1:

Invalid SQL:
DELETE FROM visitormessage;

MySQL Error : Table 'user_vbulletin.visitormessage' doesn't exist
Error Number : 1146
Date : Monday, March 31st 2008 @ 05:22:20 PM
Script : http://www.techsupportteam.org/forum...cron&cronid=25
Referrer : http://www.techsupportteam.org/forum....php?do=modify
IP Address : 82.16.245.186
Username : Jason
Classname : vb_database
MySQL Version : 5.0.27-standard

It's saying it doesn't exist, when it quite clearly does. Any ideas?

Regards Jason :)

I think I know why, but to confirm my thoughts, do you use a Table Prefix?

Thanks, Paul.

Jase2 03-31-2008 11:30 PM

Yes, I do. :)

I thought that may be the problem too. I'll need to edit it right, and include my table prefix? Which code would I edit? But there again, it's added my table prefix above -- it's just saying it can find it.

EDIT: I see this in the .php file:


Code:

$vbulletin->db->query_write("DELETE FROM visitormessage");
I believe I need to add my prefix at the beginning so it looks like this:


Code:

$vbulletin->db->query_write("DELETE FROM prefix.visitormessage");
Correct?

Regards Jason :)

Boofo 03-31-2008 11:51 PM

Nope you need this:

$vbulletin->db->query_write("DELETE FROM ".TABLE_PREFIX."visitormessage");

Jase2 03-31-2008 11:57 PM

Did that! It now brings the following error:

Quote:

Parse error: syntax error, unexpected T_STRING in /home/user/public_html/forum/includes/cron/visitormessagedelete.php on line 15
Regards Jason :)

Boofo 04-01-2008 12:16 AM

$vbulletin->db->query_write('DELETE FROM ".TABLE_PREFIX."visitormessage');

My bad.

PaulSonny 04-01-2008 12:25 AM

$vbulletin->db->query_write('DELETE FROM ".TABLE_PREFIX."visitormessage');

Yeah this should work, sorry about the table_prefix error, with me not using a table prefix myself I forgot.

Thanks, Paul.

Jase2 04-01-2008 12:25 AM

That produces the following:


All times are GMT. The time now is 09:36 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01066 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete