TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 135
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 113
  • Total: 113

Accessing TP function via cron script

Started by Malo, October 29, 2007, 08:39:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Malo

I've setup a "Guild Application" system in my TP which when they submit it, creates a post in a specific forum with a poll and all the details from the application. I also have a set expiry time of 3 days on the poll, this is all working great using the createpost() function.

I'd like to use a php script run via cron which basically checks for any of these topics that are over 72 hours old and updates the registrant security level on the forums based on the vote. This I have done and working ok, however... I'd like to then delete that post as the applicant should not be able to read the post which can include comments from existing members.

To do it right I should use the removetopic() function which takes care of all the issues with post counts, topic counts, polls etc as simply removing the topic and msgs doesn't really suffice. The problem is I'm doing this out of the confines of TP, so what would I need to require-once in order to access the removetopic() function including the several functions it uses in that?

Alternatively, would it be easier to move the post to an archive forum which only the admins have access to by simply changing id values in the topic and topic counts in the board table? However even a move looks more complex than that from the function....

jacortina

At a guess, I'd say you'd need to have Sources/RemoveTopic.php. I believe that includes all the functionality for topic removal (flag for whether or not to decrease post count and another for whether or not to move it to the recycle board). If all the functions THAT uses aren't local, it probably has its own 'reguire's to pull in Subs.php or Sub-Posts.php.

But this isn't really TP functionality. It's SMF functionality.

Malo

Yeah I forget that it's mainly smf I'm dealing with so I will check over there for a solution, it doesn't look like it has the requisite includes for the functions.

This website is proudly hosted on Crocweb Cloud Website Hosting.