• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Gesior Forum] Thread Open|Close Function [fixed!]

Status
Not open for further replies.

hodleo

Formerly cbrm -Crypto enthusiast, Retired scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,598
Solutions
3
Reaction score
955
Location
Caribbean Sea
#####################################
[> Title: Thread Open|Close Function
[> Author: Cybermaster
[> Scripted for: Gesior's Simple forum script
[> Requires: My two other Forum Functions
[> Coding: PHP+XHTML
[> Revision: 0.1
\______________________________________________/

Last One:(

Description

This new function allows moderators to open or close threads, so the users and
mods won't be able to make or edit a post while the thread is closed. Edit and New Post buttons won't appear too.

Setup
STEP 1 (SQL QUERY)
Execute the next SQL Query, depending of your database class.
MySQL:

Code:
ALTER TABLE `z_forum` ADD `closed` TINYINT(1) NOT NULL DEFAULT '0' AFTER `sticky`;
SQlite:
Code:
ALTER TABLE "z_forum" ADD "closed" TINYINT(1) NOT NULL DEFAULT "0" AFTER "sticky";

STEP 2 (MODIFYING OLD FUNCTIONS: REPLACE YOUR FORUM.PHP)

Well since changing each code its so long and messy, just replace this forum.php with yours:

-> trunk/0.3.6/forum.php
http://websvn.4za.pl/

This has been accurately scripted, so you don't get any errors and there's no way players can't have the possibility to post while the thread is closed.:ninja:
 
Last edited:
Nice release like always but fix at step one this line

Code:
[if($action  == 'show_thread')


xdddd
 
STEP 4 :

Step 2 :
in the code, it's written :
'.$quoted_post[0]['post_text'].'

Step 3 and 4 are bugged.

In the code it's written :

Code:
Code


Edit :
Step 4 :
In that number 1 is bugged, but just with this : [if($action == 'show_thread')
 
Last edited:
Was quite easy to figure it out how it should be, but it on spanish + the close function doesn't work for me
 
Update : Loads of bugs, but easy to fix.

Some founded bugs :
There is links to pics that doesn't exists.
It's on spanish
The CLOSE function doesn't work for me.
Lots of CODE/Quotes in the PHP Codes above.
All links to pictures is ex : http://otland.net/images/forum/responder.png
 
:( i thought i made it entirely on english
oh well, ill fix it later
 
if anyone want, here is the missing function:
Code:
if($action == 'close_thread')
{
    if($logged && $group_id_of_acc_logged >= $group_not_blocked)
    {
        $id = (int) $_REQUEST['id'];
        $post = $SQL->query("SELECT `id`, `closed`, `first_post`, `section` FROM `z_forum` WHERE `id` = ".$id." LIMIT 1")->fetch();
        if($post['id'] == $id)
        {
            if($post['id'] == $post['first_post'])
            {
                if($post['closed'] == 0)
                    {    
                        $SQL->query("UPDATE `z_forum` SET `closed` = 1 WHERE `id` = ".$post['id']." ");
                        header('Location: ?subtopic=forum&action=show_board&id='.$post['section']);
                    }
                else    
                        $SQL->query("UPDATE `z_forum` SET `closed` = 0 WHERE `id` = ".$post['id']." ");
                        header('Location: ?subtopic=forum&action=show_board&id='.$post['section']);
            }
        }
        else
            $main_content .= 'Post with ID '.$id.' does not exist.';
    }
    else
        $main_content .= 'You are not logged in or you are not moderator.';
}

Now I'm going to translate all texts(damn, I hope I will guess meanings of all words ;d)
 
@bilmattan: about links: I guess you have in your config.lua default url(otland.net ;d) so it works this way
 
@bilmattan: about links: I guess you have in your config.lua default url(otland.net ;d) so it works this way

No.
Check the coding :
ex
PHP:
<img src="http://otland.net/images/edit1.png" border="no">Editar post</a>'; }
            else
                $main_content .= '';     
            if($logged)
                if(isThreadOpen($thread_id)) {
                    $main_content .= '&nbsp;&nbsp;<a href="?subtopic=forum&action=new_post&thread_id='.$thread_id.'&quote='.$thread['id'].'"><img src="http://otland.net/images/forum/citar.png" border="no">Citar</a>'; }
            else
                $main_content .= '';

Easy to edit thought :D
 
Thanks for the rest of the code.

Works perfect now (I translated it also)
 
just let me fix it ^^
 
there, its fixed
just use the forum.php from the gesior svn
 
Last edited:

STEP 2 (MODIFYING OLD FUNCTIONS: REPLACE YOUR FORUM.PHP)
[/FONT][/COLOR][/COLOR]
Well since changing each code its so long and messy, just replace this forum.php with yours:

-> trunk/0.3.6/forum.php
4za.pl - Det bästa sättet att hitta information om gesior layouts.Denna sida är till salu!

This has been accurately scripted, so you don't get any errors and there's no way players can't have the possibility to post while the thread is closed.:ninja:[/QUOTE]

What it this?
 
that web is no longer available
use modern aac, the future
 
Status
Not open for further replies.
Back
Top