[0.1.0c] Highway Referral Invitation MOD

MODs, Hacks, tips and tricks for memberlist, profiles, group members, and team members.
Custom Profile fields Hacks and MODs are also included

[0.1.0c] Highway Referral Invitation MOD

Postby Highway of Life » 03 Jan 2007, 10:32

Classification: Add-on
phpBB Part: Forum

MOD Author: Highway of Life
MOD Title: Highway Referral Invitation MOD
MOD Description: This mod adds the ability for users to invite friends via email, and keeps track of how many referrals they have. -- Adds a field to registration page which allows new users to enter in the member who referred them.
Gives the ability to use strictly invitations for registration on the board.
Admin can limit the number of allotted invitations per user.
Integrates with Handyman?s Cash MOD
MOD Version: 0.1.0c


Features and planned features:
Features planned in first released version of the Referral Invitation MOD:
    Referral Features:
  • Field on registration page that allows a user registering to enter the username of a current user
  • Every time a referral is added for a user, their referral count increases
  • The board will keep track of who referred who
  • A widget can be displayed anywhere showing the top 10 users with the most successful referrals
  • A widget can be displayed anywhere showing who last referred who and a link to invite YOUR friends
  • Option to allow referred users to become friends upon successful referral


    Invitation Features:
  • User can enter the emails of users they wish to invite
  • The board will keep track of the status of every invitation
    • Invitation Sent Status - with an option to send a reminder.
    • User Joined
    • User is active (made at least 1 post)
    • User visited (but did not join) - with an option to send a reminder.
  • User can have a limited number of invitations or unlimited
  • If the user has more than one invitation remaining, they can enter more friends emails to invite.
  • Invitations can expire after a set amount of time, and the invitation will be awarded back to the user.
  • Administrator can set the limit for invitations and assign additional invitations to groups or users manually
  • Administrator can revoke the permission for a user to use the invitation system -- useful if a user abuses it.
  • Ability to disable board registration, in which case an invitation key would be required to register. -- for private boards
  • Administrator can set the format of the invitation e-mail, or use a default template provided in multiple languages.
  • Memberlist in ACP will show how users with the most invitations left, and the users who have depleted their invitation count. This is useful if an Admin needs to assign users more invitations to pass out.
  • Users can donate invitations to other users
  • If a user is inside of a group, and they have permission to invite others to that group, the user invited will be automatically added to the group upon successful invitation. -- useful to provide group or forum specific invitations.
  • Option to set number of additional invitations awarded to users based on number of successful invitations
  • Option to set number of additional invitations awarded to users based on post count
  • Administration options will be included for all of these features, so you can set the invitation to be extremely simple, or utilize ALL of the features at your option.

Works with:
  • phpBB 3.0 RC7

Format:
Image
Language: English

Licence: GNU General Public License v2

History:
  • Version 0.1.0 First Beta release of the new Referral Invitation MOD.
  • Version 0.1.0 Added prosilver theme files and edits, added invitations table constant.

Screenshots:
Image Image Image

Installation Level: Easy
Installation Time: 10 Minutes
Format: STG-MODX
Download: highway_referral_invitation_mod.zip

STG Development Topic
phpBB.com Development Topic
phpBBModders Development Topic

FAQ:

Q: I am getting the following error:
Code: Select all
SQL ERROR [ mysql4 ]

Column 'user_id' cannot be null [1048]
A: This is a bug that will be fixed in the next release.
The fix is simple...
OPEN: referral.php
FIND:
Code: Select all
$row $rowset[0];  

BEFORE, ADD:
Code: Select all

        
if (!$rowset)
        {
            
// there was no result for this user... return;
            
return;
        }  
You do not have the required permissions to view the files attached to this post.
Last edited by Highway of Life on 20 Aug 2008, 22:26, edited 14 times in total.
Reason: updated package with theme files.
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10424
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10


Re: Referral MOD

Postby Highway of Life » 03 Jan 2007, 11:30

Planned features:
  • Integrate with Hanyman?s Cash MOD (automatically detect)
    • ACP configurable value for number of points to add per registered user based on referral
    • Additional points if the referred user reaches x number of posts

  • Add Module in the UCP where a user can enter multiple email addresses for users to invite
    1. ACP config value defines the format of the email sent to users to invite

  • AJAX powered usernames list on the referral box on registration

  • Referral box disappears if the session is already holding a referral from an email or link

  • Invitation / Referral combination
    • Registration by invitation only
    • Limit the number of invitations a user is allowed to have
    • Users gain additional invitations by post count
    • For integration with CashMOD: Give the option for invitation keys by cash points.
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10424
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: Referral MOD

Postby Waleed » 03 Jan 2007, 11:47

How is version 1 doing it? Does the registered user enter a username when registering? What if s/he gets the username wrong?
User avatar
Waleed
Commander
Commander
 
Posts: 669
Joined: 25 Jul 2006, 04:18
Location: Pakistan
Gender: Male
phpBB Knowledge: 6

Re: Referral MOD

Postby Highway of Life » 03 Jan 2007, 13:43

Version 1.2 released.

Yes, he can enter a username or user_id, if he gets it wrong, nothing happens, as in... nobody gets any credit, but the registration moves on anyways.
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10424
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: [1.2.1] Referral MOD

Postby Highway of Life » 03 Jan 2007, 14:02

MOD loaded here on STG.
Visit your viewprofile to see it in action. Grin
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10424
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: [1.2.1] Referral MOD

Postby Waleed » 04 Jan 2007, 04:10

hehe. cool! Grin
User avatar
Waleed
Commander
Commander
 
Posts: 669
Joined: 25 Jul 2006, 04:18
Location: Pakistan
Gender: Male
phpBB Knowledge: 6

Re: [1.2.1] Referral MOD

Postby Handyman » 24 Mar 2007, 17:23

Couple of things I noticed while installing this?
Spoiler:
change
Code: Select all
$referrer        request_var('referrer''');

to
Code: Select all
$referrer        request_var('referrer'''true);

that way people can type in usernames like ???


also
Spoiler:
your spacing is messed up on this one
Code: Select all
<td><!-- IF ACTIVE_TOPIC_PCT neq 0 --><b><a class="gen" href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></b><br /><span class="gensmall">[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
            </tr>
         <!-- ENDIF -->

it should be
Code: Select all
<!-- IF ACTIVE_TOPIC_PCT neq 0 --><b><a class="gen" href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></b><br /><span class="genmed">[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF -->

and last thing
Spoiler:
]when making the XML files, make sure there is no gap between the last character of the find/replace/after-add and the ending of the xml box "]", that makes a lot of extra spaces so you can't just click the header to copy

one more thing I just remembered
Spoiler:
Also, when starting a find, replace, add-after, or add-before, make sure your first line doesn't have tabs in front of it? so this
Code: Select all
        'REFERRALS'        => isset($data['user_referrals']) ? $data['user_referrals'] : 0,  // Referrer MOD 1.2
        
'U_REFERAL_URL'    => append_sid("{$phpbb_root_path}ucp.$phpEx"'mode=register&amp;referrer=' $data['user_id']), // Referrer MOD 1.2
        
'L_REFERRAL_EMAIL_BODY' => sprintf($user->lang['REFERRAL_EMAIL_BODY'], $config['sitename'], $config['site_desc'], generate_board_url() . "/ucp.$phpEx?mode=register%26referrer=" $data['user_id']), // Referrer MOD 1.2
        
'L_REFERRAL_EMAIL_SUBJECT' => sprintf($user->lang['REFERRAL_EMAIL_SUBJECT'], $config['sitename']), // Referrer MOD 1.2

should be
Code: Select all
'REFERRALS'        => isset($data['user_referrals']) ? $data['user_referrals'] : 0,  // Referrer MOD 1.2
        
'U_REFERAL_URL'    => append_sid("{$phpbb_root_path}ucp.$phpEx"'mode=register&amp;referrer=' $data['user_id']), // Referrer MOD 1.2
        
'L_REFERRAL_EMAIL_BODY' => sprintf($user->lang['REFERRAL_EMAIL_BODY'], $config['sitename'], $config['site_desc'], generate_board_url() . "/ucp.$phpEx?mode=register%26referrer=" $data['user_id']), // Referrer MOD 1.2
        
'L_REFERRAL_EMAIL_SUBJECT' => sprintf($user->lang['REFERRAL_EMAIL_SUBJECT'], $config['sitename']), // Referrer MOD 1.2
Please contact me if you have any news to submit to SCOFF News.
SCOFFing at the candidates while you sleep.
My Mods || My Mod Queue
Image
User avatar
Handyman    
STG Jedi Master
STG Jedi Master
 
Posts: 7234
Joined: 08 May 2006, 04:45
Location: Where no man has gone before!
Favorite Team: Seattle Seahawks
Gender: Male

Re: [1.2.1] Referral MOD

Postby Highway of Life » 24 Mar 2007, 17:33

Okay, thanks Handyman.

I?ll implement those when/if I get a chance.
I agree with everything except for #2
I think it should be <td>stuff</td> on one line
not
<td>
stuff
</td>
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10424
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: [1.2.1] Referral MOD

Postby Handyman » 24 Mar 2007, 17:38

I'm not saying that's how it should be? that's how it is in the template, so when I used the code you had there, I couldn't find the line it was supposed to find? because it's all on one line.
Please contact me if you have any news to submit to SCOFF News.
SCOFFing at the candidates while you sleep.
My Mods || My Mod Queue
Image
User avatar
Handyman    
STG Jedi Master
STG Jedi Master
 
Posts: 7234
Joined: 08 May 2006, 04:45
Location: Where no man has gone before!
Favorite Team: Seattle Seahawks
Gender: Male

Re: [1.2.1] Referral MOD

Postby sanis » 18 Apr 2007, 12:01

Hello,
How can i add inviting link into profile?
And inviting by e-mail form?
sanis
Cadet II
Cadet II
 
Posts: 28
Joined: 08 Mar 2007, 07:19
Gender: Male

Next

Return to Memberlist and Profiles

Who is online

Users browsing this forum: ccBot [Bot] and 0 guests