PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.


Login to move these ads to the bottom of the page

#1 2005-09-09 04:15:57

Tobi
Member
From: Samos, Greece
Registered: 2005-06-27
Posts: 48
Website

Invitation 1.1.1

Code:

##        Mod title:  Invitations
##
##      Mod version:  1.1.1
##   Works on PunBB:  1.2.5, 1.2.6, 1.2.7
##     Release date:  2005-09-09
##           Author:  Tobi (tobi@script.gr)
##
##      Description:  Allows users to send invitations. The invitations come with a code 
##                    that allows to track if the invitation has been sent 
##                    and who has invited the new user.
##                    Administrators can give invitations to users that tey can send out
##
##   Affected files:  functions.php
##                    profile.php
##                    register.php
##                    login.php
##                    admin_options.php
##                    admin_groups.php
##
##       Affects DB:  Yes
##
##            Notes:  1. The install_mod routine currently works only for MySQL.
##                    2. Missing Administration interface to monitor sent invitations
##                    3. Fixed some issues that occur when installing over an alrready modded 
##                    Installation
##                    4. Corrected typo in lang/English/invitation.php
##      Changes from 
##      Version 1.0   - Added custom text to be set by the administrator
##                    - Default number invitations to be given to new users
##                      adjustable by user group
##
##
##       DISCLAIMER:  Please note that "mods" 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.
##
##

Download here

Offline

 

#2 2005-09-10 04:48:00

Tobi
Member
From: Samos, Greece
Registered: 2005-06-27
Posts: 48
Website

Re: Invitation 1.1.1

There is a minor issue in plugins/AP_invitation.php.

Please go to line 465 and change

Code:

if($group != '')  {

to

Code:

if($group != 'all')  {

I fixed that in the downloads

Offline

 

#3 2005-10-07 14:39:11

Blind Guardian
New member
Registered: 2005-10-07
Posts: 5
Website

Re: Invitation 1.1.1

Having a problem with the e-mails it's sending out. they're coming through as broken HTML wth nothing but the following

Code:

to the board<a href='URL+HASH'>URL+HASH</a>

Obviously this means it's pretty much useless until I can get it fixed, and I'm really liking the mod otherwise. I've copied the links into my browser to check that they work, and I registered an account fine via said link, but people are apparently getting "unable to verify invitation No data" error messages.

Any ideas?

Last edited by Blind Guardian (2005-10-07 14:39:55)

Offline

 

#4 2005-10-08 01:39:46

Tobi
Member
From: Samos, Greece
Registered: 2005-06-27
Posts: 48
Website

Re: Invitation 1.1.1

Hi,

Try to take out the <a href.. part in include/mod_invitation.php on line 31.
Replace

Code:

     $mtext = $form['invitation_text'] . "\n".$lang_invitation['Forum Link']."<a href='".$act_link."'>".$act_link."</a>";

with

Code:

     $mtext = $form['invitation_text'] . "\n".$lang_invitation['Forum Link'].": " . $act_link;

Some clients don't interprete this right, some, however, need it.

Otherwise I don't know why your people get this error. Maybe they have cookies switched off?

Offline

 

#5 2005-10-08 05:49:49

Blind Guardian
New member
Registered: 2005-10-07
Posts: 5
Website

Re: Invitation 1.1.1

Thank you for the prompt reply.

I switch out those lines of code, and it removed the broken HTML 'a href' tags around the links, but the phrase for the actual text is apparently broken still.

I input "test" as the custom message when I sent the confirmation e-mail to myself.

The odd thing is, from what some of my members have told me, the people who they invite have been getting the e-mails fine, but the links don't work. I've send the e-mails to both my server e-mail, hotmail and gmail accounts, and they've all come through the same.

Either way, i'm assuming some phrases are broken somewhere, so I'll try and hunt them down while waiting for a reply.

Thanks again for your time.

EDIT: Where exactly would $lang_invitation['Forum Link'] be defined?

EDIT2: Okay, the error they were getting regarding "Unable to verify invitationNo data." was because some of my members decided it'd be easier to e-mail the invite to themselves, then hand out the links over instant messenger. Thus when the invitee didn't use the same e-mail address, it wouldn't let them validate it.

EDIT3: Somewhat of a bodge-job, but I straightened out the e-mail. I basically just put everything I wanted in via quotation marks, but everyting's coming through fine on the test e-mails now.

Code:

 $mtext = "You have been invited to join the Horridthinking forums."."\n"."\n"."If you would like to browse the forums before registering, please click the following link:"."\n"."www.horridthinking.com/forums/"."\n"."\n"."Otherwise, please use the link below to register and credit the person who invited you (Note, you just use the same e-mail that this invitation was sent to whilst registering for it to be valid):" ."\n". $act_link ."\n"."\n". "In addition, your inviter left the following custom message:"."\n".$form['invitation_text'];

Last edited by Blind Guardian (2005-10-08 23:24:23)

Offline

 

#6 2005-10-13 01:10:40

Tobi
Member
From: Samos, Greece
Registered: 2005-06-27
Posts: 48
Website

Re: Invitation 1.1.1

Blind Guardian wrote:

Where exactly would $lang_invitation['Forum Link'] be defined?

There's a dedicated file invitation.php in the lang/YOURLANG directory.


Blind Guardian wrote:

I basically just put everything I wanted in via quotation marks

Shouldn't be necessary to do it like that but if it works now - why change it? smile

Offline

 

#7 2005-11-10 13:52:10

whoop
Guest

Re: Invitation 1.1.1

okay I need some help because I think I have missunderstood this mod..
what I want is an invitesystem to work even tho registration is closed.
i.e, I only want users that got an invitation from someone already on the board to be able to register.

but when I click the invitation-link in the mail when the option "Allow new registrations" is set to NO, I only get the "no new registrations is allowed" page...

is this how this script is supposed to work, or have I f*cked up the install?

(im running it on the latest version of punBB btw, had to change the allowed versions in the install-file wink )

 

#8 2005-12-17 14:07:28

hypnotoad
Member
Registered: 2005-11-10
Posts: 18

Re: Invitation 1.1.1

Any particular reason that this script changes me from an administrator on my install to a regular user when I login?  It happens every bloodly time.

Edit:  nevermind. I accidentally commented out the line

if ($group_id == PUN_UNVERIFIED)

LOL

Edit2:  I made a modification that some may find useful.  On my site, I've got another class of users called FrontPageSignup.  Basically, anyone who signs up by just coming to the site is put into this group and can only see 3 forums on the site. However, I have about 20 forums that the moderators and regular members can see.  Basically, my forum is for my friends with a few devoted to my webpage.   I don't want joe-schmoe coming in off the internet and reading what we're posting.  So...to get past this, I made the following changes on register.php

before the $db->query(INSERT' Line around line 210, add the following:

if($_POST['code'] != ''){
        $g_num = '4';
        }
        else $g_num = '6';

group 4 is a regular user who can see all the forums on my site.  group 6 is the aforementioned FrontPageSignup group.


Then in the INSERT query itself, instead of using .$intial_group_id. in the query, use .$g_num. instead.  I tested and it works great. 

I could have probably changed this code in register.php:

Code:

//MOD INVITATION: Validate invitation
    if($_POST['code'] != '')  {
      $code = pun_trim($_POST['code']);
      include_once(PUN_ROOT ."include/invitation_db.php");
      $inviter = checkInvitation($email1,$code);
      if(!is_numeric($inviter))  error('Unable to verify invitation'.$inviter, __FILE__, __LINE__, $inviter);
      }
    else $inviter = 0;
//END MOD INVITATION

to be this:

Code:

//MOD INVITATION: Validate invitation
    if($_POST['code'] != '')  {
      $code = pun_trim($_POST['code']);
      include_once(PUN_ROOT ."include/invitation_db.php");
      $inviter = checkInvitation($email1,$code);
          $g_num = '4';
      if(!is_numeric($inviter))  error('Unable to verify invitation'.$inviter, __FILE__, __LINE__, $inviter);
      }
    else {
          $inviter = 0;
          $g_num = '6';
         }
//END MOD INVITATION

but I didn't know if anything would get mucked up in doing so.  I may yet try that to streamline things.  Having the if statement before that works out well.  Hope someone gets some use out of this.

I'm just starting to learn php and can already tell I'm going to loveit.  XD

Oh yeah...you also spelled initial wrong in your variable assignment for group id, but you did it consistently so its all good.  smile


DOH!  One more thought.  If you do this, you should probably put an if statement into the profile.php file where the include line is to make sure the current users group is not equal to the one you don't want to see the forums.  Otherwise, people in that group can send out invitations and the recipients will be able to see the hidden forums.

Last edited by hypnotoad (2005-12-17 15:41:21)

Offline

 

#9 2005-12-17 15:35:14

hypnotoad
Member
Registered: 2005-11-10
Posts: 18

Re: Invitation 1.1.1

One other thing.  The invite e-mail sends out a badly formed url for my install.  It keeps insisting on putting a /cgi-system/ into the URL for the invite mail.  I changed mod_invitation.php to this:

Code:

 //    $pp = split("/",$_SERVER['SCRIPT_NAME']);
 //    array_pop($pp);
     $act_link = "http://".$_SERVER['HTTP_HOST']."/register.php?invite=".$code;

It seems to be behaving correctly now.

Last edited by hypnotoad (2005-12-17 16:10:01)

Offline

 

#10 2006-01-16 11:05:36

fredrik
New member
Registered: 2006-01-16
Posts: 2

Re: Invitation 1.1.1

And when I try to change setting for my user groups the following messege occur:

"An error was encountered
Error: Unable to update group. "

I'm using PunBB 2.1.10

I think I have located the problem to step 39 in the readme.txt.

#
#---------[ 38. FIND (line:261) ]-----------------------------------------------------
#

    $db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.$_POST['group_id']) or error('Unable to update group', __FILE__, __LINE__, $db->error());

#
#---------[ 39. REPLACE WITH ]-----------------------------------------------------
#

    $db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' , g_invitations='.$invitations.' WHERE g_id='.$_POST['group_id']) or error('Unable to update group', __FILE__, __LINE__, $db->error());

What to do? hmm

Offline

 

#11 2006-01-27 03:36:46

agravetoncas
Member
From: #gentoo on freenode
Registered: 2005-11-17
Posts: 28
Website

Re: Invitation 1.1.1

Code:

<?php
/***********************************************************************

  Caleb Champlin (med_mediator@hotmail.com)

************************************************************************/

// Language definitions used in viewforum.php in french
$lang_invitation = array(
'Invitations'    =>    'Invitations',
'New Invitations'    =>    'Créer des invitations',
'Send Invitation' => 'Envoyer une invitation',
'Request Invitation' => 'Demander invitation',
'Recipient'=>'Recepteur',
'Number'=>'Nombre',
'Message'=>'Message',
'You have'=>'Vous avez',
'Invitations left'=>'invitation(s) restante(s)',
'No code'=>'Auncune invitation disponnible',
'Mail Subject Invitation'=>'Vous avez reçu une invitation',
'Forum Link'=>'vers le forum',
'No Permission'=>'Privilèges insuffisants',
'Invitation redirect'            =>    'Invitation envoyée. Redirection... &hellip;',
'Invited By'=> 'Invité par'
);

Offline

 

#12 2006-08-29 23:08:58

lsantoro
New member
From: Buenos Aires, Argentina
Registered: 2006-07-04
Posts: 8
Website

Re: Invitation 1.1.1

Here you have invitation.php for spanish speaking people:

Code:

// Language definitions used in viewforum.php in spanish
$lang_invitation = array(
'Invitations'    =>    'Invitaciones',
'New Invitations'    =>    'Crear nuevas invitaciones',
'Send Invitation' => 'Enviar invitación',
'Request Invitation' => 'Solicitar invitación',
'Recipient'=>'Recipient',
'Number'=>'Número',
'Message'=>'Mensaje',
'You have'=>'Te quedan',
'Invitations left'=>'invitaciones',
'No code'=>'No tenés invitaciones disponibles',
'Mail Subject Invitation'=>'Invitación a CompradoresOnline!',
'Forum Link'=>'Ingresar',
'No Permission'=>'No tienes permisos para realizar esta acción',
'Invitation redirect'            =>    'Invitación enviada. Redirigiendo... &hellip;',
'Invited By'=> 'Invitado por'
);

SPECIAL THANKS TO:

Code:

$mtext = $form['invitation_text'] . "\n".$lang_invitation['Forum Link'].": " . $act_link;

Thanks, this worked.

Code:

 //    $pp = split("/",$_SERVER['SCRIPT_NAME']);
 //    array_pop($pp);
     $act_link = "http://".$_SERVER['HTTP_HOST']."/register.php?invite=".$code;

This also worked and fix the url to invite a friend!


"An error was encountered
Error: Unable to update group. "

The answer is here: http://forums.punbb.org/viewtopic.php?pid=60522#p60522

wink

Last edited by lsantoro (2006-08-30 10:29:46)

Offline

 

#13 2006-08-30 11:24:52

lsantoro
New member
From: Buenos Aires, Argentina
Registered: 2006-07-04
Posts: 8
Website

Re: Invitation 1.1.1

Well, finally I solved all the problems but Invitation Messaje defined in Options doesn't appears on invitations. ¿Any help?
I will also like to know if there is any way to allow registered users (no just NEW users) to invitate their friends.

Thanks wink

Offline

 

#14 2007-01-07 16:59:19

Chad
New member
From: Alberta, Canada
Registered: 2007-01-07
Posts: 3
Website

Re: Invitation 1.1.1

Hi there,

I installed the mod, although, my profile.php has quit working. sad  All I get is a blank page.

You can see my forum here:
http://www.whatistheamazon.com/forum/
and the profile.php:
http://www.whatistheamazon.com/forum/profile.txt

What am I missing?  How can I fix this as quick as possible?

Thanks for your reply (in advance)

Offline

 

#15 2007-01-10 17:07:28

Chad
New member
From: Alberta, Canada
Registered: 2007-01-07
Posts: 3
Website

Re: Invitation 1.1.1

Any ideas?

Thanks

Offline

 

#16 2007-01-11 08:06:45

elbekko
Moderator
From: Leuven, Belgium
Registered: 2006-01-31
Posts: 1422

Re: Invitation 1.1.1

Err, I can see profiles just fine =/


FluxBB
dictionary.com on programming: The most fun you can have with your clothes on (although clothes are not mandatory).

Offline

 

#17 2007-01-11 16:17:25

Chad
New member
From: Alberta, Canada
Registered: 2007-01-07
Posts: 3
Website

Re: Invitation 1.1.1

Yeah, because I had a backup from before I installed the mod.  Just look at the profile.txt I included.

Offline

 

#18 2007-04-14 04:17:49

Ant
New member
Registered: 2007-04-13
Posts: 8

Re: Invitation 1.1.1

Hello,

Can I use this mod with PunBB 1.2.14 ?

Thx wink

Offline

 

#19 2007-04-15 03:02:31

Mark
Moderator
From: North West England
Registered: 2005-06-06
Posts: 1252
Website

Re: Invitation 1.1.1

Yes, Just installed it on 1.2.15 and works fine smile


Cant find something you want? try searching
Also try the wiki
MSN - mark@21s6.com

Offline

 

#20 2007-04-15 03:14:20

Ant
New member
Registered: 2007-04-13
Posts: 8

Re: Invitation 1.1.1

Thank you very much wink

Offline

 

#21 2007-04-15 03:46:02

Ant
New member
Registered: 2007-04-13
Posts: 8

Re: Invitation 1.1.1

Er... How can I use the mod ?

Where can the members have their link invitation ?

Thank. wink

Offline

 

#22 2007-04-15 03:53:30

Mark
Moderator
From: North West England
Registered: 2005-06-06
Posts: 1252
Website

Re: Invitation 1.1.1

you go to the admin plugin, then give invitations to people to give out
then they go to there profile and it sends an email out to people with a link


Cant find something you want? try searching
Also try the wiki
MSN - mark@21s6.com

Offline

 

#23 2007-04-15 11:28:36

Ant
New member
Registered: 2007-04-13
Posts: 8

Re: Invitation 1.1.1

Thanks but I don't find link in my profil ?

Offline

 

#24 2007-04-15 12:02:07

Mark
Moderator
From: North West England
Registered: 2005-06-06
Posts: 1252
Website

Re: Invitation 1.1.1

its on the left just below privacy


Cant find something you want? try searching
Also try the wiki
MSN - mark@21s6.com

Offline

 

#25 2007-04-15 14:44:00

Ant
New member
Registered: 2007-04-13
Posts: 8

Re: Invitation 1.1.1

Er... I don't find.. hmm

It's on this board :
http://www.weboliens.com/forums/index.php

Thank you very much and I am really sorry for the problem

Last edited by Ant (2007-04-15 14:45:01)

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.