WTF.Error
Member
- Joined
- Aug 8, 2007
- Messages
- 489
- Reaction score
- 10
With this.
You can use to players help you server with OTS-List
[ This is cool ]
Example
Create file on Gesior ACC dir.
vote.php
And..
Votings.php
ANNNND.
Tables.
Not finished.
Need remove button if ip already voted.
Need create a try vote cheating. [ I DONT LIKE TRY'ERS ]
Credits by for me..
Not allowed on anothers forums without my permission annd with my permission too.
You can use to players help you server with OTS-List
[ This is cool ]
Example
Create file on Gesior ACC dir.
vote.php
PHP:
<?
if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
$main_content .=
' <center>
<a href="index.php?subtopic=click&action=admin">Admin</a>
</center>
'
;}
$grr = "'";
$main_content .= '<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location=' . $grr . '"+selObj.options[selObj.selectedIndex].value+"' . $grr . '");
if (restore) selObj.selectedIndex=0;
}
//-->
var isNav4, isIE4;
var childW;
var cur_click = "";
var frm = 0;
var frm2 = 0;
var frm3 = 0;
var frm4 = 0;
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
isNav4 = (navigator.appName == "Netscape") ? true : false
isIE4 = (navigator.appName.indexOf("Microsoft" != -1)) ? true : false
}
function control_click(click_, url, vote) {
<!--
childW = window.open(url,' . $grr . 'childW' . $grr . ',' . $grr . 'width=600, heigth=400, status=no, scrollbars=yes, resizable=yes, location=yes, dependent=yes' . $grr . ');
cur_click = click_;
if(vote==1 || vote==2 || vote==3 || vote==4 || vote==5 || vote==6 || vote==7 || vote==8 || vote==9 || vote==10) {
frm = 0;
setTimeout("while_loading();",100);
}
//-->
}
function while_loading() {
<!--
if(!childW.closed) {//window.closed
frm =frm+1;
setTimeout("while_loading();",100);
} else {
if(frm<40) {
alert("Voce precisa fazar o clique para votar link\nEspere a pagina carregar e confirme seu voto.");
} else {
document.location = "index.php?subtopic=click&action=vote&id="+cur_click;
}
}
//-->
}
function t()
{
var v=new Date();
var n=new Date();
var o=new Date();
// var stop_timer = false;
for(var cn=1;cn<=anz;cn++)
{
var bxx=document.getElementById(' . $grr . 'bxx' . $grr . '+cn);
var ss=bxx.title;
var s=ss-Math.round((n.getTime()-v.getTime())/1000.);
var m=0;
var h=0;
if(s<0){
bxx.innerHTML=txtafter;
stop_timer = true;
}
else
{
if(s>59){
m=Math.floor(s/60);
s=s-m*60
}
if(m>59){
h=Math.floor(m/60);
m=m-h*60
}
if(s<10){
s="0"+s
}
if(m<10){
m="0"+m
}
bxx.innerHTML=h+":"+m+":"+s+"";
}
bxx.title=bxx.title-1;
}
if (stop_timer == true) {
if (loading == false)
{
loading = true;
}
}
else {
window.setTimeout("t();",999);
}
}
</script>
<div class="box">
<p>Hello. Here you can help voting on server. <br><br><br>
</p><p></p><br><br>
<div id="voteButtons">
<center>
';
if($logged) {
$sites = $GLOBALS['SQL']->query('SELECT * FROM '.$GLOBALS['SQL']->tableName('z_vote_system_sites').';');
while($data = $sites->fetch()) {
$main_content .= ' <p><input onclick="control_click(' . $grr . ''.$data['id'].'' . $grr . ',' . $grr . ''.$data['url'].'' . $grr . ',1)" value="'.$data['site'].'" type="button"></p>';
}
} else {
$main_content .= '<b>Login first</b>';
}
$main_content .= '
</center>
</div>
<br><br>
<center>
<table align="center">
<tbody>
';
if($logged) {
if (getenv(HTTP_X_FORWARDED_FOR)) {
$ip = getenv(HTTP_X_FORWARDED_FOR);
} else {
$ip = getenv(REMOTE_ADDR);
}
$sites_vote = $GLOBALS['SQL']->query('SELECT * FROM '.$GLOBALS['SQL']->tableName('z_vote_system').' where ip = "'.$ip.'" and time_next > "'.time().'" ;');
$n = 0;
while($data_vote = $sites_vote->fetch()) {
$time = time();
$left = ($data_vote['time_next']-$time) ;
$n = $n+1;
$main_content .= '
<tr>
<td>'.$data_vote['site'].'</td>
<td><div id="bxx'.$n.'" title="'.$left.'"></div></td>
</tr>
';
}
} else {
$main_content .= '<b>Login first</b>';
}
$main_content .= '
</tbody></table>
</center>
<script language="JavaScript">
var anz='.$n.';
var stop_timer=false;
var loading=false;
var txtafter=' . $grr . '-' . $grr . ';
t();
</script>
</div>
';
?>
And..
Votings.php
PHP:
<?PHP
if($action == "vote") {
$click = stripslashes(trim($_GET['id']));
if (getenv(HTTP_X_FORWARDED_FOR)) {
$ip = getenv(HTTP_X_FORWARDED_FOR);
} else {
$ip = getenv(REMOTE_ADDR);
}
if($click > 0) {
$count = $SQL->query('SELECT count( ip )
FROM z_vote_system
WHERE ip ="'. $ip .'" and site_id = "'.$click.'"');
$data_count = $count->fetch();
// $shopoffers = $SQL->query('SELECT ip, site_id, last_vote FROM z_vote_system ' . makeOrder($order, 'order', 'ip'));
//$votes = $SQL->query('SELECT * FROM z_vote_system where ip ="'. $ip .'" ');
if($data_count[0] == 0) {
$time = time();
$time_query = $SQL->query('SELECT time, site
FROM z_vote_system_sites
WHERE id ="'. $click .'" LIMIT 1 ');
$Time_count = $time_query->fetch();
$next = $Time_count['time']+$time;
$site_name = $Time_count['site'];
// $sites = $GLOBALS['SQL']->query('SELECT * FROM '.$GLOBALS['SQL']->tableName('z_vote_system_sites').' where id = "'.$click.'";');
$SQL->query("INSERT INTO `z_vote_system` (`ip` ,`site_id` ,`last_vote`,`time_next`,`site` )
VALUES ('".$ip."', '".$click."', '".$time."', '".$next."', '".$site_name."');");
$main_content .= '<center><br>Thanks for help.<br>
<a href="index.php?subtopic=vote">Back</a><br></center';
} else {
$main_content .= '<center><br>Wait for vote again<br> <a href="index.php?subtopic=vote">Back</a><br></center';
}
}
}
if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
if($action == "admin") {
$main_content .= '<center>
<a href="index.php?subtopic=click&action=add">Add sites</a><br>
<a href="index.php?subtopic=click&action=remove">Remove Sites</a>
</center>
';
}
if($action == "remove") {
$sites = $GLOBALS['SQL']->query('SELECT * FROM '.$GLOBALS['SQL']->tableName('z_vote_system_sites').';');
while($data = $sites->fetch()) {
$main_content .= '<center><a href="index.php?subtopic=click&action=del&id='.$data['id'].'">'.$data['site'].'</a> '.$data['url'].' <br>';
}
$main_content .= '<a href="index.php?subtopic=vote">Voltar</a></center>';
;
}
if($action == "del") {
$id = (int) $_REQUEST['id'];
$SQL->query('DELETE FROM z_vote_system_sites WHERE id = '.$id.' LIMIT 1;');
$main_content .= 'Site foi deletado com sucesso<br>
<a href="index.php?subtopic=click&action=remove">Voltar</a>
';
}
if($action == "add") {
$main_content .= '
<form action="index.php?subtopic=click&action=new" method="post">
<div class="TableContainer">
<div class="CaptionContainer">
<div class="CaptionInnerContainer">
<span class="CaptionEdgeLeftTop" style="background-image: url(layouts/tibiacom/images/content/box-frame-edge.gif);"></span>
<span class="CaptionEdgeRightTop" style="background-image: url(layouts/tibiacom/images/content/box-frame-edge.gif);"></span>
<span class="CaptionBorderTop" style="background-image: url(layouts/tibiacom/images/content/table-headline-border.gif);"></span>
<span class="CaptionVerticalLeft" style="background-image: url(layouts/tibiacom/images/content/box-frame-vertical.gif);"></span>
<div class="Text">Register now an new site top site.</div>
<span class="CaptionVerticalRight" style="background-image: url(layouts/tibiacom/images/content/box-frame-vertical.gif);"></span>
<span class="CaptionBorderBottom" style="background-image: url(layouts/tibiacom/images/content/table-headline-border.gif);"></span>
<span class="CaptionEdgeLeftBottom" style="background-image: url(layouts/tibiacom/images/content/box-frame-edge.gif);"></span>
<span class="CaptionEdgeRightBottom" style="background-image: url(layouts/tibiacom/images/content/box-frame-edge.gif);"></span>
</div>
</div>
<table class="Table1" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<div class="InnerTableContainer">
<table style="width: 100%;">
<tbody>
<tr>
<td class="LabelV">Site Name:</td>
<td style="width: 90%;">
<input name="info_sitename" value="" size="30" maxlength="50">
</td>
</tr>
<tr>
<td class="LabelV">URL:</td>
<td>
<input name="info_URL" value="" size="30" maxlength="100">
</td>
</tr>
<tr>
<td class="LabelV">Time Between Vote:</td>
<td>
<input name="info_Time" value="" size="30" maxlength="50">
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<table width="100%">
<tbody>
<tr align="center">
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="border: 0px none ;">
<input name="changeinfosave" value="1" type="hidden">
<div class="BigButton" style="background-image: url(layouts/tibiacom/images/buttons/sbutton.gif);">
<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);">
<div class="BigButtonOver" style="background-image: url(layouts/tibiacom/images/buttons/sbutton_over.gif); visibility: hidden;">
</div>
<input class="ButtonText" name="Submit" alt="Submit" src="layouts/tibiacom/images/buttons/_sbutton_submit.gif" type="image"></div>
</div>
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
</td>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="border: 0px none ;">
<div class="BigButton" style="background-image: url(layouts/tibiacom/images/buttons/sbutton.gif);">
<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);">
<div class="BigButtonOver" style="background-image: url(layouts/tibiacom/images/buttons/sbutton_over.gif); visibility: hidden;">
</div>
<input class="ButtonText" name="Back" alt="Back" src="layouts/tibiacom/images/buttons/_sbutton_back.gif" type="image">
</div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</form>
';
}
if($action == "new") {
$site = stripslashes(trim($_POST['info_sitename']));
$URL = stripslashes(trim($_POST['info_URL']));
$Time_more = stripslashes(trim($_POST['info_Time']));
$Hours_to_wait = ($Time_more*60*60);
$Time = $Hours_to_wait;
$SQL->query("INSERT INTO `z_vote_system_sites` (`site` ,`url` ,`time`)
VALUES ('".$site."', '".$URL."', '".$Time."');");
$main_content .= 'Site <a href="'.$URL.'">'.$site.'</a> add.<br><br>
<a href="index.php?subtopic=vote">Vote Now</a>';
}
}
?>
ANNNND.
Tables.
PHP:
-- phpMyAdmin SQL Dump
-- version 3.1.3.1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tempo de Geração: Mai 11, 2009 as 06:27 PM
-- Versão do Servidor: 5.1.33
-- Versão do PHP: 5.2.9
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Banco de Dados: `otserver`
--
-- --------------------------------------------------------
--
-- Estrutura da tabela `z_vote_system`
--
CREATE TABLE IF NOT EXISTS `z_vote_system` (
`ip` varchar(15) NOT NULL,
`site_id` int(11) NOT NULL,
`last_vote` int(11) NOT NULL,
`time_next` int(11) NOT NULL,
`site` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Estrutura da tabela `z_vote_system_sites`
--
CREATE TABLE IF NOT EXISTS `z_vote_system_sites` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`site` text NOT NULL,
`url` text NOT NULL,
`time` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;
Not finished.
Need remove button if ip already voted.
Need create a try vote cheating. [ I DONT LIKE TRY'ERS ]
Credits by for me..
Not allowed on anothers forums without my permission annd with my permission too.