Example #1
0
 function get_languages()
 {
     global $florensia;
     /*
     		$header = array();
     		$querylang = MYSQL_QUERY("SHOW COLUMNS FROM flobase_language");
     		while ($lang = MYSQL_FETCH_ARRAY($querylang)) {
     			array_push($header, $lang[0]);
     		}
     */
     $querylang = MYSQL_QUERY("SELECT * FROM flobase_language");
     while ($lang = MYSQL_FETCH_ASSOC($querylang)) {
         foreach ($lang as $headertitle => $langvalue) {
             $this->lang[$lang['languageid']]->{$headertitle} = $langvalue;
         }
     }
 }
}
if (!$flouser->get_permission("access_admincp") or !$flouser->get_permission("mod_permission")) {
    $florensia->output_page($flouser->noaccess());
}
$permuserid = intval($_GET['userid']);
if ($flouser->userid != $permuserid) {
    $permuser = new class_user($permuserid);
    if (!$permuser->userid) {
        $florensia->output_page("<div class='warning' style='text-align:center;'>No such user</div>");
    }
    //user not valid
} else {
    //user watched own permission page
    $permuser = $flouser;
}
$permavailable = MYSQL_FETCH_ASSOC(MYSQL_QUERY("SELECT settings FROM flobase_defaults WHERE title='userpermissions_available'"));
$permavailable = explode(";", $permavailable['settings']);
foreach ($permavailable as $defaultsentry) {
    $defaultsentry = explode(":", $defaultsentry);
    if ($defaultsentry[1]) {
        $defaults[$defaultsentry[0]] = explode(",", $defaultsentry[1]);
    } else {
        $defaults[$defaultsentry[0]] = array();
    }
}
//saving new data
if ($_POST['do_save']) {
    $updatepermission = array();
    if ($_POST['inactive']) {
        $updateinactive = 1;
    } else {
Example #3
0
                $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";
        }
    }
}
$sqldiff->export_cache("{$florensia->root_abs}/sqldiff_" . $sqldiff->get_cache("timestamp") . ".php");
Example #4
0
 function get_username($userid = false, $settings = array())
 {
     global $florensia, $flouser;
     $defaultsettings = array("rawoutput" => 0);
     $settings = array_merge($defaultsettings, $settings);
     if ($userid === FALSE or $userid == $flouser->userid) {
         $nickname = $flouser->user['username'];
         $userid = $flouser->userid;
     } elseif ($userid == 0) {
         return "Guest";
     } else {
         if (!($user = MYSQL_FETCH_ASSOC(MYSQL_QUERY("SELECT username FROM forum_users WHERE uid='{$userid}'")))) {
             return "Guest";
         }
         $nickname = $user['username'];
     }
     if ($settings['rawoutput']) {
         return $nickname;
     }
     $return = "<a href='{$florensia->forumurl}/user-{$userid}.html' target='_blank'>" . $florensia->escape($nickname) . "</a>";
     if ($flouser->get_permission("mod_usernotes") or $flouser->get_permission("mod_coordinates") or $flouser->get_permission("mod_droplist", "contributed")) {
         $adminlinks[] = "<a href='" . $florensia->outlink(array('contributed', $userid, $nickname)) . "' target='_blank'>C</a>";
     }
     if ($flouser->get_permission("character", "moderate")) {
         $adminlinks[] = "<a href='" . $florensia->outlink(array('usercharacter', $userid, $nickname)) . "' target='_blank'>I</a>";
     }
     if ($flouser->get_permission("mod_permission")) {
         $adminlinks[] = "<a href='{$florensia->root}/adminpermission.php?userid={$userid}' target='_blank'>P</a>";
     }
     if ($flouser->get_permission("watch_log")) {
         $adminlinks[] = "<a href='{$florensia->root}/adminlog?currentuser={$userid}' target='_blank'>L</a>";
     }
     if (count($adminlinks)) {
         $return .= " <span class='small' style='font:weight:normal'>[" . join("|", $adminlinks) . "]</span>";
     }
     return $return;
 }
Example #5
0
function logparsebridge($matches)
{
    global $flouserdata, $strintable, $florensia, $stringtable, $classquest;
    switch ($matches[2]) {
        case "user":
            $return = $flouserdata->get_username($matches[3]);
            break;
        case "npc":
            $return = "<a href='" . $florensia->outlink(array("npcdetails", $matches[3], $stringtable->get_string($matches[3]))) . "' target='_blank'>" . $stringtable->get_string($matches[3], array('protectionlink' => 1, 'protectionsmall' => 1)) . "</a>";
            break;
        case "item":
            $return = "<a href='" . $florensia->outlink(array("itemdetails", $matches[3], $stringtable->get_string($matches[3]))) . "' target='_blank'>" . $stringtable->get_string($matches[3], array('protectionlink' => 1, 'protectionsmall' => 1)) . "</a>";
            break;
        case "dropid":
            $drop = MYSQL_FETCH_ASSOC(MYSQL_QUERY("SELECT n.English as npcname, d.npcid, i.English as itemname, d.itemid FROM server_stringtable as n, server_stringtable as i, flobase_droplist as d WHERE dropid=" . intval($matches[3]) . " AND d.npcid=n.Code AND d.itemid=i.Code LIMIT 1"));
            $return = "<a href='" . $florensia->outlink(array("npcdetails", $drop['npcid'], $drop['npcname'])) . "' target='_blank'>" . $florensia->escape($drop['npcname']) . "</a> ({$drop['npcid']})/<a href='" . $florensia->outlink(array("itemdetails", $drop['itemid'], $drop['itemname'])) . "' target='_blank'>" . $florensia->escape($drop['itemname']) . "</a> ({$drop['itemid']})";
            break;
        case "quest":
            $return = "<a href='" . $florensia->outlink(array("questdetails", $matches[3], $classquest->get_title($matches[3]))) . "' target='_blank'>" . $classquest->get_title($matches[3]) . "</a>";
            break;
        case "map":
            $return = "<a href='" . $florensia->outlink(array("mapdetails", $matches[3], $stringtable->get_string($matches[3]))) . "' target='_blank'>" . $stringtable->get_string($matches[3], array('protectionlink' => 1, 'protectionsmall' => 1)) . "</a>";
            break;
        case "timestamp":
            $return = date("m.d.y/H:i:s", $matches[3]);
            break;
        case "usernote":
            $return = "note";
            break;
        case "guide":
            $guide = MYSQL_FETCH_ASSOC(MYSQL_QUERY("SELECT title FROM flobase_guides WHERE id=" . intval($matches[3]) . " LIMIT 1"));
            if (!$guide['title']) {
                $guide['title'] = "???";
            }
            $return = "&quot;" . $florensia->escape($guide['title']) . "&quot;";
            break;
        case "gallery":
            $gallery = MYSQL_FETCH_ASSOC(MYSQL_QUERY("SELECT name FROM flobase_gallery WHERE galleryid=" . intval($matches[3]) . " LIMIT 1"));
            if (!strlen($gallery['name'])) {
                $gallery['name'] = "-";
            }
            $return = "&quot;<a href='" . $florensia->outlink(array("gallery", "i", intval($matches[3]), $gallery['name'])) . "'>" . $florensia->escape($gallery['name']) . "</a>&quot;";
            break;
        case "guild":
            $guild = MYSQL_FETCH_ASSOC(MYSQL_QUERY("SELECT guildid, guildname, server, memberamount FROM flobase_guild WHERE guildid=" . intval($matches[3]) . " LIMIT 1"));
            if (!$guild) {
                $return = "-";
            } else {
                if ($guild['memberamount']) {
                    $return = "<a href='" . $florensia->outlink(array("guilddetails", $guild['guildid'], $guild['server'], $guild['guildname'])) . "'>" . $florensia->escape($guild['guildname']) . "</a>";
                } else {
                    $return = "<a class='archiv' href='" . $florensia->outlink(array("guilddetails", $guild['guildid'], $guild['server'], $guild['guildname'])) . "'>" . $florensia->escape($guild['guildname']) . "</a>";
                }
            }
            break;
        case "character":
            $return = "<a href='" . $florensia->outlink(array("characterdetails", $matches[3])) . "'>" . $florensia->escape($matches[3]) . "</a>";
            break;
        case "characterid":
            $character = new class_character(intval($matches[3]));
            $return = "<a href='" . $florensia->outlink(array("characterdetails", $character->data['charname'])) . "'>" . $florensia->escape($character->data['charname']) . "</a>";
            break;
        case "characterverification":
            $return = "<a href='{$florensia->root}/admincharacterverification.php?s=" . intval($matches[3]) . "' target='_blank'>request</a>";
            break;
        case "log":
            $return = "";
            break;
        default:
            $return = "({$matches[2]}:{$matches[3]})";
    }
    return $return . " ({$matches[3]})";
}
Example #6
0
}
$flolang->load("statistic,character,guild");
$userid = intval($_GET['userid']);
if (!$userid or !($userid == $flouser->userid or $flouser->get_permission("character", "moderate"))) {
    $florensia->output_page($flouser->noaccess());
}
/*
if (!$userid OR !($user = MYSQL_FETCH_ARRAY(MYSQL_QUERY("SELECT username, uid, flobase_characterkey FROM forum_users WHERE uid='{$userid}'")))) {
	$content = "<div class='warning' style='text-align:center;'>No such user</div>";
} else {
*/
$tabbar['characterlist'] = array("anchor" => "characterlist", "name" => $flolang->character_userprofile_overview_verifiedlist_title, "desc" => false);
$tabbar['requests'] = array("anchor" => "requests", "name" => $flolang->character_userprofile_overview_requestlist_title, "desc" => false);
$characterlist = "";
$querycharacter = MYSQL_QUERY("SELECT * FROM flobase_character_data, flobase_character WHERE ownerid='{$userid}' AND flobase_character_data.characterid=flobase_character.characterid ORDER BY charname");
while ($character = MYSQL_FETCH_ASSOC($querycharacter)) {
    $character = new class_character($character);
    if ($character->data['gender'] == "m") {
        $gender = "<img src='{$florensia->layer_rel}/gender_male.gif' border='0' alt='male' style='height:12px;'>";
    } else {
        $gender = "<img src='{$florensia->layer_rel}/gender_female.gif' border='0' alt='female' style='height:12px;'>";
    }
    $server = "<a href='{$florensia->root}/statistics/" . $florensia->escape($character->data['server']) . "'>" . $florensia->escape($character->data['server']) . "</a>";
    if ($character->data['guildid']) {
        $guild = "<a href='" . $florensia->outlink(array("guilddetails", $character->data['guildid'], $character->data['server'], $character->data['guild'])) . "'>" . $florensia->escape($character->data['guild']) . "</a>";
    } elseif ($character->data['guild']) {
        $guild = $florensia->escape($character->data['guild']);
    } else {
        unset($guild);
    }
    if ($guild && $character->data['guildgrade']) {
Example #7
0
            $flolog->add("guide:delete", "{user:{$flouser->userid}} deleted \"" . $florensia->escape($guide['title']) . "\" ({$guide['thumpsup']}/{$guide['thumpsdown']}) (ID:" . intval($guide['id']) . ")");
        }
    }
}
/* SEARCH BY TITLE */
if (strlen($_GET['search'])) {
    foreach (explode(" ", $_GET['search']) as $keyword) {
        $searchstring[] = "title LIKE '%" . get_searchstring($keyword, 0) . "%'";
    }
    $dbwhere[] = join(" AND ", $searchstring);
}
$guidessearch = "<input type='text' name='search' value='" . $florensia->escape($_GET['search']) . "'>";
/* LANGUAGE FILTER */
$foundlang = false;
$queryguideslang = MYSQL_QUERY("SELECT language FROM flobase_guides GROUP BY language");
while ($glang = MYSQL_FETCH_ASSOC($queryguideslang)) {
    if ($_GET['lang'] == $glang['language']) {
        $glangchecked = "checked='checked'";
        $foundlang = true;
    } else {
        unset($glangchecked);
    }
    $guideslanguage[] = "<span style='margin-right:5px;'><input type='radio' name='glang' value='{$glang['language']}' style='padding:0px;' {$glangchecked}><img src='{$florensia->layer_rel}/flags/png/" . $flolang->lang[$glang['language']]->flagid . ".png' alt='" . $flolang->lang[$glang['language']]->languagename . "' border='0'></span>";
}
if (!$foundlang) {
    $glangchecked = "checked='checked'";
} else {
    $dbwhere[] = "language='{$_GET['lang']}'";
}
array_unshift($guideslanguage, "<span style='margin-right:5px;'><input type='radio' name='glang' value='all' style='padding:0px;' {$glangchecked}><span class='bordered'> ? </span></span>");
/* ORDER BY */
            }
            $charlist .= "\n                <div class='small shortinfo_" . $florensia->change() . "'>\n                    <table style='width:100%'><tr>\n                        <td style='width:50px; text-align:right;'>{$char->data['levelland']} <img src='{$florensia->layer_rel}/land.gif' style='height:11px;' alt='Land'></td>\n                        <td style='width:50px; padding-right:10px; text-align:right;'>{$char->data['levelsea']} <img src='{$florensia->layer_rel}/sealv.gif' style='height:11px;' alt='Sea'></td>\n                        <td>{$charname}</td>\n                        <td style='width:170px'>" . $florensia->escape($char->data['jobclass']) . "</td>\n                        <td style='width:150px'>{$guild}</td>\n                        <td style='width:100px'>{$server}</td>\n                        <td style='text-align:right; padding-right:3px; width:130px'>" . $flolang->sprintf($flolang->character_lastupdate, timetamp2string(date("U") - $char->data['lastupdate'], "m")) . "</td>\n                    </tr></table>\n                </div>\n            ";
        }
        $content = "\n            <div class='subtitle' style='margin-bottom:10px;'><a href='{$florensia->root}/characterdetails'>{$flolang->character_sitetitle}</a></div>\n            <div class='small' style='font-weight:bold; margin-bottom:10px; text-align:center;'>{$flolang->character_overview_selectchar}</div>\n            <div class='subtitle' style='margin-bottom:7px;'>\n                    <table style='width:100%'><tr>\n                            <td style='width:50px; text-align:right;'><img src='{$florensia->layer_rel}/land.gif' style='height:13px;' alt='Land'></td>\n                            <td style='width:50px; padding-right:10px; text-align:right;'><img src='{$florensia->layer_rel}/sealv.gif' style='height:13px;' alt='Sea'></td>\n                            <td>{$flolang->character_title_charname}</td>\n                            <td style='width:170px'>{$flolang->character_title_jobclass}</td>\n                            <td style='width:150px'>{$flolang->character_title_guild}</td>\n                            <td style='width:100px'>{$flolang->character_title_server}</td>\n                            <td style='text-align:right; padding-right:3px; width:130px'>{$flolang->character_title_lastupdate}</td>\n                    </tr></table>\n            </div>\n            {$charlist}\n            \n            <div class='subtitle' style='text-align:center; margin-top:20px;'>{$flolang->character_jumpto} " . $florensia->quicksearch() . "</div>\n        ";
        $florensia->sitetitle("Characterdetails");
        $florensia->output_page($content);
    }
} else {
    if (strlen($_GET['notfound']) or strlen($_GET['search'])) {
        if ($_GET['notfound']) {
            $_GET['search'] = $_GET['notfound'];
            $notfoundnotice = "\n                  <div class='small subtitle warning' style='font-weight:normal; padding: 3px; background-image:url({$florensia->layer_rel}/gushiptes.png); background-repeat:no-repeat; background-position:780px 5px;'>\n                    <div style='padding-left:5px; padding-top:5px;'>" . $flolang->sprintf($flolang->character_api_notfound_long, $florensia->escape($_GET['notfound'])) . "</div>\n                  </div>";
        }
        $cachelimit = 99;
        $querycharsearch = MYSQL_QUERY("SELECT charname, server, guild, guildid FROM flobase_character_data as d, flobase_character as c WHERE c.characterid=d.characterid AND charname LIKE '" . get_searchstring($_GET['search'], 0) . "%' ORDER BY charname LIMIT {$cachelimit}");
        for ($i = 0; $charsearch = MYSQL_FETCH_ASSOC($querycharsearch); $i++) {
            if ($charsearch['guildid']) {
                $charsearch['guild'] = ", <a href='" . $florensia->outlink(array('guilddetails', $charsearch['guildid'], $charsearch['server'], $charsearch['guild'])) . "'>" . $florensia->escape($charsearch['guild']) . "</a>";
            } elseif ($charsearch['guild']) {
                $charsearch['guild'] = ", " . $florensia->escape($charsearch['guild']);
            }
            $cachedlist[$i % 3] .= "<a href='" . $florensia->outlink(array('characterdetails', $charsearch['charname'])) . "'>" . $florensia->escape($charsearch['charname']) . "</a>, " . $florensia->escape($charsearch['server']) . "{$charsearch['guild']}<br />";
        }
        if ($cachedlist) {
            if ($_GET['notfound']) {
                $notfoundnotice .= "<div style='margin-top:10px;'>" . $flolang->sprintf($flolang->character_api_notfound_cachedline, $cachelimit) . "</div>";
            }
            $cachedlist = "\n            <div>\n                <table style='width:100%; margin-top:5px; font-weight:normal;' class='subtitle'>\n                <tr><td style='width:33%;'>{$cachedlist[0]}</td><td style='width:33%;'>{$cachedlist[1]}</td><td>{$cachedlist[2]}</td></tr>\n                </table>\n            </div>";
        }
        $searched = "<div class='borderd small' style='margin-top:15px;'>\n            {$notfoundnotice}\n            {$cachedlist}\n        </div>";
    } else {
Example #9
0
        $pagetitle = "<div class='subtitle' style='margin-bottom:10px;'><a href='{$florensia->root}/guilddetails'>{$flolang->guild_sitetitle}</a> &gt; <a href='" . $florensia->outlink(array('guildranking'), array('server' => $guild['server'], 'order' => 'name')) . "'>" . $florensia->escape($guild['server']) . "</a> &gt; " . $florensia->escape($guild['guildname']) . "</div>";
        $florensia->sitetitle($florensia->escape($guild['server']));
        $florensia->sitetitle($florensia->escape($guild['guildname']));
    } else {
        $pagetitle = "<div class='subtitle' style='margin-bottom:10px;'><a href='{$florensia->root}/guilddetails'>{$flolang->guild_sitetitle}</a></div>";
        $guildoverview = "<div class='warning'>" . $flolang->sprintf($flolang->guild_error_notfound, "<a href='" . $florensia->outlink(array('charapi')) . "' target='_blank'>{$flolang->character_api_form_guild_forceupdate_url_readwhy}</a>") . "</div>";
    }
} elseif (strlen($_GET['search']) > 0) {
    /*if (strlen($_GET['notfound']) OR strlen($_GET['search'])) {
      if ($_GET['notfound']) {
          $_GET['search'] = $_GET['notfound'];
          $notfoundnotice = "<b>".$flolang->sprintf($flolang->character_api_notfound_long, $florensia->escape($_GET['notfound']))."</b>";
      }*/
    $cachelimit = 100;
    $queryguildsearch = MYSQL_QUERY("SELECT memberamount, server, guildname, guildid FROM flobase_guild WHERE guildname LIKE '%" . get_searchstring($_GET['search'], 0) . "%' AND memberamount!='0' ORDER BY guildname LIMIT {$cachelimit}");
    for ($i = 0; $guildsearch = MYSQL_FETCH_ASSOC($queryguildsearch); $i++) {
        $cachedlist[$i % 3] .= "<a href='" . $florensia->outlink(array('guilddetails', $guildsearch['guildid'], $guildsearch['server'], $guildsearch['guildname'])) . "'>" . $florensia->escape($guildsearch['guildname']) . "</a>, " . $florensia->escape($guildsearch['server']) . " ({$guildsearch['memberamount']} Member)<br />";
    }
    if ($cachedlist) {
        $cachedlist = "\n            <div style='margin-top:10px;'>" . $flolang->sprintf($flolang->guild_api_notfound_cachedline, $cachelimit) . "</div>\n            <div>\n                <table style='width:100%; margin-top:5px; font-weight:normal;' class='subtitle'>\n                <tr><td style='width:33%;'>{$cachedlist[0]}</td><td style='width:33%;'>{$cachedlist[1]}</td><td>{$cachedlist[2]}</td><td>{$cachedlist[3]}</td></tr>\n            </table>\n            </div>";
    }
    $searched = "<div class='borderd small' style='margin-top:15px;'>\n            <div class='warning'>" . $flolang->sprintf($flolang->guild_error_notfound, "<a href='" . $florensia->outlink(array('charapi')) . "' target='_blank'>{$flolang->character_api_form_guild_forceupdate_url_readwhy}</a>") . "</div>\n            {$cachedlist}\n        </div>";
    $pagetitle = "<div class='subtitle' style='margin-bottom:10px;'><a href='{$florensia->root}/guilddetails'>{$flolang->guild_sitetitle}</a></div>";
    $florensia->sitetitle("Search");
} else {
    $tmptime = date("U");
    $queryrecent = MYSQL_QUERY("SELECT c.charname, l.action, l.guildid, g.guildname, g.server, l.timestamp, g.memberamount, l.oldguildgrade, l.newguildgrade FROM flobase_character_log_guild as l, flobase_guild as g, flobase_character as c , flobase_character_data as d WHERE timestamp>" . bcsub(date("U"), 60 * 60 * 48) . " AND l.guildid=g.guildid AND c.characterid=l.characterid AND d.characterid=l.characterid AND (g.priv_activity_guild='a' OR g.priv_activity_guild='') AND (d.priv_log_guild='' OR d.priv_log_guild='a') AND (l.action='l' OR l.action='a' OR l.action='j') ORDER BY timestamp DESC LIMIT 30");
    while ($recent = MYSQL_FETCH_ARRAY($queryrecent)) {
        if ($recent['memberamount']) {
            $guildlink = "<a href='" . $florensia->outlink(array("guilddetails", $recent['guildid'], $recent['server'], $recent['guildname'])) . "'>" . $florensia->escape($recent['guildname']) . "</a>";
        } else {