Example #1
0
 function sendLoginDetails($email)
 {
     global $sitename;
     global $logo;
     $query = MYSQL_QUERY("SELECT `Username`,`Password` FROM `ChallengeMembers` WHERE `Email` = '" . $email . "' ") or die(MYSQL_ERROR());
     if ($query) {
         if (MYSQL_NUM_ROWS($query)) {
             while ($row = MYSQL_FETCH_ARRAY($query)) {
                 $userpassword = $row['Password'];
                 $username = $row['Username'];
             }
             /*send email*/
             include 'email_class.php';
             $em = new EmailTemplate();
             $subject = ucfirst($sitename) . " Login Details";
             $headers = "From: " . ucwords($sitename) . " <*****@*****.**> \r\n" . 'X-Mailer: PHP/' . phpversion();
             $headers .= 'MIME-Version: 1.0' . "\r\n";
             $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
             $email_message = $username . ",<br /><br /> Thank you for your interest in joining our challenges.\n\t\t\t\t\t\t\t\t\t<br /><br />\n\t\t\t\t\t\t\t\t\tThe following are your login data:\n\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\tUsername : <b>" . $username . "</b><br />\n\t\t\t\t\t\t\t\t\tPassword : <b>" . $userpassword . "</b>\n\t\t\t\t\t\t\t\t\t<br /><br />\n\t\t\t\t\t\t\t\t\tThank you.<br />\n\t\t\t\t\t\t\t\t\t<b>" . $sitename . "</b>";
             $emailmessage = $em->get($logo, $sitename, $email_message);
             /*first send to guest */
             $sentmail = mail($email, $subject, $emailmessage, $headers);
             /*end of send email*/
             return "OK";
         } else {
             return $email . "not found in database.";
         }
     } else {
         return "Email not found in database.";
     }
 }
 function CheckIfVerified($code)
 {
     $query = MYSQL_QUERY("SELECT `ChallengeMemberId` FROM `ChallengeMembers` WHERE VerificationCode = '" . $code . "' ") or die(MYSQL_ERROR());
     if (MYSQL_NUM_ROWS($query) > 0) {
         while ($row = MYSQL_FETCH_ARRAY($query)) {
             $member_id = $row['ChallengeMemberId'];
             $result = MYSQL_QUERY("UPDATE `ChallengeMembers` SET `Verified` = '1' WHERE `ChallengeMemberId` = '" . $member_id . "' ") or die(MYSQL_ERROR());
         }
         return true;
     } else {
         return false;
     }
 }
Example #3
0
	function getSponsoredChallengesClosedCount($challenger_id){
		$query = MYSQL_QUERY("SELECT COUNT(*) AS total FROM `Challenges` WHERE `CompanyId` = '".$sponsor_id."' AND `Solved` = '1' ") OR DIE(MYSQL_ERROR());
		if($query){
			if(MYSQL_NUM_ROWS($query) > 0){
				while($row = MYSQL_FETCH_ARRAY($query)){
					$total = $row['total'];
				}
				return $total;
			}else{
				return 0;
			}
		}else{
			return 0;
		}
	}
 function lookupField($table, $id_field, $lookup_field, $id_value)
 {
     $sql_lookup = "SELECT `{$lookup_field}` from `{$table}` where `{$id_field}` = '{$id_value}'";
     $result_lookup = MYSQL_QUERY($sql_lookup);
     $rows_lookup = MYSQL_NUM_ROWS($result_lookup);
     if ($rows_lookup == null || ($rows_lookup = 0)) {
         return 0;
     } else {
         $filds = explode(",", $lookup_field);
         $ind = 0;
         $value = "";
         while ($ind < count($filds)) {
             $value .= stripslashes(MYSQL_RESULT($result_lookup, 0, $filds[$ind]) . " ");
             $ind++;
         }
         return trim($value);
     }
 }
Example #5
0
 function get_tabdesc($sectionid, $section)
 {
     global $flolang;
     return $flolang->sprintf($flolang->tabbar_desc_usernotes, MYSQL_NUM_ROWS(MYSQL_QUERY("SELECT id FROM flobase_usernotes WHERE sectionid='" . mysql_real_escape_string($sectionid) . "' AND section = '" . mysql_real_escape_string($section) . "'")));
 }
Example #6
0
    }
    $querystring = "SELECT id FROM flobase_usernotes WHERE userid='{$userid}' {$noteslanguages}";
    $querynoteslist = MYSQL_QUERY($querystring);
    $amountnotes = MYSQL_NUM_ROWS($querynoteslist);
    $tabbar['usernotes']['desc'] = $flolang->sprintf($flolang->contributed_tabbar_desc_usernotes, $amountnotes);
    $pageselect = $florensia->pageselect($amountnotes, array("contributed", $userid, $username), array('anchor' => 'usernotes'), 10);
    $querynotes = MYSQL_QUERY($querystring . " ORDER BY section, dateline DESC LIMIT " . $pageselect['pagestart'] . ",10");
    while ($notes = MYSQL_FETCH_ARRAY($querynotes)) {
        $noteslistcontent .= $classusernote->get_entry($notes['id']);
    }
    $noteslistcontent = "\n        <a name='usernotes'></a>\n        <div name='usernotes' class='small'>\n            <div style='margin-top:10px;'>" . $pageselect['selectbar'] . "</div>\n            {$noteslistcontent}\n            <div style='margin-top:10px;'>" . $pageselect['selectbar'] . "</div>\n        </div>\n    ";
}
if ($userid == $flouser->userid or $flouser->get_permission("watch_log")) {
    $querystring = "SELECT class, classid FROM flobase_addition WHERE entrystatus LIKE '%,{$userid},%'";
    $flagsquery = MYSQL_QUERY($querystring);
    $amountflags = MYSQL_NUM_ROWS($flagsquery);
    $tabbar['flags']['desc'] = $flolang->sprintf($flolang->contributed_tabbar_desc_flags, $amountflags);
    $pageselect = $florensia->pageselect($amountflags, array("contributed", $userid, $username), array('anchor' => 'flags'), 20);
    $flagsquery = MYSQL_QUERY($querystring . " ORDER BY class LIMIT " . $pageselect['pagestart'] . ",20");
    while ($flags = MYSQL_FETCH_ARRAY($flagsquery)) {
        switch ($flags['class']) {
            case "npc":
                $npc = new floclass_npc($flags['classid']);
                $flagscontent .= "<div class='shortinfo_" . $florensia->change() . "'>" . $npc->shortinfo() . "</div>";
                break;
            case "item":
                $item = new floclass_item($flags['classid']);
                $flagscontent .= "<div class='shortinfo_" . $florensia->change() . "'>" . $item->shortinfo() . "</div>";
                break;
            case "quest":
                $flagscontent .= "<div class='shortinfo_" . $florensia->change() . "'>" . $classquest->get_shortinfo($flags['classid']) . "</div>";
Example #7
0
<?php

require_once "./init.php";
if (!defined('is_florensia')) {
    die('Hacking attempt');
}
$flolang->load("droplist");
if (!$mybb->user['uid']) {
    $florensia->output_page($flouser->noaccess($flolang->droplist_updateentry_error_notloggedin));
}
$flolang->load("item");
$flolang->load("npc");
###
$notyetincludedworkaround = "AND !(" . $florensia->get_columnname("attackmax", "npc") . "='0' && " . $florensia->get_columnname("attackmin", "npc") . "='0' && " . $florensia->get_columnname("level", "npc") . "='1' && " . $florensia->get_columnname("hppoints", "npc") . "='0' && " . $florensia->get_columnname("manapoints", "npc") . "='0' && " . $florensia->get_columnname("exp", "npc") . "='0')";
###
if ($_GET['itemid'] && MYSQL_NUM_ROWS(MYSQL_QUERY("SELECT itemid FROM server_item_idtable WHERE itemid='" . mysql_real_escape_string($_GET['itemid']) . "' LIMIT 1")) or $_GET['npcid'] && MYSQL_NUM_ROWS(MYSQL_QUERY("SELECT " . $florensia->get_columnname("npcid", "npc") . " FROM server_npc WHERE " . $florensia->get_columnname("npcid", "npc") . "='" . mysql_real_escape_string($_GET['npcid']) . "' LIMIT 1"))) {
    if (strlen($_GET['search']) == 0) {
        if ($_GET['itemid']) {
            header("Location: " . $florensia->outlink(array("itemdetails", $_GET['itemid'], $stringtable->get_string($_GET['itemid'])), array(), array("escape" => FALSE)));
        } else {
            header("Location: " . $florensia->outlink(array("npcdetails", $_GET['npcid'], $stringtable->get_string($_GET['npcid'])), array(), array("escape" => FALSE)));
        }
    }
    if ($_GET['itemid']) {
        $item = new floclass_item($_GET['itemid']);
        $addtoentry = $item->shortinfo();
        foreach (explode(" ", $_GET['search']) as $keyword) {
            $searchstring[] = "name_{$stringtable->language} LIKE '%" . get_searchstring($keyword, 0) . "%'";
        }
        $querystring = "SELECT " . $florensia->get_columnname("npcid", "npc") . " FROM server_npc WHERE " . join(" AND ", $searchstring) . " {$notyetincludedworkaround} AND npc_file='MonsterChar' ORDER BY name_{$stringtable->language}";
        $formlink = $florensia->outlink(array("itemdetails", $_GET['itemid'], $stringtable->get_string($_GET['itemid'])), array(), array("anchor" => "droplist"));
Example #8
0
require_once "./init.php";
if (!defined('is_florensia')) {
    die('Hacking attempt');
}
$florensia->sitetitle("CharacterAPI");
$flolang->load("character");
if (strlen($_GET['verify'])) {
    if (!$flouser->userid) {
        $verificationbar = "<span style='color:#FF0000'>{$flolang->character_api_verify_error_notloggedin}</span>";
    } else {
        $character = new class_character($_GET['verify']);
        if (!$character->is_valid()) {
            $verificationbar = "<span style='color:#FF0000'>" . $character->get_errormsg() . "</span>";
        } elseif ($character->data['ownerid']) {
            $verificationbar = $flolang->character_api_already_verified;
        } elseif (MYSQL_NUM_ROWS(MYSQL_QUERY("SELECT id FROM flobase_character_verification WHERE userid='{$flouser->userid}' AND characterid='{$character->data['characterid']}' AND accepted='-1'"))) {
            $verificationbar = $flolang->character_api_verify_pending;
        } else {
            if ($_POST['do_upload'] && $_FILES['screenshot']['tmp_name']) {
                //verify if the screen is the original one.
                $screen = fopen($_FILES['screenshot']['tmp_name'], "rb");
                $header = fread($screen, 163);
                $origheader = "ÿØÿàJFIFÿÛC\t\t\n\f\r\f\v\v\f \$.' \",#(7),01444'9=82<.342ÿÛC\t\t\t\f\v\f\r\r2!!22222222222222222222222222222222222222222222222222ÿÀ";
                if ($header == $origheader) {
                    MYSQL_QUERY("INSERT INTO flobase_character_verification (userid, characterid, timestamp) VALUES('{$flouser->userid}', '{$character->data['characterid']}', '" . date("U") . "')");
                    @rename($_FILES['screenshot']['tmp_name'], "{$florensia->root_abs}/pictures/characterverification/" . mysql_insert_id());
                    chmod("{$florensia->root_abs}/pictures/characterverification/" . mysql_insert_id(), 0755);
                    $verificationbar = $flolang->character_api_verify_pending;
                    $florensia->notice($flolang->character_api_verify_upload_successfully, "successful");
                    $flolog->add("character:verification:request", "{user:{$flouser->userid}} created {characterverification:" . mysql_insert_id() . "} for {characterid:{$character->data['characterid']}}");
                } else {
Example #9
0
function getColoumnAsArray($table, $coloumn1, $coloumn2)
{
    if ($coloumn2) {
        $sql = "SELECT {$coloumn1},{$coloumn2} FROM {$table}";
        $result = MYSQL_QUERY($sql);
        $rows_result = MYSQL_NUM_ROWS($result);
        checkError($result, $sql);
        $arra = array();
        $i = 0;
        while ($i < $rows_result) {
            $j = MYSQL_RESULT($result, $i, $coloumn2);
            $arra[$j] = MYSQL_RESULT($result, $i, $coloumn1);
            $i++;
        }
    } else {
        $sql = "SELECT {$coloumn1} FROM {$table}";
        $result = MYSQL_QUERY($sql);
        $rows_result = MYSQL_NUM_ROWS($result);
        checkError($result, $sql);
        $arra = array();
        $i = 0;
        while ($i < $rows_result) {
            $arra[$i] = MYSQL_RESULT($result, $i, $coloumn1);
            $i++;
        }
    }
    return $arra;
}
Example #10
0
            $marketsitetitle = "<div style='margin-bottom:5px;' class='subtitle'><a href='" . $florensia->outlink(array("market")) . "'>{$flolang->market_title_main}</a> &gt; {$flolang->market_title_sell} {$serversitetitle}</div>";
        }
    } else {
        $marketsitetitle = "<div style='margin-bottom:5px;' class='subtitle'><a href='" . $florensia->outlink(array("market")) . "'>{$flolang->market_title_main}</a> &gt; {$flolang->market_title_all} {$serversitetitle}</div>";
        unset($exchangetype, $exchangedb);
    }
    $selectexchangetypeform = "\n\t\t<select name='cat'>\n\t\t\t<option value='all'>{$flolang->market_title_all}</option>\n\t\t\t<option value='sell' " . $selectexchangetype['sell'] . ">{$flolang->market_title_sell}</option>\n\t\t\t<option value='buy' " . $selectexchangetype['buy'] . ">{$flolang->market_title_buy}</option>\n\t\t</select>\n\t";
    if ($_GET['search']) {
        foreach (explode(" ", $_GET['search']) as $keyword) {
            $searchstring[] = "server_item_idtable.name_{$stringtable->language} LIKE '%" . get_searchstring($keyword, 0) . "%'";
        }
        $searchstring = join(" AND ", $searchstring) . " AND";
        $marketsitetitle = "<div style='margin-bottom:5px;' class='subtitle'><a href='" . $florensia->outlink(array("market")) . "'>{$flolang->market_title_main}</a> &gt; " . $flolang->sprintf($flolang->market_title_searching, $florensia->escape($_GET['search'])) . "  {$serversitetitle}</div>";
    }
    $query = "SELECT flobase_usermarket.id as marketid, flobase_usermarket.itemid as itemid FROM server_item_idtable, flobase_usermarket WHERE {$searchstring} server_item_idtable.itemid=flobase_usermarket.itemid {$exchangedb} {$serverdb} ORDER BY flobase_usermarket.createtime DESC";
    $querystringlist = MYSQL_QUERY($query);
    $entries = MYSQL_NUM_ROWS($querystringlist);
    $pageselect = $florensia->pageselect($entries, array("market", $exchangetype), array($serverlink));
    $querystringlist = MYSQL_QUERY($query . " LIMIT " . $pageselect['pagestart'] . "," . $florensia->pageentrylimit);
    while ($itemlist = MYSQL_FETCH_ARRAY($querystringlist)) {
        $content .= $florensia->adsense(8);
        $item = new floclass_item($itemlist['itemid']);
        $content .= "<div class='shortinfo_" . $florensia->change() . "'>" . $item->shortinfo(array("marketid" => $itemlist['marketid'])) . "</div>";
    }
    if (!$content) {
        $content = "<div style='text-align:center' class='warning'>{$flolang->market_noentries}</div>";
    }
    $content = "\n\t\t{$marketsitetitle}\n\t\t<div style='text-align:center; margin-bottom:5px;'>" . $florensia->quick_select('marketsearch', array('cat' => $exchangetype, 'search' => $_GET['search']), array($flolang->market_title_listitems => $selectexchangetypeform), $settings = array('namesselect' => 1, 'serverselect' => 1)) . "</div>\n\t\t<div style='margin-bottom:10px;'>" . $pageselect['selectbar'] . "</div>\n\t\t{$content}\n\t\t<div style='margin-top:10px;'>" . $pageselect['selectbar'] . "</div>\n\t";
}
$content = "<div style='text-align:center; margin-bottom:15px;''>" . $florensia->quicksearch(array('language' => true)) . "</div>\n\t\t{$content}\n\t";
$florensia->output_page($content);
Example #11
0
function GereChampsDoubles($id, $connexion)
{
    // Mise à jour de la table adhérents quand la table adhésions est modifiée.
    $requete = "SELECT * FROM adhesions WHERE ad_adherent='{$id}' AND ad_etat='1' ORDER BY ad_annee DESC ";
    $resultat = ExecRequete($requete, $connexion);
    $compteur = MYSQL_NUM_ROWS($resultat);
    if ($compteur > 1) {
        $requete3 = "UPDATE personnes SET pe_ancien='1' WHERE pe_id='{$id}'";
    } else {
        $requete3 = "UPDATE personnes SET pe_ancien='0' WHERE pe_id='{$id}'";
    }
    $resultat3 = ExecRequete($requete3, $connexion);
    if ($compteur > 0) {
        $objet = ObjetSuivant($resultat);
        $requete2 = "UPDATE personnes SET pe_annee9='{$objet->ad_annee}' WHERE pe_id='{$id}'";
        $resultat = ExecRequete($requete2, $connexion);
    } else {
        $objet = ObjetSuivant($resultat);
        $requete2 = "UPDATE personnes SET pe_annee9='0' WHERE pe_id='{$id}'";
        $resultat = ExecRequete($requete2, $connexion);
    }
}
Example #12
0
    $querysignature = MYSQL_QUERY("SELECT template FROM flobase_signaturetemp WHERE userid='" . $signaturetemp[1] . "'");
    if ($signature = MYSQL_FETCH_ARRAY($querysignature)) {
        $signature['layout'] = "create/" . $signaturetemp[1];
    } else {
        //ungueltige id oder keine angegeben
        $querysignature = MYSQL_QUERY("SELECT * FROM flobase_signature");
        $signature = rand(1, MYSQL_NUM_ROWS($querysignature));
        $querysignature = MYSQL_QUERY("SELECT * FROM flobase_signature LIMIT " . bcsub($signature, 1) . ",{$signature}");
        $signature = MYSQL_FETCH_ARRAY($querysignature);
    }
} else {
    $querysignature = MYSQL_QUERY("SELECT * FROM flobase_signature WHERE id='" . $signature . "'");
    if (!($signature = MYSQL_FETCH_ARRAY($querysignature))) {
        //ungueltige id oder keine angegeben
        $querysignature = MYSQL_QUERY("SELECT * FROM flobase_signature");
        $signature = rand(1, MYSQL_NUM_ROWS($querysignature));
        $querysignature = MYSQL_QUERY("SELECT * FROM flobase_signature LIMIT " . bcsub($signature, 1) . ",{$signature}");
        $signature = MYSQL_FETCH_ARRAY($querysignature);
    }
}
if (!($xml = simplexml_load_string($signature['template']))) {
    die("Failed to load template");
}
$imagepic = $layerfolder . "/" . $signature['layout'];
$info = getimagesize($imagepic);
if ($info[2] == 2) {
    //JPEG / JPG
    $Teilgrafik = imagecreatefromjpeg($imagepic);
} elseif ($info[2] == 3) {
    //PNG
    $Teilgrafik = imagecreatefrompng($imagepic);
Example #13
0
         # else $linkedchars = 0;
         # if (strlen($image['guildlinkedlist'])) $linkedguilds = count(explode(",",$image['guildlinkedlist']));
         # else $linkedguilds = 0;
         $privacyaccess = $classgallery->check_privacy($image);
         if (!$privacyaccess['access']) {
             $thumpnail = "<img src='{$florensia->layer_rel}/gallery_locked.png' style='border:0px;' alt='{$flolang->gallery_thumbnail_noaccess}' " . popup("<div class='subtitle warning small' style='text-align:center; font-weight:normal;'>" . $flolang->sprintf($flolang->gallery_error_nopermission, join("<br />", $privacyaccess['reason'])) . "</div>", "") . ">";
         } else {
             $thumpnail = "<img src='{$florensia->root}/pictures/gallery/{$image['galleryid']}_thumb' style='border:0px;' alt='" . $florensia->escape($image['name']) . "'>";
         }
         if (strlen($image['name']) > 30) {
             $imagetitle = substr($image['name'], 0, 30) . "...";
         } else {
             $imagetitle = $image['name'];
         }
         if ($image['commenting']) {
             $comments = "\n                    <tr>\n                        <td style='text-align:center;'><img src='{$florensia->layer_rel}/icon_notes.gif' alt='Notes:'></td>\n                        <td style='vertical-align:bottom;'>" . MYSQL_NUM_ROWS(MYSQL_QUERY("SELECT id FROM flobase_usernotes WHERE sectionid='" . mysql_real_escape_string($image['galleryid']) . "' AND section = 'gallery'")) . "</td>\n                    </tr>\n                    ";
         } else {
             unset($comments);
         }
         if ($image['voting']) {
             $voting = "\n                    <tr>\n                        <td style='text-align:center;'><img src='{$florensia->layer_rel}/icon_thumpsup.gif' alt='Up:'></td>\n                        <td style='vertical-align:bottom;'>{$image['thumpsup']}</td>\n                    </tr>\n                    <tr>\n                        <td style='text-align:center;'><img src='{$florensia->layer_rel}/icon_thumpsdown.gif' alt='Down:'></td>\n                        <td style='vertical-align:bottom;'>{$image['thumpsdown']}</td>\n                    </tr>\n                    ";
         } else {
             unset($voting);
         }
         $images .= "\n            <div class='gallerylist small'>\n                <div style='font-weight:bold; min-height:12px;'>" . $florensia->escape($imagetitle) . "</div>\n                <div class='thumbnail' style='float:left;'>\n                    <a href='" . $florensia->outlink(array("gallery", "i", $image['galleryid'], $image['name'])) . "'>\n                        {$thumpnail}\n                    </a>\n                </div>\n                <div>\n                <table style='margin-left:{$image['twidth']}; border-spacing:1px;'>\n                    <tr>\n                        <td style='width:17px; text-align:center;'><img src='{$florensia->layer_rel}/icon_cursor.png' alt='C:' style='height:17px;'></td>\n                        <td style='vertical-align:bottom;'>{$image['views']}/{$image['fullviews']}</td>\n                    </tr>\n                    {$voting}\n                    <tr>\n                        <td style='text-align:center;'><img src='{$florensia->layer_rel}/icon_character.gif' alt='Chars:'></td>\n                        <td style='vertical-align:bottom;'>{$linkedchars}</td>\n                    </tr>\n                    <tr>\n                        <td style='text-align:center;'><img src='{$florensia->layer_rel}/icon_guild.gif' alt='Guilds:'></td>\n                        <td style='vertical-align:bottom;'>{$linkedguilds}</td>\n                    </tr>\n                    {$comments}\n                </table>\n                </div>\n            </div>";
     }
     if ($images) {
         $imagelist .= "\n            <div style='margin-top:10px;'>" . $pageselect['selectbar'] . "</div>\n            {$images}\n            <div style='margin-top:10px;'>" . $pageselect['selectbar'] . "</div>\n        ";
     }
 }
 unset($serverselect);
Example #14
0
}
$sqlQuery4rest .= $append;
if ($_SESSION['s']['sortBy'] == "") {
    $_SESSION['s']['sortBy'] = "rating";
}
if ($_SESSION['s']['sortOrder'] == $_SESSION['s']['sortBy'] and $_SESSION['s']['equal'] == 1) {
    $newSortOrder = $_SESSION['s']['sortBy'];
    $sqlQuery4rest .= " order by {$newSortOrder}";
    $_SESSION['s']['equal'] = 0;
} else {
    $newSortOrder = $_SESSION['s']['sortBy'];
    $sqlQuery4rest .= " order by {$newSortOrder} desc ";
    $sortEqual = 1;
}
$result4rest = MYSQL_QUERY($sqlQuery4rest);
$numberOfRows4rest = MYSQL_NUM_ROWS($result4rest);
$i = 0;
while ($i < $numberOfRows4rest) {
    $menu[$i]['id'] = MYSQL_RESULT($result4rest, $i, "id");
    $menu[$i]['name'] = MYSQL_RESULT($result4rest, $i, "name");
    $menu[$i]['rating'] = MYSQL_RESULT($result4rest, $i, "rating");
    $i++;
}
?>
	
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script src="../jquery/jquery.js"></script>
Example #15
0
<?php

include 'header.php';
include 'db_connect.php';
echo '<h1>Stats</h1>';
echo "<h2>Number of Users</h2><br>";
$statement = "SELECT * FROM users";
$query = MYSQL_QUERY($statement);
echo MYSQL_NUM_ROWS($query);
echo "<br><h2>Number of Organizations></h2><br>";
$statement = "SELECT * FROM organization";
$query = MYSQL_QUERY($statement);
echo MYSQL_NUM_ROWS($query);
echo "<br><h2>Number of Ratings></h2><br>";
$statement = "SELECT * FROM rating";
$query = MYSQL_QUERY($statement);
echo MYSQL_NUM_ROWS($query);
echo "<br><h2>Number of Supervisor Comments></h2><br>";
$statement = "SELECT * FROM supervisor_comments";
$query = MYSQL_QUERY($statement);
echo MYSQL_NUM_ROWS($query);
echo "<br><h2>Number of Ads></h2><br>";
$statement = "SELECT * FROM advertisements";
$query = MYSQL_QUERY($statement);
echo MYSQL_NUM_ROWS($query);
include 'footer.php';
include 'db_close.php';
Example #16
0
<?php

require_once "GLOBAL/head.php";
////////////////////////
//  Attached Objects  //
////////////////////////
//  Get attached objects (if any)
$sql = "SELECT *, objects.id AS objectsId FROM objects, wires WHERE wires.fromid = '" . $objects[$o] . "' AND wires.toid = objects.id AND wires.active = '1' AND objects.active = '1' ORDER BY weight DESC, objects.rank, end DESC, begin DESC, name1, name2, objects.modified DESC, objects.created DESC";
$result = MYSQL_QUERY($sql);
$numrows = MYSQL_NUM_ROWS($result);
$padout = floor(log10($numrows)) + 1;
if ($padout < 2) {
    $padout = 2;
}
$i = 1;
$myrow["id"] = $myrow["objectsId"];
while ($myrow = MYSQL_FETCH_ARRAY($result)) {
    $name = $myrow["name1"];
    if ($myrow["name2"]) {
        $name .= " " . $myrow["name2"];
    }
    if (strlen($name) > 60) {
        $name = substr($name, 0, 60) . "...";
    }
    echo STR_PAD($i++, $padout, "0", STR_PAD_LEFT) . " " . "\n<a href='" . $dbAdmin . "browse.php" . urlData();
    if (sizeof($objects)) {
        echo ",";
    }
    echo $myrow["objectsId"] . "'>";
    echo strip_tags($name) . "</a><br />";
}
Example #17
0
}
if (!$flouser->get_permission("access_admincp")) {
    $florensia->output_page($flouser->noaccess());
}
$florensia->sitetitle("AdminCP");
$notesamount = array();
foreach ($flolang->lang as $langkey => $langname) {
    if (!$flouser->get_permission("mod_usernotes", $langkey)) {
        continue;
    }
    $queryusernotes = MYSQL_QUERY("SELECT id FROM flobase_usernotes WHERE language='{$langkey}' AND moderated=0");
    $amount = MYSQL_NUM_ROWS($queryusernotes);
    if ($amount) {
        $amount = "<span style='color:#FF0000;'>{$amount}</span>";
    }
    $notesamount[] = "{$amount}/{$langkey}";
}
if ($flouser->get_permission("mod_language")) {
    foreach (array_keys($flolang->lang) as $langkey) {
        if (!$flouser->get_permission("mod_language", $langkey)) {
            continue;
        }
        $queryusernotes = MYSQL_QUERY("SELECT varname FROM flobase_languagefiles WHERE lang_{$langkey}_flag=1");
        $amount = MYSQL_NUM_ROWS($queryusernotes);
        if ($amount) {
            $florensia->notice("Language {$langkey}: There are <a href='{$florensia->root}/adminlang.php?lang={$langkey}&amp;new=1'>{$amount} new variable(s)</a> which need to be translated", "warning");
        }
    }
}
$content = "\n<div class='subtitle'>AdminCP</div>\n<div style='margin-bottom:10px; font-weight:normal;' class='subtitle'>\n\t<div><a href='{$florensia->root}/adminlang.php'>Language Files</a></div>\n\t<div><a href='{$florensia->root}/adminstartpage.php'>News (Startpage)</a></div>\n\t<div><a href='{$florensia->root}/adminmenubar.php?classname=menubar'>Menubar</a></div>\n\t<div><a href='{$florensia->root}/adminmenubar.php?classname=userbar'>Userbar</a></div>\n\t<div><a href='{$florensia->root}/adminusernotes.php'>Usernotes Moderation</a> <span class='small'>(" . join(" ", $notesamount) . ")</span></div>\n\t<div><a href='{$florensia->root}/admincharacterverification.php'>Characterverification</a></div>\n\t<div><a href='{$florensia->root}/adminreactivatecharacter.php'>Characterreactivation</a></div>\n</div>\t\n<div style='margin-bottom:10px; font-weight:normal;' class='subtitle'>\n\t<div><a href='{$florensia->root}/adminlog'>FloBase Logfile</a></div>\n        <div><a href='{$florensia->root}/admincharapilog.php'>CharAPI Logfile</a></div>\n        <div><a href='{$florensia->root}/admincharcrawlerlog.php'>CharCrawler Logfile</a></div>\n\t<div><a href='{$florensia->root}/admintools/npcflags'>NPC-Flags</a></div>\n\t<div><a href='{$florensia->root}/admintools/itemflags'>Item-Flags</a> (ToDo)</div>\n\t<div><a href='{$florensia->root}/admintools/itemflags'>Quest-Flags</a> (ToDo)</div>\n\t<div><a href='{$florensia->root}/admintools/npcimages'>NPCs without images</a> (ToDo)</div>\n\t<div><a href='{$florensia->root}/admintools/itemimages'>Items without images</a> (ToDo)</div>\n</div>\n<div style='margin-bottom:10px; font-weight:normal;' class='subtitle'>\n\t<div><a href='{$florensia->root}/adminteamspeak.php'>Teamspeak</a></div>\n\t<div><a href='{$florensia->root}/adminpermission.php'>User-Permissions</a></div>\n\t<div><a href='{$florensia->root}/adminhistory.php'>Version History</a></div>\n</div>";
$florensia->output_page($content);
Example #18
0
}
if ($flouser->get_permission("teamspeak", "moderate")) {
    if (isset($_POST['do_remove'])) {
        foreach ($_POST as $postkey => $postvalue) {
            if (preg_match("/remove_[0-9]+/", $postkey) && $postkey === "remove_{$postvalue}") {
                MYSQL_QUERY("DELETE FROM flobase_teamspeak WHERE guildid='{$postvalue}'");
                if (MYSQL_AFFECTED_ROWS()) {
                    $florensia->notice("Guild with ID {$postvalue} was successfully removed.", "successful");
                    $flolog->add("teamspeak:guild:delete", "{user:{$flouser->userid}} removed {guild:{$postvalue}}");
                } else {
                    $florensia->notice("Guild with ID {$postvalue} does not exists in this list.", "warning");
                }
            }
        }
    } elseif (isset($_POST['do_add'])) {
        if (MYSQL_NUM_ROWS(MYSQL_QUERY("SELECT guildid FROM flobase_guild WHERE guildid='" . intval($_POST['guildid']) . "'"))) {
            if (MYSQL_QUERY("INSERT IGNORE INTO flobase_teamspeak (guildid, timestamp, creator) VALUES('" . intval($_POST['guildid']) . "', '" . date("U") . "', '{$flouser->userid}')")) {
                $florensia->notice("Guild with ID " . intval($_POST['guildid']) . " was successfully added.", "successful");
                $flolog->add("teamspeak:guild:add", "{user:{$flouser->userid}} added {guild:" . intval($_POST['guildid']) . "}");
            } else {
                $florensia->notice("An error occurred while adding guild with ID " . intval($_POST['guildid']) . " to our list.", "warning");
            }
        } else {
            $florensia->notice("Guild with ID " . intval($_POST['guildid']) . " does not exists.", "warning");
        }
    }
}
$queryentry = MYSQL_QUERY("SELECT ts.creator, ts.timestamp, g.guildname, g.guildid, g.server, g.memberamount, c.charname, d.guildgrade, u.uid, u.email\nFROM flobase_teamspeak AS ts\nINNER JOIN flobase_guild AS g ON ( g.guildid = ts.guildid )\nLEFT JOIN (\nflobase_character_data AS d\nINNER JOIN flobase_character AS c ON ( d.characterid = c.characterid AND (guildgrade='5' OR ownerid!='0'))\nLEFT JOIN forum_users AS u ON ( u.uid = d.ownerid )\n) ON ( ts.guildid = d.guildid ) ORDER BY g.guildname, d.guildgrade DESC");
//hell ya! - you know what I mean, don't you!?
$tmpguild = 0;
while ($entry = MYSQL_FETCH_ARRAY($queryentry)) {
Example #19
0
require_once "{$florensia->root_abs}/class_vote.php";
$classvote = new class_vote();
require_once "{$florensia->root_abs}/class_character.php";
if (is_file("{$florensia->root_abs}/experimental") && !($mybb->user['usergroup'] == 4 or $mybb->user['usergroup'] == 3)) {
    if ($mybb->session->is_spider) {
        header("Location: http://www.florensia-base.com" . $_SERVER['REQUEST_URI']);
    }
    $florensia->output_page($florensia->login());
}
if (!$mybb->session->is_spider) {
    //antibot.php
    #$siteimpressionslimit = 8;
    #$siteimpressionstimelimit = 30;
    #MYSQL_QUERY("DELETE FROM flobase_sessions WHERE lastcaptcha<'".bcsub(date("U"), $siteimpressionstimelimit)."'");
    $queryantibot = MYSQL_QUERY("SELECT antibot FROM flobase_sessions WHERE sessionid='{$mybb->cookies['sid']}' AND antibot=1 LIMIT 1");
    if (MYSQL_NUM_ROWS($queryantibot)) {
        $antibotcontent = "\n\t\t<div class='warning' style='text-align:center;'>{$flolang->content_locked}</div>\n\t\t<div class='warning' style='margin-top:30px; text-align:center;'>{$flolang->content_locked_text}</div>\n\t";
        $florensia->sitetitle("Antibot");
        $florensia->output_page($antibotcontent);
    }
    /****
    
    //Sessions
    	if (isset($_POST['captchasubmit'])) {
    		function encrypt($string, $key) {
    			$result = '';
    			for($i=0; $i<strlen($string); $i++) {
    				$char = substr($string, $i, 1);
    				$keychar = substr($key, ($i % strlen($key))-1, 1);
    				$char = chr(ord($char)+ord($keychar));
    				$result.=$char;
Example #20
0
 function updateentry($itemid, $npcid, $action = "thumpsup", $log = true)
 {
     global $flolang, $flouser, $flouserdata, $florensia, $stringtable, $flolog, $classvote;
     //not logged in
     if (!$flouser->userid) {
         return "<div class='warning' style='text-align:center'>{$flolang->droplist_updateentry_error_notloggedin}</div>";
     }
     //banned from droplist
     if (!$flouser->get_permission("add_droplist")) {
         return "<div class='warning' style='text-align:center'>{$flolang->droplist_updateentry_error_banned}</div>";
     }
     if (($action == "verified" or $action == "unverified") && !$flouser->get_permission("mod_droplist", "verify")) {
         return "<div class='warning' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_error_verify_nopermission, $entryname) . "</div>";
     }
     if ($action == "delete" && !$flouser->get_permission("mod_droplist", "delete")) {
         return "<div class='warning' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_error_delete_nopermission, $entryname) . "</div>";
     }
     if (!MYSQL_NUM_ROWS(MYSQL_QUERY("SELECT itemid FROM server_item_idtable WHERE itemid='" . mysql_real_escape_string($itemid) . "' LIMIT 1")) or !MYSQL_NUM_ROWS(MYSQL_QUERY("SELECT " . $florensia->get_columnname("npcid", "npc") . " FROM server_npc WHERE " . $florensia->get_columnname("npcid", "npc") . "='" . mysql_real_escape_string($npcid) . "' LIMIT 1"))) {
         return "<div class='warning' style='text-align:center'>{$flolang->droplist_updateentry_error_falseid}</div>";
     }
     $entryname = $stringtable->get_string($itemid, array('protectionsmall' => 1)) . "/" . $stringtable->get_string($npcid, array('protectionsmall' => 1));
     #get dropid
     list($dropid, $thumpsup, $thumpsdown) = MYSQL_FETCH_ARRAY(MYSQL_QUERY("SELECT dropid, thumpsup, thumpsdown FROM flobase_droplist WHERE itemid='" . mysql_real_escape_string($itemid) . "' AND npcid='" . mysql_real_escape_string($npcid) . "'"));
     if (!$dropid) {
         #not yet listed
         MYSQL_QUERY("INSERT INTO flobase_droplist (itemid, npcid) VALUES('" . mysql_real_escape_string($itemid) . "', '" . mysql_real_escape_string($npcid) . "')");
         $dropid = mysql_insert_id();
         $votestats = array("thumpsup" => 0, "thumpsdown" => 0);
     } else {
         $votestats = array("thumpsup" => $thumpsup, "thumpsdown" => $thumpsdown);
     }
     unset($prerating, $preratingtime);
     $error = false;
     if ($action == "thumpsup" or $action == "thumpsdown") {
         $rating = $action == "thumpsup" ? 1 : -1;
         #any pre-ratings?
         if ($pre = MYSQL_FETCH_ARRAY(MYSQL_QUERY("SELECT rating, timestamp FROM flobase_droplist_ratings WHERE dropid='{$dropid}' AND userid='{$flouser->userid}'"))) {
             list($prerating, $preratingtime) = $pre;
         }
         if ($pre && intval($prerating) == $rating) {
             #already voted and nothing changed
             return "<div class='warning' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_verify_alreadyverified, $entryname, date("m.d.Y", $preratingtime)) . "</div>";
         } elseif ($pre) {
             #already voted but changed, update rating and timestamp
             if (!MYSQL_QUERY("UPDATE flobase_droplist_ratings SET rating='{$rating}', timestamp='" . date("U") . "' WHERE dropid='{$dropid}' AND userid='{$flouser->userid}'")) {
                 $error = true;
             }
         } else {
             #net yet voted, insert new row
             if (!MYSQL_QUERY("INSERT INTO flobase_droplist_ratings (dropid, userid, rating, timestamp) VALUES('{$dropid}', '{$flouser->userid}', '{$rating}', '" . date("U") . "')")) {
                 $error = true;
             }
         }
         if ($error) {
             $this->refresh($dropid);
             #refresh so the ghost (if any) is killed
             $flolog->add("error:droplist", "MySQL-Update-Error while {$action} on {npc:{$npcid}}/{item:{$itemid}}");
             return "<div class='warning' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_verify_error, $entryname) . "</div>";
         }
         #no errors
         $votestats = $this->refresh($dropid);
         #refresh thumps-count
         if ($log) {
             if ($action == "thumpsup") {
                 $flolog->add("droplist:thumpsup", "{user:{$flouser->userid}} voted for {npc:{$npcid}}/{item:{$itemid}} ({$votestats['thumpsup']}/{$votestats['thumpsdown']})");
             } else {
                 $flolog->add("droplist:thumpsdown", "{user:{$flouser->userid}} voted against {npc:{$npcid}}/{item:{$itemid}} ({$votestats['thumpsup']}/{$votestats['thumpsdown']})");
             }
         }
         return "<div class='successful' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_verify_successful, $entryname) . "</div>";
     } elseif ($action == "withdraw") {
         if (!MYSQL_QUERY("DELETE r, v FROM\n\t\t\t\t\t\t\t\tflobase_droplist_ratings as r\n\t\t\t\t\t\t\t\tLEFT JOIN flobase_droplist_verified as v ON(r.dropid=v.dropid)\n\t\t\t\t\t\t\t\tWHERE r.dropid='{$dropid}' AND r.userid='{$flouser->userid}'")) {
             $flolog->add("error:droplist", "MySQL-Delete-Error while withdraw from {npc:{$npcid}}/{item:{$itemid}}");
             return "<div class='warning' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_withdraw_error, $entryname) . "</div>";
         }
         $votestats = $this->refresh($dropid);
         #refresh thumps-count
         if ($log) {
             $flolog->add("droplist:withdraw", "{user:{$flouser->userid}} withdraw from {npc:{$npcid}}/{item:{$itemid}} ({$votestats['thumpsup']}/{$votestats['thumpsdown']})");
         }
         return "<div class='successful' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_withdraw_successful, $entryname) . "</div>";
     } elseif ($action == "delete") {
         if (!MYSQL_QUERY("DELETE d,r,v,q\n\t\t\t\t\t\t\tFROM flobase_droplist as d \n\t\t\t\t\t\t\tLEFT JOIN flobase_droplist_ratings as r ON (r.dropid=d.dropid)\n\t\t\t\t\t\t\tLEFT JOIN flobase_droplist_verified as v ON (v.dropid=d.dropid)\n\t\t\t\t\t\t\tLEFT JOIN flobase_droplist_quest as q ON (q.dropid=d.dropid)\n\t\t\t\t\t\t\tWHERE d.dropid='{$dropid}'")) {
             $flolog->add("error:droplist", "MySQL-Delete-Error while delete {npc:{$npcid}}/{item:{$itemid}}");
             return "<div class='warning' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_delete_error, $entryname) . "</div>";
         } else {
             if ($log) {
                 $flolog->add("droplist:delete", "{user:{$flouser->userid}} deleted {npc:{$npcid}}/{item:{$itemid}} ({$votestats['thumpsup']}/{$votestats['thumpsdown']})");
             }
             return "<div class='successful' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_delete_successful, $entryname) . "</div>";
         }
     } elseif ($action == "verified") {
         list($vtime) = MYSQL_FETCH_ARRAY(MYSQL_QUERY("SELECT timestamp FROM flobase_droplist_verified WHERE dropid='{$dropid}' AND userid='{$userid}'"));
         if ($vtime) {
             return "<div class='warning' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_verify_error_alreadyverified, $entryname, date("m.d.y H:i", $vtime)) . "</div>";
         }
         #net yet verified
         if (!MYSQL_QUERY("INSERT INTO flobase_droplist_verified (dropid, userid, timestamp) VALUES('{$dropid}', '{$flouser->userid}', '" . date("U") . "') ON DUPLICATE KEY UPDATE timestamp='" . date("U") . "'")) {
             $flolog->add("error:droplist", "MySQL-Insert-Error while verify {npc:{$npcid}}/{item:{$itemid}}");
             return "<div class='warning' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_adminverify_error, $entryname) . "</div>";
         }
         #successfully
         $this->updateentry($itemid, $npcid, "thumpsup", false);
         #add also a thumpsup
         if ($log) {
             $flolog->add("droplist:verified", "{user:{$flouser->userid}} verified {npc:{$npcid}}/{item:{$itemid}} ({$votestats['thumpsup']}/{$votestats['thumpsdown']})");
         }
         return "<div class='successful' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_adminverify_successful, $entryname) . "</div>";
     } elseif ($action == "unverified") {
         if (!MYSQL_QUERY("DELETE r,v\n\t\t\t\t\t\t    FROM flobase_droplist_verified as v\n\t\t\t\t\t\t    LEFT JOIN flobase_droplist_ratings as r ON (v.dropid=r.dropid AND r.userid=v.userid)\n\t\t\t\t\t\t    WHERE v.dropid='{$dropid}'")) {
             $flolog->add("error:droplist", "MySQL-Update-Error while remove verified status on {npc:{$npcid}}/{item:{$itemid}}");
             return "<div class='warning' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_unverify_error, $entryname) . "</div>";
         }
         $votestats = $this->refresh($dropid);
         if (!mysql_affected_rows()) {
             return "<div class='bordered' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_error_unverified_notverified, $entryname) . "</div>";
         }
         if ($log) {
             $flolog->add("droplist:unverified", "{user:{$flouser->userid}} removed verified status on {npc:{$npcid}}/{item:{$itemid}} ({$votestats['thumpsup']}/{$votestats['thumpsdown']})");
         }
         return "<div class='successful' style='text-align:center'>" . $flolang->sprintf($flolang->droplist_updateentry_unverify_successful, $entryname) . "</div>";
     }
     /*
     				if ($action=="thumpsup") {
     					$sqlquery = "INSERT INTO flobase_item_droplist (itemid, npcid, thumpsup, userlist) VALUES('".mysql_real_escape_string($itemid)."', '".mysql_real_escape_string($npcid)."', 1, '".$flouser->userid."-1-".date("U")."')";
     				}
     				elseif ($action=="thumpsdown") {
     					$sqlquery = "INSERT INTO flobase_item_droplist (itemid, npcid, thumpsdown, userlist) VALUES('".mysql_real_escape_string($itemid)."', '".mysql_real_escape_string($npcid)."', 1, '".$flouser->userid."-0-".date("U")."')";
     				} else return;
     				
     				if (!MYSQL_QUERY($sqlquery)) {
     					$flolog->add("error:droplist", "MySQL-Insert-Error while $action on {npc:{$npcid}}/{item:{$itemid}}");
     					return "<div class='warning' style='text-align:center'>".$flolang->sprintf($flolang->droplist_updateentry_verify_error, $entryname)."</div>";
     				}
     				else {
     					if ($log) $flolog->add("droplist:new", "{user:{$flouser->userid}} created new entry {npc:{$npcid}}/{item:{$itemid}}");
     					return "<div class='successful' style='text-align:center'>".$flolang->sprintf($flolang->droplist_updateentry_verify_successful, $entryname)."</div>";
     				}
     */
 }
Example #21
0
 }
 if (isset($orderby_lvloptions)) {
     $orderby_lvloptions = "\n\t\t\t\t\t<select name='order' class='small'>\n\t\t\t\t\t\t<option value='name' " . $orderselected['name'] . ">{$flolang->item_order_name}</option>\n\t\t\t\t\t\t{$orderby_lvloptions}\n\t\t\t\t\t</select>\n\t\t\t\t";
 }
 if ($category['selectby_itemtype']) {
     if (MYSQL_NUM_ROWS(MYSQL_QUERY("SELECT itemtypeid FROM flobase_item_types WHERE itemtypeid='" . mysql_real_escape_string($_GET['itemtype']) . "'")) == 1) {
         $selectitemtype = $whereand . $florensia->get_columnname("itemtype", "item") . " = '" . mysql_real_escape_string($_GET['itemtype']) . "'";
         $pageselectlinkoptions['itemtype'] = $_GET['itemtype'];
         $whereand = "AND ";
     }
     $selectby_itemtypes = floclass_item::get_typeselect($category['selectby_itemtype']);
 }
 if ($category['selectby_landclasses'] == 1) {
     unset($orderselected);
     if (isset($_GET['landclass'])) {
         if (MYSQL_NUM_ROWS(MYSQL_QUERY("SELECT id FROM flobase_landclass WHERE classid='" . mysql_real_escape_string($_GET['landclass']) . "'")) == 1) {
             $orderselected[$_GET['landclass']] = "selected='selected'";
             $selectclass = $whereand . $florensia->get_columnname("landclass", "item") . " LIKE '%" . mysql_real_escape_string($_GET['landclass']) . "%'";
             $pageselectlinkoptions['landclass'] = $_GET['landclass'];
             $whereand = "AND ";
         }
     }
     $selectby_classoptions = "\n\t\t\t\t\t<select name='landclass' class='small'>\n\t\t\t\t\t\t<option value='all' " . $orderselected['all'] . ">{$flolang->item_order_alllandclasses}</option>";
     $classlist = $florensia->get_classlist("landclass", 0);
     foreach ($classlist as $classvalue) {
         $selectby_classoptions .= "<option value='" . $classvalue['classid'] . "' " . $orderselected[$classvalue['classid']] . ">" . $classvalue['classname'] . "</option>";
     }
     $selectby_classoptions .= "\t\t\t\t\t\t\n\t\t\t\t\t</select>\n\t\t\t\t";
 } elseif ($category['selectby_seaclasses'] == 1) {
     unset($orderselected);
     if (isset($_GET['seaclass'])) {
 * pear install XML_HTMLSax
 *
 */
require_once 'XML/XML_HTMLSax.php';
/**
 * Include RSS feed creation functionality.
 * We depend on the presence of FeedCreator.class.php for PHP ({@link http://www.bitfolge.de/rsscreator-en.html}).
 */
require_once "feedcreator.class.php";
// Connect to the MySQL server
MYSQL_CONNECT($db_host, $db_user, $db_pw);
MYSQL_SELECT_DB($db) or die("Unable to select database");
//Select previously indexed URLs from the cache table, and put them into an array $oneurl
$query = "select url from {$db_table}";
$result = MYSQL_QUERY($query);
$howmanyrecords = MYSQL_NUM_ROWS($result);
$currentrecord = 0;
while ($currentrecord < $howmanyrecords) {
    $url = trim(MYSQL_RESULT($result, $currentrecord, "url"));
    $oneurl[$url] = 1;
    $currentrecord++;
}
date_default_timezone_set('America/Halifax');
/**
 * Handlers for HTML parsing.
 */
class MyHandler
{
    function MyHandler()
    {
    }
Example #23
0
if (!isset($_SESSION['SESSION'])) {
    require "includes/session_init.php";
}
if ($_SESSION['LOGGEDIN'] != true) {
    header("Location: index.php");
    exit;
}
$eMail = $_SESSION['EMAIL'];
include "includes/data.php";
$connect = mysql_connect($host, $us, $ps);
if ($connect) {
    $db = 'filmidid';
    mysql_select_db($db);
    $query = "select id from user_login where eMail='{$eMail}'";
    $result = MYSQL_QUERY($query);
    $numberOfRows4name = MYSQL_NUM_ROWS($result);
    $id4login = MYSQL_RESULT($result, 0, "id");
    if (!isset($pagenum)) {
        $pagenum = 1;
    }
    $data = mysql_query("SELECT * FROM video_details d,fav_videos f where d.video_id=f.video_id and f.user_id='{$id4login}'") or die(mysql_error());
    $rows = mysql_num_rows($data);
    $page_rows = 5;
    $last = ceil($rows / $page_rows);
    if ($pagenum < 1) {
        $pagenum = 1;
    } elseif ($pagenum > $last) {
        $pagenum = $last;
    }
    $max = 'limit ' . ($pagenum - 1) * $page_rows . ',' . $page_rows;
    $data_p = mysql_query("SELECT * FROM video_details d,fav_videos f where d.video_id=f.video_id and f.user_id='{$id4login}' order by Rating{$append} desc {$max}") or die(mysql_error());
Example #24
0
                $content['new'] .= "<div class='bordered small'><b>NEW</b> {$table}/" . $tablelist[$globalkey][$table]['searchkey'] . " => " . $stringtable->get_string($tabledata[$tablelist[$globalkey][$table]['searchkey']]) . " (" . $tabledata[$tablelist[$globalkey][$table]['searchkey']] . ")</div>";
                $newentries++;
            }
            $allentries[] = $tabledata[$tablelist[$globalkey][$table]['searchkey']];
        }
        //search for deleted entries
        unset($comma);
        foreach ($allentries as $searchkeys) {
            $exceptkeys .= $comma . $tablelist[$globalkey][$table]['searchkey'] . "!='" . mysql_real_escape_string($searchkeys) . "'";
            $comma = " AND ";
        }
        if ($exceptkeys) {
            $exceptkeys = "WHERE {$exceptkeys}";
        }
        $querytabledata_old = MYSQL_QUERY("SELECT " . $tablelist[$globalkey][$table]['searchkey'] . " FROM {$table} {$exceptkeys}", $dbold);
        $delentries = MYSQL_NUM_ROWS($querytabledata_old);
        while ($tabledata_old = MYSQL_FETCH_ASSOC($querytabledata_old)) {
            $sqldiff->write_cache("sql,{$globalkey},{$table},del," . $tabledata_old[$tablelist[$globalkey][$table]['searchkey']], $tabledata_old[$tablelist[$globalkey][$table]['searchkey']]);
            $content['del'] .= "<div class='bordered small'><b>DEL</b> {$table}/" . $tablelist[$globalkey][$table]['searchkey'] . " => " . $stringtable->get_string($tabledata_old[$tablelist[$globalkey][$table]['searchkey']]) . " (" . $tabledata_old[$tablelist[$globalkey][$table]['searchkey']] . ")</div>";
        }
        #---------------
        //any diffs made? if yes than set settings for later use, if no than ignore whole table
        if ($diffentries or $newentries or $delentries) {
            $sqldiff->write_cache("sql,{$globalkey},{$table},settings,searchkey", $tablelist[$globalkey][$table]['searchkey']);
            $sqldiff->write_cache("sql,{$globalkey},{$table},settings,ignore", $tablelist[$globalkey][$table]['ignore']);
            $sqldiff->write_cache("sql,{$globalkey},{$table},settings,columnnametable", $tablelist[$globalkey][$table]['columnnametable']);
            $sqldiff->write_cache("sql,{$globalkey},{$table},settings,parsexml", $tablelist[$globalkey][$table]['parsexml']);
            $finalcontent .= "\n\t\t\t\t\t<div class='subtitle' style='margin-top:12px;'>{$table} Diff: {$diffentries}/New: {$newentries}/Del: {$delentries}</div>\n\t\t\t\t\t{$content['diff']}\n\t\t\t\t\t{$content['new']}\n\t\t\t\t\t{$content['del']}\n\t\t\t\t";
        }
    }
}
Example #25
0
function createComboBox_tow($tables, $id_field, $value_field, $id_value, $field_name, $required = "", $actions = "", $cond = "")
{
    $result = '<select name="' . $field_name . '" id="' . $field_name . '" class="' . $required . '" ' . $actions . ' >\\n';
    if ($required == '') {
        $result .= "<option></option>\n";
    }
    $arr_tables = explode(',', $tables);
    foreach ($arr_tables as $table) {
        $result .= "<optgroup label='{$table}'>";
        $sql_combo = "SELECT {$id_field} , {$value_field} from {$table} {$cond} ORDER BY {$value_field}";
        $def = substr($table, 0, 1);
        $result_combo = MYSQL_QUERY($sql_combo);
        checkError($result_combo, $sql_combo);
        $rows_combo = MYSQL_NUM_ROWS($result_combo);
        $i = 0;
        while ($i < $rows_combo) {
            $id = MYSQL_RESULT($result_combo, $i, $id_field);
            $filds = explode(",", $value_field);
            $ind = 0;
            $value = "";
            while ($ind < count($filds)) {
                $value .= MYSQL_RESULT($result_combo, $i, $filds[$ind]) . " ";
                $ind++;
            }
            $result .= "<option ";
            if ($id_value != null && $id_value != "" && $id_value == $def . $id) {
                $result .= "selected ";
            }
            $result .= "value=\"{$def}{$id}\">" . stripslashes($value) . "</option>\n";
            $i++;
        }
        $result .= "</optgroup>";
    }
    $result .= "</select>\n";
    return $result;
}
Example #26
0
function systemMapper($objects = "0", $limit = null, $x = 50, $y = 50, $step = 0, $color = "999999", $thisPageName = "stub")
{
    //  Handle recursion
    $limitNext = $limit === null ? null : $limit - 1;
    $obj = explode(",", $objects);
    $depth = count($obj) - 1;
    $first = $obj[0];
    $final = $obj[$depth];
    //  Calulate position
    $radius = $depth ? 48 / pow(2, $depth) : 0;
    $radians = -1 * 6.28318 * $step;
    $degrees = round(abs($radians * (-180 / 3.14159)));
    $left = round($x + $radius * cos($radians));
    $top = round($y + $radius * sin($radians));
    $opacity = round(100 / pow(2, $depth));
    if ($degrees >= 0 && $degrees < 60) {
        $red = 255;
        $green = 0;
        $blue = 255 - round(abs(60 - $degrees) * 4.25);
    }
    if ($degrees >= 60 && $degrees < 120) {
        $red = 255 - round(abs(60 - $degrees) * 4.25);
        $green = 0;
        $blue = 255;
    }
    if ($degrees >= 120 && $degrees < 180) {
        $red = 0;
        $green = 255 - round(abs(180 - $degrees) * 4.25);
        $blue = 255;
    }
    if ($degrees >= 180 && $degrees < 240) {
        $red = 0;
        $green = 255;
        $blue = 255 - round(abs(180 - $degrees) * 4.25);
    }
    if ($degrees >= 240 && $degrees < 300) {
        $red = 255 - round(abs(300 - $degrees) * 4.25);
        $green = 255;
        $blue = 0;
    }
    if ($degrees >= 300 && $degrees < 360) {
        $red = 255;
        $green = 255 - round(abs(300 - $degrees) * 4.25);
        $blue = 0;
    }
    $colorTemp = systemColorBuild($red, $green, $blue);
    // child's initial color
    if ($depth > 1) {
        $colorTemp = systemColorBlend($color, $colorTemp, 0.7);
    }
    // blend color with parent
    if ($depth > 1) {
        $colorTemp = systemColorBlend($colorTemp, "FFFFFF", $depth * 0.2);
    }
    // blend color with parent
    $color = $colorTemp;
    //  Here is where the radius should blend the color!!
    //  need to add that, here's a hack instead
    if ($radius == 0) {
        $color = "FF0000";
    }
    //  Pull from current node
    $sql = "\n\t\tSELECT * FROM objects \n\t\tWHERE id = '{$final}' \n\t\tAND active = 1 \n\t\tLIMIT 1\n\t\t";
    $res = MYSQL_QUERY($sql);
    $row = MYSQL_FETCH_ARRAY($res);
    $name = strip_tags($row["name1"]);
    if (!$final) {
        $name = "&times;&nbsp;Object-Relation-Grouper";
    }
    if (!$name) {
        $name = "Untitled";
    }
    //  Translate $objects trail to page.html?id=objects
    if ($first == 1) {
        $page = "object";
    }
    if ($first == 13) {
        $page = "read";
    }
    if ($first == 14) {
        $page = "read";
    }
    if ($first == 15) {
        $page = "read";
    }
    if ($first == 16) {
        $page = "read";
    }
    if ($first == 17) {
        $page = "read";
    }
    if ($first == 18) {
        $page = "read";
    }
    if (!$page) {
        $page = "object";
    }
    $id = null;
    for ($i = 2; $i < count($obj); $i++) {
        if ($i > 2) {
            $id .= ",";
        }
        $id .= $obj[$i];
    }
    //  Update Array
    global $flat;
    $node = $final;
    if (!isset($flat[$depth])) {
        $flat[$depth] = array();
    }
    if (!isset($flat[$depth][$node])) {
        $flat[$depth][$node] = array();
        $flat[$depth][$node]["node"] = $final;
        $flat[$depth][$node]["name"] = nl2br($name);
        $flat[$depth][$node]["top"] = $top;
        $flat[$depth][$node]["left"] = $left;
        $flat[$depth][$node]["opacity"] = $opacity;
        $flat[$depth][$node]["color"] = $color;
        $flat[$depth][$node]["url"] = $thisPageName . ".html?node=" . $node;
        if ($depth == 0) {
            if ($flat[$depth][$node]["name"] == '&times;&nbsp;Object-Relation-Grouper') {
                $flat[$depth][$node]["name"] .= "<br /><br /><br />Click any box to navigate . . .";
            } else {
                $flat[$depth][$node]["name"] .= "<br /><br /><br />Click here to visit page.";
            }
            $flat[$depth][$node]["url"] = $page . ".html?id=" . $node;
        }
    }
    //  Find children of current node
    if ($limit > 0 || $limit === null) {
        $sql = "\n\t\t\tSELECT objects.id AS objectsId FROM wires, objects \n\t\t\tWHERE wires.fromid = '{$final}' AND wires.toid = objects.id \n\t\t\tAND wires.active = 1 AND objects.active = 1 \n\t\t\tORDER BY weight DESC, rank, end DESC, begin DESC, name1, name2, objects.modified DESC, objects.created DESC\n\t\t\t";
        $res = MYSQL_QUERY($sql);
        $num = MYSQL_NUM_ROWS($res);
        $i = 0;
        while ($row = MYSQL_FETCH_ARRAY($res)) {
            $nodeNext = $objects . "," . $row["objectsId"];
            $stepNext = $i / $num;
            $i++;
            systemMapper($nodeNext, $limitNext, $left, $top, $stepNext, $color, $thisPageName);
        }
    }
}
Example #27
0
}
include "../include/data.php";
$connect = mysql_connect($host, $us, $ps);
if ($connect) {
    $db = 'vitbifi';
    mysql_select_db($db);
}
$sqlQuery4menu = "select DISTINCT menuId, orderTime from menu where 1";
$result4menu = MYSQL_QUERY($sqlQuery4menu);
$numberOfRows4menu = MYSQL_NUM_ROWS($result4menu);
$sqlQuery4avail = "select DISTINCT menuId, time, link from delivery_time";
$result4avail = MYSQL_QUERY($sqlQuery4avail);
$numberOfRows4avail = MYSQL_NUM_ROWS($result4avail);
$sqlQuery4qty = "select DISTINCT link from quantity;";
$result4qty = MYSQL_QUERY($sqlQuery4qty);
$numberOfRows4qty = MYSQL_NUM_ROWS($result4qty);
$i = 0;
while ($i < $numberOfRows4qty) {
    $menuQty[$i]['link'] = MYSQL_RESULT($result4qty, $i, "link");
    $i++;
}
$i = 0;
while ($i < $numberOfRows4avail) {
    $menuAvail[$i]['menuId'] = MYSQL_RESULT($result4avail, $i, "menuId");
    $menuAvail[$i]['deliveryTime'] = MYSQL_RESULT($result4avail, $i, "time");
    $menuAvail[$i]['link'] = MYSQL_RESULT($result4avail, $i, "link");
    $i++;
}
$i = 0;
while ($i < $numberOfRows4menu) {
    $menu[$i]['menuId'] = MYSQL_RESULT($result4menu, $i, "menuId");
Example #28
0
<?php

require_once "./init.php";
if (!defined('is_florensia')) {
    die('Hacking attempt');
}
$florensia->sitetitle("Changelog");
$stringhistory = "SELECT id, date, changes FROM flobase_versionhistory ORDER BY date DESC, id DESC";
$pageselect = $florensia->pageselect(MYSQL_NUM_ROWS(MYSQL_QUERY($stringhistory)), array("changelog"), array(), 20);
$queryhistory = MYSQL_QUERY($stringhistory . " LIMIT " . $pageselect['pagestart'] . ",20");
while ($history = MYSQL_FETCH_ARRAY($queryhistory)) {
    $historylist .= "\n\t\t<div class='shortinfo_" . $florensia->change() . "' style='margin-bottom:15px;'>\n\t\t\t<table style='width:100%;'>\n\t\t\t\t<tr><td style='font-weight:bold; border-bottom:1px solid;'>" . date("m.d.Y", $history['date']) . "</td></tr>\n\t\t\t\t<tr><td style='height:7px'></td></tr>\n\t\t\t\t<tr><td class='small'>" . $parser->parse_message($history['changes']) . "</td></tr>\n\t\t\t</table>\n\t\t</div>\n\t";
}
$content = "\n<div class='subtitle' style='text-align:center; margin-bottom:5px;'>Florensia Base Changelog</div>\n<div style='margin-top:10px;'>" . $pageselect['selectbar'] . "</div>\n{$historylist}\n<div style='margin-top:10px;'>" . $pageselect['selectbar'] . "</div>\n";
$florensia->output_page($content);
    $sortOrder = "DESC";
}
if ($sortOrder == "DESC") {
    $newSortOrder = "ASC";
} else {
    $newSortOrder = "DESC";
}
$limitQuery = " LIMIT " . $startLimit . "," . $numberOfRows;
$nextStartLimit = $startLimit + $limitPerPage;
$previousStartLimit = $startLimit - $limitPerPage;
if ($sortBy != "") {
    $orderByQuery = " ORDER BY " . $sortBy . " " . $sortOrder;
}
$sql = "SELECT   * FROM INNODB_BUFFER_POOL_STATS" . $orderByQuery . $limitQuery;
$result = MYSQL_QUERY($sql);
$numberOfRows = MYSQL_NUM_ROWS($result);
if ($numberOfRows == 0) {
    ?>

Sorry. No records found !!

<?php 
} else {
    if ($numberOfRows > 0) {
        $i = 0;
        ?>


<br>
<?php 
        if ($_REQUEST['startLimit'] != "") {
Example #30
0
 function get_shortinfo($questlist, $settings = array())
 {
     global $florensia, $stringtable, $classquesttext, $flolang, $floaddition;
     $flolang->load("quest");
     if (!is_array($questlist)) {
         $questlistquery = MYSQL_QUERY("SELECT * FROM server_questlist WHERE questlistid='" . mysql_real_escape_string($questlist) . "'");
         if (!($questlist = MYSQL_FETCH_ARRAY($questlistquery))) {
             return FALSE;
         }
     }
     $questlistxml = simplexml_load_string($questlist['questlistxml']);
     /*
     		//workaround for "deleted" shellquests
     		if (preg_match('/^qsl[0-9]+$/', $questlistxml->Quest->SourceObject)) {
     			$querystorelist = MYSQL_QUERY("SELECT npcid FROM server_storelist WHERE storexml LIKE '%{$questlist['questlistid']}%'");
     			if (MYSQL_NUM_ROWS($querystorelist)==0) {
     				return FALSE;
     			}
     		}
     */
     //startnpc
     $querystartnpc = MYSQL_QUERY("SELECT " . $florensia->get_columnname("npcid", "npc") . " FROM server_npc WHERE " . $florensia->get_columnname("npcid", "npc") . "='" . $questlistxml->attributes()->SourceObject . "'");
     if ($settings['npclink'] && MYSQL_NUM_ROWS($querystartnpc) == 1) {
         $queststartnpc = "<a href='" . $florensia->outlink(array("npcdetails", $questlistxml->attributes()->SourceObject, $stringtable->get_string($questlistxml->attributes()->SourceObject))) . "'>" . $stringtable->get_string($questlistxml->attributes()->SourceObject, array('protectionsmall' => 1, 'protectionlink' => 1)) . "</a>";
     } else {
         $queststartnpc = $stringtable->get_string($questlistxml->attributes()->SourceObject, array('protectionsmall' => 1));
     }
     //see / land-quest
     if ($questlist['questtype'] == "s") {
         $questpicture = "<img src='{$florensia->layer_rel}/sealv.gif' height='12' alt='{$flolang->questtype_sea}' title='{$flolang->questtype_sea}'>";
     } else {
         $questpicture = "<img src='{$florensia->layer_rel}/land.gif' height='12' alt='{$flolang->questtype_land}' title='{$flolang->questtype_land}'>";
     }
     //questlevelrange
     if (intval($questlistxml->OccurTerm->attributes()->LvLim)) {
         $questlevelrange = $questlistxml->OccurTerm->attributes()->Lv . "-" . $questlistxml->OccurTerm->attributes()->LvLim;
         if (intval($questlistxml->OccurTerm->attributes()->LvOptimaize)) {
             $questlevelrange .= " (<b>" . $questlistxml->OccurTerm->attributes()->LvOptimaize . "</b>)";
         }
     } else {
         $questlevelrange = $questlistxml->OccurTerm->attributes()->Lv . "+";
     }
     //next quest
     if (strlen($questlist['nextquest'])) {
         $questhistory[] = "{$flolang->nextquest} <a href='" . $florensia->outlink(array("questdetails", $questlist['nextquest'], $this->get_title($questlist['nextquest']))) . "'>" . $this->get_title($questlist['nextquest']) . "</a>";
     }
     //prev quest
     if (strlen($questlist['privquest'])) {
         $questhistory[] = "{$flolang->previousquest} <a href='" . $florensia->outlink(array("questdetails", $questlist['privquest'], $this->get_title($questlist['privquest']))) . "'>" . $this->get_title($questlist['privquest']) . "</a>";
     }
     //questclasses
     $questclasses = "";
     foreach (str_split($questlist['questclasses']) as $class) {
         if (strtolower($class) == "p") {
             continue;
         }
         $classname = $florensia->get_classname($class);
         $questclasses .= "<img src='{$florensia->layer_rel}/icon_" . strtolower($class) . ".png' title='" . $florensia->escape($classname[0]) . "' alt='{$class}' style='height:12px; margin-right:2px; border:none;'>";
     }
     $addition = $floaddition->get_additionlist("quest", $questlist['questlistid']);
     if ($addition['not_implemented'] or $addition['removed'] or $addition['event']) {
         $stringsettings['color'] = "195,195,195";
         $tablecolor = "class='inactiveentry'";
     }
     if (count($addition)) {
         $flag = "<div class='small shortinfo_1'>" . join("<br/>", $addition) . "</div>";
         $flagicon = "<img src='{$florensia->layer_rel}/flag.gif' boder='0' style='height:10px;' " . popup($flag, "") . ">";
     }
     return "\n\t\t\t<table style='width:100%; border-collapse:0px; border-spacing:0px; padding:0px;' {$tablecolor}>\n\t\t\t<tr>\n\t\t\t\t<td style='width:450px'>\n\t\t\t\t\t<table cellpadding='0' cellspacing='0' width='100%' style='border-collapse:0px; border-spacing:0px; padding:0px;'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><a href='" . $florensia->outlink(array("questdetails", $questlist['questlistid'], $questlist['questtitle_' . $classquesttext->language])) . "'>" . $questlist['questtitle_' . $classquesttext->language] . "</a> {$flagicon}</td>\n\t\t\t\t\t\t\t<td style='text-align:right'>{$questpicture}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t\t<td class='small'>\n\t\t\t\t\t<table cellpadding='0' cellspacing='0' width='100%' style='border-collapse:0px; border-spacing:0px; padding:0px;'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>{$flolang->quest_shortview_map} <a href='" . $florensia->outlink(array("mapdetails", $questlistxml->attributes()->SourceArea, $stringtable->get_string($questlistxml->attributes()->SourceArea))) . "'>" . $stringtable->get_string($questlistxml->attributes()->SourceArea, array('protectionsmall' => 1, 'protectionlink' => 1)) . "</a></td>\n\t\t\t\t\t\t\t<td style='text-align:right'>{$questclasses}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t\n\t\t\t\t</td>\n\t\t\t\t\t\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td style='width:400px; padding-left:20px;' class='small'>{$flolang->quest_shortview_level} {$questlevelrange}<br />{$questhistory[0]}</td>\n\t\t\t\t<td class='small'>{$flolang->quest_shortview_npc} {$queststartnpc}<br />{$questhistory[1]}</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t";
 }