Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > BT.Manager (phpMyBitTorrent)
Reply
Thread Tools
  #1  
Old 20th November 2010, 16:41
Giorgatzelos's Avatar
Giorgatzelos Giorgatzelos is offline
Senior Member
 
Join Date: Nov 2009
Greece
Posts: 300
Default Redirection After Poll Error...
Hello to all, i made an index.htm as intro to my site that includes a intro.swf...wich really works when you type "www.archectypo.com" (my site)...first appears intro.htm and then when pushing enter goes to intro.php....so far so good...but when i create a poll and someone wants to pick an option it redirects to index.htm and the site's intro....how can i fix that?this is my index.php , poll.php , index.htm and .htaccess...

Second where can i edit shoutbox's tooltips and generally tooltips?


please help!

my index.php

PHP Code:
<?php
/*
*----------------------------phpMyBitTorrent V 2.0.4---------------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*--------------   Created By Antonio Anzivino (aka DJ Echelon)   --------------*
*-------------               http://www.p2pmania.it               -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*-------------              http://www.bittorrent.com             -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*--   This program is free software; you can redistribute it and/or modify   --*
*--   it under the terms of the GNU General Public License as published by   --*
*--   the Free Software Foundation; either version 2 of the License, or      --*
*--   (at your option) any later version.                                    --*
*--                                                                          --*
*--   This program is distributed in the hope that it will be useful,        --*
*--   but WITHOUT ANY WARRANTY; without even the implied warranty of         --*
*--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          --*
*--   GNU General Public License for more details.                           --*
*--                                                                          --*
*--   You should have received a copy of the GNU General Public License      --*
*--   along with this program; if not, write to the Free Software            --*
*-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA --*
*--                                                                          --*
*------------------------------------------------------------------------------*
*------              2005 phpMyBitTorrent Development Team              ------*
*-----------               http://phpmybittorrent.com               -----------*
*------------------------------------------------------------------------------*
*/
include("header.php");
////////////////////////////MOD ARCADE/////////////////////
function get_date_time($timestamp 0)
{
if (
$timestamp)
return 
date("Y-m-d H:i:s"$timestamp);
else
  
$idcookie $_COOKIE['uid'];
  return 
gmdate("Y-m-d H:i:s"time());
}
$player getuserid($btuser);
if(
$_GET["act"]=="Arcade")
{
  if(
$_POST['gname'] == "asteroids")
  {
 
$game 1;
 
$level 1;
 
$score $_POST['score'];
  }
  if(
$_POST['gname'] == "breakout")
  {
 
$game 2;
 
$level 1;
 
$score $_POST['gscore'];
  }
  if(
$_POST['gname'] == "hexxagon")
  {
 
$game 3;
 
$level 1;
 
$score $_POST['gscore'];
  }
  if(
$_POST['gname'] == "invaders")
  {
 
$game 4;
 
$level 1;
 
$score $_POST['score'];
  }
  if(
$_POST['gname'] == "moonlander")
  {
 
$game 5;
 
$level 1;
 
$score $_POST['gscore'];
  }
  if(
$_POST['gname'] == "pacman")
  {
 
$game 6;
 
$level 1;
 
$score $_POST['gscore'];
  }
  if(
$_POST['gname'] == "psol")
  {
 
$game 7;
 
$level 1;
 
$score $_POST['gscore'];
  }
  if(
$_POST['gname'] == "simon")
  {
 
$game 8;
 
$level 1;
 
$score $_POST['gscore'];
  }
  if(
$_POST['gname'] == "snake")
  {
 
$game 9;
 if(
$_POST['levelName'] == "LEVEL: SLUG")
 {
   
$level 1;
 }
 if(
$_POST['levelName'] == "LEVEL: WORM")
 {
   
$level 2;
 }
 if(
$_POST['levelName'] == "LEVEL: PYTHON")
 {
   
$level 3;
 }
 
$score $_POST['score'];
  }
  if(
$_POST['gname'] == "tetris")
  {
 
$game 10;
 
$level $_POST['level'];
 
$score $_POST['gscore'];
  }
$db->sql_query("INSERT INTO `".$db_prefix."_flashscores` ( `ID` , `game` , `user` , `level` , `score`, `date`) VALUES ( '', '".$game."', '".$player."', '".$level."', '".$score."', '" get_date_time() . "');") OR DIE(MySQL_ERROR());
$urlc="flashscores.php";
 print(
"<html><head><meta http-equiv=refresh content='0;url=$urlc'></head></html>\n");
 die;
 
}
if (
$has_newpm) {
        
OpenTable2(_btpm);
        echo 
"<h3>"._btyougotpm."</h3>";
        
CloseTable2();

}

OpenTable("Anime Categories");
echo 
"<center>\n";
echo 
"<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"905\" height=\"550\" id=\"3dmenu\" align=\"middle\">\n";
echo 
"<param name=\"movie\" value=\"3dmenu.swf\" />\n";
echo 
"<param name=\"quality\" value=\"high\" />\n";
echo 
"<param name=\"scale\" value=\"exactfit\" />\n";
echo 
"<param name=\"wmode\" value=\"transparent\" />\n";
echo 
"<param name=\"menu\" value=\"false\">\n";
echo 
"<embed src=\"3dmenu.swf\" quality=\"high\" scale=\"exactfit\" wmode=\"transparent\" width=\"905\" height=\"550\" name=\"3dmenu\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n";
echo 
"</object>\n";
echo 
"</center>\n";
CloseTable();

OpenTable("Anime Trailers");
$query "SELECT * FROM ".$db_prefix."_youtubevideo ORDER BY addtime";
$sql $db->sql_query($query);
echo 
"<marquee  onMouseOver=\"this.stop();\" onMouseOut=\"this.start();\" width=\"100%\" direction=\"left\" loop=\"infinite\" scrollamount=\"2\">\n";
echo
"<table border=\"1\">\n<tr>";
while (
$row $db->sql_fetchrow($sql)) {
$link str_replace("http://youtube.com/v/","",$row["link"]);
$name $row['name'];
echo
"<td style=\"text-align: center;\">\n<a href=\"".$siteurl."/youtube.php?op=show&amp;video=".$row["link"]."\">\n<img title=\"".$name."\" src=\"http://i3.ytimg.com/vi/".$link."/default.jpg\" class=\"vimg120\" qlicon=\"".$link."\" alt=\"".$name."\">\n</a>\n<br />\n<p>$name</p>\n</td>\n";
}
echo
"</tr>\n</table>\n";
echo 
"</marquee>\n";
CloseTable();

if (
$user->user) {
include (
"torrents-needseed.php");
}
if (
$user->user AND $user->can_shout =="true")
{
include (
"blocks/shoutbox.php");
}

if (
$welcome_message != ""){
OpenTable(_btsitenews'726');
$welcome_message format_comment($welcome_message);
parse_smiles($welcome_message);
echo 
"<table width=\"100%\"><tr><td>".$welcome_message."</td></tr></table>";
CloseTable();
}
echo 
"<a name=\"infotracker\"></a>";
OpenTable(_btinfotracker'728');
$legend '<b>';
$sqlev "SELECT name, color FROM ".$db_prefix."_levels";
$reslev $db->sql_query($sqlev);
        while (
$rowlev $db->sql_fetchrow($reslev)) {
        
$legend .='<a href="memberslist.php?mode=group&g='.$rowlev['name'].'" style="color: '.$rowlev['color'].'; font-weight: bold;">'.$rowlev['name'].'</a> ';
}
$legend .= '</b>';
$db->sql_freeresult($reslev);
$sql "SELECT O.id AS id, O.page AS page, UNIX_TIMESTAMP(O.logged_in) AS logged_in, IF(U.name IS NULL, U.username, U.name) as name, U.donator AS donator, U.warned AS warned, U.can_do as can_do, U.level AS level, U.Show_online AS Show_online, U.uploaded as uploaded, U.downloaded AS downloaded FROM ".$db_prefix."_online_users O LEFT JOIN ".$db_prefix."_users U ON O.id = U.id WHERE UNIX_TIMESTAMP(NOW()-U.lastlogin) < 1800 AND U.Show_online = true;";
$res $db->sql_query($sql);
$tot $db->sql_numrows($res);
$i 1;
$simple "\n<p>";
$advanced "<table border=\"1\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n";
$advanced .= "<thead><tr><td><p align=\"center\"><b>"._btusername."</b></p></td><td><p align=\"center\"><b>"._btratio."</b></p></td><td><p align=\"center\"><b>"._btpagename."</b></p></td><td><p align=\"center\"><b>"._btloggedinfor."</b></p></td></tr></thead>\n<tbody>\n";
$user_now $db->sql_numrows($res);
if (
$user_now == 0$simple .= _btnouseronline;
else {
        while (
$row $db->sql_fetchrow($res)) {
        
//if($row[id] == $user->id)break;
        
if($row["donator"] == 'true')$donator true;
        else
        
$donator false;
                
$simple .= "<a href=\"user.php?op=profile&id=".$row["id"]."\"><font color=\"".getusercolor($row["can_do"])."\">";
                
$simple .= htmlspecialchars($row["name"])."</font></a>";
                if (
$row["level"] == "premium"$simple .= pic("icon_premium.gif",'','premium');
                elseif (
$row["level"] == "moderator"$simple .= pic("icon_moderator.gif",'','moderator');
                elseif (
$row["level"] == "admin"$simple .= pic("icon_admin.gif",'','admin');
                if(
$donator$simple .= '<img src="http://www.bvlist.com/images/donator.gif" height="16" width="16" title="donator" alt="donator" />';
                if(
$row["warned"] == "1"$simple .= '<img src="http://www.bvlist.com/images/warning.gif" title="warned" alt="warned" />';
                if (
$i $tot$simple .= ", ";
                
$i++;

                
$advanced .= "<tr>";
                
$advanced .= "<td><p><a href=\"user.php?op=profile&id=".$row["id"]."\"><font color=\"".getusercolor($row["can_do"])."\">";
                
$advanced .= htmlspecialchars($row["name"])."</font></a>";
                if (
$row["level"] == "premium"$advanced .= pic("icon_premium.gif",'','premium');
                elseif (
$row["level"] == "moderator"$advanced .= pic("icon_moderator.gif",'','moderator');
                elseif (
$row["level"] == "admin"$advanced .= pic("icon_admin.gif",'','admin');
                if(
$donator$advanced .= '<img src="http://www.bvlist.com/images/donator.gif" height="16" width="16" title="donator" alt="donator" />';
                if(
$row["warned"] == "1"$advanced .= '<img src="http://www.bvlist.com/images/warning.gif" title="warned" alt="warned" />';
                
$advanced .= "</p></td>";

                if (
$row["uploaded"] == AND $row["downloaded"] == 0$ratio "---";
                elseif (
$row["downloaded"] == 0$ratio "&infin;";
                else {
                        
$ratio $row["uploaded"]/$row["downloaded"];

                        if (
$ratio 0.1$ratio "<font color=\"#ff0000\">" number_format($ratio2) . "</font>";
                        elseif (
$ratio 0.2$ratio "<font color=\"#ee0000\">" number_format($ratio2) . "</font>";
                        elseif (
$ratio 0.3$ratio "<font color=\"#dd0000\">" number_format($ratio2) . "</font>";
                        elseif (
$ratio 0.4$ratio "<font color=\"#cc0000\">" number_format($ratio2) . "</font>";
                        elseif (
$ratio 0.5$ratio "<font color=\"#bb0000\">" number_format($ratio2) . "</font>";
                        elseif (
$ratio 0.6$ratio "<font color=\"#aa0000\">" number_format($ratio2) . "</font>";
                        elseif (
$ratio 0.7$ratio "<font color=\"#990000\">" number_format($ratio2) . "</font>";
                        elseif (
$ratio 0.8$ratio "<font color=\"#880000\">" number_format($ratio2) . "</font>";
                        elseif (
$ratio 0.9$ratio "<font color=\"#770000\">" number_format($ratio2) . "</font>";
                        elseif (
$ratio 1)   $ratio "<font color=\"#660000\">" number_format($ratio2) . "</font>";
                        else 
$ratio "<font color=\"#00FF00\">".  number_format($ratio2) . "</font>";
                }
                
$advanced .= "<td><p>".$ratio."</p></td>";
                
$advanced .= "<td><p>";
                if (
defined("_btpage_".$row["page"])) $advanced .= constant("_btpage_".$row["page"]);
                else
                
$advanced .= str_replace('.php','',$row['page']);
                
$advanced .= "</p></td>";
                
$advanced .= "<td><p>".mkprettytime(time()-$row["logged_in"])."</p></td>";
                
$advanced .= "</tr>\n";    
        }
    
$simple .="<br><br><p>Legend: ".$legend."</p><div style='font-size: 8pt;' align=\"center\"><a href=\"javascript:advanced();\">"._btadvancedmode."</a></div>";
        
$simple .= "";
}
$advanced .= "</tbody></table>\n";
$db->sql_freeresult($res);

//Simple mode
echo "<div id=\"users_simple\" class=\"show\">";
echo 
$simple;
echo 
"</div>";

//Advanced mode
echo "<div id=\"users_advanced\" class=\"hide\">";
echo 
$advanced;
echo 
"<br><p>Legend: ".$legend."</p><div style='font-size: 8pt;' align=\"center\"><a href=\"javascript:simple();\">"._btsimplemode."</a></div>";
echo 
"</div>";
echo 
"<br><div><span class=\"genmed\"><p>"._btindex_legend."<b>$user_now</b>"._btindex_legend1."<strong>$most_users_online</strong> on $most_users_online_when</p></span></div>";
        echo 
"<p>";
        
//Total users
        
$sql "SELECT COUNT(id) FROM ".$db_prefix."_users WHERE `active` = 1 AND UNIX_TIMESTAMP(lastlogin) > UNIX_TIMESTAMP(NOW()) - 86400;";
        
$res $db->sql_query($sql);
        list (
$totuser) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
        echo 
"<b>"._btindex_total24."</b> ".$totuser."<br />\n";
        
//Total users
        
$sql "SELECT COUNT(id) FROM ".$db_prefix."_users WHERE `active` = 1 AND UNIX_TIMESTAMP(regdate) > UNIX_TIMESTAMP(NOW()) - 86400*7;";
        
$res $db->sql_query($sql);
        list (
$totuser) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
        echo 
"<b>"._btindex_register7."</b> ".$totuser."<br />\n";
        
//Total users
        
$sql "SELECT COUNT(id) FROM ".$db_prefix."_users WHERE `active` = 1 AND UNIX_TIMESTAMP(regdate) > UNIX_TIMESTAMP(NOW()) - 86400;";
        
$res $db->sql_query($sql);
        list (
$totuser) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
        echo 
"<b>"._btindex_register24."</b> ".$totuser."<br />\n";
        
//Total users
        
$sql "SELECT COUNT(id) FROM ".$db_prefix."_users;";
        
$res $db->sql_query($sql);
        list (
$totuser) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
        echo 
"<b>"._btindex_totalregister."</b> ".$totuser."<br />\n";
        
//Total Torrents and their size
        
$sql "SELECT COUNT(id), SUM(size) FROM ".$db_prefix."_torrents;";
        
$res $db->sql_query($sql);
        list (
$tottorrent$totshare) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
        echo 
"<b>"._btindex_totaltorrents."</b> ".$tottorrent."<br />\n";
        echo 
"<b>"._btindex_totalshare."</b> ".mksize($totshare)."<br />\n";
        
//Total peers and their speed
        
$sql "SELECT COUNT(id), (SUM(upload_speed)+SUM(download_speed))/2 FROM ".$db_prefix."_peers;";
        
$res $db->sql_query($sql);
        list (
$totpeers$totspeed) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
        echo 
"<b>"._btindex_totalpeers."</b> ".$totpeers."<br />\n";
        echo 
"<b>"._btindex_speed."</b> ".mksize($totspeed)."/s<br />\n";
        
//Total seeders and total leechers
        
$sql "SELECT COUNT(id) FROM ".$db_prefix."_peers GROUP BY seeder ORDER BY seeder ASC;";
        
$res $db->sql_query($sql);
        list (
$totseeders) = $db->sql_fetchrow($res);
        list (
$totleechers) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
        echo 
"<b>"._btindex_totalseeders."</b> ".$totseeders."<br />\n";
        echo 
"<b>"._btindex_totalleechers."</b> ".$totleechers."<br />\n";
        
$sql "SELECT COUNT(id) as cnt, client FROM ".$db_prefix."_peers WHERE client IS NOT NULL GROUP BY client ORDER BY cnt DESC LIMIT 1;";
        
$res $db->sql_query($sql);
        list (
$cnt$client) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
        echo 
"<b>"._btindex_client."</b> ".$client." (".$cnt.")<br />\n";
        echo 
"</p>\n";
CloseTable();
OpenTable("Clock/Calendar");
echo 
"<center>\n";
echo 
"<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"550\" height=\"250\" id=\"clock2\" align=\"middle\">\n";
echo 
"<param name=\"movie\" value=\"clock2.swf\" />\n";
echo 
"<param name=\"quality\" value=\"high\" />\n";
echo 
"<param name=\"scale\" value=\"exactfit\" />\n";
echo 
"<param name=\"wmode\" value=\"transparent\" />\n";
echo 
"<param name=\"menu\" value=\"false\">\n";
echo 
"<embed src=\"clock2.swf\" quality=\"high\" scale=\"exactfit\" wmode=\"transparent\" width=\"550\" height=\"250\" name=\"clock\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n";
echo 
"</object>\n";
echo 
"</center>\n";
CloseTable();
OpenTable("Birthday's Annowncements");
$birthday_list '';
$now getdate(time() - date('Z'));
$sql "SELECT * FROM ".$db_prefix."_users WHERE ban = '0' AND birthday LIKE '" $now['mday']."-"$now['mon']."-" "%'";
    
$result $db->sql_query($sql) or btsqlerror($sql);
    echo
'<img src="http://www.archectypo.com/images/Birthday_Cake.png" title="Birthday Present" alt="cake" />';
    while (
$row $db->sql_fetchrow($result))
    {
        if(
$row["donator"] == 'true')$donator true;
        else
        
$donator false;
$img '';
                if (
$row["level"] == "premium"$img .= pic("icon_premium.gif",'','premium');
                elseif (
$row["level"] == "moderator"$img .= pic("icon_moderator.gif",'','moderator');
                elseif (
$row["level"] == "admin"$img .= pic("icon_admin.gif",'','admin');
                if(
$donator$img .= '<img src="http://www.archectypo.com/images/donator.gif" height="16" width="16" title="donator" alt="donator" />';
                if(
$row["warned"] == "1"$img .= '<img src="http://www.archectypo.com/images/warning.gif" title="warned" alt="warned" />';
        
        
$name = ($row['name'] == '' $row['username'] : $row['name']);
        
$birthday_list .= (($birthday_list != '') ? ', ' '') ."<a href=\"user.php?op=profile&amp;id=".$row["id"]."\"><font color=\"".getusercolor($row["can_do"])."\">{$name}</font></a>{$img}";
        if (
$age = (int) substr($row['birthday'], -4))
        {        
            
$birthday_list .= ' (' . ($now['year'] - $age) . ')';
        }
    }
    
$db->sql_freeresult($result);
echo (
$birthday_list != '') ? $birthday_list ' &nbsp;&nbsp;&nbsp;No Birthday\'s Today';
CloseTable();
OpenTable("Affiliates");
echo 
"<center>\n";
echo 
"<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"510\" height=\"126\" id=\"Affiliates\" align=\"middle\">\n";
echo 
"<param name=\"movie\" value=\"Affiliates.swf\" />\n";
echo 
"<param name=\"quality\" value=\"high\" />\n";
echo 
"<param name=\"scale\" value=\"exactfit\" />\n";
echo 
"<param name=\"wmode\" value=\"transparent\" />\n";
echo 
"<param name=\"menu\" value=\"false\">\n";
echo 
"<embed src=\"Affiliates.swf\" quality=\"high\" scale=\"exactfit\" wmode=\"transparent\" width=\"510\" height=\"126\" name=\"Affiliates\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n";
echo 
"</object>\n";
echo 
"</center>\n";
CloseTable();
include(
"poll.php");
//if($forumshare)include ("forumposts.php");
if($search_cloud)include('blocks/searchcloud.php');
/*OpenTable("last 10 uploads");
        $sql = "SELECT ".$db_prefix."_torrents.*, IF(".$db_prefix."_torrents.numratings < '".$minvotes."', NULL, ROUND(".$db_prefix."_torrents.ratingsum / ".$db_prefix."_torrents.numratings, 1)) AS rating, ".$db_prefix."_categories.name AS cat_name, ".$db_prefix."_categories.image AS cat_pic, U.username, IF(U.name IS NULL, U.username, U.name) as user_name, U.level as user_level FROM ".$db_prefix."_torrents LEFT JOIN ".$db_prefix."_categories ON category = ".$db_prefix."_categories.id LEFT JOIN ".$db_prefix."_users U ON ".$db_prefix."_torrents.owner = U.id WHERE banned = 'no' AND ".$db_prefix."_torrents.password IS NULL ORDER BY ".$db_prefix."_torrents.added DESC LIMIT 10;";
        $res = $db->sql_query($sql) or btsqlerror($sql);
        if ($db->sql_numrows($res) > 0) {
                torrenttable($res,"usertorrent");
        } else {
                OpenTable2();
                echo "<h3>"._btnotorrents."</h3>";
                CloseTable2();
        }
CloseTable();*/
include ("blocks/statstable_blocks.php");
include(
"footer.php");
?>
my poll.php

PHP Code:
<?php
/*
*----------------------------phpMyBitTorrent V 2.0.4---------------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*--------------   Created By Antonio Anzivino (aka DJ Echelon)   --------------*
*-------------               http://www.p2pmania.it               -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*-------------              http://www.bittorrent.com             -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*--   This program is free software; you can redistribute it and/or modify   --*
*--   it under the terms of the GNU General Public License as published by   --*
*--   the Free Software Foundation; either version 2 of the License, or      --*
*--   (at your option) any later version.                                    --*
*--                                                                          --*
*--   This program is distributed in the hope that it will be useful,        --*
*--   but WITHOUT ANY WARRANTY; without even the implied warranty of         --*
*--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          --*
*--   GNU General Public License for more details.                           --*
*--                                                                          --*
*--   You should have received a copy of the GNU General Public License      --*
*--   along with this program; if not, write to the Free Software            --*
*-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA --*
*--                                                                          --*
*------------------------------------------------------------------------------*
*------              ©2005 phpMyBitTorrent Development Team              ------*
*-----------               http://phpmybittorrent.com               -----------*
*------------------------------------------------------------------------------*
*-----------------   Sunday, September 14, 2008 9:05 PM   ---------------------*
*/
global $db$db_prefix;
global 
$db$db_prefix;
if (
$_SERVER["REQUEST_METHOD"] == "POST")
{
  
$choice $_POST["choice"];
  if (
$btuser && $choice != "" && $choice 256 && $choice == floor($choice))
  {
    
$res $db->sql_query("SELECT * FROM ".$db_prefix."_polls ORDER BY added DESC LIMIT 1") or sqlerr();
    
$arr $db->sql_fetchrow($res) or die("No poll");
    
$pollid $arr["id"];
      
$userid "".getuserid($btuser)."";
    
$res $db->sql_query("SELECT * FROM ".$db_prefix."_pollanswers WHERE pollid=$pollid && userid=$userid") or sqlerr();
    
$arr $db->sql_fetchrow($res);
    if (
$arr) die("Dupe vote");
    
$db->sql_query("INSERT INTO ".$db_prefix."_pollanswers VALUES(0, $pollid$userid$choice)") or sqlerr();
    if (
$db->sql_affectedrows() != 1)
      
bterror(_btpolls_polls_notcounted,_bterror);
    
header("Location: $siteurl/");
    die;
  }
}
if (
$user->user){
OpenTable('Polls');
  
// Get current poll
  
$res $db->sql_query("SELECT * FROM ".$db_prefix."_polls ORDER BY added DESC LIMIT 1");
  if(
$pollok=($db->sql_numrows($res)))
  {
      
$arr $db->sql_fetchrow($res);
      
$pollid $arr["id"];
      
$userid "".getuserid($btuser)."";
      
$question $arr["question"];
      
$o = array($arr["option0"], $arr["option1"], $arr["option2"], $arr["option3"], $arr["option4"],
        
$arr["option5"], $arr["option6"], $arr["option7"], $arr["option8"], $arr["option9"],
        
$arr["option10"], $arr["option11"], $arr["option12"], $arr["option13"], $arr["option14"],
        
$arr["option15"], $arr["option16"], $arr["option17"], $arr["option18"], $arr["option19"]);

  
// Check if user has already voted
      
$res $db->sql_query("SELECT * FROM ".$db_prefix."_pollanswers WHERE pollid=$pollid AND userid=$userid") or sqlerr();
      
$arr2 $db->sql_fetchrow($res);
  }


if (
$user->admin)
  {
      print(
"<div align=right><font class=small>");
        print(
""._btpolls_polls_mod."[<a class=altlink href=makepoll.php?returnto=main><b>"._btpolls_polls_new."</b></a>]\n");
        if(
$pollok) {
          print(
" - [<a class=altlink href=makepoll.php?action=edit&pollid=$arr[id]&returnto=main><b>"._btpolls_index_edit."</b></a>]\n");
            print(
" - [<a class=altlink href=polls.php?action=delete&pollid=$arr[id]&returnto=main><b>"._btpolls_index_delete."</b></a>]");
        }
        print(
"</font></div>");
    }
    print(
"\n");
    if(
$pollok) {
    print(
"<table   border=1 cellspacing=2 cellpadding=2 align=center><tbody><tr><td class=text>\n");
      print(
"<p align=center><b>$question</b></p>\n");
      
$voted $arr2;
      if (
$voted)
      {
        
// display results
        
if ($arr["selection"])
          
$uservote $arr["selection"];
        else
          
$uservote = -1;
            
// we reserve 255 for blank vote.
        
$res $db->sql_query("SELECT selection FROM ".$db_prefix."_pollanswers WHERE pollid=$pollid AND selection < 20") or sqlerr();

        
$tvotes $db->sql_numrows($res);

        
$vs = array(); // array of
        
$os = array();

        
// Count votes
        
while ($arr2 $db->sql_fetchrow($res))
          
$vs[$arr2[0]] += 1;

        
reset($o);
        for (
$i 0$i count($o); ++$i)
          if (
$o[$i])
            
$os[$i] = array($vs[$i], $o[$i]);

        function 
srt($a,$b)
        {
          if (
$a[0] > $b[0]) return -1;
          if (
$a[0] < $b[0]) return 1;
          return 
0;
        }

        
// now os is an array like this: array(array(123, "Option 1"), array(45, "Option 2"))
        
if ($arr["sort"] == "yes")
            
usort($ossrt);

        print(
"<table   border=1 cellspacing=2 cellpadding=2>\n");
        
$i 0;
        while (
$a $os[$i])
        {
          if (
$i == $uservote)
            
$a[1] .= "&nbsp;*";
          if (
$tvotes == 0)
              
$p 0;
          else
              
$p round($a[0] / $tvotes 100);
          if (
$i 2)
            
$c "";
          else
            
$c "";
          print(
"<tr><td width=1% ><nobr>" $a[1] . "&nbsp;&nbsp;</nobr></td><td width=99% >" .
            
"<img src=$siteurl/images/bar_left.gif><img src=$siteurl/images/bar.gif height=9 width=" . ($p 2) .
            
"><img src=$siteurl/images/bar_right.gif> $p%</td></tr>\n");
          ++
$i;
        }
        print(
"</table>\n");
            
$tvotes number_format($tvotes);
        print(
"<p align=center>"._btpolls_index_votes.$tvotes<br />\n");
        print(
"[<a class=altlink href=polloverview.php><b>"._btpolls_polls_results."</b></a>]</p>\n");
        print(
"</table>");
      }
      else
      {
        print(
"<form method=post action=http://www.archectypo.com/index.php><p>\n");
        
$i 0;
        while (
$a $o[$i])
        {
          print(
"<input type=radio name=choice value=$i>$a<br>\n");
          ++
$i;
        }
        print(
"<br></p>");
        print(
"<div align=center><input type=submit value="._btpolls_polls_vote." class=btn><br>[<a href=polls.php><b>"._btpolls_polls_results."</b></a>]</div></form></td></tr></tbody></table>");
      }
  

}else{
    echo 
""._btpolls_polls_login."";
}
CloseTable();
}
?>
My index.html

HTML Code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7" />
<title>ArcheCtypo Intro</title>
</head>
<body bgcolor="#c0c0c0">
<!--url's used in the movie-->
<a href="http://www.archectypo.com/index.php"></a>
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="intro" width="1280" height="860" align="middle" id="intro">
  <param name="allowScriptAccess" value="sameDomain" />
  <param name="movie" value="intro.swf" />
  <param name="quality" value="high" />
  <param name="bgcolor" value="#c0c0c0" />
  <embed src="intro.swf" quality="high" bgcolor="#c0c0c0" width="1280" height="860" name="intro" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
Code:
# $Author: joerobe $
# $Date: 2007/08/08 12:27:07 $
# $Last Revision: 2005/09/25 1:17 $

# deny most common files except PHP

<FilesMatch "\.(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd|theme|module|torrent)$">
deny from all
</FilesMatch>

<Limit GET POST>
  Order Allow,Deny
  Allow from all
</Limit>
<Limit PUT>
  Deny from all
</Limit>

#Add MIME-Types
AddType application/x-bittorrent .torrent

#HTTP Error Management: works ONLY on root directory. Add yourself your subdirectory
#IE if phpMyBitTorrent is installed in http://www.yoursite.com/mydir change
#/httperror.php.... to /mydir/httperror.php...
ErrorDocument 400 /httperror.php?errid=400
ErrorDocument 401 /httperror.php?errid=401
ErrorDocument 403 /httperror.php?errid=403
ErrorDocument 404 /httperror.php?errid=404
ErrorDocument 500 /httperror.php?errid=500
and this is my .htaccess..


what exactly should i change so that after poll vote it goes to index.php and not intro.html?Where can i edit shoutbox's tooltips and generally tooltips?
Reply With Quote
  #2  
Old 21st November 2010, 11:42
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
in poll.php change
Code:
header("Location: $siteurl/");
to
Code:
header("Location: $siteurl/index.php");
Reply With Quote
The Following User Says Thank You to joeroberts For This Useful Post:
Giorgatzelos (15th December 2010)
Reply

Tags
error , poll , redirection


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 07:38. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.