Advertisement:

Author Topic: Invitation System  (Read 82065 times)

Offline machinenoob

  • Semi-Newbie
  • *
  • Posts: 49
Re: Invitation System
« Reply #100 on: December 03, 2011, 12:08:33 AM »
Just as a notice this mod is not compatible with referral mod 3.0.3.  I installed the referral mod first and then tried to install the invitation mod and got errors on the registration.php

If i install this one first then the referral it worked great... not sure why.. just wanted to let you know/member know..

1)install invitation system first
2) install referral mod

also some of those modifications would be great mentioned above if there was a way for the admin to see who generated what key..

Offline krazytim

  • Semi-Newbie
  • *
  • Posts: 22
    • Tim Silva
Re: Invitation System
« Reply #101 on: December 03, 2011, 06:05:24 AM »
I finally got the mod working.

I somehow had an invite.template.php file within my custom theme's folder. So I deleted that file, uninstalled the mod, reinstalled it, and everything now works in both the default theme & my custom theme.

One last question: Is there a way to only allow for registration through invitation?

*edit - Nvm, I didn't realize I had to change my method of registration off of the "registration disabled" setting.

Thanks for the support! This mod is wonderful. :)

Offline machinenoob

  • Semi-Newbie
  • *
  • Posts: 49
Re: Invitation System
« Reply #102 on: December 04, 2011, 09:44:34 AM »
OK i have some questions...maybe I just set it up differently..

1) when someone registers they are not put in a permission group yet, so they are classified as newbie. Per membergroup invite numbers I have Newbie set at 0.  When testing this a newly registered member can generate 5 keys before they are out...

2) is there a way for the admin to generate a key FOR a member??

3) is there a way to increase a specified groups TOTAL amount of keys or is this automatically done when the number of days is set for more to be added... ??

Offline hadesflames

  • SMF Hero
  • ******
  • Posts: 2,773
  • Gender: Male
  • C++ Coder
Re: Invitation System
« Reply #103 on: December 05, 2011, 04:51:55 PM »
I finally got the mod working.

I somehow had an invite.template.php file within my custom theme's folder. So I deleted that file, uninstalled the mod, reinstalled it, and everything now works in both the default theme & my custom theme.

One last question: Is there a way to only allow for registration through invitation?

*edit - Nvm, I didn't realize I had to change my method of registration off of the "registration disabled" setting.

Thanks for the support! This mod is wonderful. :)

If you enable the mod, no one can register without an active key. You don't need to edit your registration settings. If you turn registration off, no one can register, key or not.

OK i have some questions...maybe I just set it up differently..

1) when someone registers they are not put in a permission group yet, so they are classified as newbie. Per membergroup invite numbers I have Newbie set at 0.  When testing this a newly registered member can generate 5 keys before they are out...

2) is there a way for the admin to generate a key FOR a member??

3) is there a way to increase a specified groups TOTAL amount of keys or is this automatically done when the number of days is set for more to be added... ??


1 - What?...

2 - Not really. You can create one, the edit the db to give it to someone else, but the mod itself does not support this.

3 - It's on the settings page. Go take a look.

Offline machinenoob

  • Semi-Newbie
  • *
  • Posts: 49
Re: Invitation System
« Reply #104 on: December 05, 2011, 07:04:59 PM »
Quote
1 - What?...

2 - Not really. You can create one, the edit the db to give it to someone else, but the mod itself does not support this.

3 - It's on the settings page. Go take a look.

1) I installed the mod.  I enabled the invite system.  When a person registers they are automatically placed in a "Regular Group" as well as a post based group NEWBIES.. I went to set permissions and it doesn't list REGULAR groups, just Group moderator and the others that I added.  Then it lists Newbies, etc.  For newbies I put 0 as the number.  But it still allows a regular member who is NOT placed in any group except the AUTOmatic NEWBIE to have 5 generated keys. 

I am no coder by any means, BUT i looked at the INSTALL PHP...

Code: [Select]
$invites_column = array(
1 => array(
'name' => 'invite_count',
'type' => 'int',
'size' => 5,
'null' => false,
'default' => 0,
'unsigned' => true,
),
2 => array(
'name' => 'invite_max',
'type' => 'int',
'size' => 5,
'null' => false,
'default' => 5, <---------------------------??????????
'unsigned' => false,
),
3 => array(
'name' => 'invite_roll_max',
'type' => 'int',
'size' => 5,
'null' => false,
'default' => 5,
'unsigned' => false,
),

To me it seems that when a user is created the DEFAULT is 5.  Maybe it should be 0 until they are added to a group.????

Not sure.. but that is my current guess...

Anyway regular members get 5 automatically when they register...is there another setting that i need to change in order to not allow this at all for the regular members?
« Last Edit: December 05, 2011, 07:08:12 PM by machinenoob »

Offline krazytim

  • Semi-Newbie
  • *
  • Posts: 22
    • Tim Silva
Re: Invitation System
« Reply #105 on: December 07, 2011, 12:29:56 AM »
Thanks for the feedback Hades.

Another few questions.

1.) Is there a way to show who a member was invited by? The old invitation system I used (for SMF 1) had an "Invited by: User" section on the profile pages.

2.) Even though I left the "Modify Member Group Settings" fields on "0" for some membergroups, every member group is able to generate invitation keys. How can I turn off invitations for membergroups?

3.) In the admin settings under "Manage Keys" every member link goes to the same page, which is a missing profile page "index.php?action=profile;u=255". So if I have 5 users who generated keys (Bill, Bob, Joe, John, and Josh), click on any one of their names in the list will take me to "index.php?action=profile;u=255" for some reason.

Just curious, is an update for this mod in the works?

Offline PLAYBOY

  • SMF Hero
  • ******
  • Posts: 2,065
  • Livephotoshop.com & Lullabyabc.com
    • Lullabies and Us
Re: Invitation System
« Reply #106 on: December 25, 2011, 03:23:16 PM »
When you send multiple invitations at once by writing emails and names seperated by commas, mod doesnt add the emails to SMF Emailing order (list) , it just sends them all at once which is a problem for the people who is using smf under a shared hosting because we can send 100-200 emails per hour. So can this be fixed?


Quote
1.) Is there a way to show who a member was invited by? The old invitation system I used (for SMF 1) had an "Invited by: User" section on the profile pages.

I wish. I desperately need it.

Quote
is an update for this mod in the works?

i use the current version under 2.0.2

Offline Alex311

  • Semi-Newbie
  • *
  • Posts: 69
Re: Invitation System
« Reply #107 on: February 23, 2012, 10:05:13 AM »
Hello

I installed this mod on version 2.0.2 it works perfectly.

I want to know which file edit to change the language of the world ?
I have a forum in French and the mod is in English.

Thank you for your answers

Offline CR Forum

  • Semi-Newbie
  • *
  • Posts: 99
Re: Invitation System
« Reply #108 on: February 26, 2012, 03:42:22 PM »
I installed it. Same issue of not wanting to have it available to everybody but only to select levels. I want to have it only for admins, for example. Also, the mod does not disable. I disabled it by checking the box but it was still showing up for other users. I had to uninstall it for this reason until i figure out how to get it working to my requirements. Great mod. Just needs a little more tweaking i guess.

Cheers!

Offline CR Forum

  • Semi-Newbie
  • *
  • Posts: 99
Re: Invitation System
« Reply #109 on: February 26, 2012, 04:47:16 PM »
Okay i was able to make it appear for Admin only. I wanted to know how to customize the text "The invitation key you used is invalid...". I tried finding it in modifications.english.php and errors.template.php but couldn't find anything....

Please advise.
Thanks
Sam

Offline CR Forum

  • Semi-Newbie
  • *
  • Posts: 99
Re: Invitation System
« Reply #110 on: February 26, 2012, 05:13:57 PM »
Problem: The way I made it to show up for admin only perhaps led to a problem with sessions for other members and I could not get folks who leggoed in to SMF log automatically in to WP through the WP-SMF bridge that I have installed. So I have to find a more cleaner way of making the button appear only for admin and for nobody else. A permission based way could be the best.

Offline kiziol

  • Newbie
  • *
  • Posts: 2
Re: Invitation System
« Reply #111 on: April 09, 2012, 08:23:22 AM »
Hello All... i have a problem with the mod... how to change the length of the generated code, I would like instead of 40 to generate 8th .. Thanks in advance Regards

Offline NeobeatIKK

  • Semi-Newbie
  • *
  • Posts: 12
Re: Invitation System
« Reply #112 on: April 28, 2012, 12:08:08 PM »
Works in smf 2.0.2... just wondering why this isn't listed as "2.0.2 compatible"

Offline machinenoob

  • Semi-Newbie
  • *
  • Posts: 49
Re: Invitation System
« Reply #113 on: April 29, 2012, 05:27:25 PM »
Just did a fresh install on 2.02.  At first it would not let me, but when navigating to the PACKAGES at the bottom RIGHT corner there is an ADVANCED option that allows you to emulate a different version.  Once I changed it to 2.01 the package was available to install.



Offline machinenoob

  • Semi-Newbie
  • *
  • Posts: 49
Re: Invitation System
« Reply #114 on: April 29, 2012, 05:49:06 PM »
Well I had been away from SMF for a while.. and came back and asked for a mod that was an invitation/referral type system... well no one really has time so I started looking at the code again on this mod.. I am no coder so if anyone can help.. any advice would be appreciated..

One issue that was mentioned above was the fact that when someone registers on the forum they are put in a group called NEWBIE and even if you set the number of invites to ZERO in the admin panel they are able to generate keys.  I am wondering if this is the reason???

Code: [Select]
function GenerateInviteKey()
{
global $context, $user_info, $smcFunc;

$request = $smcFunc['db_query']('', '
SELECT invite_count, invite_roll_max, invite_max
FROM {db_prefix}members
WHERE id_member = {int:id}
LIMIT 1',
array(
'id' => (int)$user_info['id'],
)
);

$member = $smcFunc['db_fetch_assoc']($request);

if(allowedTo('admin_forum') || $member['invite_max'] < 0) <-----------------------------this compares to see if its admin or if invite_max is -1 = unlimited invites....
{
// This person is an admin, or has infinite invites, no need to ask any questions.
$context['invitation_key'] = gen_key($user_info['id'], $user_info['name']);
$context['sub_template'] = 'invite_generate';
}
else <--------------------------------------------------------------------------------if your not admin and your invite_max is NOT set to -1 then do this...
{
// Sorry buddy, but the same can't be said about you ;)
$smcFunc['db_free_result']($request);

if($member['invite_count'] < $member['invite_roll_max']) <------------------ROLL MAX?????? should it be invite_max???? remember during install the invite_max and roll_max default to 5
{
// Good, you have some invites left =]
$context['invitation_key'] = gen_key($user_info['id'], $user_info['name']);
$smcFunc['db_query']('', '
UPDATE {db_prefix}members
SET invite_count = {int:count}
WHERE id_member = {int:id}',
array(
'count' => ((int)$member['invite_count']) + 1,
'id' => (int)$user_info['id'],
)
);
$context['sub_template'] = 'invite_generate';
}
else
// Sorry, maybe next time ;)
$context['sub_template'] = 'no_keys';
}
}

so not sure if that is the issue or not... Hades can you describe why you use invite_count, invite_max, invite_roll_max...

to me the member should only have a invite_count = current number of invites a user can make, which SUBTRACTS each time a key is generated, once it equals 0 then no more keys get generated....  as for invite_max_roll........in the admin panel it just asks if you would like them to roll over, NOT a number to allow to roll over??? looking at the code I notice you subtract these values, but why??? if you used just the invite_count option that subtracts, then you can set a default number of invites per group and then when they reach 0 that's it, no more and it would 1)never go away 2) could be a task to change after so many days 3) more could be added per admin panel for each group

if I am looking at this completely wrong PLEASE educate me.  I am trying to understand it

again thanks for this mod.

Offline Wuschii

  • Newbie
  • *
  • Posts: 5
Re: Invitation System
« Reply #115 on: May 13, 2012, 09:29:37 AM »
Can you please add 2.0.2 Support? That would be really nice!

EDIT: Just Changed the Compativle mode to 2.0.1 and installed it. Works very well!
« Last Edit: May 13, 2012, 09:48:41 AM by Wuschii »

Offline bolubeyi61

  • Sr. Member
  • ****
  • Posts: 758
  • Gender: Male
    • Spina Bifida Turkey
Re: Invitation System
« Reply #116 on: June 18, 2012, 06:44:37 PM »
thank you hadesflames. very good mod.

Offline IceFork

  • Semi-Newbie
  • *
  • Posts: 41
Re: Invitation System
« Reply #117 on: June 21, 2012, 07:22:08 PM »
¬°Thanks for the Mod hadesflames!


This is my Spanish translation:

Code: [Select]
<file name="$languagedir/Admin.spanish_es.php">
<operation>
<search position="end" />
<add><![CDATA[
//MOD Sistema de Invitaciones
$txt['invite_system'] = 'Sistema de Invitaciones';
$txt['invite_system_mod_settings'] = 'Ajustes Generales';
$txt['invite_system_mod_settings_desc'] = 'Modificar ajustes del Sistema de Invitaciones.';
$txt['invite_system_mod_settings_group'] = 'Ajustes de Grupos de Usuarios';
$txt['invite_system_mod_settings_group_desc'] = 'Modificar ajustes para cada Grupo de Usuarios.';
$txt['invite_system_mod_manage'] = 'Administrar Invitaciones';
$txt['invite_system_mod_manage_desc'] = 'Administrar todas las Invitaciones.';
$txt['invite_system_mod_generate'] = 'Generar Invitacion';
$txt['invite_system_mod_generate_desc'] = 'Generar nueva Invitacion.';
$txt['invite_system_mod_email'] = 'Ajustes de Correo';
$txt['invite_system_mod_email_desc'] = 'Administrar ajustes de Invitaciones por Correo electronico.';
]]></add>
</operation>
</file>



<file name="$languagedir/Errors.spanish_es.php">
<operation>
<search position="end" />
<add><![CDATA[
//MOD Sistema de Invitaciones.
$txt['invite_blank'] = 'No se ha introducido ningun Codigo de Invitacion.';
$txt['invite_wrong'] = 'El Codigo de Invitacion introducido es incorrecto.';
]]></add>
</operation>
</file>



<file name="$languagedir/index.spanish_es.php">
<operation>
<search position="end" />
<add><![CDATA[
//MOD Sistema de Invitaciones
$txt['invite'] = 'Invitaciones';
$txt['invite_key'] = 'Invitacion:';
$txt['invite_manage'] = 'Administrar Invitaciones';
$txt['invite_generate'] = 'Generar Invitacion';
$txt['invite_email_send'] = 'Enviar Invitacion por Correo';
]]></add>
</operation>
</file>



<file name="$languagedir/ManageScheduledTasks.spanish_es.php">
<operation>
<search position="end" />
<add><![CDATA[
//MOD Sistema de Invitaciones
$txt['scheduled_task_invitePrune'] = 'Eliminar Invitaciones no utilizadas';
$txt['scheduled_task_desc_invitePrune'] = 'Eliminar las Invitaciones a los 7 dias de no haber sido utilizadas.';
$txt['scheduled_task_keyExpire'] = 'Tiempo de expiracion de las Invitaciones';
$txt['scheduled_task_desc_keyExpire'] = 'Desactivar Invitaciones trascurrido un tiempo de no haber sido utilizadas.';
$txt['scheduled_task_keyRenew'] = 'Tiempo para renovar las Invitaciones';
$txt['scheduled_task_desc_keyRenew'] = 'Renovar las Invitaciones que un usuario puede generar.';
]]></add>
</operation>
</file>



<file name="$languagedir/Modifications.spanish_es.php">
<operation>
<search position="end" />
<add><![CDATA[
// MOD Sistema de Invitaciones.
$txt['invite_settings_title'] = 'Ajustes del Sistema de Invitaciones';
$txt['invite_enabled'] = 'Activar Sistema de Invitaciones';
$txt['invite_email'] = 'Activar Sistema de Invitaciones por Correo electronico';
$txt['invite_email_member'] = 'Enviar Invitacion por Correo';
$txt['roll_over'] = 'Permitir usar las Invitaciones no utilizadas durante un mes, el mes siguiente';
$txt['key_renew'] = 'Dias tras los que los usuarios volveran a disponer automaticamente de Invitaciones (0 = Desactivar)';
$txt['key_expire'] = 'Dias tras los que caducaran las Invitaciones (0 = Nunca caducan)';
$txt['invite_groups'] = 'Numero de Invitaciones por Grupo de Usuarios:<br />-1 = Invitaciones ilimitadas.';
$txt['invite_reg_page'] = 'Codigo de Invitacion:';
$txt['invite_error'] = 'Error';
$txt['invite_success'] = 'Aceptado';
$txt['invite_email_separate'] = 'Separa las diferentes direcciones de correo y nombres por comas.';
$txt['invite_email_subject'] = 'Asunto del Correo:';
$txt['invite_email_message'] = 'Mensaje del Correo:<br />
Codigos:<br />
{invitee} = Nombre del destinatario.<br />
{inviter} = Nombre de quien lo envia.<br />
{forum} = Nombre del foro.<br />
{message} = Cuerpo del mensaje.*<br />
{link} = Enlace a la pagina de registro.*<br />
{key} = Invitacion.*<br />
*Puede ser usado en el Asunto.';
$txt['invite_email_title'] = 'Enviar una Invitacion por Correo Electronico';
$txt['invite_email_invalid'] = 'La direccion de Correo introducida no es valida.';
$txt['invite_email_empty'] = 'No se ha rellenado algun campo, vuelve a intentarlo.';
$txt['invite_key_batch_sent'] = 'La Invitacion fue enviada a';
$txt['invite_key_batch_not_sent'] = 'La Invitacion no fue enviada a';
$txt['invite_email_not_sent_spaces'] = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
$txt['invite_email_not_sent_reason'] = array(
'porque la direccion de Correo electronico es invalida.',
'porque hubo un problema al enviar la Invitacion, ponte en contacto con el Administrador.',
'porque no dispones de Invitaciones.',);
$txt['invite_email_sent'] = 'La Invitacion ha sido enviada con exito.';
$txt['invite_email_not_sent'] = 'Hubo un problema al enviar tu Invitacion, ponte en contacto con el Administrador.';
$txt['invite_email_recipient_name'] = 'Nombre del destinatario:';
$txt['invite_email_recipient'] = 'Direccion de Correo electronico del destinatario:';
$txt['invite_email_recipient_message'] = 'Mensaje que se adjuntara a la Invitacion:';
$txt['invite_new_key_head'] = 'Tu nueva Invitacion';
$txt['invite_new_key'] = 'Tu nueva Invitacion es:<br /><br />';
$txt['invite_no_key'] = 'No dispones de Invitaciones.';
$txt['invite_system_no_keys'] = 'No hay Codigos de Invitacion.';
$txt['invite_system_key_id'] = 'Invitacion ID';
$txt['invite_system_member_name'] = 'Nombre del creador';
$txt['invite_system_key'] = 'Codigo de Invitacion';
$txt['invite_system_status'] = 'Estado';
$txt['invite_system_remove'] = 'Eliminar seleccionados';
$txt['invite_system_remove_all'] = 'Eliminar todos';
$txt['invite_system_change'] = 'Cambiar estado';
$txt['invite_system_remove_confirm'] = 'Vas a eliminar las Invitaciones seleccionadas.';
$txt['invite_system_remove_all_confirm'] = 'Vas a eliminar todas las Invitaciones.';
$txt['invite_system_change_confirm'] = 'Vas a cambiar el estado de las Invitaciones seleccionadas.';
$txt['active'] = 'Activa';
$txt['nactive'] = 'Inactiva';
$txt['save'] = 'Guardar';
$txt['send'] = 'Enviar';
]]></add>
</operation>
</file>


languages.xml file (english +  spanish_es) attached.

Offline IceFork

  • Semi-Newbie
  • *
  • Posts: 41
Re: Invitation System
« Reply #118 on: June 21, 2012, 07:30:42 PM »
Now, some questions...

How I can know the number of invitations that each user have?

How a user can know the invitations he has?

How do I assign invitations to a single user?

 ???

Sorry for my bad english.

Offline Mstcool

  • Sr. Member
  • ****
  • Posts: 911
Re: Invitation System
« Reply #119 on: July 25, 2012, 02:33:44 PM »
Does this work with 2.0.2?