The Arcive of vBulletin Modifications Site. | 
    |
| 
		 
			 
			#1  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
			
			 
			
			Hello, 
		
		
		
		
		
		
		
		
	
	How can I setup a Cron Job to permanently delete soft deleted thread && thread has been soft deleted for more than 7 days. OR Permanent Delete all threads from a forum that are only 7 days old. In this case Delete only X amount of threads per day. Please guide. Thanks  | 
| 
		 
			 
			#2  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
			
			 
			
			If you write a script to do what you described, you can put it in includes/cron and then create a new scheduled task to use it.  You can look at the other scripts in that folder to see how they work. 
		
		
		
		
		
		
		
		
	
	I'm not sure if that's a lot of help - as for the thread pruning, you can find that code in an existing script and copy it. I think admincp/thread.php has code for when you do it from the admincp.  | 
| 
		 
			 
			#3  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
			
			 
			
			okay, I will look into it. But if someone else be more helpful that would be great !! 
		
		
		
		
		
		
		
		
	
	Thanks a lot kh99  | 
| 
		 
			 
			#4  
			
			
			
			
			
		 
		
	 | 
|||
		
		
  | 
|||
| 
		
	
		
		
			
			 
			
			There's no easy way to tell, natively, when a thread has been soft deleted. However, a work-around to this would be to delete threads where the last post is older than 7 days ago and the thread is soft deleted. The reasoning behind this is that once a thread has been soft deleted it won't be posted in anymore. 
		
		
		
		
		
		
		
		
	
	Code: 
	define('ONE_WEEK', 604800);
$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "thread WHERE lastpost <= " . (TIMENOW - ONE_WEEK) . " AND visible = 0");
 | 
![]()  | 
	
	
		
  | 
	
		
  | 
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
						
  | 
				|
  More Information | 
				|
| 
						 Template Usage: 
						
 Phrase Groups Available: 
						
  | 
					
						 Included Files: 
						
 Hooks Called: 
						
  |