Ce este Verificarea Voturilor?

Este un sistem prin care se verifica daca jucatorii voteaza sau nu pentru siteul sau serverul tau prin introducerea corecta a codului de securitate pe pagina noastra de vot.

Postback PHP

Whitelist IP: monitor.topg.org in your Firewall Settings.

Pentru a activa postback URL mergi in Panou Utilizator si foloseste optiunea Edit corespunzatoare siteului sau serverului.

1. Seteaza Postback URL (pentru TopG):

https://YOURDOMAIN/postback.php
Pentru a seta acest link foloseste optiunea Edit din Panou Utilizator corespunzatoare serverului tau.
Numele fisierului postback.php este doar demonstrativ si poate fi schimbat dupa cum se doreste.


2. Actualizeaza link-ul tau de vot si adauga parametrul la sfarsit:

https://topg.org/CATEGORY/in-SITEID-PARAMETER
Link-ul tau de vote pentru TopG trebuie sa aiba un extra -PARAMETER la sfarsit. Copie LINK-ul din Cod de Votare si pune -USERNAME sau -123456 sau ce vrei sa tii ca evidenta. (PARAMETER poate fi doar numere, litere si _ ). De exemplu doresti sa verifici daca utilizatorul cu nume `Razor` a votat sau nu genereaza link-ul astfel https://topg.org/CATEGORY/in-SITEID-Razor.

3. Raspunsul nostru:

TopG va apela siteul tau doar daca votul este valid si apelul va arata astfel:
https://YOURDOMAIN/postback.php?p_resp=PARAMETER&ip=USERIP
Trimitem inapoi acelasi PARAMETER si apelul este realizat DOAR DAVA jucatorul a votat corect. Fisierul tau postback.php ar trebui sa ACTUALIZEZE in acel moment utilizatorul PARAMETER va fiind Valid. Daca acesta nu a votat, nu trimitem nici un raspuns/apel.


Exemplu:

Cum ar trebui sa arate link-ul tau de vote pentru User ID (primul exemplu) sau Username (al doilea):
https://topg.org/CATEGORY/in-SITEID-1234
https://topg.org/CATEGORY/in-SITEID-Razor

Raspunsul nostru, dupa vaz, primul sau al doilea, va fi:
https://YOURDOMAIN/postback.php?p_resp=1234&ip=123.123.123.123
https://YOURDOMAIN/postback.php?p_resp=Razor&ip=123.123.123.123
Concluzie: Jucatorul cu User ID 1234 sau Username Razor a votat pentru tine si in acest caz am apelat postback-ul tau si am retransmis inapoi parametrul.
123.123.123.123 is the IP address used by the player to vote on Topg.
Te rugam sa citesti exemplul noastru in PHP example pentru a intelege cum sa capturezi raspunsul. Trimitem raspunsul HTTP doar can jucatorul voteaza valid. Daca ai nevoie de asistenta pentru a instala acest system contacteaza-ne.

How to fix voting callback on topg for Fusion CMS:
If you are using Fusion CMS go to /applications/modules/vote/plugins/topg.php and change line 21 to this:
return $this->CI->input->ip_address() == gethostbyname('monitor.topg.org');

postback.php example


define("DEBUG", 0); //set to 1 to enable debuger
define("LOG_FILE", "_postback.log"); //if debug is enabled will create this file for logs
define("TOPG_IP", gethostbyname("monitor.topg.org")); //This is TopG IP address

$ip_request = $_SERVER['REMOTE_ADDR']; //for Cloudflare $ip_request = $_SERVER["HTTP_CF_CONNECTING_IP"];
if($ip_request == TOPG_IP) //check if response is coming from TopG
{
	if(DEBUG == true) {	
	 error_log(date('[Y-m-d H:i] ')."[OK] Valid callback: $ip_request".PHP_EOL, 3, LOG_FILE);	 
	}
	
	//get the parameters response from us and clean them
	$p = preg_replace('/[^A-Za-z0-9\_\-]+/','',$_GET['p_resp']); //can be only numbers letters, minus and underscore
	$user_ip = preg_replace('/[^0-9\.]+/','',$_GET['ip']); //can be only numbers and dots
	
	//connect to database
	
	//if using MySQL uncomment the following lines (remove slashes)
	//$p = mysql_escape_string($p); 
	//$user_ip = mysql_escape_string($user_ip);
	
	//or if using MySQLi (change $DB name to correct one)
	//$p = $DB->real_escape_string($p);
	//$user_ip = $DB->real_escape_string($user_ip);
	
	if(DEBUG == true) {	
	 error_log(date('[Y-m-d H:i] ')."[GET] Parameters [p_resp]=$p [ip]=$user_ip".PHP_EOL, 3, LOG_FILE); 
	}
	
	//Note: we send the parameters $_GET['p_resp'] and $_GET['ip'] back ONLY! if user $p has voted
	//here run your code
	//first you should check if account $p is valid and exists in your database
	//also check if the user has voted in the last 12 hours
	//give points to user $p that voted with ip $user_ip
	//close database
}
else
{
	if(DEBUG == true) {	
	 error_log(date('[Y-m-d H:i] ')."[Invalid] Invalid request: $ip_request".PHP_EOL, 3, LOG_FILE); 
	}
	//handle invalid request when callback is NOT from TopG.
	//ignore or log the $ip_request as invalid request in your database
}

Minecraft Votifier

Minecraft Votifier

Whitelist IP: monitor.topg.org in your Firewall Settings.

Pentru Minecraft folosim un plugin special nummit votifier. Procesul de vot se desfasoara in felul urmator:
  1. Jucatorul introduce username-ul pe pagina noastra de vot.
  2. Trimitem raspuns catre serverul tau daca a votat sau nu.
TOP: To auto-fill Minecraft username field change your voting link to this syntax:
https://topg.org/Minecraft/in-SITEID-username

Cum sa activezi Votifier

Poti activa si seta acest plugin din Panoul Utilizatorului prin functia Edit.

Descarca si instaleaza plugin-ul

Poti gasi acest plugin gratuit pe forumul Bukkit sau pe Curse: Download Votifier . Al doilea pas este sa cauti in comunitatea bukkit un votifier listener compatibil cu versiunea ta de minecraft.

Setarile tale pentru votifier

PUBLIC KEY it's a long string file located: /plugins/Votifier/rsa/public.key. Copy-paste ALL of it.
VOTIFIER IP and VOTIFIER PORT settings can be found inside: /plugins/Votifier/config.yml
host: VOTIFIER IP //your external IP address, the one used to connect to play
port: VOTIFIER PORT //the default votifier port is 8192
debug: false //set to true to see connection details in console 
listener_folder: plugins/Votifier/listeners
Recomandam sa activati modul debug (debug: true) pentru a testa la inregistrarea pe topuri noi.