Ref - Link Script (Schneeballsystem)

09/17/2014 15:36 Chill3rruXx#1
Hallo ich wollte fragen ob jemand so ein script braucht da man damit auch super spieler für seinen Server werben kann ?
09/17/2014 15:59 .Colossus.#2
Würde mich interessieren ;)
Release es doch einfach.
09/17/2014 18:00 Chill3rruXx#3
ne wenn dann nur vk sry.
09/17/2014 18:12 .Colossus.#4
Dann ist das die falsche Section.

#Moverequest.
09/17/2014 18:34 .Ambition シ#5
release doch einfach...als ob das einer kauft
09/17/2014 18:41 lfcmaus#6
mit ref link versteh ich jetzt so das man in die homepage ein script einbaut welches automatisch nach x sekunden auf hompeage x weiter leitet sowas oder was meinst damit?
09/17/2014 19:06 Chill3rruXx#7
nein das ist so wie bei meiner ex seite jeder user der da drauf geht bekommt einen extra link den er weiter schicken muss. Dann bekommt man pro klick auf deinen link einen Punkt oder what ever :)
09/17/2014 19:22 .Tobias#8
Das hat man in 2 Minuten gecodet.
09/17/2014 23:42 Chill3rruXx#9
schön für dich aber dein server sieht trotzdem nach Müll aus :)
09/17/2014 23:45 .Tobias#10
Achso :o
Mit deinem Ref Link Script was man in 5 Minuten Codet sieht ein Server natürlich viel besser aus.
Ich wusste das ja nicht.

Falls jemand das haben will meldet euch ich Scripte euch das kostenlos.
09/18/2014 02:38 Coniesan#11
For Hen Script (mysql_query API) @ Quick Coding:

100 Coins als Belohnung dafür dass man den Link verbreitet und wenn jemand drauf klickt
1x Pro IP
Weitere Prüfungen sind nurnoch Formsache...
Dauer des Codings hierfür: 10min
PHP Code:
<?
class reflink {
    private 
$db;
    private 
$bonus;
    
    public function 
__construct($database)
    {
        
$this->db $database;
        
        
// Coins für Reflink klick
        
$this->bonus 100;
    }
    
    public function 
getLink($value)
    {
        
$qry 'SELECT id FROM account.account WHERE login LIKE "'.$_SESSION['user_name'].'";';
        
$exec mysql_query($qry$this->db)or die(mysql_error());
        
$id mysql_fetch_object($exec)->id;
        if(empty(
$id))
            throw new 
Exception('No id found');
        return 
$id;
    }
    
    public function 
doAction($value)
    {
        if(!
$this->checkInt($value))
            return 
'Invalid reflink!';
        
        if(!
$this->checkRef($value))
            return 
'You already voted';
        
        
$qry 'INSERT INTO account.refcheck VALUES ("'.$value.'","'.$this->getIP().'",NOW());';
        
$exec mysql_query($qry$this->db);
        
        
$qry 'UPDATE account.account SET coins=coins+'.$this->bonus.' WHERE id="'.$value.'";';
        
$exec mysql_query($qry$this->db);
        
        return 
'Reflinking successful!';
    }
    
    private function 
checkRef($value)
    {
        
        
$qry 'SELECT count(ip) AS sum FROM account.refcheck WHERE id="'.$value.'" AND ip="'.$this->getIP().'" and AND `date` >= CAST(NOW() - INTERVAL 1 DAY AS DATE);';
        
$exec mysql_query($qry$this->db);
        
$count mysql_fetch_object($exec)->sum;
        if(
$count 0)
            return 
false;
        return 
true;
    }
    
    private function 
getIP()
    {
        
$ip trim(addslashes($_SERVER['REMOTE_ADDR']));
        return 
$ip;
    }
    private function 
checkInt($value) {
        
$checkit preg_match("/^[0-9]+$/",$value);
        if(
$checkit) return true;
        else return 
false;
    }
}
    
$this->reflink = new reflink($sqlServ);

if(!empty(
$_SESSION['user_name']))
{
    echo 
'Your reflink: 
        <input type="text" value="http://your-page.com/?p=reflink&id='
.$this->reflink->getLink($_SESSION['user_name']).'" />
    '
;
}
if(!empty(
$_GET['p']) && $_GET['p']=='reflink' && !empty($_GET['id']))
{
    echo 
$this->reflink->doAction($_GET['id']);
}

?>
PS: Dieses Script ist nicht getestet (Fee-Coding)
HF damit ;)

#Edit:
Hatte nochn bissel LW und ne lustige Idee:
Leveln durch Reflink, damit meine ich:
Pro erfolgreichen Reffer bekommt man exp und steigt auf der HP im Level auf, wobei man pro lv. Coins oder anderes Zeug bekommt (Items, was weiß ich!?)
Hier mal ein kleiner Entwurf:
exp Class
PHP Code:
class exp {
    private 
$db;
    
    public function 
__construct()
    {
        
$this->db = new $database;
    }
    
    public function 
setExp($userID$exp)
    {
        if(
$exp 0)
            
$exp '+'.$exp;
            
        
$sql 'UPDATE '.$this->db->webdb['level'].'.exp SET exp=exp'.$exp.' WHERE uid='.$userID.';';
        
$result $this->db->exec($this->db->web$sql);
        if(empty(
$result) || $result === false)
            return 
false;
        else
            return 
true;
    }
    
    public function 
getExp($userID)
    {
        
$sql 'SELECT exp FROM '.$this->db->webdb['level'].'.exp WHERE uid='.$userID.';';
        
$result mysqli_fetch_object($this->db->exec($this->db->web$sql))->exp;
        if(empty(
$result) || $result === false)
            return 
false;
        else
            return 
true;
    }

Level Class
PHP Code:
<?php
class level {
    private 
$exp;
    private 
$expTmp;
    private 
$expNeed;
    private 
$level;
    
    public function 
__construct()
    {
    }
    
    public function 
getLevel($userID)
    {
        
$this->exp = new exp;
        
$this->expTmp $this->exp->getExp($userID);
        
$this->expNeed 100;
        
        
$this->level 0;
        while(
$this->expTmp >= $this->expNeed)
        {
            
$this->expNeed $this->expNeed + ($this->expNeed 50);
            
$this->expTmp $this->expTmp $this->expNeed;
            
$this->level++;
        }
        return 
$this->level;
    }
}
?>
example php
PHP Code:
    function __autoload($name) {
        include(
"./".$name.".class.php");
    }
    
spl_autoload_register("__autoload");
    
    
$level = new level;
    echo 
$level->getLevel(1);