News:

Wondering if this will always be free?  See why free is better.

Main Menu

Invitation System

Started by hadesflames, July 21, 2010, 10:50:15 PM

Previous topic - Next topic

machinenoob

Request if possible:

Ability to generate keys for other users or give keys away.  Of course Admin gets as many as possible.

hadesflames

Quote from: machinenoob on February 18, 2013, 07:32:45 PM
Request if possible:

Ability to generate keys for other users or give keys away.  Of course Admin gets as many as possible.

This feature already exists.

machinenoob

ahh I found it... where you can GIFT it out. 

one thing to mention is that it still lists it created under the Admin and doesn't show WHO you gave it too.  also it uses the person's ID... now i know its not hard to get the ID by looking at the users profile links for u=####.. but is there a way it could be easily changed to the email??? make it simpler.

OR

how about an option to just give a credit to another person by email.  So instead of generating it for them, you can give them +1 on their numbers and -1 on yours (or admin unlimited).

Just wondering...but thankyou for your hard work... i was browsing the code and WOW trying to keep up with some of it was intimidating because not only am i looking at PHP, but also how SMF codes its functions.

If you could implement this, it would be great, but I know it takes time.

machinenoob

OK by messing around I found out how to change it from the "Receiver id:" to the "Receiver's Email:" and use the users EMAIL.  It will also change the creator to the USER you gave it to so that you know it is theirs when looking up what keys are active and who has them.  The previous way gave the key to the member, but still showed it was created by the original user.  So if the admin was the ONLY person creating keys and wanted to see what key went to which person you couldn't do it without looking in the database and looking at the ID for which it was assigned.

in INVITE.PHP

// Looks like this guy is giving this thing away.

if(!empty($_GET['sa']) && $_GET['sa'] == 'gift' && !empty($_GET['id']) && allowedTo('gift_invites')){

$empty = empty($_POST['receiver']);

checkSession($empty ? 'get' : 'post');



if($empty){

$context['invite_gift']['id'] = $_GET['id'];

$context['sub_template'] = 'gift';

return;

}else{

$email_gift = $_POST['receiver'];

$request = $smcFunc['db_query']('', '

SELECT *

FROM {db_prefix}members

WHERE email_address = {string:id}

LIMIT 1',

array(

'id' => $email_gift

)

);

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

$smcFunc['db_free_result']($request);

if(empty($gift_info)){

$context['sub_template'] = 'no_email';

return;

}

$receiver = $gift_info['id_member'];
$gift_name = $gift_info['member_name'];


and then at the end

$smcFunc['db_query']('', '

UPDATE {db_prefix}invites

SET member_id = {int:receiver},
member_name = {string:membername}

WHERE invite_id = {int:id}

LIMIT 1',

array(

'receiver' => $receiver,

'id' => $invite_id,

'membername' => $gift_name,

)

);


in INVITE.ENGLISH.PHP added

$txt['gift_receiver_email'] = 'Receiver' . "'s" . ' Email:';

$txt['no_email'] = 'Email was not found.';


in INVITE.TEMPLATE.PHP add this function

function template_no_email(){

global $txt;



echo '

<div class="cat_bar">

<h3 class="catbg">

', $txt['invite_error'],'

</h3>

</div>

<span class="clear upperframe"><span></span></span>

<div class="roundframe"><div class="innerframe">

<div style="text-align: center;">', $txt['no_email'], '</div>

</div></div>

<span class="lowerframe"><span></span></span>';

}


All credits go to the original mod designer.  I hope he will consider incorporating it with BETTER optimized coding.  I am no coder by far.

Thank you for your mod Hadesflames, it is much appreciated.

machinenoob

I also created a form in the admin that uses the same GIFT idea, but instead to give the user invites,but the invitation system is setup on MEMBERGROUPS max invites, and not necessarily the actual invite_max...

not sure why it was setup this way... to me the easiest way would be to just have invite count and subtract from there until 0, but i understand being able to set each group to a roll max/etc.

so the way the system is setup now... this is how I think it should be setup... if I am TOTALLY wrong or someone has a better Idea PLEASE post/correct mine.

probably in the MEMBERGROUPS this should have ROLL MAX.. so that the when the system runs it will only roll over that amount (ex. if a user has 15 invites (invite max), it will set it to what ever ROLL MAX is even if its only 5.  This would be based on invite count, since this number should keep growing.  THen you could probably get a statistics page on how many invites the user has generated.

so on the mod page there should not just be ROLL MAX numbers there should be also CURRENT INVITES.. because it when you set each group, it changes MAX INVITES, INVITE ROLL MAX, INVITE MAX to the same numbers....

Another suggestion
MAX INVITES = maximum for each group no matter what.
ROLL MAX = maximum that will carry over on top of the current invite max
INVITE MAX = maximum each person can invite. 

example
GROUP NEWBIE = MAX INVITES in membergroups = 10
user JOHN =, INVITE COUNT = 0, INVITE MAX = 1, ROLL MAX = 5

This means john can generate only 10 keys throughout his time as a newbie.  He has earned 1 invite, and has not used it. At the end of the cycle the system will leave everything alone because its less than MAX INVITES and less than ROLL MAX.

8 months later JOHN = INVITE COUNT = 8, INVITE MAX = 20, ROLL MAX = 5.

This means JOHN has earned up to 20 invites, but the max he can ever currently use is 10, so the system won't let him go above 10.  However he can roll 5 keys for when he MOVES up the GROUP ladder, so his INVITE MAX would drop to 13 so that he still rolls over the 5 on top of his current 8.

OK this is long and I got lost myself.. anyway... just a suggestion..

If someone can explain it better or has a better suggestion, PLEASE post it..

Hadesflames may incorporate it, or may not, but a user with coding skills might take on the challenge..




danigp6

Hi all, I have a problem installing this mod.

I had a 500 server error when doing it. Do I have to do something manually? Maybe it is a problem with permissions

What can I do? Thank you

jafonseca

I have a question, when a registered user (normal user) generate an invitation and the new user make registration uin the forum, the in the profile new user does  not appear the line invited by:___ , usually it put in the database  that is invited by user id 255 that does not exit, but the invitation had been make by an user!!
In other user groups the they make the invite code, and the new user make registration in the forum, in the profile of the new shows invited by:---
How can I find the error? Why put the name who invited that person in Member groups and not in comme registered users? What is the membre of ID 255 that does not exist??¿

hadesflames

@machinenoob the invite max column is so that the mod knows how many invites to refill the user with whenever you have it set to refill.

JFFP

Quote from: jafonseca on April 29, 2013, 06:41:05 AM
What is the membre of ID 255 that does not exist??¿

Because member ID 255 not exist in your forum (deleted account), only members up to 255 ID can receive and manage yours invites, if you are a member 300 and create a new key, your key will be saved as 255's key.
Someone can help with this? I have 7000 ID's

slavegirl

Some improvements of this mod.


carlos777

hi!
I'm trying to install this mod on my forum, and throws me this error when installing

SQL logic error or missing database
near "DESCRIBE": syntax error
File: /home/u542269640/public_html/Packages/temp/install.php
Line: 74


db_extend('packages');

$smcFunc['db_create_table']($invite['table'], $invite['columns'], $invite['indexes'], array(), 'ignore');

$request = $smcFunc['db_query']('', '
DESCRIBE {db_prefix}members invited_by',
array()
);


Does anyone could help me?

I am Spanish and I am translating with google, hope it reads well. thanks


thestone

#171
I installed the mod, how is write here in special page for instructions: http://custom.simplemachines.org/mods/index.php?action=parse
But, nothing was happenned, when I access install.php, I receive a blank page.
Someone want to help me?



// SOLVED

net5

Hello.

Well im using that mod but i cant find out the way to generate invite keys or send invite email from normal members.

dllb

Is there any chance that you might update the mod any time soon, so it will work with v. 2.0.7 as well? That would be awesome.

hadesflames

Quote from: net5 on February 01, 2014, 09:04:42 PM
Hello.

Well im using that mod but i cant find out the way to generate invite keys or send invite email from normal members.

Make sure normal members have permission to use the mod. Go to the permissions section in the admin panel.

Quote from: dllb on February 05, 2014, 04:46:40 PM
Is there any chance that you might update the mod any time soon, so it will work with v. 2.0.7 as well? That would be awesome.

1.1.1 worked fine in 2.0.7. You should upgrade to 1.1.2, which also works fine in 2.0.7. What was the problem you had...

net5

Hello.

1st: Great mod.
2nd: I installed a mod " Menu Editor Lite " for the nav bar. when i installed that mod the Invites tab gone. Any help to restore it ? Thanx!


[SOLVED]: i add a tab from menu editor lite to be external this: /index.php?action=invite  for everyone with the same problem.

hadesflames

This means the menu editor mod was not done properly. I suspect Labradoodle probably just approved the mod himself thinking it was fine even though his code is usually terrible.

TMR Guy

Hello all,

I am very new at this computer stuff so please bear with me as I might get some of the terminology wrong. I just learned how to copy and paste a year ago but I'm learning fast lol. I do try and find the answer on my own by reading as much as I can but sometimes it gets a little overwhelming, it's like trying to read a foreign language (like I said I'm very new at this) Anyways if someone would be kind enough to help me out it would be greatly appreciated.

I installed this mod and it only works with my Admin account, my members keep getting this message saying "Sorry, but you can not generate anymore keys for now. Please contact your administrator to find out when you can generate more keys," when they use the Send Key via Email or Generate Invitation Key tab. I'm sure I'm just missing something simple like checking a box or setting user's permission, but I can't for the life of me figure it out or does it not work with 2.0.7? If not can someone suggest a similar mod that will?

Thanks in advance,

TMR Guy


SlowRiot

Hi,

There appears to be a bug with batch email invite mode.  The list of names and addresses appears to get processed correctly, and you get a confirmation saying they've been emailed - however, only the first email is sent, and only the first key is generated.  Mail server logs confirm that no other emails are attempted.

The system is Debian linux x86_64, webserver is apache2, php 5.5.11-2 and the mail server is exim4 4.82.

TMR Guy

But it only works with my Admin account, my members keep getting this message saying "Sorry, but you can not generate anymore keys for now. Please contact your administrator to find out when you can generate more keys," when they use the Send Key via Email or Generate Invitation Key tab.

I'm only allowing one member group to invite members and it's set to -1 (unlimited)

QuoteThe system is Debian linux x86_64, webserver is apache2, php 5.5.11-2 and the mail server is exim4 4.82.
I have no idea what that means  ???

Advertisement: