vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   how to prune thread without posts? (https://vborg.vbsupport.ru/showthread.php?t=191731)

cache 09-24-2008 04:43 AM

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.

Marco van Herwaarden 09-24-2008 09:31 AM

Replies = Posts.

cache 09-25-2008 02:40 AM

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.

Dismounted 09-25-2008 04:38 AM

Quote:

Originally Posted by cache (Post 1629704)
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 (Post 1629704)
I also delete all users without any posts, if I can delete any thread without any user, it can also help me.

Huh?

Marco van Herwaarden 09-25-2008 12:02 PM

How did this start in the first place. vBulletin by default never leaves a thread wtihout posts.

cache 09-26-2008 04:51 AM

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.

Marco van Herwaarden 09-26-2008 07:49 AM

Then the solution should be to create a better backup. Can't you create a new backup?

cache 09-28-2008 03:52 AM

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?

Marco van Herwaarden 09-28-2008 10:31 AM

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]

cache 09-28-2008 05:51 PM

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)

Dismounted 09-29-2008 04:51 AM

You need to modify config.php and add your user ID to the list of users that can execute queries. Additionally, I believe that error message also has a link documenting what you need to do.


All times are GMT. The time now is 04:54 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.00979 seconds
  • Memory Usage 1,726KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete