Advertisement:

Author Topic: Invitation System  (Read 81940 times)

Offline machinenoob

  • Semi-Newbie
  • *
  • Posts: 49
Re: Invitation System
« Reply #160 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.

Offline hadesflames

  • SMF Hero
  • ******
  • Posts: 2,773
  • Gender: Male
  • C++ Coder
Re: Invitation System
« Reply #161 on: February 19, 2013, 03:29:01 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.

Offline machinenoob

  • Semi-Newbie
  • *
  • Posts: 49
Re: Invitation System
« Reply #162 on: February 20, 2013, 12:31:26 PM »
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.

Offline machinenoob

  • Semi-Newbie
  • *
  • Posts: 49
Re: Invitation System
« Reply #163 on: February 23, 2013, 01:28:59 PM »
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

Code: [Select]
// 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

Code: [Select]
$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
Code: [Select]
$txt['gift_receiver_email'] = 'Receiver' . "'s" . ' Email:';

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

in INVITE.TEMPLATE.PHP add this function
Code: [Select]
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.

Offline machinenoob

  • Semi-Newbie
  • *
  • Posts: 49
Re: Invitation System
« Reply #164 on: February 24, 2013, 09:24:22 AM »
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..




Offline danigp6

  • Newbie
  • *
  • Posts: 2
Re: Invitation System
« Reply #165 on: March 08, 2013, 05:38:20 AM »
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

Offline jafonseca

  • Semi-Newbie
  • *
  • Posts: 57
Re: Invitation System
« Reply #166 on: April 29, 2013, 06:41:05 AM »
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??¿

Offline hadesflames

  • SMF Hero
  • ******
  • Posts: 2,773
  • Gender: Male
  • C++ Coder
Re: Invitation System
« Reply #167 on: May 01, 2013, 09:19:25 AM »
@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.

Offline JFFP

  • Semi-Newbie
  • *
  • Posts: 60
  • Gender: Male
Re: Invitation System
« Reply #168 on: June 06, 2013, 07:08:17 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

Offline slavegirl

  • Newbie
  • *
  • Posts: 1
Re: Invitation System
« Reply #169 on: June 06, 2013, 05:05:34 PM »
Some improvements of this mod.


Offline carlos777

  • Newbie
  • *
  • Posts: 1
Re: Invitation System
« Reply #170 on: June 28, 2013, 12:53:56 PM »
hi!
 I'm trying to install this mod on my forum, and throws me this error when installing

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

Code: [Select]
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


Offline thestone

  • Newbie
  • *
  • Posts: 9
Re: Invitation System
« Reply #171 on: September 01, 2013, 09:40:14 AM »
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
« Last Edit: September 01, 2013, 10:45:03 AM by thestone »

Offline net5

  • Newbie
  • *
  • Posts: 8
Re: Invitation System
« Reply #172 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.

Offline dllb

  • Newbie
  • *
  • Posts: 2
Re: Invitation System
« Reply #173 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.

Offline hadesflames

  • SMF Hero
  • ******
  • Posts: 2,773
  • Gender: Male
  • C++ Coder
Re: Invitation System
« Reply #174 on: March 04, 2014, 01:18:38 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.

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...

Offline net5

  • Newbie
  • *
  • Posts: 8
Re: Invitation System
« Reply #175 on: March 06, 2014, 01:14:08 PM »
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.

Offline hadesflames

  • SMF Hero
  • ******
  • Posts: 2,773
  • Gender: Male
  • C++ Coder
Re: Invitation System
« Reply #176 on: March 08, 2014, 10:31:22 PM »
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.

Offline TMR Guy

  • Jr. Member
  • **
  • Posts: 136
Re: Invitation System
« Reply #177 on: March 27, 2014, 07:10:54 PM »
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


Offline SlowRiot

  • Newbie
  • *
  • Posts: 1
Re: Invitation System
« Reply #178 on: April 16, 2014, 10:12:32 AM »
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.

Offline TMR Guy

  • Jr. Member
  • **
  • Posts: 136
Re: Invitation System
« Reply #179 on: April 21, 2014, 02:35:20 PM »
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)

Quote
The 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  ???