Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 10-30-2017, 10:06 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will run the code on my local dev site to see what I find.

--------------- Added [DATE]1509428993[/DATE] at [TIME]1509428993[/TIME] ---------------

Okay, this should work:

PHP Code:
global $vbulletin;
require_once(
DIR '/includes/functions_databuild.php');

$deleted 0;
$curtime TIMENOW;
$physicaldel false;
$del_user fetch_userinfo(1);
$del_forumid '4';
$reason 'Thema alt entfernt via cron.';

$delinfo = array(
    
'userid'          => $del_user['userid'],
    
'username'        => $del_user['username'],
    
'reason'          => $reason,
    
'keepattachments' => true
);

$countposts = ($vbulletin->forumcache["$del_forumid"]['options'] & $vbulletin->bf_misc_forumoptions['countposts']);

$query "SELECT thread.* FROM " TABLE_PREFIX "thread AS thread WHERE lastpost <= " . ($curtime 365*86400) . " AND forumid = " $del_forumid;

$threads_delete $vbulletin->db->query_read($query);
$mthread =& datamanager_init('Thread'$vbulletinERRTYPE_SILENT'threadpost');

while (
$thread_delete $vbulletin->db->fetch_array($threads_delete))
{
    if (!
$deleted)
    {
        
$deleted true;
    }

    
$mthread->set_existing($thread_delete);
    
$mthread->delete($countposts$physicaldel$delinfofalse);
}

unset(
$mthread);

if (
$deleted)
{
    
build_forum_counters($del_forumid);
}

$move_prefixid 'reportthread_solved';
$source_forumid 10;
$destination_forumid 12;

$vbulletin->db->query_write(
    UPDATE " 
TABLE_PREFIX "thread
        SET forumid = " 
$destination_forumid "
        WHERE forumid = " 
$source_forumid "
        AND lastpost <= " 
. ($curtime 100*86400) . "
        AND prefixid = '" 
$move_prefixid "'
"
);

build_forum_counters($source_forumid);
build_forum_counters($destination_forumid); 
--------------- Added [DATE]1509429187[/DATE] at [TIME]1509429187[/TIME] ---------------

I move that these double-post merges go away.
Reply With Quote
  #12  
Old 10-31-2017, 06:39 AM
Za4a Tuner's Avatar
Za4a Tuner Za4a Tuner is offline
 
Join Date: Aug 2005
Location: Germany
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your help and spending time on my problem,
but the code from the post above won't work in my board
I used it, as you posted it, or have i to do some changes?

kr Chris
Reply With Quote
  #13  
Old 10-31-2017, 01:44 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It should work exactly as I posted it, but it could be that you have other plugins hooked at "threaddata_delete" that are causing an issue. Do you have any plugins hooked there?
Reply With Quote
  #14  
Old 11-01-2017, 10:58 AM
Za4a Tuner's Avatar
Za4a Tuner Za4a Tuner is offline
 
Join Date: Aug 2005
Location: Germany
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
It should work exactly as I posted it, but it could be that you have other plugins hooked at "threaddata_delete" that are causing an issue. Do you have any plugins hooked there?
in the plug-in list is nothing hooked at "threaddata_delete".
Reply With Quote
  #15  
Old 11-01-2017, 02:50 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you manually run the daily cleanup, what error(s) do you get?
Reply With Quote
  #16  
Old 11-04-2017, 06:35 PM
Za4a Tuner's Avatar
Za4a Tuner Za4a Tuner is offline
 
Join Date: Aug 2005
Location: Germany
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hy,
sorry for the late answer, but i wasn't at home till now.

All the shedulded tasks even don't run!
Attachment 156714

The plugin is disabled, and the task for "daily cleanup" run:
Attachment 156715

but when i open the logfile, there is no entry for the task!
Attachment 156716

I don't know whats wrong
Reply With Quote
  #17  
Old 11-04-2017, 07:02 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you manually run the daily cleanup, what error messages do you get?
Reply With Quote
  #18  
Old 11-04-2017, 07:10 PM
Za4a Tuner's Avatar
Za4a Tuner Za4a Tuner is offline
 
Join Date: Aug 2005
Location: Germany
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is the error message:
PHP Code:
[Sat Nov 04 21:06:43 2017] [error] [client 95.91.250.110PHP Fatal error:  Only variables can be passed by reference in .../includes/cron/dailycleanup.php(126) : eval()'d code on line 12, referer: .../admincp/cronadmin.php?do=modify 
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:46 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07161 seconds
  • Memory Usage 2,276KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete