NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 04-13-2007 16:52:23

Aterisque
New member

Modifying User Flags

Not sure if this is in the right thread, sorry XD;

I remember reading somewhere about adding a User Flag that didn't do anything besides give that person a "title" in their Profile when viewing the "Special:" part of it.

EX: Member since 2006

I have edited modflags.php so now I have a little check box but from then on I am completely lost. I have even peered into functions.php and fiddled around.

While editting, there is one thing that I am not sure about which is the <langop> part. It seems the langop is what gives out descriptions and commands. The trouble is I don't know where to find the root file so I can edit the name etc.

:S Thanks in advance for any help.

Offline

#2 04-14-2007 04:49:36

Waccoon
Administrator

Re: Modifying User Flags

First, add whatever flags you want to support to modflags.php.  Then, somewhere around line 550 (depending on your version of the board, find this code:

Code:

    $new_flags =
        $_POST['general'].
        $_POST['draw_user'].
        $_POST['anim_user'].
        $_POST['upload_user'].
        $_POST['adult_user'].
        $_POST['immunity'];

Add the appropriate checkbox name in there.  The "value" of the checkbox must of course be a single upper-case letter that does not conflict with any other flags.

This will only allow you to add the flag manually.  To add flags by default when people register, you'll have to search functions.php for code that processes flags, and update each entry.  There are quite a few of them, but I presume not every member should have the flag you want to add.

Offline

#3 04-14-2007 15:31:13

Aterisque
New member

Re: Modifying User Flags

Thank you for your reply.

I have added the checkboxes into my modflags.php, but when I go to view it it merely shows two boxes that can be checked and unchecked, but with no title/text next to it.

I have also added the checkbox names in the functions.php, but still nothing shows up whenever I check the boxes and then view the person's profile.

Here is what I'm doing, maybe there's something wrong in how I'm scripting it. These are the individual codes that I have placed with the rest.

This is in the modflags.php:

Code:

<input type="checkbox" name="gamemaster" value="E" <? if (strstr($row2['usrflags'], 'E')) { echo 'checked '; } ?>/><?=$langop_type_gamemaster?>

This is in the functions.php:

Code:

             $_POST['gamemaster']='E'.

For the functions.php, I am wondering if I want to add another flag, will it be:

Code:

                $_POST['gamemaster']='E'.
                $_POST['kos']='K';

The version of wacintaki is 1.3.6

Offline

#4 04-15-2007 00:27:30

Waccoon
Administrator

Re: Modifying User Flags

The $langop variables are defined in the language file.  Since you're adding new values, you have to add the text you want directly into the code, as follows:

Code:

<input type="checkbox" name="gamemaster" value="E" <? if (strstr($row2['usrflags'], 'E')) { echo 'checked '; } ?>/>Gamemaster

When processing flags in profile.php, you'll have to add the text there as well.

When the data is sent to functions.php, the actual letters are appended to the userflags, so you don't have to add the ='E' into the functions file.  To make sure the syntax is correct (periods and semicolon), here's the whole clip.

Code:

    $new_flags =
        $_POST['general'].
        $_POST['draw_user'].
        $_POST['anim_user'].
        $_POST['upload_user'].
        $_POST['adult_user'].
        $_POST['immunity'].
        $_POST['gamemaster'].
        $_POST['kos'];

Offline

#5 04-15-2007 19:27:40

Aterisque
New member

Re: Modifying User Flags

Thank you very much for you help!

smile

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB