Jump to content

'Free iPod Script' Tweaking, Constants.inc.


Earnshaw24

Recommended Posts

Heyo People.

 

Have been desperately searching for some help.

 

Well, I have set up this site - www.uk-rewards.com

 

Using a script, I have adjusted the script countless times for tweaks and such however, there is one major thing that is in the way. This being, the code that determines how many referalls you need per product.

 

However, when you edit it, it changes the amount so all products require that amount of referalls. So I can't have products with different amounts.

 

:(

 

Here is the constants.inc,

 

Hopefully you can help!

 

 <?php

define('MAX_INT',2147483647);

define('FE_USER_EMAIL_EXISTS',          'e-mail exists in database');
define('FE_EMPTY_EMAIL',                'Empty email');
define('FE_USER_DOMAIN',                'Invalid email');
define('FE_USER_PASSWORD',              'Passwords are required and must be at least 3 letters long');
define('FE_USER_SELECT_IPOD',           'You must select a free gift');

define('FE_ERROR_REF',                'You must to enter at least one correct email.');

define('USERS_ON_PAGE',              20);

define('COUNT_SELF',                  1);
define('COUNT_REFERALS',              5);


$ipods = array(
        1=>
            '80gb Video iPod',
            'Xbox 360 Premium',
            'Nintendo Wii',
        );



// you may modify this strings

?>
   

Link to comment
https://forums.phpfreaks.com/topic/37607-free-ipod-script-tweaking-constantsinc/
Share on other sites

COUNT_REFERALS needs to be replaced by an array and the number of referals for each plromotion should be entered in teh same order as in the ipods array;

 

 

$count_referals  = array(
                                5, // 80g ipod
                                12, // Xobx
                                9, //Wii
                                );
$ipods = array(
                   '80gb Video iPod',
                   'Xbox 360 Premium',
                   'Nintendo Wii',
                   );

 

You will then have to search your code for COUNT_REFERALS and replace it with $count_referal[$ipodkey] ($ipodkey) is the index of the promotion from the array $ipods which you can grab using array_keys();

 

Feel free to send me Nintendo Wii for solving this.....

Right, this is what the constants looks like now :)

 

<?php

define('MAX_INT',2147483647);

define('FE_USER_EMAIL_EXISTS',          'e-mail exists in database');
define('FE_EMPTY_EMAIL',                'Empty email');
define('FE_USER_DOMAIN',                'Invalid email');
define('FE_USER_PASSWORD',              'Passwords are required and must be at least 3 letters long');
define('FE_USER_SELECT_IPOD',           'You must select a free gift');

define('FE_ERROR_REF',                'You must to enter at least one correct email.');

define('USERS_ON_PAGE',              20);

$count_referals  = array(
                                8, // 80g ipod
                                12, // Xobx
                                10, //Wii
                                );


$ipods = array(
        1=>
            '80gb Video iPod',
            'Xbox 360 Premium',
            'Nintendo Wii',
        );



// you may modify this strings

?>

 

Then the only code I could find that was similar to what you said.

 

Was in the 'editinfo.tpl'

 

and that looks like so:

 

{if $session.user_id == 1}
    Referer: <a href="account.php?id={$referer_id}">{$cache_userdata.$referer_id.email|default:"none"}</a><br><br>
{/if}

Offers complete: {$cache_userdata.$id.count_self}
{if $session.user_id == 1 && !($cache_userdata.$id.count_self)}
    <br><a href="add_approved.php?user_id={$id}">[ Add completion record ]</a>
{/if}
<br>
Friends accomplished: [b]{$cache_userdata.$id.count_referals}[/b]<br>
<br>
{if $cache_userdata.$id.assigned}
    Prize assigned.<br>
    Prize recived: {$cache_userdata.$id.recieved_date|default:"not yet"}
    {if !($cache_userdata.$id.recieved_date) && $session.user_id == 1}
    <input type=submit name="send" value="Mark sent">
    {/if}

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.