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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2008, 04:43 AM
cache cache is offline
 
Join Date: Aug 2007
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default how to prune thread without posts?

Since I have deleted some posts, some threads no longer have any posts in them. For the admincp/Threads&Post/Prune, you can specify
at Least X Replies
at Most X Replies
at Least X Views
at Most X Views

but I don't see any options for prunning thread at most X Posts. So how do I delete any threads that have no post in them?
thanks.
Reply With Quote
  #2  
Old 09-24-2008, 09:31 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Replies = Posts.
Reply With Quote
  #3  
Old 09-25-2008, 02:40 AM
cache cache is offline
 
Join Date: Aug 2007
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your reply.

So does the "replies" include the original post or simply subsequence reply post?

Anyway, when I changed the "at most replies" to be 1, I deleted some thread, however still I have a lot of thread without any post. I regenerate the counters a few times, I could not delete all threads without single post.

A separate question:
I also delete all users without any posts, if I can delete any thread without any user, it can also help me.
Reply With Quote
  #4  
Old 09-25-2008, 04:38 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cache View Post
So does the "replies" include the original post or simply subsequence reply post?
Replies do not include the first post, as that is not a "reply" (what's it replying to?).
Quote:
Originally Posted by cache View Post
I also delete all users without any posts, if I can delete any thread without any user, it can also help me.
Huh?
Reply With Quote
  #5  
Old 09-25-2008, 12:02 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How did this start in the first place. vBulletin by default never leaves a thread wtihout posts.
Reply With Quote
  #6  
Old 09-26-2008, 04:51 AM
cache cache is offline
 
Join Date: Aug 2007
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This happened when backing up with the phymyadmin (I know we should have used the shell to backup). Since the post table is larger, some of the posts were timed out. Thus when the database is restored the largest table is incomplete, thus we end up with many threads with no posts.
Reply With Quote
  #7  
Old 09-26-2008, 07:49 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then the solution should be to create a better backup. Can't you create a new backup?
Reply With Quote
  #8  
Old 09-28-2008, 03:52 AM
cache cache is offline
 
Join Date: Aug 2007
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I thought I had a weekly automatic shell backup, however it backed the wrong database_name and overwrote the good data. The only good database was from a phpmyadmin experiment earlier, however many posts were not backed up in that phpmyadmin backup. I am willing to accept the fact that some posts were lost. I would like to just prune the empty thread.

any solutions?
Reply With Quote
  #9  
Old 09-28-2008, 10:31 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not fully tested, so create a backup first:

[sql]delete thread
FROM `thread`
WHERE (SELECT COUNT(*) as postcount FROM post WHERE thread.threadid = post.threadid) = 0[/sql]
Reply With Quote
  #10  
Old 09-28-2008, 05:51 PM
cache cache is offline
 
Join Date: Aug 2007
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the code. First I need to access the query, When I clicked
Maintenance > Execute SQL Query
I got error message saying I don't have database access permission. Why can't I access the SQL Query? (At the admin panel /admincp I can see all the access listed, only when click SQL Query do I get the error message)
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 10:21 PM.


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.08133 seconds
  • Memory Usage 2,246KB
  • Queries Executed 11 (?)
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_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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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