Bravo List
Register
Go Back   > Bravo List > Source Code > Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 26-05-18, 12:13
Elena's Avatar
Elena Elena is offline
Member
 
Join Date: Sep 2010
Ukraine
Posts: 6
Thumbs up Ghost Site
If there is no IP in the user's database as if it came to the site at the address, it throws in any direction what is indicated in the script (or to Google's error page, or to another address).

Insert at the beginning of the file index.php:

PHP Code:
//////////////////////
$gost mysql_result(sql_query("SELECT value FROM gost WHERE name = 'gost'"), 0);
$ip getip();
$r = @sql_query("SELECT * FROM users WHERE ip='".unesc($ip)."'") or sqlerr(__FILE____LINE__);
$user mysql_fetch_array($r);
if (
$gost == && !$user){
print(
"<html><head><meta http-equiv=refresh content='0;url=https://www.yandex.com'></head></html>");

Run the query in the database:

Code:
CREATE TABLE IF NOT EXISTS `gost` (
  `name` varchar(255) NOT NULL DEFAULT '',
  `value` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO `gost` (`name`, `value`) VALUES
('gost', '0');
Create the root file called gost.php:
PHP Code:
<?php
require_once("include/bittorrent.php");
dbconn(false);
if (
get_user_class() >= UC_SYSOP){
$gost = (int)$_GET['gost'];
stdhead("Ghost Site");
begin_frame(".:: Ghost Site ::.");
if (
$gost != ""){
 if (
$gost == 1) {
 
mysql_query("UPDATE gost SET value = '1' WHERE name = 'gost'");
 
write_log("The site is open to all by $CURUSER[username]"); }
 if (
$gost == 2) {
 
mysql_query("UPDATE gost SET value = '0' WHERE name = 'gost'");
 
write_log("Site is included in the GHOST mode by $CURUSER[username]"); }
}
$gost mysql_result(mysql_query("SELECT value FROM gost WHERE name = 'gost'"), 0);
if (
$gost == 0){
    print(
"<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\" align=\"center\"><center>");
    print(
"<tr><td class=embedded style='background-color: #FF0000;padding-bottom: 5px'  colspan=4 align=center width=100% >
  <center><font color=#FFD700><b>The site is now in GHOST mode</b></font></center></td></tr>
    <tr><td align=\"center\"><a href=?gost=1><input type=button class=button4 value='Click here to open a site for everyone!'></a></td></tr><center></table>"
);
    
end_frame();
stdfoot();
}else{
    print(
"<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\" align=\"center\"><center>");
    print(
"<tr><td class=embedded style='background-color: #FFD700;padding-bottom: 5px'  colspan=4 align=center width=100% >
  <center><font color=#FF0000><b>The site is now VISIBLE to all.</b></font></center></td></tr>
    <tr><td align=\"center\"><a href=?gost=2><input type=button class=button4 value='Click here to go into GHOST mode'></a></td></tr><center></table>"
);
end_frame();
stdfoot();
}} else {
  
$url '';
  while (list(
$var,$val) = each($_GET))
    
$url .= "&$var=$val";
$i strpos($url"&url=");
if (
$i !== false)
    
$url substr($url$i 5);
if (
substr($url04) == "www.")
    
$url "http://" $url;
  print(
"<html><head><meta http-equiv=refresh content='0;url=$DEFAULTBASEURL'></head></html>");
?>
In the admin panel, throw a link to this file so that you can switch the ghost mode from the site, rather than climb to the database.
Reply With Quote
Reply

Thread Tools

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 19:54. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2018, vBulletin Solutions Inc.