Exemple #1
0
 public static function deleteCache($filename)
 {
     if (file_exists('cache/' . $filename . '.cache.php')) {
         $del = unlink('cache/' . $filename . '.cache.php');
         if (!$del) {
             buildError('<b>Cache error.</b> tried to delete non-existing cache file (cache/' . $filename . '.cache.php)');
         }
     }
 }
Exemple #2
0
 public static function connectToRealmDB($realmid)
 {
     self::selectDB('webdb');
     if ($GLOBALS['realms'][$realmid]['mysql_host'] != $GLOBALS['connection']['host'] || $GLOBALS['realms'][$realmid]['mysql_user'] != $GLOBALS['connection']['user'] || $GLOBALS['realms'][$realmid]['mysql_pass'] != $GLOBALS['connection']['password']) {
         mysql_connect($GLOBALS['realms'][$realmid]['mysql_host'], $GLOBALS['realms'][$realmid]['mysql_user'], $GLOBALS['realms'][$realmid]['mysql_pass']) or buildError("<b>Database Connection error:</b> A connection could not be established to Realm. Error: " . mysql_error(), NULL);
     } else {
         self::connectToDB();
     }
     mysql_select_db($GLOBALS['realms'][$realmid]['chardb']) or buildError("<b>Database Selection error:</b> The realm database could not be selected. Error: " . mysql_error(), NULL);
     self::$connectedTo = 'chardb';
 }
		-[ Created by ©Nomsoft
		  `-[ Original core by Anthony (Aka. CraftedDev)

				-CraftedWeb Generation II-                  
			 __                           __ _   							   
		  /\ \ \___  _ __ ___  ___  ___  / _| |_ 							   
		 /  \/ / _ \| '_ ` _ \/ __|/ _ \| |_| __|							   
		/ /\  / (_) | | | | | \__ \ (_) |  _| |_ 							   
		\_\ \/ \___/|_| |_| |_|___/\___/|_|  \__|	- www.Nomsoftware.com -	   
                  The policy of Nomsoftware states: Releasing our software   
                  or any other files are protected. You cannot re-release    
                  anywhere unless you were given permission.                 
                  © Nomsoftware 'Nomsoft' 2011-2012. All rights reserved.  */
require 'includes/classes/template_parse.php';
connect::selectDB('webdb');
$getTemplate = mysql_query("SELECT path FROM template WHERE applied='1' ORDER BY id ASC LIMIT 1");
$row = mysql_fetch_assoc($getTemplate);
$template['path'] = $row['path'];
if (!file_exists("styles/" . $template['path'] . "/style.css") || !file_exists("styles/" . $template['path'] . "/template.html")) {
    buildError("<b>Template Error: </b>The active template does not exist or missing files.", NULL);
    exit_page();
}
?>
<link rel="stylesheet" href="styles/<?php 
echo $template['path'];
?>
/style.css" />
<link rel="stylesheet" href="styles/global/style.css" />
<?php 
plugins::load('styles');
}
function sendResponse($calltype, $result)
{
    header("Content-type: application/json");
    echo json_encode(array($calltype => $result));
}
function buildError($errname, $errdata)
{
    return array("error" => array($errname, $errdata));
}
if (!class_exists('Magmi_Plugin')) {
    if (!isset($_REQUEST['api'])) {
        header('Status 406 : Unauthorized call', true, 406);
        exit;
    }
    $api = $_REQUEST['api'];
    if (!in_array($api, array_keys(Magmi_RemoteAgent::$apidesc))) {
        header('Status 406 : Unauthorized call', true, 406);
        exit;
    }
    $missing = Magmi_RemoteAgent::checkParams($_REQUEST, $api);
    if (count($missing) > 0) {
        header('Status 400 : Invalid parameters', true, 400);
        $error = buildError("missing mandatory parameters", implode(",", $missing));
        sendResponse($api, $error);
    } else {
        $mra = Magmi_RemoteAgent::getInstance();
        $result = $mra->{$api}($_REQUEST);
        sendResponse($api, $result);
    }
}
Exemple #5
0
    public static function loadVotingLinks()
    {
        connect::selectDB('webdb');
        $result = mysql_query("SELECT * FROM votingsites ORDER BY id DESC");
        if (mysql_num_rows($result) == 0) {
            buildError("Couldnt fetch any voting links from the database. " . mysql_error());
        } else {
            while ($row = mysql_fetch_assoc($result)) {
                ?>
            <div class='votelink'>
            <table width="100%">
                <tr>
                    <td width="20%"><img src="<?php 
                echo $row['image'];
                ?>
" /></td>
                    <td width="50%"><strong><?php 
                echo $row['title'];
                ?>
</strong> (<?php 
                echo $row['points'];
                ?>
 Vote Points)<td>
                    <td width="40%">
					<?php 
                if (website::checkIfVoted($row['id']) == FALSE) {
                    ?>
                    		<input type='submit' value='Vote'  onclick="vote('<?php 
                    echo $row['id'];
                    ?>
',this)">
					<?php 
                } else {
                    $getNext = mysql_query("SELECT next_vote FROM " . $GLOBALS['connection']['webdb'] . ".votelog\n\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE userid='" . account::getAccountID($_SESSION['cw_user']) . "'\n\t\t\t\t\t\t\t\t\t\t\t\t\t AND siteid='" . $row['id'] . "' ORDER BY id DESC LIMIT 1");
                    $row = mysql_fetch_assoc($getNext);
                    $time = $row['next_vote'] - time();
                    echo 'Time until reset: ' . convTime($time);
                }
                ?>
                         </td>
                     </tr>
              </table>
              </div>
			  <?php 
            }
        }
    }
Exemple #6
0
 public function connectToRealmDB($realmid)
 {
     $this->selectDB('webdb');
     $getRealmData = mysql_query("SELECT mysql_host,mysql_user,mysql_pass,char_db FROM realms WHERE id='" . (int) $realmid . "'");
     if (mysql_num_rows($getRealmData) > 0) {
         $row = mysql_fetch_assoc($getRealmData);
         if ($row['mysql_host'] != $GLOBALS['connection']['host'] || $row['mysql_user'] != $GLOBALS['connection']['user'] || $row['mysql_pass'] != $GLOBALS['connection']['password']) {
             mysql_connect($row['mysql_host'], $row['mysql_user'], $row['mysql_pass']) or buildError("<b>Database Connection error:</b> A connection could not be established to Realm. Error: " . mysql_error(), NULL);
         } else {
             $this->connect();
         }
         mysql_select_db($row['char_db']) or buildError("<b>Database Selection error:</b> The realm database could not be selected. Error: " . mysql_error(), NULL);
     }
 }
Exemple #7
0
#		  `-[ Original core by Anthony (Aka. CraftedDev)
#
#				-CraftedWeb Generation II-
#			 __                           __ _
#		  /\ \ \___  _ __ ___  ___  ___  / _| |_
#		 /  \/ / _ \| '_ ` _ \/ __|/ _ \| |_| __|
#		/ /\  / (_) | | | | | \__ \ (_) |  _| |_
#		\_\ \/ \___/|_| |_| |_|___/\___/|_|  \__|	- www.Nomsoftware.com -
#                  The policy of Nomsoftware states: Releasing our software
#                  or any other files are protected. You cannot re-release
#                  anywhere unless you were given permission.
#                  © Nomsoftware 'Nomsoft' 2011-2012. All rights reserved.
connect::selectDB('webdb');
if (!isset($_SESSION['cw_user'])) {
    $sql = "WHERE shownWhen = 'always' OR shownWhen = 'notlogged'";
} else {
    $sql = "WHERE shownWhen = 'always' OR shownWhen = 'logged'";
}
$getMenuLinks = mysql_query("SELECT * FROM site_links " . $sql . " ORDER BY position ASC");
if (mysql_num_rows($getMenuLinks) == 0) {
    buildError("<b>Template error:</b> No menu links was found in the CraftedWeb database!", NULL);
    echo "<br/>No menu links was found!";
}
while ($row = mysql_fetch_assoc($getMenuLinks)) {
    $curr = substr($row['url'], 3);
    if ($_GET['p'] == $curr) {
        echo '<li><a href="' . $row['url'] . '" class="current">' . $row['title'] . '</a></li>';
    } else {
        echo '<li><a href="' . $row['url'] . '">' . $row['title'] . '</a></li>';
    }
}
Exemple #8
0
    include "../../documents/refundpolicy.php";
    echo $rp_message;
}
#################
if (isset($_POST['serverStatus'])) {
    echo '<div class="box_one_title">Server status</div>';
    $num = 0;
    foreach ($GLOBALS['realms'] as $k => $v) {
        if ($num != 0) {
            echo "<hr/>";
        }
        server::serverStatus($k);
        $num++;
    }
    if ($num == 0) {
        buildError("<b>No realms found: </b> Please setup your database and add your realm(s)!", NULL);
        echo "No realms found.";
    }
    unset($num);
    ?>
<hr/>
<span id="realmlist">set realmlist <?php 
    echo $GLOBALS['connection']['realmlist'];
    ?>
</span>
</div>
<?php 
}
#################
if (isset($_POST['convertDonationList'])) {
    for ($row = 0; $row < count($GLOBALS['donationList']); $row++) {
Exemple #9
0
<?php

#   ___           __ _           _ __    __     _
#  / __\ __ __ _ / _| |_ ___  __| / / /\ \ \___| |__
# / / | '__/ _` | |_| __/ _ \/ _` \ \/  \/ / _ \ '_ \
#/ /__| | | (_| |  _| ||  __/ (_| |\  /\  /  __/ |_) |
#\____/_|  \__,_|_|  \__\___|\__,_| \/  \/ \___|_.__/
#
#		-[ Created by ©Nomsoft
#		  `-[ Original core by Anthony (Aka. CraftedDev)
#
#				-CraftedWeb Generation II-
#			 __                           __ _
#		  /\ \ \___  _ __ ___  ___  ___  / _| |_
#		 /  \/ / _ \| '_ ` _ \/ __|/ _ \| |_| __|
#		/ /\  / (_) | | | | | \__ \ (_) |  _| |_
#		\_\ \/ \___/|_| |_| |_|___/\___/|_|  \__|	- www.Nomsoftware.com -
#                  The policy of Nomsoftware states: Releasing our software
#                  or any other files are protected. You cannot re-release
#                  anywhere unless you were given permission.
#                  © Nomsoftware 'Nomsoft' 2011-2012. All rights reserved.
website::getNews();
if ($GLOBALS['enableSlideShow'] == false && $GLOBALS['news']['enable'] == false) {
    buildError("<b>Configuration file error.</b>Neither the slideshow or the news are displayed, the homepage will be empty.");
    echo "Seems like the homepage was empty!";
}