Greyfish(LGSL)

PHP, MySQL, Javascript, XHTML и др.
Потребителски аватар

Автор на темата
Extreme
Администратор
Администратор
Мнения: 500
Регистриран: 05 окт 2016, 20:53
Се отблагодари: 67 пъти
Получена благодарност: 16 пъти

Re: Greyfish(LGSL)

Мнение от Extreme » 12 фев 2017, 20:15

Дай линк.
–Човек вярва на това, което му се иска.
Адолф Хитлер.

-------------------------------------------------------------------------------------------
Правила на форума
Правила при качване на плъгини

Потребителски аватар

ElitePower
Потребител
Потребител
Мнения: 546
Регистриран: 13 окт 2016, 14:20
Се отблагодари: 7 пъти
Получена благодарност: 10 пъти

Re: Greyfish(LGSL)

Мнение от ElitePower » 12 фев 2017, 20:18

Справих се, добавих jquery библиотека и вкарах втория код.

Потребителски аватар

JustyleR
Модератор
Модератор
Мнения: 416
Регистриран: 24 фев 2017, 18:59
Местоположение: Русе
Се отблагодари: 11 пъти
Получена благодарност: 31 пъти
Години: 19
Контакти:

Re: Greyfish(LGSL)

Мнение от JustyleR » 26 фев 2017, 04:19

Беше ми скучно и направих малък инсталатор на системата.

Как работи?

1. Теглите инсталатора (Линка е по-долу).
2. Слагате го в главната папка на greyfish. (greyfish/install трябва да стане)
3. Изтривате sql.sql и conf.php от главната директория.
4. Отваряте инсталатора (http://www.sitename.com/greyfish/install).
5. Следвате стъпките и накрая системата ще бъде готова за работа.

- Без да настройвате config файлове.
- Без да качвате SQL-ове в базата данни.
- Лесно и просто.
greyfish_install.rar
(3.35 KиБ) Свален 190 пъти
greyfish_install.rar
(3.35 KиБ) Свален 190 пъти
Ако имате някакви предложения/въпроси/проблеми, пишете ми.

ПС:

Не съм проверявал кода, написах го за 30-40мин от скука и веднага го качих.
Ако има някакви грешки, пишете да ги оправя.

ПС2:

Системата има някой друг бъг, могат да се оправят лесно.
Кода може да се пренапише за оптимизация.
Бях написал и един малък скрипт с който си добавяте листа във форума, без да редактирате файлове и т.н.
Ако на някой му трябва, да ми драсне л.с.
Steam | Github
Вече не ползвам Skype, ако има нещо ми пишете на лично или в Discord сървъра.

Потребителски аватар

XTSY ҳ̸Ҳ̸ҳßâß
Потребител
Потребител
Мнения: 103
Регистриран: 17 окт 2016, 14:50
Контакти:

Re: Greyfish(LGSL)

Мнение от XTSY ҳ̸Ҳ̸ҳßâß » 19 мар 2017, 17:13

Влизам в админ панела на GreyFish между другото много хубав админ панел цъкам да добавя сървър и ми вади грешка 500. Някой ако може да помогне.

Потребителски аватар

JustyleR
Модератор
Модератор
Мнения: 416
Регистриран: 24 фев 2017, 18:59
Местоположение: Русе
Се отблагодари: 11 пъти
Получена благодарност: 31 пъти
Години: 19
Контакти:

Re: Greyfish(LGSL)

Мнение от JustyleR » 19 мар 2017, 19:02

На какъв хост си?
Вади ли ти нещо в error_log файла?

Аз лично нямам никакви проблеми, странно..
Steam | Github
Вече не ползвам Skype, ако има нещо ми пишете на лично или в Discord сървъра.

Потребителски аватар

XTSY ҳ̸Ҳ̸ҳßâß
Потребител
Потребител
Мнения: 103
Регистриран: 17 окт 2016, 14:50
Контакти:

Re: Greyfish(LGSL)

Мнение от XTSY ҳ̸Ҳ̸ҳßâß » 19 мар 2017, 19:40

ЕрорЛога:

Код: Избери всички

[19-Mar-2017 15:41:39 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:19:39 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:20:07 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:21:46 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:24:53 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:28:15 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:37:14 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:38:19 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:44:25 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:57:22 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:58:24 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:02:05 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:09:37 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:10:39 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:16:49 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:17:44 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:23:26 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:23:48 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
list.php

Код: Избери всички

<?php
if (empty($_SERVER['HTTP_REFERER'])){die();}
include("inc/game_q.php");
use xPaw\SourceQuery\SourceQuery;
$Query = new SourceQuery( );
require_once("inc/TeamSpeak3/TeamSpeak3.php");
?>
<link href="//<?php echo $_SERVER['HTTP_HOST'];?>/greyfish/style_list.css" rel="stylesheet" type="text/css" media="screen, projection" />
<script src="//<?php echo $_SERVER['HTTP_HOST'];?>/greyfish/js/fancybox/jquery.fancybox.pack.js"></script>
<script src="//<?php echo $_SERVER['HTTP_HOST'];?>/greyfish/js/jquery.tablesorter.min.js"></script>


<section id="flip-scroll">
<table cellpadding="0" cellspacing="0" border="0" id="table" class="tinytable cf">
<thead>
<tr>
<th>#</th>
<th>Име</th>
<th>IP</th>
<th>Карта</th>
<th>Играчи</th>
<th>Вот</th>
</tr>
</thead>
<tbody>
               
<?php
include("conf.php");
function truncate_charsasd($text, $limit, $ellipsis = '...') {
    if( strlen($text) > $limit ) {
        $endpos = strpos(str_replace(array("\r\n", "\r", "\n", "\t"), ' ', $text), ' ', $limit);
        if($endpos !== FALSE)
        $text = trim(substr($text, 0, $endpos)) . $ellipsis;
    }
    return $text;
}

$greyfish_Get = mysqli_query($link,"SELECT * FROM greyfish_servers ORDER by type DESC");
while($row = mysqli_fetch_assoc($greyfish_Get)) {
	$hostname = $row['hostname'];
	$players = $row['players'];
	$maxplayers = $row['maxplayers'];
	$ip = $row['ip'];
	$port = $row['port'];
	$type = $row['type'];
	$last_update = $row['last_update'];
	$map = $row['map'];
	$mapimg = "";//globalize
	if (file_exists($_SERVER['DOCUMENT_ROOT'].'/greyfish/maps/'.$type.'/'.$map.'.jpg')) {
		 $mapimg = '//'.$_SERVER['HTTP_HOST'].'/greyfish/maps/'.$type.'/'.$map.'.jpg';
	} else {
		$mapimg = '//'.$_SERVER['HTTP_HOST'].'/greyfish/maps/map_no_response.jpg';
	}
	
	$status = $row['status'];
	$vote = $row['vote'];
	$servid = $row['id'];
	$game = "";//globalize
	$statusimg = ""; //globalize
	$steam = ""; //globalize
	if($type == "cs" || $type=="csgo") {
	$steam = "<a href='steam://connect/$ip:$port' title='steam'><img src='//".$_SERVER['HTTP_HOST']."/greyfish/icons/steam/steam.gif' alt='steam'/></a>";
	} 
	$gametracker ="<a href='https://www.gametracker.com/server_info/$ip:$port/' target='_blank' title='gametracker'><img src='//".$_SERVER['HTTP_HOST']."/greyfish/icons/gt/gt.gif' alt='gt'/></a>";
	switch($status) {
		case '1': {
			$statusimg ='<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/status/online.png" title="This server is online" alt="online"/>';
			break;
		}
		case '0': {
			$statusimg ='<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/status/offline.png" title="This server is offline" alt="offline"/>';
			break;
		}
	}
	switch($type) {
		case 'cs': {
			
			////////////////LIKE CRON////////////////////
			if($last_update < time()) {
			$nextupd = time() + $greyfish_update;
			
			try
			{
			$Query->Connect( ''.$ip.'',$port, 1, SourceQuery::GOLDSOURCE );
			$update_q_cs = $Query->GetInfo();
			$ServerErr = true;
			}
			catch( Exception $e )
			{
			$ServerErr = false;
			}
			finally
			{
			$Query->Disconnect( );
			}
	
			$host_cron = $update_q_cs['HostName'];
			if ($ServerErr == false) {
			//offline
			$query_q_cs = mysqli_query($link,"UPDATE greyfish_servers SET status='0', players='0',maxplayers='0',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_cs);
			} else {
			//online
			$map_cron = $update_q_cs['Map'];
			$p_cron = $update_q_cs['Players'];
			$maxp_cron = $update_q_cs['MaxPlayers'];
			$query_q_cs = mysqli_query($link,"UPDATE greyfish_servers SET status='1',hostname='$host_cron',map='$map_cron', players='$p_cron',maxplayers='$maxp_cron',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_cs);
			}
			}
			///////////////////END CRON///////////////////////

			$game = '<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/cs/cs.png" alt="CS 1.6"/>';
			break;
		}
		case 'csgo': {
			
			////////////////LIKE CRON////////////////////
			if($last_update < time()) {
			$nextupd = time() + $greyfish_update;
			
			try
			{
			$Query->Connect( ''.$ip.'',$port, 1, SourceQuery::SOURCE );
			$update_q_cs = $Query->GetInfo();
			$ServerErr = true;
			}
			catch( Exception $e )
			{
			$ServerErr = false;
			}
			finally
			{
			$Query->Disconnect( );
			}
	
			$host_cron = $update_q_cs['HostName'];
			if ($ServerErr == false) {
			//offline
			$query_q_cs = mysqli_query($link,"UPDATE greyfish_servers SET status='0', players='0',maxplayers='0',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_cs);
			} else {
			//online
			$map_cron = $update_q_cs['Map'];
			$p_cron = $update_q_cs['Players'];
			$maxp_cron = $update_q_cs['MaxPlayers'];
			$query_q_cs = mysqli_query($link,"UPDATE greyfish_servers SET status='1',hostname='$host_cron',map='$map_cron', players='$p_cron',maxplayers='$maxp_cron',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_cs);
			}
			}
			///////////////////END CRON///////////////////////
			
			$game = '<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/csgo/csgo.png" alt="CS:GO"/>';
			break;
		}
		case 'samp': {
			
			////////////////LIKE CRON////////////////////
			if($last_update < time()) {
			$nextupd = time() + $greyfish_update;
			
			try {
			$rQuery = new QueryServer( $ip, $port );
    
			$aInformation  = $rQuery->GetInfo( );
			$aServerRules  = $rQuery->GetRules( );
			$aTotalPlayers = $rQuery->GetDetailedPlayers( );
    
			$rQuery->Close( );
			$serverState = true;
			}
			catch (QueryServerException $pError) {
			$serverState = false;
			}
			if ($serverState == true) {
			$host_cron = mb_convert_encoding( $aInformation['Hostname'], "utf-8", "windows-1251");
			$map_cron = $aInformation['Map'];
            $p_cron = $aInformation['Players'];
			$maxp_cron = $aInformation['MaxPlayers'];
			$query_q_samp = mysqli_query($link,"UPDATE greyfish_servers SET status='1',hostname='$host_cron',map='$map_cron', players='$p_cron',maxplayers='$maxp_cron',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_samp);
			} else {
			$query_q_samp = mysqli_query($link,"UPDATE greyfish_servers SET status='0', players='0',maxplayers='0',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_samp);
			}
			
			}
			///////////////////END CRON///////////////////////
			
			$game = '<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/samp/samp.png" alt="San Andreas Multi-Player"/>';
			break;
		}
		case 'ts': {
			
			////////////////LIKE CRON////////////////////
			if($last_update < time()) {
			$nextupd = time() + $greyfish_update;
			try
			{
			// connect to server, authenticate and grab info
			$ts3 = TeamSpeak3::factory("serverquery://$query_ts_user:$query_ts_pass@$ip:10011/?server_port=$port");
  
 
			$host_cron= $ts3->virtualserver_name;
			$p_cron  = $ts3->virtualserver_clientsonline ;
			$maxp_cron =  $ts3->virtualserver_maxclients ;
			$query_q_ts = mysqli_query($link,"UPDATE greyfish_servers SET status='1',hostname='$host_cron', players='$p_cron',maxplayers='$maxp_cron',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_ts);
			}
			catch(Exception $e)
			{
			$query_q_ts3 = mysqli_query($link,"UPDATE greyfish_servers SET status='0', players='0',maxplayers='0',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_ts3);
			}
			}
			///////////////////END CRON///////////////////////
			
			$game = '<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/ts/ts.png" alt="TeamSpeak 3"/>';
			break;
		}
		case 'mc': {
			
			////////////////LIKE CRON////////////////////
			if($last_update < time()) {
			$nextupd = time() + $greyfish_update;
			
			try {
			$Query = new MinecraftQuery( );
			$Query->Connect( $ip,$port );
		   
			$mc_data =  $Query->GetInfo( );
			$host_cron = mb_convert_encoding($mc_data['HostName'], "utf-8", "windows-1251");
			$map = $mc_data['Map'];
		    $p_cron = $mc_data['Players'];
		    $maxp_cron = $mc_data['MaxPlayers'];
			$query_q_mc = mysqli_query($link,"UPDATE greyfish_servers SET status='1',hostname='$host_cron', players='$p_cron',maxplayers='$maxp_cron',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_mc);
		     
			} catch( MinecraftQueryException $e ) {
			 $query_q_mc = mysqli_query($link,"UPDATE greyfish_servers SET status='0', players='0',maxplayers='0',last_update='$nextupd' WHERE id='$servid'");
			 @mysqli_free_result($query_q_mc);
			}
			
			}
			///////////////////END CRON///////////////////////
			
			$game = '<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/mc/mc.png" alt="Minecraft"/>';
			break;
		}
	}

 echo "
 <tr>
 <td>$game $statusimg</td>
 <td><span title='$hostname'>".truncate_charsasd($hostname,32,'...')."</span></td>
 <td><span onclick='prompt(\"IP адреса на сървъра $hostname е:\",\"$ip:$port\"); return false;' style='cursor:pointer'>$ip:$port</span> $gametracker $steam</td>
 <td><a class='tip2'><span><img src='$mapimg' alt='$map'/></span>$map</a></td>
 <td class='slots'><i class='fancybox uncategorizei' data-fancybox-type='iframe' data-href='//".$_SERVER['HTTP_HOST']."/greyfish/showplayers.php?ip=$ip&port=$port&game=$type' title='".truncate_charsasd($hostname,32,'...')." :: PLAYERS:' data-type='iframe'>$players/$maxplayers</i></td>
 <td><span class='upme vote-btn' data-vote='upvote'  data-my='$servid'></span> <span id='bid-$servid'>$vote</span> <span class='downme vote-btn' data-vote='downvote'  data-my='$servid'></span></td>
 </tr>";
	
}
@mysqli_free_result($greyfish_Get);
?>           
</tbody>
</table>
</section>


<?php
//total servers
$gettotal = mysqli_query($link,"SELECT COUNT(*) as numservers FROM greyfish_servers");
$row1 = mysqli_fetch_assoc($gettotal);

//total players
$gettotal2 = mysqli_query($link,"SELECT SUM(players) as numplayers FROM greyfish_servers");
$row2 = mysqli_fetch_assoc($gettotal2);


//total max slots
$gettotal3 = mysqli_query($link,"SELECT SUM(maxplayers) as slots FROM greyfish_servers");
$row3 = mysqli_fetch_assoc($gettotal3);

@$per_cent = floor(($row2['numplayers']/$row3['slots'])*100);
$bg = ""; //globalize

if($per_cent < 0 || $per_cent > 35) {
	$bg = "#ac0";
} 
if($per_cent > 50) {
	$bg = "#fb5";
} 
if($per_cent > 80) {
	$bg = "#f67";
}

echo '
<div class="progressbar" style="width: 100%"><div  style="background-color:'.$bg.';width:'.$per_cent.'%;max-width:100%" class="progressbar-inner"></div></div>

<div class="downstats">Имаме '.$row1['numservers'].' сървъра, '.$row2['numplayers'].' играча и '.$row3['slots'].' слота!</div>';

//free fucking memory
@mysqli_free_result($gettotal);
@mysqli_free_result($gettotal2);
@mysqli_free_result($gettotal3);
?>

<script>
$("#table").tablesorter( {sortList: [[0,0], [1,0]]} );

	  $(".fancybox").fancybox({
		maxWidth	: 800,
		maxHeight	: 600,
		fitToView	: false,
		width		: '70%',
		height		: '70%',
		autoSize	: false,
		closeClick	: false,
		openEffect	: 'none',
		closeEffect	: 'none'
	});
</script>
<?php include("js/vote.php");?>
Хостинга ми е от новахостинг

Потребителски аватар

NightStaLkeR CS
Потребител
Потребител
Мнения: 65
Регистриран: 26 яну 2017, 10:36
Години: 17

Re: Greyfish(LGSL)

Мнение от NightStaLkeR CS » 08 апр 2017, 01:23

Може ли някой да ми помогне с слагането му? На платен хост съм. Може просто да ми обясни на просто.

Благодаря предварително!

Потребителски аватар

JustyleR
Модератор
Модератор
Мнения: 416
Регистриран: 24 фев 2017, 18:59
Местоположение: Русе
Се отблагодари: 11 пъти
Получена благодарност: 31 пъти
Години: 19
Контакти:

Re: Greyfish(LGSL)

Мнение от JustyleR » 13 апр 2017, 04:08

NightStaLkeR написа:Може ли някой да ми помогне с слагането му? На платен хост съм. Може просто да ми обясни на просто.

Благодаря предварително!
Малко късно ти видях мнението, обаче..

1. Теглиш системата и я слагаш в папката greyfish (примерно).
2. Теглиш инсталатора, който написах и го слагаш в същата папката.
3. Отваряш папката на инсталатора чрез сайта, тоест: www.sitename.com/greyfish/install и следваш стъпките.
4. След това отваряш само www.sitename.com/greyfish и си влизаш в админ панелът.
Steam | Github
Вече не ползвам Skype, ако има нещо ми пишете на лично или в Discord сървъра.

Потребителски аватар

stop cry! cry!
Потребител
Потребител
Мнения: 375
Регистриран: 07 яну 2017, 02:18
Се отблагодари: 2 пъти

Re: Greyfish(LGSL)

Мнение от stop cry! cry! » 11 юни 2017, 02:59

XTSY написа:ЕрорЛога:

Код: Избери всички

[19-Mar-2017 15:41:39 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:19:39 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:20:07 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:21:46 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:24:53 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:28:15 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:37:14 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:38:19 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:44:25 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:57:22 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 16:58:24 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:02:05 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:09:37 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:10:39 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:16:49 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:17:44 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:23:26 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
[19-Mar-2017 17:23:48 Europe/Sofia] PHP Parse error:  syntax error, unexpected '{' in /home/csrevolu/public_html/forum/greyfish/list.php on line 93
list.php

Код: Избери всички

<?php
if (empty($_SERVER['HTTP_REFERER'])){die();}
include("inc/game_q.php");
use xPaw\SourceQuery\SourceQuery;
$Query = new SourceQuery( );
require_once("inc/TeamSpeak3/TeamSpeak3.php");
?>
<link href="//<?php echo $_SERVER['HTTP_HOST'];?>/greyfish/style_list.css" rel="stylesheet" type="text/css" media="screen, projection" />
<script src="//<?php echo $_SERVER['HTTP_HOST'];?>/greyfish/js/fancybox/jquery.fancybox.pack.js"></script>
<script src="//<?php echo $_SERVER['HTTP_HOST'];?>/greyfish/js/jquery.tablesorter.min.js"></script>


<section id="flip-scroll">
<table cellpadding="0" cellspacing="0" border="0" id="table" class="tinytable cf">
<thead>
<tr>
<th>#</th>
<th>Име</th>
<th>IP</th>
<th>Карта</th>
<th>Играчи</th>
<th>Вот</th>
</tr>
</thead>
<tbody>
               
<?php
include("conf.php");
function truncate_charsasd($text, $limit, $ellipsis = '...') {
    if( strlen($text) > $limit ) {
        $endpos = strpos(str_replace(array("\r\n", "\r", "\n", "\t"), ' ', $text), ' ', $limit);
        if($endpos !== FALSE)
        $text = trim(substr($text, 0, $endpos)) . $ellipsis;
    }
    return $text;
}

$greyfish_Get = mysqli_query($link,"SELECT * FROM greyfish_servers ORDER by type DESC");
while($row = mysqli_fetch_assoc($greyfish_Get)) {
	$hostname = $row['hostname'];
	$players = $row['players'];
	$maxplayers = $row['maxplayers'];
	$ip = $row['ip'];
	$port = $row['port'];
	$type = $row['type'];
	$last_update = $row['last_update'];
	$map = $row['map'];
	$mapimg = "";//globalize
	if (file_exists($_SERVER['DOCUMENT_ROOT'].'/greyfish/maps/'.$type.'/'.$map.'.jpg')) {
		 $mapimg = '//'.$_SERVER['HTTP_HOST'].'/greyfish/maps/'.$type.'/'.$map.'.jpg';
	} else {
		$mapimg = '//'.$_SERVER['HTTP_HOST'].'/greyfish/maps/map_no_response.jpg';
	}
	
	$status = $row['status'];
	$vote = $row['vote'];
	$servid = $row['id'];
	$game = "";//globalize
	$statusimg = ""; //globalize
	$steam = ""; //globalize
	if($type == "cs" || $type=="csgo") {
	$steam = "<a href='steam://connect/$ip:$port' title='steam'><img src='//".$_SERVER['HTTP_HOST']."/greyfish/icons/steam/steam.gif' alt='steam'/></a>";
	} 
	$gametracker ="<a href='https://www.gametracker.com/server_info/$ip:$port/' target='_blank' title='gametracker'><img src='//".$_SERVER['HTTP_HOST']."/greyfish/icons/gt/gt.gif' alt='gt'/></a>";
	switch($status) {
		case '1': {
			$statusimg ='<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/status/online.png" title="This server is online" alt="online"/>';
			break;
		}
		case '0': {
			$statusimg ='<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/status/offline.png" title="This server is offline" alt="offline"/>';
			break;
		}
	}
	switch($type) {
		case 'cs': {
			
			////////////////LIKE CRON////////////////////
			if($last_update < time()) {
			$nextupd = time() + $greyfish_update;
			
			try
			{
			$Query->Connect( ''.$ip.'',$port, 1, SourceQuery::GOLDSOURCE );
			$update_q_cs = $Query->GetInfo();
			$ServerErr = true;
			}
			catch( Exception $e )
			{
			$ServerErr = false;
			}
			finally
			{
			$Query->Disconnect( );
			}
	
			$host_cron = $update_q_cs['HostName'];
			if ($ServerErr == false) {
			//offline
			$query_q_cs = mysqli_query($link,"UPDATE greyfish_servers SET status='0', players='0',maxplayers='0',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_cs);
			} else {
			//online
			$map_cron = $update_q_cs['Map'];
			$p_cron = $update_q_cs['Players'];
			$maxp_cron = $update_q_cs['MaxPlayers'];
			$query_q_cs = mysqli_query($link,"UPDATE greyfish_servers SET status='1',hostname='$host_cron',map='$map_cron', players='$p_cron',maxplayers='$maxp_cron',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_cs);
			}
			}
			///////////////////END CRON///////////////////////

			$game = '<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/cs/cs.png" alt="CS 1.6"/>';
			break;
		}
		case 'csgo': {
			
			////////////////LIKE CRON////////////////////
			if($last_update < time()) {
			$nextupd = time() + $greyfish_update;
			
			try
			{
			$Query->Connect( ''.$ip.'',$port, 1, SourceQuery::SOURCE );
			$update_q_cs = $Query->GetInfo();
			$ServerErr = true;
			}
			catch( Exception $e )
			{
			$ServerErr = false;
			}
			finally
			{
			$Query->Disconnect( );
			}
	
			$host_cron = $update_q_cs['HostName'];
			if ($ServerErr == false) {
			//offline
			$query_q_cs = mysqli_query($link,"UPDATE greyfish_servers SET status='0', players='0',maxplayers='0',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_cs);
			} else {
			//online
			$map_cron = $update_q_cs['Map'];
			$p_cron = $update_q_cs['Players'];
			$maxp_cron = $update_q_cs['MaxPlayers'];
			$query_q_cs = mysqli_query($link,"UPDATE greyfish_servers SET status='1',hostname='$host_cron',map='$map_cron', players='$p_cron',maxplayers='$maxp_cron',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_cs);
			}
			}
			///////////////////END CRON///////////////////////
			
			$game = '<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/csgo/csgo.png" alt="CS:GO"/>';
			break;
		}
		case 'samp': {
			
			////////////////LIKE CRON////////////////////
			if($last_update < time()) {
			$nextupd = time() + $greyfish_update;
			
			try {
			$rQuery = new QueryServer( $ip, $port );
    
			$aInformation  = $rQuery->GetInfo( );
			$aServerRules  = $rQuery->GetRules( );
			$aTotalPlayers = $rQuery->GetDetailedPlayers( );
    
			$rQuery->Close( );
			$serverState = true;
			}
			catch (QueryServerException $pError) {
			$serverState = false;
			}
			if ($serverState == true) {
			$host_cron = mb_convert_encoding( $aInformation['Hostname'], "utf-8", "windows-1251");
			$map_cron = $aInformation['Map'];
            $p_cron = $aInformation['Players'];
			$maxp_cron = $aInformation['MaxPlayers'];
			$query_q_samp = mysqli_query($link,"UPDATE greyfish_servers SET status='1',hostname='$host_cron',map='$map_cron', players='$p_cron',maxplayers='$maxp_cron',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_samp);
			} else {
			$query_q_samp = mysqli_query($link,"UPDATE greyfish_servers SET status='0', players='0',maxplayers='0',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_samp);
			}
			
			}
			///////////////////END CRON///////////////////////
			
			$game = '<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/samp/samp.png" alt="San Andreas Multi-Player"/>';
			break;
		}
		case 'ts': {
			
			////////////////LIKE CRON////////////////////
			if($last_update < time()) {
			$nextupd = time() + $greyfish_update;
			try
			{
			// connect to server, authenticate and grab info
			$ts3 = TeamSpeak3::factory("serverquery://$query_ts_user:$query_ts_pass@$ip:10011/?server_port=$port");
  
 
			$host_cron= $ts3->virtualserver_name;
			$p_cron  = $ts3->virtualserver_clientsonline ;
			$maxp_cron =  $ts3->virtualserver_maxclients ;
			$query_q_ts = mysqli_query($link,"UPDATE greyfish_servers SET status='1',hostname='$host_cron', players='$p_cron',maxplayers='$maxp_cron',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_ts);
			}
			catch(Exception $e)
			{
			$query_q_ts3 = mysqli_query($link,"UPDATE greyfish_servers SET status='0', players='0',maxplayers='0',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_ts3);
			}
			}
			///////////////////END CRON///////////////////////
			
			$game = '<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/ts/ts.png" alt="TeamSpeak 3"/>';
			break;
		}
		case 'mc': {
			
			////////////////LIKE CRON////////////////////
			if($last_update < time()) {
			$nextupd = time() + $greyfish_update;
			
			try {
			$Query = new MinecraftQuery( );
			$Query->Connect( $ip,$port );
		   
			$mc_data =  $Query->GetInfo( );
			$host_cron = mb_convert_encoding($mc_data['HostName'], "utf-8", "windows-1251");
			$map = $mc_data['Map'];
		    $p_cron = $mc_data['Players'];
		    $maxp_cron = $mc_data['MaxPlayers'];
			$query_q_mc = mysqli_query($link,"UPDATE greyfish_servers SET status='1',hostname='$host_cron', players='$p_cron',maxplayers='$maxp_cron',last_update='$nextupd' WHERE id='$servid'");
			@mysqli_free_result($query_q_mc);
		     
			} catch( MinecraftQueryException $e ) {
			 $query_q_mc = mysqli_query($link,"UPDATE greyfish_servers SET status='0', players='0',maxplayers='0',last_update='$nextupd' WHERE id='$servid'");
			 @mysqli_free_result($query_q_mc);
			}
			
			}
			///////////////////END CRON///////////////////////
			
			$game = '<img src="//'.$_SERVER['HTTP_HOST'].'/greyfish/icons/mc/mc.png" alt="Minecraft"/>';
			break;
		}
	}

 echo "
 <tr>
 <td>$game $statusimg</td>
 <td><span title='$hostname'>".truncate_charsasd($hostname,32,'...')."</span></td>
 <td><span onclick='prompt(\"IP адреса на сървъра $hostname е:\",\"$ip:$port\"); return false;' style='cursor:pointer'>$ip:$port</span> $gametracker $steam</td>
 <td><a class='tip2'><span><img src='$mapimg' alt='$map'/></span>$map</a></td>
 <td class='slots'><i class='fancybox uncategorizei' data-fancybox-type='iframe' data-href='//".$_SERVER['HTTP_HOST']."/greyfish/showplayers.php?ip=$ip&port=$port&game=$type' title='".truncate_charsasd($hostname,32,'...')." :: PLAYERS:' data-type='iframe'>$players/$maxplayers</i></td>
 <td><span class='upme vote-btn' data-vote='upvote'  data-my='$servid'></span> <span id='bid-$servid'>$vote</span> <span class='downme vote-btn' data-vote='downvote'  data-my='$servid'></span></td>
 </tr>";
	
}
@mysqli_free_result($greyfish_Get);
?>           
</tbody>
</table>
</section>


<?php
//total servers
$gettotal = mysqli_query($link,"SELECT COUNT(*) as numservers FROM greyfish_servers");
$row1 = mysqli_fetch_assoc($gettotal);

//total players
$gettotal2 = mysqli_query($link,"SELECT SUM(players) as numplayers FROM greyfish_servers");
$row2 = mysqli_fetch_assoc($gettotal2);


//total max slots
$gettotal3 = mysqli_query($link,"SELECT SUM(maxplayers) as slots FROM greyfish_servers");
$row3 = mysqli_fetch_assoc($gettotal3);

@$per_cent = floor(($row2['numplayers']/$row3['slots'])*100);
$bg = ""; //globalize

if($per_cent < 0 || $per_cent > 35) {
	$bg = "#ac0";
} 
if($per_cent > 50) {
	$bg = "#fb5";
} 
if($per_cent > 80) {
	$bg = "#f67";
}

echo '
<div class="progressbar" style="width: 100%"><div  style="background-color:'.$bg.';width:'.$per_cent.'%;max-width:100%" class="progressbar-inner"></div></div>

<div class="downstats">Имаме '.$row1['numservers'].' сървъра, '.$row2['numplayers'].' играча и '.$row3['slots'].' слота!</div>';

//free fucking memory
@mysqli_free_result($gettotal);
@mysqli_free_result($gettotal2);
@mysqli_free_result($gettotal3);
?>

<script>
$("#table").tablesorter( {sortList: [[0,0], [1,0]]} );

	  $(".fancybox").fancybox({
		maxWidth	: 800,
		maxHeight	: 600,
		fitToView	: false,
		width		: '70%',
		height		: '70%',
		autoSize	: false,
		closeClick	: false,
		openEffect	: 'none',
		closeEffect	: 'none'
	});
</script>
<?php include("js/vote.php");?>
Хостинга ми е от новахостинг
Имам същият проблем

Потребителски аватар

ProGam3r Пурата
Потребител
Потребител
Мнения: 115
Регистриран: 22 яну 2017, 16:16

Greyfish(LGSL)

Мнение от ProGam3r Пурата » 18 авг 2017, 18:19

Става ли на free host ?

Потребителски аватар

nameless. ᑭᔕᗩ
Потребител
Потребител
Мнения: 1017
Регистриран: 20 май 2017, 11:47
Се отблагодари: 33 пъти
Получена благодарност: 23 пъти

Greyfish(LGSL)

Мнение от nameless. ᑭᔕᗩ » 18 авг 2017, 18:48

Разбира се, че не защото LGSL e направено специално за платен хост форуми.

Потребителски аватар

JustyleR
Модератор
Модератор
Мнения: 416
Регистриран: 24 фев 2017, 18:59
Местоположение: Русе
Се отблагодари: 11 пъти
Получена благодарност: 31 пъти
Години: 19
Контакти:

Greyfish(LGSL)

Мнение от JustyleR » 19 авг 2017, 02:11

nameless. написа:
18 авг 2017, 18:48
Разбира се, че не защото LGSL e направено специално за платен хост форуми.
Стига си писал глупости..
ProGam3r написа:
18 авг 2017, 18:19
Става ли на free host ?
Пробвай..
Steam | Github
Вече не ползвам Skype, ако има нещо ми пишете на лично или в Discord сървъра.

Потребителски аватар

nameless. ᑭᔕᗩ
Потребител
Потребител
Мнения: 1017
Регистриран: 20 май 2017, 11:47
Се отблагодари: 33 пъти
Получена благодарност: 23 пъти

Greyfish(LGSL)

Мнение от nameless. ᑭᔕᗩ » 19 авг 2017, 16:07

Какви глупости ? Ти въобще пробвал ли си на фрее хост да сложиш LGSL ? И, ако да тръгнало ли ти е?
Хмм.. съмнявам се.

Отговори

Върни се в “Уеб Програмиране”

Кой е на линия

Потребители, разглеждащи този форум: Няма регистрирани потребители и 1 гост