vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Is there an auto - purge for PM's? (https://vborg.vbsupport.ru/showthread.php?t=301961)

snakes1100 09-13-2013 06:27 PM

Yes, i tested for a client, thats why i posted what i did & thats why it was rewrote because of that issue.

smirkley 09-13-2013 06:44 PM

Is the rewrite in the latest download?
Or did you rewrite it for your client?
(and if so could you point me to the area to be rewritten?)

snakes1100 09-13-2013 07:10 PM

No, sorry its a private script rewrite that wasnt released here.

kh99 09-13-2013 07:17 PM

Quote:

Originally Posted by smirkley (Post 2445393)
Which is why I used an = and then the ( 0, -1) in my first suggested example.


I see. It's IN (1, 2, 3) to check for one of a number of values, but = just checks one.

I'm quite sure that you just want to remove the word NOT from the existing case 3. (But I don't know anything about the other issue you guys were discussing).

smirkley 09-13-2013 07:28 PM

Quote:

Originally Posted by snakes1100 (Post 2445418)
No, sorry its a private script rewrite that wasnt released here.

No biggie. I will keep an eye out whilst I test this. So far I have it working but if something crops up, I am sure I can figure it out.

Quote:

Originally Posted by kh99 (Post 2445421)
I see. It's IN (1, 2, 3) to check for one of a number of values, but = just checks one.

I'm quite sure that you just want to remove the word NOT from the existing case 3. (But I don't know anything about the other issue you guys were discussing).

Thanks kh99. Since I can only test this on a daily basis (on a test usergroup, without bothering going into the database to backdate test pm's), I am going to test it (since I have already implemented it in test) by combining case 1 contents with case 2 contents into case 3 removing the old case 3 contents, and changing the phrase in the template for acp. This may not be the most effecient use, but I know the cron runs atm with this change without error. I will just have to wait till tomorrow to find out if it indeed operated as desired as I dont have enough time today to force the issue. If it doesnt work, I will try your suggestion and then report back. If it does, then eureka!!

Thanks again.

kh99 09-13-2013 07:32 PM

If you're talking about trying the last code you posted above, that won't work because the only way the condition would be true is if pm.folderid was equal to -1 and to 0. If you wanted to do it that way you'd need an OR (and add parens), like:

Code:

$pms_query_where_clouse .= " AND (pm.folderid = '0' OR pm.folderid = '-1')";

But that's actually equivalent to "AND pm.folderid IN (0, -1)", which is what you get by removing the NOT.

snakes1100 09-13-2013 07:33 PM

Check the PM folders after it runs on its own for PM's that got deleted, but left the msg in the box, you will no longer be able to click or delete via the forum.

smirkley 09-15-2013 02:35 PM

Quote:

Originally Posted by kh99 (Post 2445427)
If you're talking about trying the last code you posted above, that won't work because the only way the condition would be true is if pm.folderid was equal to -1 and to 0. If you wanted to do it that way you'd need an OR (and add parens), like:

Code:

$pms_query_where_clouse .= " AND (pm.folderid = '0' OR pm.folderid = '-1')";

But that's actually equivalent to "AND pm.folderid IN (0, -1)", which is what you get by removing the NOT.

Forgot to return to this, but yes you are correct. My attempt didnt work as you suggested. Didnt prune anything in tests.

I will try your suggestion next and report back the results.

Is there a preferred methed? Use the OR or use the AND without the NOT?

kh99 09-15-2013 02:52 PM

Quote:

Originally Posted by smirkley (Post 2445779)
Is there a preferred methed? Use the OR or use the AND without the NOT?

No, it's just two different ways of expressing the same condition.

smirkley 09-15-2013 11:02 PM

Quote:

Originally Posted by kh99 (Post 2445427)
If you're talking about trying the last code you posted above, that won't work because the only way the condition would be true is if pm.folderid was equal to -1 and to 0. If you wanted to do it that way you'd need an OR (and add parens), like:

Code:

$pms_query_where_clouse .= " AND (pm.folderid = '0' OR pm.folderid = '-1')";

But that's actually equivalent to "AND pm.folderid IN (0, -1)", which is what you get by removing the NOT.

That did the trick on a manual run of the cron. I will be testing it on auto cron tonight, but it looks like it worked perfect.

Thank you once again kh99
(I will likely post these changes on the original 3.7 thread)
(if it says reusable code, does that mean I can submit this in my name with original credits as a new 4.x mod?)


All times are GMT. The time now is 12:41 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.01166 seconds
  • Memory Usage 1,741KB
  • 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
  • (3)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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