Link for credits

Results 1 to 4 of 4
  1. #1
    Valued Member dezertawp is offline
    MemberRank
    Apr 2006 Join Date
    BulgariaLocation
    100Posts

    Link for credits

    Hi. Let me present you this system. Gives to any user unique link (by username). When someone click on it gives between 1 and 3 credits for webshop. Works only on muweb 0.8

    vote.php put it in modules folder.
    PHP Code:
    <center>
    <?php
    include "conreal.php";

    $id stripslashes($_GET['id']);
    $id str_replace("drop"""$id);
    $id str_replace(";"""$id);
    $id str_replace("shutdown"""$id);
    $id str_replace("UPDATE"""$id);
    if (
    eregi("[^a-zA-Z0-9_-]"$id))
    {
        echo 
    "Asshole.";
    }
    else
    {
        if (
    $_POST['click'])
        {
            echo 
    "<font color='#FFFFFF'>";

            
    $time time();
            
    $time1 time() - 86400;
            
    $ip $_SERVER['REMOTE_ADDR'];

            
    $s mssql_num_rows(mssql_query("SELECT * from MEMB_INFO where memb___id='$id'"));
            if (
    $s == "1")
            {
                
    $query mssql_query("SELECT * from items WHERE ip='$ip' and userid='$id' and vreme>$time1 ORDER by vreme DESC");
                
    $broi mssql_num_rows($query);
                if (
    $broi == "0")
                {
                    
    $rand rand(1,3);
                    
    $insert mssql_query("INSERT INTO items (vreme, userid , ip ) VALUES('$time','$id','$ip')");
                    
    $update mssql_query("Update MEMB_CREDITS set credits = credits+$rand WHERE memb___id='$id'");
                    echo 
    "You successful vote for $id and he get $rand credits!";
                }
                else
                {
                    echo 
    "You are already vote. You can vote again after 24 hours.";
                }

                echo 
    "</font>";
            }
            else
            {
                echo 
    "This user doesn't exist!";
            }
        }
        else
        {
    ?>
        <form action="http://watch-bg.info/en/index.php?op=vote&id=<?= $id ?>" method="post">
        <input type="submit" value="Vote for <?= $id ?>" name="click">
        </form>
        <?php
        
    }
    }
    ?>
    </center>
    link.php in modules again.
    PHP Code:
    <center><font color='#FFFFFF'>
    <?php
    include "conreal.php";
    if (
    $_SESSION['user']==TRUE)
    {
    $user=$_SESSION['user'];
    echo 
    "
    Разпространявайте линка си за кредити в webshop-а.<br> Твоят линк е:
    <br><br><a href='
    $yoursite/index.php?op=vote&id=".$user."'>$yoursite/index.php?op=vote&id=".$user."</a>";
    }
    ?>
    </font></center>
    topreferal.php ... modules/
    PHP Code:
    <?php
    include "conreal.php";
    $query mssql_query("SELECT DISTINCT TOP 100 (userid), broi from items order by broi desc");
    while (
    $a $fetch mssql_fetch_array($query)) {
        
        
    $id $a['userid'];
        
    $getname mssql_query("SELECT * from MEMB_INFO where memb___id='$id'");
        
    $fatch mssql_fetch_array($getname);
        
    $username $fatch['memb___id'];

        
    $broi mssql_num_rows(mssql_query("SELECT * from items where userid='$id'"));
        
    $up mssql_query("UPDATE items SET broi='$broi' WHERE userid='$id'");
        
    $username $fatch['memb___id']; 
        

        
        echo 
    '
    $username '-' $broi '<br>

    '
    ;
    }
    ?>
    conreal.php in main directory
    PHP Code:
    <?php
    $conn
    =mssql_connect('localhost','sa','password'); 
    $selected=mssql_select_db('MuOnline'$conn);

    $yoursite="http://Yoursite"// Your website without /! Example http://referalsystem.com
    ?>

    Query Analizerin MuOnline database MuOnline
    Code:
    CREATE TABLE [items] (
    	[vreme] [int] NULL ,
    	[userid] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    	[ip] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    	[broi] [int] NULL 
    ) ON [PRIMARY]
    GO

    And... made new link which goes to http://mysite.com/index.php?op=link

    Credits: NewGuy


  2. #2
    RZ's most loyal knight Dios is offline
    ModeratorRank
    Apr 2005 Join Date
    ArgentinaLocation
    5,241Posts

    Re: Link for credits

    Approved

  3. #3
    Account Upgraded | Title Enabled! Lisko is offline
    MemberRank
    Dec 2007 Join Date
    BulgariaLocation
    440Posts

    Re: [Release] Link for credits

    The code is bugged :) (for me, so i wrote new)

    SQL:
    PHP Code:
    if exists (select from dbo.sysobjects where id object_id(N'[dbo].[vote_credits]') and OBJECTPROPERTY(idN'IsUserTable') = 1)
    drop table [dbo].[vote_credits]
    GO

    CREATE TABLE 
    [dbo].[vote_credits] (
    [
    account] [varchar] (255COLLATE Chinese_PRC_CI_AS NOT NULL ,
    [
    time] [bigintNOT NULL 
    ON [PRIMARY]
    GO 
    vote.php
    PHP Code:
    <?php 
    if (isset($_SESSION['user'])){
    require(
    "config.php");
    $account_id stripslashes($_SESSION['user']);
    $account_id clean_var($account_id);
    $id = (int)$_GET['id'];
    $credits '10'// credits to add
    $link 'http://yourvotelink.net '// lik to vote
    echo "
    <form method='post' action='' >
    <table class='sort-table' width='350' border='0' cellspacing='0' cellpadding='0' align='center'>           
    <thead>
    <tr><td> Гласувай за нас и вземи кредити за Уеб Магазина </td></tr>
    </thead>
    <tbody>
    <tr><td><br />
    - Въведи коректно посоченият код и гласувай за сървъра.<br />
    - При всяко гласуване получавате 
    $credits кредита. <br />
    - Може да гласувате само веднъж на всеки 12 часа.<br /></td></tr>
    <tr><td>&nbsp;</td></tr>
    </tbody>
    </table>
    </form>"
    ;

    $time time();
    $timeup $time 43200
    $query mssql_query("SELECT * from vote_credits WHERE account='$account_id' and time>'$timeup'");
    $check mssql_num_rows($query);
    if (
    $check == "0") {
    $insert mssql_query("INSERT INTO vote_credits (account, time) VALUES ('$account_id','$time')");
    $update mssql_query("Update MEMB_CREDITS set credits = credits+$credits WHERE memb___id='$account_id'");
    echo 
    "<meta http-equiv=\"refresh\" content=\"0;url=$link\" />";
    }
    else
    {
    echo 
    "<br /><table class='sort-table' width='350' border='0' cellspacing='0' cellpadding='0' align='center'>           
    <tr><td><font color=red>Вече сте гласували за последните 24 часа.</font></td></tr>
    </table>"
    ;
    }
    }
    else { 
    echo 
    "<table class='sort-table' width='450' border='0' cellpadding='0' cellspacing='0' align='center'><tr><td>&nbsp;</td></tr><tr><td class='center'><a href='$link' target='_blank'>Please Vote For Us</a></td></tr><tr><td>&nbsp;</td></tr></table><br />";
    }
    ?>
    Link in Muweb Website:
    http://yoursite.com/index.php?op=vote

  4. #4
    Account Upgraded | Title Enabled! Lisko is offline
    MemberRank
    Dec 2007 Join Date
    BulgariaLocation
    440Posts

    Re: [Release] Link for credits

    Quote Originally Posted by DarkMaster. View Post
    credits: [DаrksTeam]newguy

    aslo stop to copy > paste from our forum, u even didnt ask us.
    That`s script is wroten by me :) can`t i release it when i want ?
    Last edited by Lisko; 10-08-09 at 12:31 PM.



Advertisement