PDA

View Full Version : Super Close Threads v1.0


g-force2k2
08-28-2002, 10:00 PM
As requested by Ice Melee...

a big thanks to GoldKnight for helping me beta test this one and get things squared away ;)

What does this hack do?

Well if your and Administrator and at times you don't want anyone editing or replying to a closed thread (including Moderators and S Moderators) this hack will prevent then from doing so...

Super Close and Super Open thread are special admin features that i have included in the admin optioins... once a super close is implemented it will decline moderators and smoderators from replying editing and even accessing the edit thread options...

It is a new type of close that can only be induced by an Administrator in the admin thread options... a Super Close will overide both a close and an open thread at anytime...

Well i hope that some use can be made of this hack :)

To Dos?
File Modifiactions (10)
Template Modifiactions (2)
Template Additions (1)

If you like this hack i'd be greatful if you clicked install ;) regards... Enjoy...

g-force2k2

g-force2k2
08-29-2002, 04:26 AM
Screenshot A :: the super close thread redirect

Note: it can be configured in the template ;)

g-force2k2

g-force2k2
08-29-2002, 04:27 AM
Screenshot B :: Admin Options Drop Down list

Of course the Moderators S Moderators don't have permission to use this action ;)

g-force2k2

g-force2k2
08-29-2002, 04:28 AM
Screenshot C :: Threads Edit Thread Options

This option is only available to the Administrators ;) to Moderators and S Moderators this option is not viewable :p

g-force2k2

Goldknight
08-29-2002, 04:30 AM
Since I already have one so...

* Goldknight install

As I stated before.. you have been on the roll for making hacks and release hacks. As usual, always best hacker in my book. :cool:

Smoothie
08-29-2002, 06:30 AM
Add any extra queries?

kmfdm_kid2000
08-29-2002, 08:33 AM
This one's REALLY Functional, especially for my community, thanks...

* kmfdm_kid2000 Installs

Takes a bit, but VERY Worth it...Now if only someone would fill in
MY REQUEST (https://vborg.vbsupport.ru/showthread.php?s=&threadid=42763), I'd be ONE happy person :D

Boofo
08-29-2002, 08:34 AM
Ok, g-force2k2, buddy, here I am looking for my daily "fix" from you. :)

Here is the code I have in the showthread.php:

if ($thread[open]) {
$closereason="";
eval("\$replyopenclosed = \"".gettemplate("showthread_replyopen")."\";");
} else {
$thread[closereason]=bbcodeparse2($thread[closereason],0,1,1,1);
eval("\$closereason = \"".gettemplate("showthread_closereason")."\";");
if (ismoderator($thread[forumid],'canopenclose')) {
eval("\$replyopenclosed = \"".gettemplate("showthread_replyclosedmod")."\";");
} else {
eval("\$replyopenclosed = \"".gettemplate("showthread_replyclosed")."\";");
}
}

And here is the code you want me to replace it with:

// +++++++ Super Close Thread Hack [ g-force2k2 ] +++++++
if(($thread[open] == 0) OR ($thread[open] == 2)) {
$replyclose='https://vborg.vbsupport.ru/images/threadclosed.gif';
} else {
$replyclose='https://vborg.vbsupport.ru/images/reply.gif';
}
// +++++++ Super Close Thread Hack [ g-force2k2 ] +++++++

Ok, now, how do I incorporate your code into what I have so everything stays working? Everything else in the install file went in without a hitch. :)

kmfdm_kid2000
08-29-2002, 08:50 AM
Sucks having to install a hack on top of another...I somehow intergrated the Strike Thru Closed topics with this one on the first try, but there was only 1 small line of PHP that needed intergration...For what it's worth, maybe this'll help someone down the road...*NOTE* This is for having this hack intergrated with Strike thru closed topics!!!

In forumdisplay.php Replace:


$thread[newoldhot]='folder';
if (!$thread[open]) {
$thread[newoldhot]='lock'.$thread[newoldhot];
}

with:

// +++++++ Super Close Thread Hack [ g-force2k2 ] +++++++
$thread[newoldhot]='folder';
if(($thread[open] == 0) OR ($thread[open] == 2)) {
$thread[newoldhot]='lock'.$thread[newoldhot];
// Strike-Through Hack
$thread[title] = "<span class='locked'>$thread[title]</span>";
// End Strike-Through Hack
}
// +++++++ Super Close Thread Hack [ g-force2k2 ] +++++++

Both hacks work nicely together then...

Thanks again for a GREAT hack!!!

EDIT: There's More stuff that you have to do to get that Strike through Hack to work, but those things are described on the thread for that hack...This is the only instance where they kinda "Brush Against" each other...

Boofo
08-29-2002, 08:55 AM
Here's how I did it. :)

// +++++++ Super Close Thread Hack [ g-force2k2 ] +++++++
$thread[newoldhot]='folder';
if(($thread[open] == 0) OR ($thread[open] == 2)) {
$thread[newoldhot]='lock'.$thread[newoldhot];
// +++++++ Super Close Thread Hack [ g-force2k2 ] +++++++

// Strike-Through Hack
$thread[title] = "<span class='locked'>$thread[title]</span>";
// End Strike-Through Hack
}

kmfdm_kid2000
08-29-2002, 09:01 AM
Yeah, your way looks neater...I'm still learning PHP, mostly I'm teaching myself through hacks :p Good to keep code nice and neat though ;)

Boofo
08-29-2002, 09:07 AM
Doing it that way makes it easier later if you have to find a piece of code for a certain hack. Having them all run together can get a little confusing. :)

BTW: I like your sig. A little big for my tastes, but nice graphics to it. :)

Originally posted by kmfdm_kid2000
Yeah, your way looks neater...I'm still learning PHP, mostly I'm teaching myself through hacks :p Good to keep code nice and neat though ;)

Gohan
08-29-2002, 10:00 AM
Great hack, g-force2k2!

without problem :D

Chris M
08-29-2002, 12:53 PM
Ah...So this is a Super Close:)

*installs*

Satan

kmfdm_kid2000
08-29-2002, 12:53 PM
Originally posted by Boofo
BTW: I like your sig. A little big for my tastes, but nice graphics to it. :)

Thank you ;) There, a smaller version...

g-force2k2
08-29-2002, 02:40 PM
Boofo before i attempt any mod for your code... do the templates that are called simply the button coding? regards...

g-force2k2

Keyser S?ze
08-29-2002, 06:28 PM
hey looks great

question

does the super close option show to mods/s mods/members? or can only admins see that option

even so, looks great, ill try to install it tonight

Goldknight
08-29-2002, 06:56 PM
Originally posted by IceMalee
hey looks great

question

does the super close option show to mods/s mods/members? or can only admins see that option

even so, looks great, ill try to install it tonight

Members/SuperMod/Mod can see it but cannot access, it will block them out. Only Admin can access that option.

Keyser S?ze
08-29-2002, 07:23 PM
somehow i feel version 1.1 coming after this post :)

how about making it so that when a admin super closes, no other admin, other than that admin can touch it

im thinking make it based on user id

also would be good to have a setting in the admin cp to set it so that super close can be undone by any admin, or only by the admin that closed it, so u can easily turn that on or off


maybe even a new close feature, perm close, which means only the closeing admin can reopen it

i prefer the term "locked" over super close tho, but anyways, what yall think?

Chris M
08-29-2002, 07:38 PM
I think what would be better, is almost how you said it, but that the Main Admin (who you define in the code) can override ANY Admin Super Close;)

Satan

g-force2k2
08-29-2002, 08:07 PM
if you're the only admin that whats to worry about? a simple mod like that? nah its not worth it... if you want it restricted to yourself i will place the code in this post... otherwise something like that isn't worth the effort ;) regards...

g-force2k2

Keyser S?ze
08-29-2002, 08:29 PM
at my forum theres 5 admins, tho only 3 are active

and no theres not much to worry about, but just a added security, thats why i said be able to turn that on or off

Boofo
08-29-2002, 10:37 PM
Yes, but there is also the closed reason hack (from, you guessed it, Xenon :)) in there. If I enter the first line of code from your hack in my code, there, it works fine, but it shows an empty closed reason at the top for the thread. Any way to have it open up the closed reason to add the reason for closing it also?

Originally posted by g-force2k2
Boofo before i attempt any mod for your code... do the templates that are called simply the button coding? regards...

g-force2k2

g-force2k2
08-29-2002, 11:55 PM
could you link me to his hack? i didn't see it in his profile x_X and i will build an addon for you Boofo :) regards...

g-force2k2

Boofo
08-30-2002, 12:15 AM
Here you go, my friend. :) Thank you. ;)

https://vborg.vbsupport.ru/showthread.php?postid=264907#post264907

g-force2k2
08-30-2002, 12:25 AM
Okay Boofo i just made a slight alteration ;) try this code...

if ($thread[open] == 1) {
$closereason="";
eval("\$replyopenclosed = \"".gettemplate("showthread_replyopen")."\";");
} else {
$thread[closereason]=bbcodeparse2($thread[closereason],0,1,1,1);
eval("\$closereason = \"".gettemplate("showthread_closereason")."\";");
if (ismoderator($thread[forumid],'canopenclose')) {
eval("\$replyopenclosed = \"".gettemplate("showthread_replyclosedmod")."\";");
} else {
eval("\$replyopenclosed = \"".gettemplate("showthread_replyclosed")."\";");
}
}

regards... btw i should have remember he and Sinecure did that one together :P

g-force2k2

Boofo
08-30-2002, 12:35 AM
This is the only line you changed from that code, right?

if ($thread[open] == 1) {


It works, but now I get a blank Closed Thread Reason at the top of the page. :)

Boofo
08-30-2002, 12:42 AM
By the way, my regular Open/Close Thread (above the Super Open/Close thread) in the Admin options no longer works. I get a session error. :)

g-force2k2
08-30-2002, 01:05 AM
well that could be just your sessions... not the coding but i could be wrong :p i didn't get any sessions... and i don't know why you get a blank reason :p but i'll keep on the look out ;) regards...

g-force2k2

Boofo
08-30-2002, 01:08 AM
What about the regular Open/Close Thread in the admin options? Please let me know something as soon as you find out. I really like this hack and don't want to uninstall it if I don't have to. You seem to make pretty good hacks there. :)

g-force2k2
08-30-2002, 02:01 AM
yeah Boofo but if its not a sintax error it maybe just be the server... cause i know i use to get messed up sessions... but i could be wrong... regards...

g-force2k2

Goldknight
08-30-2002, 02:04 AM
?? cuz of your and Boofo's "modify" codes? So far yours work well on my net and local server :p

Boofo
08-30-2002, 02:15 AM
The regular Open/Close Thread worked fine before. :)

Here is the error I get when I try to use it now:

vBulletin Message
The action you have attempted could not be performed as your session appears to be invalid. Click the below link to attempt this action again with a new session.
Try this action again!


Originally posted by g-force2k2
yeah Boofo but if its not a sintax error it maybe just be the server... cause i know i use to get messed up sessions... but i could be wrong... regards...

g-force2k2

g-force2k2
08-30-2002, 02:26 AM
ya... i used to always get them (on my old server)... maybe it could have something to do with my code... like i said i could be wrong >_O better off asking someone like Xenon or PPN on this one... regards... (i don't know to much about sessions)

g-force2k2

Boofo
08-30-2002, 02:29 AM
Ok, but why does it only start doing that now? :)

Originally posted by g-force2k2
ya... i used to always get them (on my old server)... maybe it could have something to do with my code... like i said i could be wrong >_O better off asking someone like Xenon or PPN on this one... regards... (i don't know to much about sessions)

g-force2k2

g-force2k2
08-30-2002, 02:46 AM
lol i don't know ;p thats why i said its better off asking one of the more experience vb ppl ;) sorry Boofo :( regards...

g-force2k2

Boofo
08-30-2002, 03:06 AM
I see how you are. :) That's ok, I'll just uninstall it for now. Since it won't work with the closed thread reason installed, anyway. Thanks anyway. :)

Mono
09-18-2002, 02:27 AM
Nice. This one is good for my little spammy mods who like to take advantage of their abilities to post in closed threads.

Clicks install

Works great too.

Bastian B.
09-21-2002, 01:54 AM
Super Hack! Very good!

I have install it!

-Sidekick-
09-24-2002, 04:22 AM
Is there going to be a upgrade for this hack so it works along with the reason for closing thread hack?

N9ne
09-29-2002, 01:48 PM
Question: Does this add queries? If so, how many and on what pages?

g-force2k2
09-29-2002, 02:47 PM
Originally posted by Tha Rock
Question: Does this add queries? If so, how many and on what pages?

It doesn't add any queries to my knowledge :p regards...

g-force2k2

N9ne
09-29-2002, 03:07 PM
Good, I shall install it then ;)

On a side note: g-force: how's those requests coming along [the hacks i requested a while ago]

N9ne
10-23-2002, 07:52 PM
I have a problem, PHP people, help me please! :(

if ($thread[open]) {
$replyclose="https://vborg.vbsupport.ru/images/reply.gif";
$thread[closereason]="";
} else {
$replyclose="https://vborg.vbsupport.ru/images/threadclosed.gif";
if (trim($thread[closereason])) {
$thread[closereason]=bbcodeparse2($thread[closereason],0,1,1,1);
eval("\$thread[closereason] = \"".gettemplate("showthread_closereason")."\";");
} else {
$thread[closereason] = "";
}
}

That is what I have in my showthread.php file...

I have to replace it with:

// +++++++ Super Close Thread Hack [ g-force2k2 ] +++++++
if(($thread[open] == 0) OR ($thread[open] == 2)) {
$replyclose='https://vborg.vbsupport.ru/images/threadclosed.gif';
} else {
$replyclose='https://vborg.vbsupport.ru/images/reply.gif';
}
// +++++++ Super Close Thread Hack [ g-force2k2 ] +++++++


I'm sure there's an easy fix for this but I don't know what it is :D

N9ne
10-23-2002, 08:13 PM
Attached is a PHP file of my instructions so hopefull it doesn't parse the image code.

N9ne
10-24-2002, 04:12 PM
bump, please help! :(

N9ne
10-24-2002, 05:13 PM
Ok I managed to fix it for myself! Ok it took me a bit of thinking though [I had no idea where to start!], but in the end I just used some intelligence and tried a few tricks and looked at the PHP, tried to understand it and got a grip of it and fixed it for myself! At first I had a problem that it wasn't calling the template for closereason but I also fixed that, but then I had a problem with it showing the reply image instead of close image but I fixed that too!

Thanks for a great hack, now i can superclose threads :D

mehungie2
02-03-2003, 03:30 AM
how do i integrate this hack with close reason hack. im having problems with the showthread.php modifications. please help

mehungie2
02-09-2003, 12:09 AM
i hate to double post but can someone help me with this?

Zelda-King
03-23-2003, 04:32 PM
It's a nice hack but it would be nice if moderators couldn't alter these threads at all. Currently they can move/delete them still.

I fixed that on my board by adding the code to more sections of postings.php.

eg, at the top of a section under (for example)
// ############################### start stick / unstick thread ############################### you get an 'if' action thing. In this case if ($HTTP_POST_VARS['action'] == 'stick' OR ($action == 'stick' AND $s == $session['dbsessionhash'])) {. Under this you get $threadid=verifyid("thread",$threadid);
$threadinfo=getthreadinfo($threadid);

if (!$threadinfo[visible]) {
$idname="thread";
eval("standarderror(\"".gettemplate("error_invalidid")."\");");
. Just put // +++++++ Super Close Thread Hack [ g-force2k2 ] +++++++
if(($threadinfo[open] == 2) AND ($bbuserinfo[usergroupid] != 6)) {
show_nopermission();
}
// +++++++ Super Close Thread Hack [ g-force2k2 ] +++++++ underneath any function you don't want moderators to have power for, such as deleting/moving a superclosed thread.

Also, in postings.php, it would be better if 'the thread has been successfully superopen/superclose'' read 'super-opened/super-closed or something. Just change

$action = "superclose";
} elseif($threadinfo[open] == 2) {
$threadinfo[open] = 1;
$action = "superopen"; to
$action = "super-closed";
} elseif($threadinfo[open] == 2) {
$threadinfo[open] = 1;
$action = "super-opened";

-Sidekick-
06-13-2003, 07:31 PM
I want this to work for 2 userid's not a usergroup. How would that be phrased correctly in the appropriate areas?

dreamcast122
07-11-2003, 03:21 PM
Nice work!

Pyth

FiX
01-25-2007, 04:04 PM
Is something like this availible for VB 3.6.x?

nikki712
02-26-2007, 08:33 PM
Is something like this availible for VB 3.6.x?
I'd like to know this too. I'm running 3.6.4, and I'd like a mod like this.