1 (edited by Kriptonic 2003-08-16 13:37)

Topic: Anti Guest Profiles

##
##
##        Mod title:  Anti-Guest Profile
##
##      Mod version:  2.0
##   Works on PunBB:  1.0
##     Release date:  2003-08-20
##           Author:  Andrew West A.KA. Kriptonic
##
##      Description:  This mod gives guest the error message "You do not have
##                    permission to access this page." When trying to view
##                    profiles.
##
##   Affected files:   lang/en/en_common.php
##                          profile.php
##
##       Affects DB:  No
##
##            Notes:  This mod has been completely rewritten due to a suggestion
##                       made by Kennel and works the same.
##
##                    Generated with ModGenerator (http://modgen.cactuz.nu/)
##                    on: 2003-08-16 08:54:55
##
##       DISCLAIMER:  Please note that modifications are not officially
##                    supported by PunBB. Installation of this modification
##                    is
##                    done at your own risk. Backup your forum database and
##                    any and all applicable files before proceeding.
##
##


#
#---------[ 1. OPEN ]---------------------------------------------------------
#

profile.php


#
#---------[ 2. FIND (line: 27) ]----------------------------------------------
#

require 'include/common.php';


#
#---------[ 3. AFTER, ADD ]---------------------------------------------------
#

// Begin Anti Guest Profiles Mod
if ($cookie['is_guest'])
        message($lang_common['No Guests Reading'].' <a href="login.php">'.$lang_common['Login'].'</a> '.$lang_common['or'].' <a href="register.php">'.$lang_common['register'].'</a>.');
// Begin Anti Guest Profiles Mod


#
#---------[4. Open]------------------------------------------------------------ 
#

lang/en/en_common.php

#
#---------[4. Find (line : 8)]------------------------------------------------------------
#

'lang_encoding'            => 'iso-8859-1',


#
#---------[5. AFTER, ADD]------------------------------------------------------
#

'No Guests Reading'             =>      'Only logged in users are allowed to read profiles.',

#
#---------[ 4. SAVE/UPLOAD ]--------------------------------------------------
#

I hope this works out nicely. A small hack, but keeps bandwidth down, I mean what guest needs to read profiles?

- kriptonic

Re: Anti Guest Profiles

Ah, the first mod to use Cactuz' ModGenerator, excellent!

One tiny detail though. You should probably just check the boolean $cookie['is_guest'] since $cur_user will be completely empty if it's a guest. It works the way you posted, but it's prettier with is_guest :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Anti Guest Profiles

Ok, I may do that as 2.0 -

ETA - Whenever a feel like investigating. lol

- kriptonic

Re: Anti Guest Profiles

Ok, got bored and fixed this. I decided it to be v.2 since it was completely rewritten.

- kriptonic

5 (edited by Cactuz 2003-08-16 14:18)

Re: Anti Guest Profiles

Now submit that at PunBB Resource smile

Byt why use $lang_common['No Guests Reading'] when there already is a no_permission?

Re: Anti Guest Profiles

I wanted a custom text there. wink I will submit it now. smile

- kriptonic

Re: Anti Guest Profiles

First of all I would like to say this: I am very picky. If I release a version of PunBB and I find that I have a typo in a comment or an unnessecary tab in one of the scripts, I go crazy. That's how picky I am :-)

I love the fact that you guys want to help out the PunBB community (or what is to become the PunBB community), so don't get man when I barge in and complain over some tiny little detail.

I have two comments on your mod:

1. You jumped to 2.0 fairly quickly I must say. Actually, it doesn't feel like changing one if statement is reason enough to bump up the version number to 2.0. I would call this version 1.0.1.

2. Cactuz and I worked together on ModGen (he did all the coding) to make sure that anything it spits out looks exactly the way we want it. No extra spaces there and no lowercase characters there. The readme.txt you have included above does not look like something that ModGen has generated. Could you perhaps run it through ModGen again so that it conforms to "the standard"?

You see? Now you're thinking: What's wrong with this guy? Is he a 73 year old lady or what? :-)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Anti Guest Profiles

1. I rewrote the code COMPLETELY, why would I name it 1.0.1 meaning I gave it a different build? It's a totally different version.

2. I will RERUN it, but THAT is EXACTLY what came out.. wink

- kriptonic

Re: Anti Guest Profiles

Kriptonic wrote:

1. I rewrote the code COMPLETELY, why would I name it 1.0.1 meaning I gave it a different build? It's a totally different version.

Ok, ok. I just figured you would want to stay at version 1 since nobody ever had the opportunity to download the actual version 1.0. Well, it was here for a few hours, but that's it.

Kriptonic wrote:

2. I will RERUN it, but THAT is EXACTLY what came out.. ;)

I just ran it and this is the result

##
##
##        Mod title:  Anti-Guest Profile
##
##      Mod version:  2.0
##   Works on PunBB:  1.0
##     Release date:  2003-08-20
##           Author:  Andrew West A.K.A. Kriptonic
##
##      Description:  This mod gives guest the error message "You do not have
##                    permission to access this page." when trying to view
##                    profiles.
##
##   Affected files:  lang/en/en_common.php
##                    profile.php
##
##       Affects DB:  No
##
##            Notes:  This mod has been completely rewritten due to a
##                    suggestion made by Kennel and works the same.
##
##                    Generated with ModGenerator (http://modgen.cactuz.nu/)
##                    on: 2003-08-19 11:45:11
##
##       DISCLAIMER:  Please note that modifications are not officially
##                    supported by PunBB. Installation of this modification
##                    is
##                    done at your own risk. Backup your forum database and
##                    any and all applicable files before proceeding.
##
##


#
#---------[ 1. OPEN ]---------------------------------------------------------
#

profile.php


#
#---------[ 2. FIND (line: 27) ]----------------------------------------------
#

require 'include/common.php';


#
#---------[ 3. AFTER, ADD ]---------------------------------------------------
#

// Begin Anti Guest Profiles Mod
if ($cookie['is_guest'])
        message($lang_common['No Guests Reading'].' <a href="login.php">'.$lang_common['Login'].'</a> '.$lang_common['or'].' <a href="register.php">'.$lang_common['register'].'</a>.');
// Begin Anti Guest Profiles Mod


#
#---------[ 4. OPEN ]---------------------------------------------------------
#

lang/en/en_common.php


#
#---------[ 5. FIND (line: 8) ]-----------------------------------------------
#

'lang_encoding'            => 'iso-8859-1',


#
#---------[ 6. AFTER, ADD ]---------------------------------------------------
#

'No Guests Reading'             =>      'Only logged in users are allowed to read profiles.',


#
#---------[ 7. SAVE/UPLOAD ]--------------------------------------------------
#

I've changed the disclaimer a bit and sent it to Cactuz. Hopefully, he will update ModGen today. Perhaps he will then fix the small bug with the wordwrapping in the disclaimer text :-)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Anti Guest Profiles

The disclaimer and the bug is hopefully fixed now. But I have no energy to test it wink

Re: Anti Guest Profiles

Kennel, is see where you're coming from. But you have to really make it right with standards, because say if you were to have PunBB, and totally rewrote (but still no downloads we logged) it would HAVE to ve v.2 as it was completely rewrote..

Oh well it's not big deal. lol Let's just let it go.. I'll just start naming them like .01 and changing their build numbers until 1.0 if necessary. smile

- kriptonic