|
Joined: Oct 2007
Posts: 354 Likes: 8
Enthusiast
|
Enthusiast
Joined: Oct 2007
Posts: 354 Likes: 8 |
The owners of a board I maintain ( http://www.stovebolt.com/ubbthreads/ubbthreads.php/) have asked if we could automate topic pruning for a couple of the forums. These are forums where the info gets stale pretty quickly. I looked for a way through the Control Panel but couldn't find it. It occurred to me that this could be done using sql, but obviously I would not want to screw it up. Is there a way to call prunethreads.php with the right values so the system would do the actual pruning? I'm thinking of something like php prunethreads.php -d day -m month -y year -f forumname. The problem is, the Control Panel prune process involves review and approval (for obvious reasons), and I'm not sure if that can be handled from a script (maybe using expect?) Any thoughts or ideas would be welcomed. On one forum they want the topics kept at 90 days, and the other at 30 days. Maybe this is a feature request???
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
If I recall correctly, there isnt a feature to automatically purge older content. But here is a solution that may get you similar results.
1) Go to Control Panel > Forum Settings 2) Click on "Details" next to the forum row you want to manage 3) Toward the bottom, find "Default Topic View (Days):" 4) Select "Active in the last 1 week" for 7 days, or "Active in the last month" for 30 days...etc 5) In the "Default Sort Field and Direction?" field, update it to "Topic Start Time" and "Descending" 6) Click the "Submit Changes" button.
This will not purge the topics from the selected forum, but it will set the default display of the topics in that forum to only the last XX days. And it will sort the posts by TOPIC, rather than by replies.
NOTE: [*] Users can change their own account settings per forum to show what they choose, or use the forum default settings (what you've selected here) [*] These older topics can still be found by users when accessing the forum search, unless they exclude those forums or adjust their search range.
Manual-Purging directions: -As and admin, use the page-jumper in that forum to go to the end of Topic Listing. -Choose the drop-down arrow from the inline moderation column (far right of the topic list header). -Choose "Select All Topics". -Then from the Inline moderation selector at the bottom of the column, choose "Delete Topics" and click the "Go" button. This will delete only the topics in your selection.
EDIT: Someone else could probably expand on what I've written - or provide an easier solution. or even a more-correct way of doing it. This is just a quick write-up from my memory of how I resolved my "For-Sale" / "Want-To-Buy" section issues a few years ago. I dont purge those sections, because the discussions in them are useful content. They also keep a paper-trail for if a bad-transaction might happen. But as for the purging you're asking for, at this time my memory is not recalling a built-in easier solution.
Last edited by id242; 08/18/2015 8:28 PM.
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
And just like that, I just remembered the "Prune Topics" section in CP... which you mentioned in your topic. LOL forums/admin/prunethreads.php
A "I don't care if it looks amateur, just get this done!" solution could be: - I suppose you could edit the admin/prunethreads (/templates/default/admin, IIRC) INPUT from a PUT to a POST. - Run the settings you want to automatically purge with. - Look at/copy that URL (it will have a "doprunethreads.php" in the url, followed by a "?" and options/request). - Use that url as a hyperlink where you want an admin to click and run it on their own desired schedule. Don't forget that after you found the option/request string for your batch, to return the INPUT command back to PUT.
|
|
|
|
Joined: Oct 2007
Posts: 354 Likes: 8
Enthusiast
|
Enthusiast
Joined: Oct 2007
Posts: 354 Likes: 8 |
If I was going to do that, I would copy prunethreads.php, rename it, and edit that.
Is there not a way to provide the values it needs through a script?
I'm going to take a look at the file and see what I can do.
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
Is there not a way to provide the values it needs through a script? In the post right above yours, I summarized the way to find the exact values you are looking for, by adjusting the INPUT's PUT/POST command to have the URL display your desired custom values. I'm going to take a look at the file and see what I can do. You're welcome
|
|
|
|
Joined: Jun 2006
Posts: 16,292 Likes: 116
|
Joined: Jun 2006
Posts: 16,292 Likes: 116 |
Keep in mind, this script requires you to be logged in, so unless you completely remove all security checks, you're not going to be able to automate it with cron; it'd probably be easier to hack a copy of the file and weed out all ubb specific variables and then call it from cron (personally I'd make a script with the prune queries and just call that from cron).
|
|
|
|
Joined: Oct 2007
Posts: 354 Likes: 8
Enthusiast
|
Enthusiast
Joined: Oct 2007
Posts: 354 Likes: 8 |
What I was thinking was to write a script that acts directly on the database rather than try to run it through prunethreads.php. The problem is I need to know exactly what data and tables need to be purged. I can probably figure that out from the prunethreads.php file, but I was seeking the expert advice of the guys who wrote the code.
Let me poke around some, and I'll come back with some ideas and let you point out the flaws in my thinking.
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
I was seeking the expert advice of the guys who wrote the code. Those group of guys have long-since left. Read Gizmo's reply below.
Last edited by id242; 08/20/2015 4:55 PM.
|
|
|
|
Joined: Jun 2006
Posts: 16,292 Likes: 116
|
Joined: Jun 2006
Posts: 16,292 Likes: 116 |
UBB Systems purchased UBB.Threads from Rick Baker in June of 2011, which would have been version 7.5.6 (Rick traded his stock options with Groupee for UBB.threads on January 1, 2010 which would have been version v7.5.4). Since January of 2015, principle development on UBB.Threads is done by UBBDev (versions 7.5.9+), aka myself and id242. BTW, Rick wasn't the sole person behind UBB.threads, under Groupee he worked with Charles Capps and under David Dreezer; so when you get down to "brass tax" there are quite a few hands that've been in UBB.threads. Plus, when you get down to where ideas and features magically appeared, you'll note that features have been plucked from 3rd party developers from UBBDev since the 90's.
|
|
|
|
Joined: Oct 2007
Posts: 354 Likes: 8
Enthusiast
|
Enthusiast
Joined: Oct 2007
Posts: 354 Likes: 8 |
I think both of you are being a bit too modest.
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
I think both of you are being a bit too modest. http://id242.com/ubbthreads/ubbthreads-7-6-0.htmlAs I sit here with my tumbler of Macallan 15 scotch whisky and a fine cigar, I am trying to figure out what it is that you meant with that comment.
|
|
|
|
Joined: Apr 2007
Posts: 3,940 Likes: 1
Former Developer
|
Former Developer
Joined: Apr 2007
Posts: 3,940 Likes: 1 |
if anyone needs a cron script that does all kinds of tasks, i have one.
it does things like prune specific forums to specific age ( configurable ) prunes PMs to a specific age by Member groups ( configurable ) generates sitemap.xml and sitemap.xml.gz ( configurable )
and other crap.
you basically cron it and it is set to only be allowed to run from ( 127.0.0.1 - so no outside influences can intrude ).
PM me and i can provide it free..
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
PM me and i can provide it free.. Who says this? why not just attach it... lol
|
|
|
|
Joined: Dec 2003
Posts: 6,560 Likes: 78
|
Joined: Dec 2003
Posts: 6,560 Likes: 78 |
What you need to respect SD for, is this site was never about mods previously, only stock code and bug fixes.
Code Mods or hacks were suggested to be posted at ubbdev in the past. In fact in the far far past, code mods were deleted here by the powers that be.
So I can see why he was hesitant to post a code mod here.
BTW,, If anyone recalls we were to have cron jobs supported in stock v8. To enhance some of the cache jobs that run only based on certain activities on the board.
Blue Man Group There is no such thing as stupid questions. Just stupid answers
|
|
|
0 members (),
396
guests, and
110
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|