mirror of
https://github.com/2009scape/2009scape.github.io.git
synced 2024-10-05 15:07:16 +02:00
Made it work with Php7
This commit is contained in:
parent
837ed253eb
commit
95e5541e50
@ -4,7 +4,7 @@
|
||||
// System definitions.
|
||||
define('JWEB', true);
|
||||
define('DEBUG_MODE', false);
|
||||
define('USER_IP', $_SERVER['REMOTE_ADDR']);
|
||||
define('USER_IP', isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1');
|
||||
|
||||
// Site configurations.
|
||||
define('SITE_NAME', 'RuneScape - MMORPG');
|
||||
|
@ -20,8 +20,8 @@ if (defined('PAGE_DESCRIPTION')) {
|
||||
|
||||
|
||||
$q = dbquery("SELECT * FROM users WHERE UID = '" . USER_ID . "' LIMIT 1");
|
||||
if(mysql_num_rows($q) > 0) {
|
||||
$row = mysql_fetch_assoc($q);
|
||||
if($q->num_rows > 0) {
|
||||
$row = $q->fetch_assoc();
|
||||
$username = $row['username'];
|
||||
$displayname = $row['displayname'];
|
||||
}
|
||||
@ -108,8 +108,8 @@ $online = dbevaluate("SELECT COUNT(UID) FROM users WHERE online = '1';");
|
||||
<div id="lang">
|
||||
<a href="http://www.runescape.com/title.ws"><img alt="English" title="English" src="<?php echo WWW; ?>/img/main/layout/en.gif" /></a>
|
||||
<a href="http://www.runescape.com/l=1/title.ws"><img alt="Deutsch" title="Deutsch" src="<?php echo WWW; ?>/img/main/layout/de.gif" /></a>
|
||||
<a href="http://www.runescape.com/l=2/title.ws"><img alt="Français" title="Français" src="<?php echo WWW; ?>/img/main/layout/fr.gif" /></a>
|
||||
<a href="http://www.runescape.com/l=3/title.ws"><img alt="Português (BR)" title="Português (BR)" src="<?php echo WWW; ?>/img/main/layout/br.gif" /></a>
|
||||
<a href="http://www.runescape.com/l=2/title.ws"><img alt="Français" title="Français" src="<?php echo WWW; ?>/img/main/layout/fr.gif" /></a>
|
||||
<a href="http://www.runescape.com/l=3/title.ws"><img alt="Português (BR)" title="Português (BR)" src="<?php echo WWW; ?>/img/main/layout/br.gif" /></a>
|
||||
</div>
|
||||
-->
|
||||
|
||||
@ -191,7 +191,7 @@ $online = dbevaluate("SELECT COUNT(UID) FROM users WHERE online = '1';");
|
||||
<li><a href="<?php echo WWW; ?>/adventurers-log" class="fly"><span>Adventurer's Log</span></a></li>
|
||||
|
||||
<li><a href="<?php echo WWW; ?>/poll" class="fly"><span>Polls</span></a></li>
|
||||
<li><a href="<?php echo WWW; ?>/kbase/guid/Downloads_and_Wallpapers" class="fly"><span>Downloads & Wallpapers</span></a></li>
|
||||
<li><a href="<?php echo WWW; ?>/kbase/guid/Downloads_and_Wallpapers" class="fly"><span>Downloads & Wallpapers</span></a></li>
|
||||
</ul>
|
||||
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
|
||||
</li>
|
||||
@ -201,9 +201,9 @@ $online = dbevaluate("SELECT COUNT(UID) FROM users WHERE online = '1';");
|
||||
<!--[if lte IE 6]><iframe src=""></iframe><![endif]-->
|
||||
<ul>
|
||||
<li><a href="<?php echo WWW; ?>/kbase/guid/Customer_Support" class="fly"><span>Customer Support</span></a></li>
|
||||
<li><a href="<?php echo WWW; ?>/loginapplet/loginappletb4b5.html?mod=www&dest=loginapplet/loginapplet.ws?mod=accountappeal&dest=passwordchoice.ws" class="fly"><span>Password Recovery</span></a></li>
|
||||
<li><a href="<?php echo WWW; ?>/loginapplet/loginappletef7e.html?mod=www&dest=loginapplet/loginapplet.ws?mod=accountappeal&dest=lockchoice.ws" class="fly"><span>Locked Account Recovery</span></a></li>
|
||||
<li><a href="<?php echo WWW; ?>/account/account_history" class="fly"><span>Appeal Bans & Mutes</span></a></li>
|
||||
<li><a href="<?php echo WWW; ?>/loginapplet/loginappletb4b5.html?mod=www&dest=loginapplet/loginapplet.ws?mod=accountappeal&dest=passwordchoice.ws" class="fly"><span>Password Recovery</span></a></li>
|
||||
<li><a href="<?php echo WWW; ?>/loginapplet/loginappletef7e.html?mod=www&dest=loginapplet/loginapplet.ws?mod=accountappeal&dest=lockchoice.ws" class="fly"><span>Locked Account Recovery</span></a></li>
|
||||
<li><a href="<?php echo WWW; ?>/account/account_history" class="fly"><span>Appeal Bans & Mutes</span></a></li>
|
||||
<li><a href="<?php echo WWW; ?>/bugtracker/m=bugtracker_v4.php" class="fly"><span>Submit a Bug Report</span></a></li>
|
||||
<li><a href="<?php echo WWW; ?>/parents" class="fly"><span>Parents' Guide</span></a></li>
|
||||
</ul>
|
||||
|
@ -37,7 +37,7 @@ require_once("header.php");
|
||||
<img src="<?php echo WWW; ?>/img/main/home/feature_poll_icon.jpg" alt="" />
|
||||
<div class="featureTitle">Latest Poll - 17-Oct-2013 </div>
|
||||
<div class="featureDesc">Authentication Server Maintenance - (Free/Member)<A
|
||||
href="<?php echo WWW; ?>/poll">Vote Here...</A></div>
|
||||
href="<?php echo WWW; ?>/poll">Vote Here...</A></div>
|
||||
</div>
|
||||
|
||||
<div class="feature">
|
||||
@ -120,8 +120,8 @@ href="<?php echo WWW; ?>/kbase/guid/herblore_the_potions">More...</A></P>
|
||||
<?php
|
||||
$news_qry = dbquery("SELECT * FROM web_news WHERE main_news='1' ORDER BY date DESC LIMIT 1");
|
||||
|
||||
if (mysql_num_rows($news_qry) > 0) {
|
||||
while ($news = mysql_fetch_assoc($news_qry)) {
|
||||
if ($news_qry->num_rows > 0) {
|
||||
while ($news = $news_qry->fetch_assoc()) {
|
||||
echo "
|
||||
|
||||
<div class='recentNews'>
|
||||
@ -142,8 +142,8 @@ href="<?php echo WWW; ?>/kbase/guid/herblore_the_potions">More...</A></P>
|
||||
<?php
|
||||
$news_qry = dbquery("SELECT * FROM web_news WHERE main_news='0' ORDER BY date DESC LIMIT 0,3");
|
||||
|
||||
if (mysql_num_rows($news_qry) > 0) {
|
||||
while ($news = mysql_fetch_assoc($news_qry)) {
|
||||
if ($news_qry->num_rows > 0) {
|
||||
while ($news = $news_qry->fetch_assoc()) {
|
||||
echo '
|
||||
<div class="sectionBody">
|
||||
<div class="recentNews">
|
||||
@ -166,4 +166,4 @@ href="<?php echo WWW; ?>/kbase/guid/herblore_the_potions">More...</A></P>
|
||||
|
||||
<?php
|
||||
include_once("./footer.php");
|
||||
?>
|
||||
?>
|
||||
|
@ -41,8 +41,8 @@ class database {
|
||||
*/
|
||||
public function connect($database) {
|
||||
$this->database = $database;
|
||||
$this->connection = @mysql_pconnect($this->host, $this->username, $this->password) or $this->error(mysql_error());
|
||||
@mysql_select_db($this->database, $this->connection) or $this->error(mysql_error());
|
||||
$this->connection = new mysqli($this->host, $this->username, $this->password) or $this->error($this->connection->error);
|
||||
@$this->connection->select_db($this->database) or $this->error($this->connection->error);
|
||||
|
||||
/*
|
||||
* If the connection was successful, we can now
|
||||
@ -58,7 +58,7 @@ class database {
|
||||
*/
|
||||
public function disconnect() {
|
||||
if ($this->connected) {
|
||||
@mysql_pclose($this->connection);
|
||||
@mysqli_close($this->connection);
|
||||
$this->connected = false;
|
||||
}
|
||||
}
|
||||
@ -69,7 +69,7 @@ class database {
|
||||
* @return resource The data recieved from the database.
|
||||
*/
|
||||
public function execute_query($query) {
|
||||
$resultset = mysql_query($query, $this->connection) or $this->error('While executing ["' . $query . '"]: ' . mysql_error());
|
||||
$resultset = $this->connection->query($query) or $this->error('While executing ["' . $query . '"]: ' . $this->connection->error);
|
||||
return $resultset;
|
||||
}
|
||||
|
||||
@ -82,11 +82,11 @@ class database {
|
||||
if(!$result = @$this->execute_query($query)) {
|
||||
return 0;
|
||||
}
|
||||
if(@mysql_num_rows($result) == 0) {
|
||||
if(@$result->num_rows == 0) {
|
||||
return $default_value;
|
||||
}
|
||||
else {
|
||||
return @mysql_result($result, 0);
|
||||
return @$result->data_seek( 0); $result->fetch_array()[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user