New Webid Banner System 1.2

This new banner system allows users to add there own banners from there user control panel

  1. jjjason84
    WeBid Version:
    • 1.1.0
    ------ UPDATED 9/1/2013 -----
    I do not know if this mod will work in webid version 1.1.0

    ------ UPDATED 4/16/2013 -----
    This new banner system allows users to add there own banners from there user control panel.

    Some info about the mod

    1. The user can create as many banner user accounts as they want. (But they will have to pay the fee to activate there account for each banner user account that was created.)

    2. The banner fees can be controlled in the admin area.

    3. If the user deletes all there banners by mistake they don't have to re-pay the fee to re-upload there banner as long as they still have there banner user account and all there banners was deleted it will be free to re-upload only 1 banner or if the user deletes only 1 of there banners they will be allowed to re-upload a replacement banner.

    4. Users can delete there own banner user account.

    5. Users can add Text under banner

    6. Users can add ALT text to there banner

    7. Users can add Views purchased (If the user sets this to 20 and after the banner was Viewed 20 times it will turn the banner off)

    8. Users can edit there banners (This is free)

    9. Banner fees are live payment as soon as the user pays the fee there account will be activated or allowed to upload a extra banner (The fees can be controlled in the admin area)

    10. User can add Keywords to there banner

    11. Maximum banner size 400x100 pixels

    NOTES: I have no idea if the other payment gateways will work with this mod because i don't have accounts on the other payment gateways to test them.

    The tpl pages is barebone coding and you will have to style them.

    Install steps
    1. login to your sql and go to your webid sql
    Click on the SQL tab at the top (If you are using phpmyadmin) and enter these codes

    For these 2 SQL syntax you will have to change the value column from DOUBLE (8,4) TO DOUBLE (8,2) to get the live payment to work correctly for the banner system and to fix the fee system in your webid.
    PHP:
    INSERT INTO `webid_fees`(`id`, `fee_from`, `fee_to`, `fee_type`, `value`, `type`) VALUES (NULL,'0.0000','0.0000','flat','0.00','banner_fee')

    INSERT INTO `webid_fees`(`id`, `fee_from`, `fee_to`, `fee_type`, `value`, `type`) VALUES (NULL,'0.0000','0.0000','flat','0.00','ex_banner_fee')
    PHP:
    ALTER TABLE `webid_bannersusersADD `sellerint(11NOT NULL;
    ALTER TABLE `webid_bannersusersADD `newuserenum('y''n'NOT NULL;
    ALTER TABLE `webid_bannersusersADD `paidint(2NOT NULL
    ALTER TABLE `webid_bannersusersADD `ex_banner_paidenum('n''y'NOT NULL;
    ALTER TABLE `webid_bannersusersADD `time_stampint(20NULL
    ALTER TABLE `webid_bannersADD `sellerint(11NOT NULL;   
    2. Add these to language/EN/messages.inc.php
    PHP:
    $MSG['350_10129'] = "There is a $5.00 fee for every extra banner you add to your account.<br> After you pay the $5.00 fee you will be allowed to upload a extra banner to your account.";
    $MSG['350_10130'] = "Add New Account";
    $MSG['350_10131'] = "Delete selected accounts (banners will be deleted)";
    $MSG['350_10132'] = "Banner Setup Fee";
    $MSG['350_10133'] = "Advertisement Banner Setup Fee";
    $MSG['350_10134'] = "Extra Advertisement Banner Fee";
    $MSG['350_10135'] = "New advertisement account";
    $MSG['350_10136'] = "Extra Banner Fee";
    $MSG['350_10137'] = "To upload your banner please proceed to one of the payment gateways listed below to pay the fee of <b>%s</b>.";
    $MSG['350_10138'] = "Extra Banner Fee of <b>%s</b>";
    $MSG['350_10139'] = "To activate your banner account please proceed to one of the payment gateways listed below to pay the fee of <b>%s</b>.";
    $MSG['350_10127'] = "There is a $10.00 setup fee and by clicking the (Add New Account) button you are agreeing to pay the $10.00 setup fee and will be redacted to the payment page and after the payment has been made your new account will be activated.";
    $MSG['350_10121'] = "My Advertisement";
    $MSG['350_10122'] = "Your Banners Control Panel";
    $MSG['350_10124'] = "Back";
    $MSG['350_10125'] = "Manage Account Info";
    $MSG['350_10123'] = "Maximum width and height can not exceed 400x100 pixels";
    3. Open pay.php
    find this code
    PHP:
    case 7// pay final value fee (live mode)
            
    if (isset($_GET['auction_id']))
            {
                
    $_SESSION['auction_id'] = intval($_GET['auction_id']);
            }
            if (!isset(
    $_SESSION['auction_id']) || $_SESSION['auction_id'] < || $system->SETTINGS['fee_type'] != 2)
            {
                
    header('location: index.php');
                exit;
            }
            
    $pp_paytoemail $gateway_data['paypal_address'];
            
    $an_paytoid $gateway_data['authnet_address'];
            
    $an_paytopass $gateway_data['authnet_password'];
            
    $wp_paytoid $gateway_data['worldpay_id'];
            
    $tc_paytoid $gateway_data['toocheckout_id'];
            
    $mb_paytoemail $gateway_data['moneybookers_address'];
            
    $query "SELECT current_bid FROM " $DBPrefix "auctions WHERE user = " $user->user_data['id'] . " AND id = " $_SESSION['auction_id'];
            
    $res mysql_query($query);
            
    $system->check_mysql($res$query__LINE____FILE__);
            
    $final_value mysql_result($res0);
            
    $query "SELECT value FROM " $DBPrefix "fees WHERE type = 'endauc_fee' ORDER BY value ASC";
            
    $res mysql_query($query);
            
    $system->check_mysql($res$query__LINE____FILE__);
            while (
    $row mysql_fetch_assoc($res))
            {
                if (
    $final_value $row['fee_from'] && $final_value $row['fee_to'])
                {
                    if (
    $row['fee_type'] == 'flat')
                    {
                        
    $payvalue $row['value'];
                    }
                    else
                    {
                        
    $payvalue = ($row['value'] / 100) * $final_value;
                    }
                }
            }
            
    $custoncode $_SESSION['auction_id'] . 'WEBID7';
            
    $message sprintf($MSG['776'], $system->print_money($payvalue));
            
    $title $system->SETTINGS['sitename'] . ' - ' $MSG['791'];
            
    $fees->add_to_account($MSG['791'], 'endauc_fee'$payvalue);
            break;
    Add after it
    PHP:
    case 8:  // Pay new banner user account fee (live mode)       
            
    $query "SELECT value FROM " $DBPrefix "fees WHERE type = 'banner_fee'";
            
    $sql mysql_query($query);
            
    $system->check_mysql($sql$query__LINE____FILE__);
            
    $payvalue mysql_result($sql0);
            
    // Retrieve users from the database
            
    $query "SELECT u.*, COUNT(b.user) as count FROM " $DBPrefix "bannersusers u
            LEFT JOIN " 
    $DBPrefix "banners b ON (b.user = u.id)
            GROUP BY u.id ORDER BY u.name"
    ;
            
    $res mysql_query($query);
            
    $system->check_mysql($res$query__LINE____FILE__);
                while (
    $row mysql_fetch_assoc($res))
                {
                    if(
    $row['seller'] == $_SESSION['WEBID_LOGGED_IN'] && $row['paid'] == && $row['newuser'] == y)
                    {
                    
    $id $row['id'];
                    }
                }
            
    $pp_paytoemail $gateway_data['paypal_address'];
            
    $an_paytoid $gateway_data['authnet_address'];
            
    $an_paytopass $gateway_data['authnet_password'];
            
    $wp_paytoid $gateway_data['worldpay_id'];
            
    $tc_paytoid $gateway_data['toocheckout_id'];
            
    $mb_paytoemail $gateway_data['moneybookers_address'];
            
    $custoncode $id 'WEBID8';
            
    $message sprintf($MSG['350_10139'], $system->print_money($payvalue));
            
    $title $system->SETTINGS['sitename'] . ' - ' $MSG['350_10135'];
            
    $fees->add_to_account($MSG['350_10135'], 'banner_fee'$payvalue);
            break;
        case 
    9// Pay extra banner fee (live mode)
            
    $query "SELECT value FROM " $DBPrefix "fees WHERE type = 'ex_banner_fee'";
            
    $sql mysql_query($query);
            
    $system->check_mysql($sql$query__LINE____FILE__);
            
    $payvalue mysql_result($sql0);
            
    // Retrieve users from the database
            
    $query "SELECT * FROM " $DBPrefix "bannersusers WHERE id = " intval($_POST['pfval']);
            
    $res mysql_query($query);
            
    $system->check_mysql($res$query__LINE____FILE__);
                while (
    $row mysql_fetch_assoc($res))
                {
                    if(
    $row['seller'] == $_SESSION['WEBID_LOGGED_IN'] && $row['paid'] == && $row['newuser'] == n)
                    {
                    
    $id $row['id'];
                    }
                }
            
    $pp_paytoemail $gateway_data['paypal_address'];
            
    $an_paytoid $gateway_data['authnet_address'];
            
    $an_paytopass $gateway_data['authnet_password'];
            
    $wp_paytoid $gateway_data['worldpay_id'];
            
    $tc_paytoid $gateway_data['toocheckout_id'];
            
    $mb_paytoemail $gateway_data['moneybookers_address'];   
            
    $custoncode $id 'WEBID9';
            
    $message sprintf($MSG['350_10138'], $system->print_money($payvalue));
            
    $title $system->SETTINGS['sitename'] . ' - ' $MSG['350_10136'];
            
    $fees->add_to_account($MSG['350_10136'], 'banner_fee'$payvalue);
            break;
    Save and close pay.php

    Importing Notes
    You may also need the paypal IPN fix mod to get the payment system to work in webid if you use the paypal IPN fix mod you will have to add the codes that is shown below to the paypal IPN fix mod pages.
    http://www.webidsupport.com/forums/showthread.php?6185-Paypal-IPN-fix&highlight=paypal

    4. Open includes functions_fees.php
    Find this code
    PHP:
    case 7//final value fee
                    
    $query "UPDATE " $DBPrefix "winners SET ff_paid = 1 WHERE ff_paid = 0 AND auction = " $custom_id " AND seller = " $user->user_data['id'];
                    
    $system->check_mysql(mysql_query($query), $query__LINE____FILE__);
                    
    $query "UPDATE " $DBPrefix "users SET suspended = 0 WHERE id = " $user->user_data['id'];
                    
    $system->check_mysql(mysql_query($query), $query__LINE____FILE__);
                break;
    Add after it
    PHP:
    case 8//Activate New Banner Account
                    
    $query "UPDATE " $DBPrefix "bannersusers SET paid = 1 WHERE id = " $custom_id;
                    
    $system->check_mysql(mysql_query($query), $query__LINE____FILE__);
                break;
                case 
    9//Activate Extra Banner on banner user account
                    
    $query "UPDATE " $DBPrefix "bannersusers SET ex_banner_paid = 'y' WHERE id = " $custom_id;
                    
    $system->check_mysql(mysql_query($query), $query__LINE____FILE__);
                break;
    Save and close functions_fees.php

    5. edit themes/your theme/user_menu.tpl
    Find this code
    PHP:
    <li><a href="mail.php">{L_623}</a> {NEWMESSAGES}</li>
            <
    li><a href="outstanding.php">{L_422}</a></li>
    Add after
    PHP:
    <li><a href="managebanners.php">{L_30_0215}</a></li>
    Save and close themes/your theme/user_menu.tpl

    6. upload the files to your webid

    7. go to your admin area and clear the cache.

    8. your done

Recent Reviews

  1. svendiesvuota
    svendiesvuota
    5/5,
    Version: 1.2
    good