The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
4 posters

    Referral-based Registration

    Poll

    Do you agree or disagree ?

    [ 1 ]
    Referral-based Registration Bar_left25%Referral-based Registration Bar_right [25%] 
    [ 3 ]
    Referral-based Registration Bar_left75%Referral-based Registration Bar_right [75%] 

    Total Votes: 4
    okamii
    okamii
    Forumember


    Posts : 40
    Reputation : 2
    Language : English

    Referral-based Registration Empty Referral-based Registration

    Post by okamii March 5th 2024, 6:52 pm

    Add the ability to turn on an referral-based registration from the admin panel and be able to set/manage a list of codes from there that could be used for new users when creating a new account. So when turned on, on registration page would be asked as required to type down a referral code to be able to create a new account.
    invisible_fa
    invisible_fa
    Active Poster


    Male Posts : 1020
    Reputation : 26
    Language : Spanish, English and a bit of French ;)
    Location : Does it matter? I'm Invisible, you will not see me anyway

    Referral-based Registration Empty Re: Referral-based Registration

    Post by invisible_fa March 8th 2024, 11:34 am

    Hi.

    So, this would be a system where you can be invited by someone else and this person sends you a code and you have to fill it when you register, isn't it?

    Well, you can do already something similar, but it would be a manual task.

    You can create a custom profile field (text field), where people can say if they have been invited by other community member, and write the nickname.

    Later, as admin, you can check if that other member exists, and, if so, you accept the new member and let him/her start posting on your forum (playing with permissions)

    YoshiGM, SarkZKalie and TonnyKamper like this post

    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51499
    Reputation : 3523
    Language : English
    Location : United States

    Referral-based Registration Empty Re: Referral-based Registration

    Post by SLGray March 8th 2024, 11:53 pm




    Referral-based Registration Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    darrin5698
    darrin5698
    New Member


    Posts : 1
    Reputation : 1
    Language : English

    Referral-based Registration Empty Re: Referral-based Registration

    Post by darrin5698 August 12th 2024, 8:05 am

    okamii wrote:Add the ability to turn on an referral-based registration from the admin panel and be able to set/manage a list of codes from there that could be used for new users when creating a new account Vantage ADP. So when turned on, on registration page would be asked as required to type down a referral code to be able to create a new account.
    To implement a referral-based registration system with admin management, you'll need to follow these general steps:

    1. Database Schema
    Update your database schema to support referral codes and track their usage.

    Referral Codes Table: Store the referral codes and their details.

    sql
    Copy code
    CREATE TABLE referral_codes (
    id INT AUTO_INCREMENT PRIMARY KEY,
    code VARCHAR(255) UNIQUE NOT NULL,
    is_active BOOLEAN DEFAULT TRUE,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    );
    Users Table: Add a field to track which referral code was used.

    sql
    Copy code
    ALTER TABLE users
    ADD COLUMN referral_code_id INT,
    ADD FOREIGN KEY (referral_code_id) REFERENCES referral_codes(id);
    2. Admin Panel Interface
    Create an interface in your admin panel to manage referral codes.

    Add New Referral Code: Provide a form to create new referral codes.
    List Referral Codes: Display existing referral codes with options to activate/deactivate or delete.
    3. Registration Form
    Modify the registration form to include a referral code field.

    Frontend: Add an input field for the referral code in your registration form.

    html
    Copy code
    <label for="referral_code">Referral Code</label>
    <input type="text" id="referral_code" name="referral_code" required>
    Backend Validation: Validate the referral code when the user submits the registration form.

    javascript
    Copy code
    // Example in Node.js/Express
    app.post('/register', async (req, res) => {
    const { referral_code, ...userDetails } = req.body;
    if (referral_code) {
    const referral = await db.query('SELECT * FROM referral_codes WHERE code = ? AND is_active = TRUE', [referral_code]);
    if (!referral.length) {
    return res.status(400).send('Invalid referral code');
    }
    userDetails.referral_code_id = referral[0].id;
    }
    // Proceed with user registration
    });
    4. Admin Panel Functionality
    Integrate the referral code management into your admin panel.

    Create Referral Codes: Provide functionality to add new codes.
    Manage Existing Codes: Allow activation, deactivation, or deletion.
    Tracking Usage: Optionally, track which referral codes are used and by how many users.
    5. Testing
    Ensure thorough testing:

    Create Referral Codes: Verify that codes can be created and managed correctly.
    Register with Codes: Test registration with and without valid/invalid referral codes.
    Admin Functions: Ensure that admins can manage referral codes as expected.
    6. Deployment
    Deploy your changes to the production environment.

    Example Technologies
    Backend: Node.js with Express, Python with Django, PHP with Laravel
    Frontend: React, Vue, Angular
    Database: MySQL, PostgreSQL, MongoDB
    By following these steps, you'll be able to implement a referral-based registration system with admin management capabilities.

      Current date/time is September 23rd 2024, 9:19 am