PDA

View Full Version : This thread closed by? Ideas?


08-16-2000, 12:24 PM
Anyone have any ideas on how to add a "This thread closed by (who ever closed it)" whenever a thread is closed?

Thanks,
Parker

08-16-2000, 06:58 PM
yeah that would be a great addition... now that i have mods

08-16-2000, 07:17 PM
until a hack is made for this, I would suggest just posting to a thread before closing it, and say why

08-16-2000, 07:20 PM
yeah that's what i do...

08-17-2000, 06:48 PM
In your showthread.php file look for:

if ($threadinfo[open]==1) {
$replyclose="$replyimage";
} else {
$replyclose="$closedthreadimage";
}

and change this to:

if ($threadinfo[open]==1) {
$replyclose="$replyimage";
} else {
$replyclose="$closedthreadimage";
$whoclosed = "This thread closed by $username";
}

then in your showthread template put:

$whoclosed

wherever you want it on the page.

Note: You will have to post the last message in the thread for the correct person to show up as to closed it as it lists the last person in thread as the closer. But this allows your mods to post the reason why it was closed and at the same time alert the author of the post who closed it.

Parker

08-17-2000, 07:12 PM
No offense meant, Parker, but if the mod has to post the last post before closing the thread, he might as well say "this thread is closed by me because..." etc. Your hack doesn't shorten the procedure and therefore seems a bit redundent to me.

08-17-2000, 07:31 PM
bira:

Yes, it is redundant but at the same time it puts at the top of the page who closed it. Members are lazy and gon't want to go down a long thread to see who closed something. This way they see at the top.

I am still working on a way to get this to be automatic but I thought that I would throw this out to see if anyone could get any use out of it.

Don't like it. Don't use it. Its that simple.

Parker

08-17-2000, 08:26 PM
don't be discouraged on my account, Parker. I was merely hoping you could extend the hack further :)

08-17-2000, 09:39 PM
Future Hackers of America

open postings.php and find:


if ($threadinfo[open]==1)
{
$DB_site->query("UPDATE thread SET open=0 WHERE threadid=$threadid");
$action="closing";
}


This is where you want to start your hack. You will need to open newreply.php, see what the code does when a user posts a reply. Duplicate the required elements in postings.php inside the code above. You want to set $message to something like "Thread Closed". You already have the $username of the mod so you don't need to figure it out. You want to insert a post stating the thread is closed, which will be from the Mod right before the thread is really closed. It is really simple to do but I will leave it up to you guys to do it.

[sidenote]

Is there a way to call newreply.php from inside postings.php so that one wouldn't actually have to anything other than insert the call right before the thread close?


newreply.php?action=postreply&message=Closed%20Thread


The idea is to simulate what is sent when a user clicks on the "Post" button when entering a message. Possible? I don't know

08-17-2000, 11:55 PM
rangersfan -

//Set EVERY form generated variable here, including:
//$action and
//$submit (<-- I think that's the name. It's the name value of the submit button)

require("newreply.php");
// Or, if that doesn't work:
// include("newreply.php");

08-18-2000, 02:56 AM
ok,

That just went right over my head! :)

No problemo bira. Like I said I was just trying to get something out there for a temporary fix until someone else came up with something that really worked.

Parker

08-18-2000, 03:46 AM
Ed I think I tried that and it didn't work.

08-18-2000, 04:39 AM
Parker - That was to rangersfan. He asked about calling newreply.php from posting.php :)

Umm... I think it should. Pretty sure I've seen it done before. The only reason it didn't work in Perl was because of the shebang line (#!/usr/bin/perl)

I'm not sure how to repress what it returns (the page it returns I mean) though - that could be the problem.

[Edited by Ed Sullivan on 08-18-2000 at 01:47 AM]

08-18-2000, 04:56 AM
Ermm well calling newreply.php is going to end up calling global.php again which is going to end up involving a cookie which is going to mean it is going to send header information and we can't at this point so we will at least get a warning message about header's already been sent..

08-18-2000, 05:33 AM
Good point.

Your best bet is to ripout the posting code, and put that in a file called newreply.inc.php. Make sure you delete the redirect related stuff. Then just set the variables and "require" it in postings.php.

08-18-2000, 11:43 AM
I am really interested in seeing what you guys come up with for this.

Parker

08-18-2000, 12:07 PM
me too ... although i am more interested in a post and close thread hack :D

09-08-2000, 02:46 PM
Any one want to take a stab at this hack still?

A pretty cool hack to.