Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

Have you purchased a mod and lost your copy? Just file a support ticket through your "My Mods" page.


This forum is now closed and has moved to a new location! Click here to find out why.
Pages: 1 ... 3 4 [5] 6

AuthorTopic: [MCCode] Voting System  (Read 10079 times)

Voice4Vision

  • Basic Member
  • *
  • Reputation Power: 6
  • Voice4Vision has no influence.
  • Offline Offline
  • Posts: 8
    • View Profile
    • Email
Re: [MCCode] Voting System
« Reply #60 on: September 07, 2009, 04:15:42 PM »
strats, get in touch with me on MSN and I will try and get this figured out for you.
Logged

strats

  • Active Member
  • **
  • Reputation Power: 13
  • strats has no influence.
  • Offline Offline
  • Posts: 109
    • View Profile
Re: [MCCode] Voting System
« Reply #61 on: September 08, 2009, 02:30:24 AM »
strats, get in touch with me on MSN and I will try and get this figured out for you.

Okies :)
Logged

strats

  • Active Member
  • **
  • Reputation Power: 13
  • strats has no influence.
  • Offline Offline
  • Posts: 109
    • View Profile
Re: [MCCode] Voting System
« Reply #62 on: September 09, 2009, 08:35:41 AM »
Logged

tittlemouse

  • Basic Member
  • *
  • Reputation Power: 2
  • tittlemouse has no influence.
  • Offline Offline
  • Posts: 2
    • View Profile
Re: [MCCode] Voting System
« Reply #63 on: September 18, 2009, 02:40:48 AM »
nice mod works great on V2 thanks.
Logged

strats

  • Active Member
  • **
  • Reputation Power: 13
  • strats has no influence.
  • Offline Offline
  • Posts: 109
    • View Profile
Re: [MCCode] Voting System
« Reply #64 on: September 18, 2009, 05:06:16 AM »
If anyone wants a working version of this mail me I know someone selling it for a few bucks
Logged

tittlemouse

  • Basic Member
  • *
  • Reputation Power: 2
  • tittlemouse has no influence.
  • Offline Offline
  • Posts: 2
    • View Profile
Re: [MCCode] Voting System
« Reply #65 on: September 18, 2009, 11:55:51 AM »
If anyone wants a working version of this mail me I know someone selling it for a few bucks
no need this one is perfect and it works fine
Logged

Cronus

  • Administrator
  • Senior Member
  • *****
  • Reputation Power: 2901
  • Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!
  • Offline Offline
  • Posts: 550
    • MSN Messenger - preston__08@hotmail.com
    • View Profile
    • WWW
Re: [MCCode] Voting System
« Reply #66 on: September 20, 2009, 02:31:49 PM »
If anyone pays for a "working" version from strats they are a fool.
The only problems with this mod are the ones created by the owners installing it.

And if you really can't get it to install, paid support will do it for you for $5.
Logged
My msn is preston__08@hotmail.com if anyone is interested, I am online frequently.

strats

  • Active Member
  • **
  • Reputation Power: 13
  • strats has no influence.
  • Offline Offline
  • Posts: 109
    • View Profile
Re: [MCCode] Voting System
« Reply #67 on: September 21, 2009, 12:04:09 AM »
Thats well cheeky.
Logged

Rioter

  • Basic Member
  • *
  • Reputation Power: 18
  • Rioter has no influence.
  • Offline Offline
  • Posts: 11
    • View Profile
    • Email
Re: [MCCode] Voting System
« Reply #68 on: September 21, 2009, 07:48:10 AM »
I've just tested this and it's absolutely fine, no errors.
Logged

Agon

  • Basic Member
  • *
  • Reputation Power: 13
  • Agon has no influence.
  • Offline Offline
  • Posts: 19
    • View Profile
Re: [MCCode] Voting System
« Reply #69 on: October 20, 2009, 02:10:54 PM »
Easy install, works great. Thanks!
Logged

mentaljason

  • Basic Member
  • *
  • Reputation Power: 13
  • mentaljason has no influence.
  • Offline Offline
  • Posts: 28
  • MentalJason HURRAH
    • View Profile
    • WWW
Re: [MCCode] Voting System
« Reply #70 on: January 14, 2010, 08:20:54 AM »
just a little pointer that it is simple for users to continue double voting undetected with this script by lagging their browser and double clicking the link with the weel on their mouse they can get 2X reward, a button would be slightly more secure.
Logged
Like Mccodes? Like things to be free? try My mods forum where all of the mods are free!

Cronus

  • Administrator
  • Senior Member
  • *****
  • Reputation Power: 2901
  • Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!
  • Offline Offline
  • Posts: 550
    • MSN Messenger - preston__08@hotmail.com
    • View Profile
    • WWW
Re: [MCCode] Voting System
« Reply #71 on: February 06, 2010, 06:23:37 AM »
just a little pointer that it is simple for users to continue double voting undetected with this script by lagging their browser and double clicking the link with the weel on their mouse they can get 2X reward, a button would be slightly more secure.
It would be pretty hard for them to get it to load at EXACTLY the same time, and really there is no way to block this possibility =/
Logged
My msn is preston__08@hotmail.com if anyone is interested, I am online frequently.

Jordan

  • Active Member
  • **
  • Reputation Power: 55
  • Jordan has no influence.
  • Offline Offline
  • Posts: 102
  • Website Developer for hire;
    • MSN Messenger - Pudda2008@hotmail.co.uk
    • View Profile
    • WWW
    • Email
Re: [MCCode] Voting System
« Reply #72 on: February 24, 2010, 03:02:06 AM »
LOL @ MetalJason xD
Logged
Contact me
MakeWebGames.com

mranthony

  • Basic Member
  • *
  • Reputation Power: 25
  • mranthony has no influence.
  • Offline Offline
  • Posts: 13
    • View Profile
Re: [MCCode] Voting System
« Reply #73 on: June 18, 2010, 03:05:49 PM »
For those who are still having problems with this { with v2 }
I have a fix
Open up your   voting.php
And replace it with this

<?php
@include_once(DIRNAME(__FILE__) .'/globals.php');
$t = time();
$qt = $db->fetch_row($db->query("SELECT * FROM votes2 WHERE Userid=0"));
if($t > $qt['Voted'])
{
$del = sprintf("DELETE FROM votes WHERE userid > 0");
$db->query($del);
$new=mktime(0,0,0)+86400;
$upp = sprintf("UPDATE votes2 SET Voted=%u WHERE userid=0", $new);
$db->query($upp);
}
print "<br><br><center>";
if($userid == 1)
{
print"<a href=voting.php?add=site>Add New Voting Site</a><br><br>";
}
$width=50;
$second="";
if($userid == 1)
{
$width=70;
$second="<th>---</th><th>---</th>";
}
print"<table width=$width% border=1>
<tr><th>Voting Site</th><th>Reward</th><th>---</th>$second</tr>";
$hk=$db->query("SELECT * FROM votingsites");
while($r=$db->fetch_row($hk))
{
$blahhh=$db->query("SELECT * FROM votes WHERE site={$r['id']} && userid=$userid");
if($db->num_rows($blahhh) > 0)
{
$link="<font color=red><i>Done!</i></font>";
}
else
{
$link="<a href=voted.php?ID={$r['id']} target=_blank><b><font color=green>Vote</font></b></a>";
}
if($r['rewardtype'] == 1)
{
$reward=money_formatter($r['reward']);
}
if($r['rewardtype'] == 2 && $r['reward'] > 1)
{
$reward="{$r['reward']} Crystals";
}
if($r['rewardtype'] == 2 && $r['reward'] == 1)
{
$reward="{$r['reward']} Crystal";
}
if($r['rewardtype'] == 3)
{
$juk=$db->query("SELECT * FROM items WHERE itmid={$r['reward']}");
$item=$db->fetch_row($juk);
$reward="{$item['itmname']}";
}
if($r['rewardtype'] == 4)
{
$reward="{$r['reward']} Energy";
}
if($r['rewardtype'] == 5)
{
$reward="{$r['reward']} Brave";
}
if($r['rewardtype'] == 6)
{
$reward="{$r['reward']} Will";
}
if($userid == 1)
{
$sekond="<td><center><a href=voting.php?edit={$r['id']}><font color=blue>Edit</font></a></center></td><td><center><a href=voting.php?del={$r['id']}><font color=red>Del</font></a></center></td>";
}
print"<tr><td>{$r['name']}</td><td><center>$reward</center></td><td><center>$link</center></td>$sekond</tr>";
}
print"</table></center>";


if($userid == 1 && $_GET['add'])
{
print"<br><hr width=75%><br>";
if($_POST['name'] && $_POST['link'] && $_POST['type'] && $_POST['reward'])
{
$type = abs((int) $_POST['type']);
$reward = abs((int) $_POST['reward']);
$info=str_replace(array("'","\n"),array("'","<br />"),strip_tags($_POST['name']));
$name = mysql_real_escape_string($info);
$info=str_replace(array("'","\n"),array("'","<br />"),strip_tags($_POST['link']));
$link = mysql_real_escape_string($info);
if($type == 3)
{
$juk=$db->query("SELECT * FROM items WHERE itmid=$reward");
if($db->num_rows($juk) == 0)
{
print"<center>The item you have selected for a reward does not exist.<br>><a href=voting.php>Back</a>";
die("");
}
}
$db->query("INSERT INTO votingsites VALUES ('','$name','$link','$type','$reward');");
print"<center>You have successfully added the site: $name<br>><a href=voting.php>Back</a>";
}
else
{
print"<form action='voting.php?add=site' method='post'>
<table width=40% border=1>
<tr>
<th colspan=2>Add A New Voting Site</th>
</tr>
<tr>
<th>Name:</th>
<td><center><input type='text' name='name' value='{$_POST['name']}' /></center></td>
</tr>
<tr>
<th>Voting Link:<br><font size=1 color=red>Include http://<font></th>
<td><center><input type='text' name='link' value='{$_POST['link']}' /></center></td>
</tr>
<tr>
<th>Reward Type:</th>
<td><center><select type='dropdown' name='type'>
<option value='1'>Money
<option value='2'>Crystals
<option value='3'>Item
<option value='4'>Energy
<option value='5'>Brave
<option value='6'>Will
</select></center></td>
</tr>
<tr>
<th>Reward Amount:<br><font size=1 color=red>If Item Put ID #</font></th>
<td><center><input type='text' name='reward' value='{$_POST['reward']}' /></center></td>
</tr>
<tr>
<th colspan=2><input type='submit' value='Add New Voting Site' /></form></th>
</tr>
</table>";
}
}

if($userid == 1 && $_GET['edit'])
{
$_GET['edit'] = abs((int) $_GET['edit']);
$blak=$db->query("SELECT * FROM votingsites WHERE id={$_GET['edit']}");
if($db->num_rows($blak) == 0)
{
print"<center>This voting site does not exist!<br>>Back</center>";
die("");
}
else
{
$r=$db->fetch_row($blak);
}
print"<br><hr width=75%><br>";
if($_POST['name'] && $_POST['link'] && $_POST['type'] && $_POST['reward'])
{
$type = abs((int) $_POST['type']);
$reward = abs((int) $_POST['reward']);
$info=str_replace(array("'","\n"),array("'","<br />"),strip_tags($_POST['name']));
$name = mysql_real_escape_string($info);
$info=str_replace(array("'","\n"),array("'","<br />"),strip_tags($_POST['link']));
$link = mysql_real_escape_string($info);
if($type == 3)
{
$juk=$db->query("SELECT * FROM items WHERE itmid=$reward");
if($db->num_rows($juk) == 0)
{
print"<center>The item you have selected for a reward does not exist.<br>><a href=voting.php>Back</a>";
die("");
}
}
$db->query("UPDATE votingsites SET name='$name' WHERE id='{$_GET['edit']}'");
$db->query("UPDATE votingsites SET url='$link' WHERE id='{$_GET['edit']}'");
$db->query("UPDATE votingsites SET rewardtype='$type' WHERE id='{$_GET['edit']}'");
$db->query("UPDATE votingsites SET reward='$reward' WHERE id='{$_GET['edit']}'");
print"<center>You have successfully edited the site: $name<br>><a href=voting.php>Back</a>";
}
else
{
print"<form action='voting.php?edit={$_GET['edit']}' method='post'>
<table width=40% border=1>
<tr>
<th colspan=2>Edit An Existing Voting Site</th>
</tr>
<tr>
<th>Name:</th>
<td><center><input type='text' name='name' value='{$r['name']}' /></center></td>
</tr>
<tr>
<th>Voting Link:<br><font size=1 color=red>Include http://<font></th>
<td><center><input type='text' name='link' value='{$r['url']}' /></center></td>
</tr>
<tr>
<th>Reward Type:</th>
<td><center><select type='dropdown' name='type'>
<option ";
if($r['rewardtype'] == 1)
{
print"selected ";
}
print"value='1'>Money
<option ";
if($r['rewardtype'] == 2)
{
print"selected ";
}
print"value='2'>Crystals
<option ";
if($r['rewardtype'] == 3)
{
print"selected ";
}
print"value='3'>Item
<option ";
if($r['rewardtype'] == 4)
{
print"selected ";
}
print"value='4'>Energy
<option ";
if($r['rewardtype'] == 5)
{
print"selected ";
}
print"value='5'>Brave
<option ";
if($r['rewardtype'] == 6)
{
print"selected ";
}
print"value='6'>Will
</select></center></td>
</tr>
<tr>
<th>Reward Amount:<br><font size=1 color=red>If Item Put ID #</font></th>
<td><center><input type='text' name='reward' value='{$r['reward']}' /></center></td>
</tr>
<tr>
<th colspan=2><input type='submit' value='Edit Voting Site' /></form></th>
</tr>
</table>";
}
}

if($userid == 1 && $_GET['del'])
{
$_GET['del'] = abs((int) $_GET['del']);
$blak=$db->query("SELECT * FROM votingsites WHERE id={$_GET['del']}");
if($db->num_rows($blak) == 0)
{
print"<center>This voting site does not exist!<br>><a href=voting.php>Back</a></center>";
die("");
}
else
{
$r=$db->fetch_row($blak);
}
print"<br><hr width=75%><br>";
if($_GET['confirm'])
{
$db->query("DELETE FROM votingsites WHERE id='{$_GET['del']}'");
print"<center>You have successfully deleted the site: {$r['name']}<br>><a href=voting.php>Back</a>";
}
else
{
print"<form action='voting.php?del={$_GET['del']}&confirm=delete' method='post'>
<table width=55% border=1>
<tr>
<th colspan=2>Are you sure you would like to delete {$r['name']}?</th>
</tr>
<tr>
<th colspan=2><input type='submit' value='Delete Voting Site' /></form></th>
</tr>
</table>";
}
}
$h->endpage();
?>


that should fix it, if not tell me ill have another look.
Logged

Dusty

  • Basic Member
  • *
  • Reputation Power: 21
  • Dusty has no influence.
  • Offline Offline
  • Posts: 39
  • TRD Computer Repair
    • Yahoo Instant Messenger - peewee986
    • View Profile
    • WWW
Re: [MCCode] Voting System
« Reply #74 on: June 20, 2010, 09:29:40 AM »
I had the same problem that more people was having with it, allowing the user to click the vote link as must as they want. and get paid for it and only one vote counting.   If I would have read all this when that happen a few days/ a week may be or 2 back when I got it. I would have been able to remember what I did.

I know I only changed some thing with the if bla print vote else done  or some thing like that. 

BUT any ways IT WORKS GREAT and made my life a crap load easier added voting site and editing them.

Layout looks great, for users, admins, and the editing vote links layout is great.   

+5 to Cronus 

Im also thinking about adding that Vote Log also, I have not done that yet but will be looking at it when Im done working on what working on now... Will post results after
Logged
TRD Computer Repair Services
www.trdcomputer.com
Pages: 1 ... 3 4 [5] 6
« previous next »
 


This forum is now closed and has moved to a new location! Click here to find out why.