Your ultimate PunBB resource!
You are not logged in.
## 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. ## ##
Offline
Having a problem with the e-mails it's sending out. they're coming through as broken HTML wth nothing but the following
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
Hi,
Try to take out the <a href.. part in include/mod_invitation.php on line 31.
Replace
$mtext = $form['invitation_text'] . "\n".$lang_invitation['Forum Link']."<a href='".$act_link."'>".$act_link."</a>";
with
$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
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.
test
to the board: http://www.horridthinking.com/forums/re … 1a44add0cc
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.
$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
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? ![]()
Offline
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
)
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:
//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 INVITATIONto be this:
//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 INVITATIONbut 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. ![]()
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
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:
// $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
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? ![]()
Offline
<?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... …', 'Invited By'=> 'Invité par' );
Offline
Here you have invitation.php for spanish speaking people:
// 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... …', 'Invited By'=> 'Invitado por' );
SPECIAL THANKS TO:
$mtext = $form['invitation_text'] . "\n".$lang_invitation['Forum Link'].": " . $act_link;
Thanks, this worked.
// $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![]()
Last edited by lsantoro (2006-08-30 10:29:46)
Offline
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 ![]()
Offline
Hi there,
I installed the mod, although, my profile.php has quit working.
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
Any ideas?
Thanks
Offline
Yeah, because I had a backup from before I installed the mod. Just look at the profile.txt I included.
Offline
Hello,
Can I use this mod with PunBB 1.2.14 ?
Thx ![]()
Offline
Er... How can I use the mod ?
Where can the members have their link invitation ?
Thank. ![]()
Offline
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
Offline
Thanks but I don't find link in my profil ?
Offline
Er... I don't find.. ![]()
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