<?php 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");
$create_slots = array_reverse($create_slots); $sigchars = join($sep, $create_slots); //save chars MYSQL_QUERY("UPDATE flobase_signaturetemp SET characters='" . mysql_real_escape_string($sigchars) . "' WHERE userid='" . $mybb->user['uid'] . "'"); } } else { $saved_chars = explode($sep, $template['characters']); $sigchars = join($sep, $saved_chars); foreach ($saved_chars as $i => $charname) { $_POST['slot_' . $i] = $charname; } } unset($charselect); for ($i = 0; $i < count($xml->char); $i++) { if (strlen($_POST['slot_' . $i])) { $characterslot = new class_character($_POST['slot_' . $i]); if (!$characterslot->is_valid()) { $errorcharnotice = $characterslot->get_errormsg(); } else { unset($errorcharnotice); } if ($errorcharnotice) { $errorcharnotice = " <span class='small' style='font-weight:normal;'><span style='color:#FF0000;'>(</span>{$errorcharnotice}<span style='color:#FF0000;'>)</span></span>"; } } else { unset($errorcharnotice); } $charselect .= "<tr><td style='width:100px;'>" . $flolang->sprintf($flolang->signature_slots, $i + 1) . ":</td><td><input type='text' name='slot_{$i}' value='" . $florensia->escape($_POST['slot_' . $i]) . "' maxlength='255' style='width:200px;'>{$errorcharnotice}</td></tr>"; } if (count($xml->char) == 0) { $charselect .= "<tr><td colspan='2' class='small'>{$flolang->signature_create_characterslots_notice}</tr>";
} $querycharacter = MYSQL_QUERY("SELECT SQL_CALC_FOUND_ROWS charname, levelland, levelsea, levelsum, guild, guildid, guildgrade, jobclass, gender, server, lastupdate FROM flobase_character_data AS d, flobase_character AS c WHERE d.characterid = c.characterid {$dbwhere} {$dborderby} LIMIT {$startpage}, 70"); list($foundrows) = MYSQL_FETCH_ARRAY(MYSQL_QUERY("SELECT FOUND_ROWS()")); $pageselect = $florensia->pageselect($foundrows, array("ranking"), array("order" => $_GET['order'], "class" => $_GET['class'], "server" => $_GET['server']), 70); for ($i = $pageselect['pagestart'] + 1; $character = MYSQL_FETCH_ARRAY($querycharacter); $i++) { if ($character['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;'>"; } if (strlen($character['guild'])) { if ($character['guildid']) { $guild = "<a href='" . $florensia->outlink(array('guilddetails', $character['guildid'], $character['server'], $character['guild'])) . "'>" . $florensia->escape($character['guild']) . "</a>"; } else { $guild = $florensia->escape($character['guild']); } if ($character['guildgrade']) { $guild = class_character::guildgrade($character['guildgrade']) . " " . $guild; } } else { $guild = ""; } $characterlist .= $florensia->adsense(20); $characterlist .= "\n\t\t<div class='shortinfo_" . $florensia->change() . "'>\n\t\t\t<table style='width:100%'><tr>\n\t\t\t\t<td style='width:35px; text-align:right;'>{$i}.</td>\n\t\t\t\t<td style='width:50px; text-align:right;'>" . intval($character['levelsum']) . "</td>\n\t\t\t\t<td style='width:50px; text-align:right;'>" . intval($character['levelland']) . " <img src='{$florensia->layer_rel}/land.gif' style='height:11px;'></td>\n\t\t\t\t<td style='width:50px; padding-right:10px; text-align:right;'>" . intval($character['levelsea']) . " <img src='{$florensia->layer_rel}/sealv.gif' style='height:11px;'></td>\n\t\t\t\t<td>{$gender} <a href='" . $florensia->outlink(array("characterdetails", $character['charname'])) . "'>" . $florensia->escape($character['charname']) . "</a></td>\n\t\t\t\t<td style='width:150px'>" . $florensia->escape($character['jobclass']) . "</td>\n\t\t\t\t<td style='width:140px'>{$guild}</td>\n\t\t\t\t<td style='width:90px'><a href='" . $florensia->outlink(array('statistics', $character['server'])) . "'>" . $florensia->escape($character['server']) . "</a></td>\n\t\t\t\t<td style='text-align:right; padding-right:3px; width:100px'>" . $flolang->sprintf($flolang->character_lastupdate, timetamp2string(date("U") - $character['lastupdate'], "m")) . "</td>\n\t\t\t</tr></table>\n\t\t</div>\n\t"; } foreach ($florensia->validserver as $server) { $validserverlinks[] = "<a href='" . $florensia->outlink(array('statistics', $server)) . "'>{$server}</a>"; } $content = "\n<div class='subtitle'><a href='{$florensia->root}/statistics'>{$flolang->statistic_sitetitle}</a> > {$flolang->statistic_ranking_sitetitle}</div>\n<div class='subtitle small' style='font-weight:normal; margin-bottom:15px;'>" . $flolang->sprintf($flolang->statistic_notice_seealso, join(", ", $validserverlinks)) . "</div>\n\n<div class='bordered' style='font-weight:bold; margin-bottom:15px;'>\n\t" . $florensia->quick_select("ranking", array(), array($flolang->statistic_ranking_quickselect_orderby => $orderbyselect, $flolang->statistic_ranking_quickselect_filterjobclass => $classfilter, $flolang->statistic_ranking_quickselect_filterserver => $serverfilter)) . "\n</div>\n<div style='margin-bottom:8px;'>" . $pageselect['selectbar'] . "</div>\n<div class='subtitle' style='margin-bottom:7px;'>\n\t<table style='width:100%'><tr>\n\t\t<td style='width:35px; text-align:right;'>#</td>\n\t\t<td style='width:50px; text-align:right;'><img src='{$florensia->layer_rel}/land.gif' style='height:13px;'>+<img src='{$florensia->layer_rel}/sealv.gif' style='height:13px;'></td>\n\t\t<td style='width:50px; text-align:right;'><img src='{$florensia->layer_rel}/land.gif' style='height:13px;'></td>\n\t\t<td style='width:50px; padding-right:10px; text-align:right;'><img src='{$florensia->layer_rel}/sealv.gif' style='height:13px;'></td>\n\t\t<td>{$flolang->character_title_charname}</td>\n\t\t<td style='width:150px'>{$flolang->character_title_jobclass}</td>\n\t\t<td style='width:140px'>{$flolang->character_title_guild}</td>\n\t\t<td style='width:90px'>{$flolang->character_title_server}</td>\n\t\t<td style='text-align:right; padding-right:3px; width:100px'>{$flolang->character_title_lastupdate}</td>\n\t</tr></table>\n</div>\n<div class='small'>{$characterlist}</div>\n<div style='margin-top:10px;'>" . $pageselect['selectbar'] . "</div>\n"; $florensia->sitetitle("Ranking"); $florensia->output_page($content);
} } } $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)) { $linkclass = ""; if (!$entry['memberamount']) { $linkclass = "class='archiv'"; } $guildlink = "<a {$linkclass} href='" . $florensia->outlink(array("guilddetails", $entry['guildid'], $entry['server'], $entry['guildname'])) . "'>" . $florensia->escape($entry['guildname']) . "</a>"; if ($tmpguild != $entry['guildid']) { $bg = $bg == "background-color:#396087;" ? "background-color:#496f96;" : "background-color:#396087;"; $removecheckbox = "<input type='checkbox' name='remove_{$entry['guildid']}' value='{$entry['guildid']}' style='padding:0px; margin:0px;'>"; $addedby = $flouserdata->get_username($entry['creator']); $addeddate = date("m.d.y", $entry['timestamp']); $tmpguild = $entry['guildid']; } else { unset($guildlink, $entry['server'], $entry['memberamount'], $removecheckbox, $addedby, $addeddate); } $username = $entry['uid'] ? $flouserdata->get_username($entry['uid']) : ""; if (!$flouser->get_permission("teamspeak", "mail")) { unset($entry['email']); } $list .= "\n\t<tr>\n\t\t<td style='{$bg} text-align:right; padding-right:5px;'>{$removecheckbox}</td>\n\t\t<td style='{$bg}'>{$guildlink}</td>\n\t\t<td style='{$bg}'>" . $florensia->escape($entry['server']) . "</td>\n\t\t<td style='{$bg} text-align:right; padding-right:5px;'>{$entry['memberamount']}</td>\n\t\t<td style='{$bg}'>" . class_character::guildgrade($entry['guildgrade']) . " <a href='" . $florensia->outlink(array("characterdetails", $entry['charname'])) . "'>" . $florensia->escape($entry['charname']) . "</a></td>\n\t\t<td style='{$bg}'>{$username}</td>\n\t\t<td style='{$bg}'>" . $florensia->escape($entry['email']) . "</td>\n\t\t<td style='{$bg}'>{$addedby}</td>\n\t\t<td style='{$bg} text-align:right; padding-right:5px;'>{$addeddate}</td>\n\t</tr>\t\n\t"; } $content = "\n<div class='subtitle' style='margin-bottom:10px;'><a href='{$florensia->root}/admincp.php'>AdminCP</a> > Teamspeak</div>\n<form action='{$florensia->root}/adminteamspeak.php' method='POST'>\n\t<table style='width:100%; font-weight:normal;' class='small subtitle'>\n\t\t<tr>\n\t\t\t<td style='border-bottom:1px solid; font-weight:bold; width:15px;'></td>\n\t\t\t<td style='border-bottom:1px solid; font-weight:bold;'>Guildname</td>\n\t\t\t<td style='border-bottom:1px solid; font-weight:bold;'>Server</td>\n\t\t\t<td style='border-bottom:1px solid; font-weight:bold; text-align:right; padding-right:5px;'>Member</td>\n\t\t\t<td style='border-bottom:1px solid; font-weight:bold;'>Leader</td>\n\t\t\t<td style='border-bottom:1px solid; font-weight:bold;'>Owner</td>\n\t\t\t<td style='border-bottom:1px solid; font-weight:bold;'>Email</td>\n\t\t\t<td style='border-bottom:1px solid; font-weight:bold;'>Added by</td>\n\t\t\t<td style='border-bottom:1px solid; font-weight:bold; text-align:right; padding-right:5px;'>Created</td>\n\t\t</tr>\n\t\t{$list}\n\t</table>\n\t<div style='float:right; padding:3px; padding-top:5px;'><input type='submit' name='do_remove' value='Remove selected'></div>\n\t<div class='subtitle small' style='padding:2px;'>\n\t\t\t<input type='text' name='guildid'>\n\t\t\t<input type='submit' name='do_add' value='Add GuildID to list'>\n\t</div>\n</form>\n"; $florensia->sitetitle("AdminCP"); $florensia->sitetitle("Teamspeak"); $florensia->output_page($content);
$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']) { $guild .= " " . class_character::guildgrade($character->data['guildgrade']);
preg_match('/^([a-z]{2})/', $_GET['sig'], $language); if (is_dir($cfg['language_abs'] . '/' . $language[1]) && $language[1] != "") { $flolang->language = $language[1]; } $flolang->load("signature"); /* * Loading character... */ preg_match("/^([a-z]{2}|0){$sep}([0-9t]+){$sep}(.+)\\.(png|gif)\$/", $_GET['sig'], $character); $character = explode($sep, $character[3]); foreach ($character as $charname) { if (trim($charname) == "0" or $charname == "") { $charinfo['placeholder_' . bcadd(count($charinfo), 1)] = 0; continue; } $api = new class_character($charname); if (!$api->is_valid()) { //timeout or deleted continue; } $charinfo[$charname] = $api->data; } /* * Loading template/signature... */ preg_match("/^([a-z]{2}|0){$sep}([0-9t]+)/", $_GET['sig'], $signature); $signature = $signature[2]; if (preg_match('/^t([0-9]+)$/', $signature, $signaturetemp)) { $querysignature = MYSQL_QUERY("SELECT template FROM flobase_signaturetemp WHERE userid='" . $signaturetemp[1] . "'"); if ($signature = MYSQL_FETCH_ARRAY($querysignature)) { $signature['layout'] = "create/" . $signaturetemp[1];
break; case "clicks": $dborderby = "ORDER BY views DESC, fullviews DESC"; break; case "views": $dborderby = "ORDER BY fullviews DESC, views DESC"; break; default: $dborderby = ""; } if ($_GET['character'] or isset($_GET['guild'])) { if ($_GET['character']) { if (intval($_GET['archivid'])) { $character = new class_character(intval($_GET['archivid'])); } else { $character = new class_character($_GET['character']); } if (!$character->is_valid()) { $pagetitle = "<div class='subtitle' style='margin-bottom:3px;'><a href='" . $florensia->outlink(array("gallery")) . "'>{$flolang->gallery_pagetitle_gallery}</a> > {$flolang->gallery_pagetitle_character}</div>"; $imagelist = "<div class='small' style='margin-top:10px; border-bottom:1px solid; font-weight:bold;'>" . $character->get_errormsg() . "</div>"; } else { list($linkedimages) = MYSQL_FETCH_ARRAY(MYSQL_QUERY("SELECT COUNT(galleryid) FROM flobase_character_gallery WHERE characterid='{$character->data['characterid']}'")); $linkedimages = intval($linkedimages); #var_dump(count($linkedimages)); if ($linkedimages < 1) { $imagelist = "<div class='small'>" . $flolang->sprintf($flolang->gallery_overview_error_character_noimages, $florensia->escape($character->data['charname'])) . " <a href='" . $florensia->outlink(array("gallery", "upload"), $character->merge_opt_link(array("character" => $character->data['charname']))) . "'>{$flolang->gallery_link_uploadimages}</a>.</div>"; $pagetitle = "<div class='subtitle' style='margin-bottom:3px;'><a href='" . $florensia->outlink(array("gallery")) . "'>{$flolang->gallery_pagetitle_gallery}</a> > {$flolang->gallery_pagetitle_character} > <a href='" . $florensia->outlink(array("characterdetails", $character->data['charname']), $character->merge_opt_link()) . "'>" . $florensia->escape($character->data['charname']) . "</a></div>"; } else { //images found! $pageselect = $florensia->pageselect($linkedimages, array("gallery", "c", $character->data['charname']), $pageselectoption, $galleryimagelimit); $pagetitle = "<div class='subtitle' style='margin-bottom:3px;'><a href='" . $florensia->outlink(array("gallery")) . "'>{$flolang->gallery_pagetitle_gallery}</a> > {$flolang->gallery_pagetitle_character} > <a href='" . $florensia->outlink(array("characterdetails", $character->data['charname']), $character->merge_opt_link()) . "'>" . $florensia->escape($character->data['charname']) . "</a></div>";
/* <div class='subtitle' style='padding:10px; margin-bottom:15px; margin-right:315px;'> <div style='margin:auto; height:164px; width:279px; background-image:url({$florensia->layer_rel}/character_inv.png); background-position:center; background-repeat:no-repeat;'></div> </div> */ $content = "\n <div class='subtitle' style='margin-bottom:10px;'><a href='{$florensia->root}/characterdetails'>{$flolang->character_sitetitle}</a> > " . $florensia->escape($character->data['charname']) . "</div>\n <div class='subtitle' style='text-align:center; margin-bottom:15px;'>{$flolang->character_jumpto} " . $florensia->quicksearch() . "</div>\n {$charoverview}\n "; $florensia->sitetitle("Characterdetails"); $florensia->sitetitle($florensia->escape($character->data['charname'])); $florensia->output_page($content); } else { foreach ($getcharacter as $charname) { if ($charname == "0") { continue; } #ignore placeholder $char = new class_character($charname); if (!$char->is_valid()) { $errorcharnotice = $char->get_errormsg(); $char->data['jobclass'] = $guild = $server = $char->data['levelsea'] = $char->data['levelland'] = $char->data['updatepriority'] = "-"; $char->data['lastupdate'] = date("U"); $charname = $florensia->escape($charname) . "<br /><span style='color:#FF0000;'>(</span>{$errorcharnotice}<span style='color:#FF0000;'>)</span>"; } else { if ($char->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;'>"; } $charname = "{$gender} <a href='" . $florensia->outlink(array("characterdetails", $char->data['charname'])) . "'>" . $florensia->escape($char->data['charname']) . "</a>"; $server = "<a href='{$florensia->root}/statistics/" . $florensia->escape($char->data['server']) . "'>" . $florensia->escape($char->data['server']) . "</a>"; if ($char->data['guildid']) { $guild = "<a href='" . $florensia->outlink(array("guilddetails", $char->data['guildid'], $char->data['server'], $char->data['guild'])) . "'>" . $florensia->escape($char->data['guild']) . "</a>";
break; case "name": $dborderby = "ORDER BY charname, levelsea DESC, levelland DESC"; break; case "class": $dborderby = "ORDER BY jobclass, charname"; break; case "grade": $dborderby = "ORDER BY guildgrade DESC, charname"; break; } $today = mktime(0, 0, 0, date("m"), date("d"), date("Y")); $overall = array('levelsea' => 0, 'levelland' => 0, 'member' => 0, 'f' => 0, 'm' => 0, 'jobclass' => array()); $querycharacter = MYSQL_QUERY("SELECT * FROM flobase_character_data, flobase_character WHERE guildid='{$_GET['guildid']}' AND flobase_character_data.characterid=flobase_character.characterid {$dborderby}"); while ($character = MYSQL_FETCH_ASSOC($querycharacter)) { $character = new class_character($character); $overall['member']++; $overall[$character->data['gender']]++; $overall['levelland'] += $character->data['levelland']; $overall['levelsea'] += $character->data['levelsea']; $overall['jobclass'][$character->data['jobclass']]++; 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;'>"; } if ($character->data['guildgrade']) { $guildgrade = class_character::guildgrade($character->data['guildgrade']); } else { unset($guildgrade); }
function updateentry($exchangetype, $itemid, $action, $extendtime = 0) { global $flouser, $flolang, $stringtable, $mybb, $florensia; // $flolang->load("market"); if ($exchangetype != "buy" && $exchangetype != "sell") { return false; } //not logged in if (!$mybb->user['uid']) { $florensia->notice($flolang->market_updateentry_error_notloggedin, "warning"); return false; } //banned from market if (!$flouser->get_permission("add_usermarket")) { $florensia->notice($flolang->market_updateentry_error_banned, "warning"); return false; } if ($action == "add" or $action == "update") { if ($action == "add" && MYSQL_NUM_ROWS(MYSQL_QUERY("SELECT id FROM flobase_usermarket WHERE userid='" . $mybb->user['uid'] . "' AND exchangetype='{$exchangetype}' AND itemid='" . mysql_real_escape_string($itemid) . "'")) != 0) { $florensia->notice($flolang->market_updateentry_error_alreadysaved, "warning"); return false; } elseif (MYSQL_NUM_ROWS(MYSQL_QUERY("SELECT itemid FROM server_item_idtable WHERE itemid='" . mysql_real_escape_string($itemid) . "'")) == 0) { $florensia->notice($flolang->market_updateentry_error_existitem, "warning"); return false; } $character = new class_character($_POST['charactername']); if (!$character->is_valid()) { if ($character->get_errormsg() == "timeout") { $florensia->notice($flolang->market_updateentry_error_character_timeout, "warning"); } else { $florensia->notice($flolang->market_updateentry_error_character_exists, "warning"); } return false; } //finally, if character verified... $timeout = bcadd(date("U"), intval($_POST['timeoutdays']) * 24 * 60 * 60); $itemamount = intval($_POST['itemamount']); if ($itemamount == 0 or $itemamount == "") { $itemamount = 1; } foreach ($_POST['marketlanguage'] as $languageid) { if (!$flolang->lang[$languageid]->visible_usermarket) { continue; } $marketlanguage .= $comma . $languageid; $comma = ","; } $exchangegelt = intval(str_replace(array(",", "."), "", $_POST['exchangegelt'])); if ($action == "add") { if (!MYSQL_QUERY("INSERT INTO flobase_usermarket (userid, itemid, itemamount, exchange, exchangegelt, exchangetype, server, characterid, marketlanguage, timeout, createtime) VALUES('" . $mybb->user['uid'] . "', '" . mysql_real_escape_string($itemid) . "', '{$itemamount}', '" . mysql_real_escape_string($_POST['exchange']) . "', '{$exchangegelt}', '{$exchangetype}', '" . mysql_real_escape_string($character->data['server']) . "', '{$character->data['characterid']}', '{$marketlanguage}', '{$timeout}', '" . date("U") . "')")) { $florensia->notice($flolang->market_updateentry_error_default, "warning"); return false; } else { $florensia->notice($flolang->sprintf($flolang->market_updateentry_successful_add, $stringtable->get_string($itemid), intval($_POST['timeoutdays'])), "successful"); return true; } } elseif ($action == "update") { if (!MYSQL_QUERY("UPDATE flobase_usermarket SET itemamount='{$itemamount}', exchange='" . mysql_real_escape_string($_POST['exchange']) . "', exchangegelt='{$exchangegelt}', server='" . mysql_real_escape_string($character->data['server']) . "', characterid='{$character->data['characterid']}', marketlanguage='{$marketlanguage}', timeout='{$timeout}' WHERE userid='{$mybb->user['uid']}' AND itemid='" . mysql_real_escape_string($itemid) . "' AND exchangetype='{$exchangetype}'")) { $florensia->notice($flolang->market_updateentry_error_default, "warning"); return false; } else { $florensia->notice($flolang->sprintf($flolang->market_updateentry_successful_update, $stringtable->get_string($itemid)), "successful"); return true; } } } elseif ($action == "delete") { MYSQL_QUERY("DELETE FROM flobase_usermarket WHERE userid='" . $mybb->user['uid'] . "' AND exchangetype='{$exchangetype}' AND itemid='" . mysql_real_escape_string($itemid) . "'"); $florensia->notice($flolang->sprintf($flolang->market_updateentry_successful_delete, $stringtable->get_string($itemid)), "successful"); return true; } elseif ($action == "extend" && intval($extendtime)) { $maxtime = 2 * 30; $extendtimedb = intval($extendtime) * 24 * 60 * 60; $verifyextend = MYSQL_FETCH_ARRAY(MYSQL_QUERY("SELECT timeout FROM flobase_usermarket WHERE userid='" . $mybb->user['uid'] . "' AND exchangetype='{$exchangetype}' AND itemid='" . mysql_real_escape_string($itemid) . "'")); if (bcadd($verifyextend['timeout'], $extendtimedb) >= bcadd(date("U"), $maxtime * 24 * 60 * 60)) { $florensia->notice($flolang->sprintf($flolang->market_updateentry_error_extend_timespan, $stringtable->get_string($itemid), intval($extendtime), $maxtime), "warning"); return false; } MYSQL_QUERY("UPDATE flobase_usermarket SET timeout=timeout+{$extendtimedb} WHERE userid='" . $mybb->user['uid'] . "' AND exchangetype='{$exchangetype}' AND itemid='" . mysql_real_escape_string($itemid) . "'"); $florensia->notice($flolang->sprintf($flolang->market_updateentry_successful_extend, $stringtable->get_string($itemid), $extendtime), "successful"); return true; } }