function postX($content, $class) { switch ($class) { case "blizz": $content = str_replace("[quote]", "<blockquote class=\"quote-blizzard\">", $content); break; case "mvp": $content = str_replace("[quote]", "<blockquote class=\"quote-mvp\">", $content); break; default: $content = str_replace("[quote]", "<blockquote class=\"quote-public\">", $content); break; } $content = str_replace("[/quote]", "</blockquote>", $content); $content = str_replace("[b]", "<b>", $content); $content = str_replace("[/b]", "</b>", $content); $content = str_replace("[i]", "<i>", $content); $content = str_replace("[/i]", "</i>", $content); $content = str_replace("[u]", "<u>", $content); $content = str_replace("[/u]", "</u>", $content); $content = str_replace("[ul]", "<ul>", $content); $content = str_replace("[/ul]", "</ul>", $content); $content = str_replace("[li]", "<li>", $content); $content = str_replace("[/li]", "</li>", $content); $content = str_replace("[code]", "<code>", $content); $content = str_replace("[/code]", "</code>", $content); $content = str_replace("[img]", "<img src=\"", $content); $content = str_replace("[/img]", "\"/>", $content); $content = str_replace("[IMG]", "<img src=\"", $content); $content = str_replace("[/IMG]", "\"/>", $content); $bomb = explode("[item=", $content); foreach ($bomb as $bombs) { $new = explode(" /]", $bombs); if (is_numeric($new[0])) { $url = "http://www.wowhead.com/item=" . $new[0] . "&xml"; if (ini_get('allow_url_fopen')) { $xml = simplexml_load_file($url); } else { $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $xml_raw = curl_exec($ch); $xml = simplexml_load_string($xml_raw); } //$xml = new SimpleXMLElement("http://www.wowhead.com/item=".$new[0]."&xml", NULL, TRUE); $img = $xml->item->icon; $name = $xml->item->name; $q = $xml->item->quality; $parlevu = '<a class="bml-link-item color-q' . quality($q) . '" rel="item=' . $new[0] . '"><span class="icon-frame frame-10"> <img height="10" width="10" src="http://wow.zamimg.com/images/wow/icons/small/' . strtolower($img) . '.jpg" alt="" /></span> ' . $name . '</a> <span style="display:none;">(itemid : '; $content = str_replace("[item=", "{$parlevu}", $content); $content = str_replace(" /]", ")</span>", $content); } } return $content; }
function lastbooks() { date_default_timezone_set('Europe/Rome'); //echo "<table class=\"booklist\">"; echo "<tr><th>Titolo</th><th>Autori</th><th>Anno</th><th>Prezzo</th><th>Stato</th><th>Data Aggiunta</th></tr>"; $sql = "SELECT user_books.ID, title, author, year, price, status, notes, user_books.date, bookid\nFROM books, user_books WHERE bookid=books.ID AND user_books.venduto=0 ORDER BY user_books.date DESC LIMIT 10"; $q = mysql_query($sql) or die("errore.<br>"); while ($riga = mysql_fetch_array($q)) { echo "<tr><td><a href=\"#\" onclick=\"popup({$riga['0']});\">{$riga['1']}</a></td><td>{$riga['2']}</td><td>{$riga['3']}</td><td>{$riga['4']}</td>\n\t\t<td>" . quality($riga[5]) . "</td><td title=\"" . date('H:i - d/m/Y', strtotime($riga[7])) . "\">" . convertDate(strtotime($riga[7])) . "</td></tr>"; /*date('H:i - d/m/Y',strtotime($riga[7]))."</td></tr>");*/ } //echo "</table>"; }
function select_quantity() { global $world_db, $characters_db, $realm_id, $user_name, $output, $action_permission, $user_lvl, $locales_search_option, $ultra_mult, $ultra_base, $uv_credits, $uv_money, $credits_fractional, $ultra_vendor_max_item_level, $ultra_vendor_max_item_req_level, $sql, $core; valid_login($action_permission["view"]); if (empty($_GET["myItem"])) { redirect("ultra_vendor.php?error=1"); } if ($core == 1) { $iquery = "SELECT *, itemlevel AS ItemLevel, requiredlevel AS RequiredLevel FROM items " . ($locales_search_option != 0 ? "LEFT JOIN items_localized ON (items_localized.entry=items.entry AND language_code='" . $locales_search_option . "') " : " ") . "WHERE items.entry='" . $_GET["myItem"] . "'"; } else { $iquery = "SELECT *,\r\n name AS name1, Quality AS quality, SellPrice AS sellprice, BuyPrice AS buyprice\r\n FROM item_template " . ($locales_search_option != 0 ? "LEFT JOIN locales_item ON locales_item.entry=item_template.entry " : " ") . "WHERE item_template.entry='" . $_GET["myItem"] . "'"; } $iresult = $sql["world"]->query($iquery); $item = $sql["world"]->fetch_assoc($iresult); $continue_sale = true; // check if the item's level exceeds the configured limits if ($ultra_vendor_max_item_level > -1) { if ($item["ItemLevel"] > $ultra_vendor_max_item_level) { $continue_sale = false; } } // check if the item's required level exceeds the configured limits if ($ultra_vendor_max_item_req_level > -1) { if ($item["RequiredLevel"] > $ultra_vendor_max_item_req_level) { $continue_sale = false; } } // check if the item is on the disabled list $d_query = "SELECT itemid FROM ultravendor_disables WHERE itemid='" . $item["entry"] . "'"; $d_result = $sql["mgr"]->query($d_query); if ($sql["mgr"]->num_rows($d_result)) { $continue_sale = false; } // if we weren't blocked by any of the tests above... if ($continue_sale) { // Localization if ($locales_search_option != 0) { if ($core == 1) { $item["name1"] = $item["name"]; } else { $item["name1"] = $item["name_loc" . $locales_search_option]; } } else { $item["name1"] = $item["name1"]; } if ($core == 1) { $cquery = "SELECT guid, level, gold FROM characters WHERE name='" . $_GET["charname"] . "'"; } else { $cquery = "SELECT guid, level, money AS gold FROM characters WHERE name='" . $_GET["charname"] . "'"; } $cresult = $sql["char"]->query($cquery); $char = $sql["char"]->fetch_assoc($cresult); $chargold = $char["gold"]; $chargold = str_pad($chargold, 4, "0", STR_PAD_LEFT); $pg = substr($chargold, 0, -4); if ($pg == "") { $pg = 0; } $ps = substr($chargold, -4, 2); if ($ps == "" || $ps == "00") { $ps = 0; } $pc = substr($chargold, -2); if ($pc == "" || $pc == "00") { $pc = 0; } $mul = $ultra_mult[$item["quality"]]; $qual = quality($item["quality"]); if ($item["sellprice"] != 0) { $base_price = $item["sellprice"]; } else { if ($item["buyprice"] == 0) { $base_price = $ultra_base; } else { $base_price = $item["buyprice"]; } } $output .= ' <table class="top_hidden"> <tr> <td> <div class="half_frame fieldset_border center center_text"> <span class="legend">' . lang("ultra", "selectquantity") . '</span>'; $gold = $mul * $base_price; $gold = str_pad($gold, 4, "0", STR_PAD_LEFT); $cg = substr($gold, 0, -4); if ($cg == "") { $cg = 0; } $cs = substr($gold, -4, 2); if ($cs == "" || $cs == "00") { $cs = 0; } $cc = substr($gold, -2); if ($cc == "" || $cc == "00") { $cc = 0; } $gold = $mul * $base_price; $base_gold = $base_price; $base_gold = str_pad($base_gold, 4, "0", STR_PAD_LEFT); $bg = substr($base_gold, 0, -4); if ($bg == "") { $bg = 0; } $bs = substr($base_gold, -4, 2); if ($bs == "" || $bs == "00") { $bs = 0; } $bc = substr($base_gold, -2); if ($bc == "" || $bc == "00") { $bc = 0; } // Localization $isranked = lang("ultra", "isranked"); $isranked = str_replace("%1", '<b>' . $item["name1"] . '</b>', $isranked); $isranked = str_replace("%2", '<b>"' . $qual . '"</b>', $isranked); $output .= $isranked; $output .= ' <br />'; // Localization $willcost = lang("ultra", "willcost"); $willcost = str_replace("%1", '<span id="uv_mul">' . $mul . '</span>', $willcost); $cost_display = $bg . '<img src="img/gold.gif" alt="gold" style="position: relative; bottom: -6px;" />' . $bs . '<img src="img/silver.gif" alt="silver" style="position: relative; bottom: -6px;" />' . $bc . '<img src="img/copper.gif" alt="copper" style="position: relative; bottom: -6px;" />'; $willcost = str_replace("%2", $cost_display, $willcost); $output .= $willcost; $output .= ' <br />'; // Localization $orcost = lang("ultra", "or"); $or_display = $cg . '<img src="img/gold.gif" alt="gold" style="position: relative; bottom: -6px;" />' . $cs . '<img src="img/silver.gif" alt="silver" style="position: relative; bottom: -6px;" />' . $cc . '<img src="img/copper.gif" alt="copper" style="position: relative; bottom: -6px;" />'; $orcost = str_replace("%1", $or_display, $orcost); $output .= $orcost; $output .= ' <br /> <br />'; // Localization $charhas = lang("ultra", "has"); $charhas = str_replace("%1", '<b>' . $_GET["charname"] . '</b>', $charhas); $money_display = $pg . '<img src="img/gold.gif" alt="gold" style="position: relative; bottom: -6px;" />' . $ps . '<img src="img/silver.gif" alt="silver" style="position: relative; bottom: -6px;" />' . $pc . '<img src="img/copper.gif" alt="copper" style="position: relative; bottom: -6px;" />'; $charhas = str_replace("%2", $money_display, $charhas); $output .= $charhas; $output .= ' <br /> <br />'; // credits if ($uv_money > 0) { // get our credit balance $query = "SELECT Credits FROM config_accounts WHERE Login='******'"; $result = $sql["mgr"]->query($query); $result = $sql["mgr"]->fetch_assoc($result); $credits = $result["Credits"]; if ($credits < 0) { // unlimited credits $output .= lang("global", "credits_unlimited"); $output .= ' <br /> <br />'; } elseif ($credits >= 0) { $credit_cost = $uv_credits * ($gold / $uv_money); // if Allow Fractional Credits is disabled then cost must be a whole number $credit_cost = !$credits_fractional ? ceil($credit_cost) : $credit_cost; $credits_per_item = lang("ultra", "credits_peritem"); $credits_per_item = str_replace("%1", '<b>' . $credit_cost . '</b>', $credits_per_item); $credits_per_item = str_replace("%2", '<b>' . $item["name1"] . '</b>', $credits_per_item); $output .= $credits_per_item; $output .= ' <br /> <br />'; $credits_avail = lang("ultra", "credits_avail"); $credits_avail = str_replace("%1", '<b>' . (double) $credits . '</b>', $credits_avail); $output .= $credits_avail; $output .= ' <br /> <br />'; } } $output .= ' <br /> <br /> <form method="get" action="ultra_vendor.php" id="form"> <div> <input type="hidden" name="action" value="selected_quantity" /> <input type="hidden" name="charname" value="' . $_GET["charname"] . '" /> <input type="hidden" name="gold" value="' . $gold . '" /> <input type="hidden" name="item" value="' . $item["entry"] . '" /> </div> <div> <span>' . lang("ultra", "wanted") . ': </span> <input type="text" name="want" value="0" /> <br /> <br /> </div> <table class="center"> <tr> <td>'; makebutton(lang("ultra", "submit"), "javascript:do_submit()\" type=\"def", 180); $output .= ' </td> <td>'; makebutton(lang("global", "back"), "javascript:window.history.back()\" type=\"def", 130); $output .= ' </td> </tr> </table> </form> </div> </td> </tr> </table>'; } else { $output .= ' <table class="top_hidden"> <tr> <td> <div class="half_frame fieldset_border center center_text"> <span class="legend">' . lang("ultra", "denied_legend") . '</span> <span>' . lang("ultra", "denied") . '</span> <br /> <br /> <table> <tr> <td>'; makebutton(lang("global", "back"), "javascript:window.history.back()\" type=\"def", 130); $output .= ' </td> </tr> </table> </div> </td> </tr> </table>'; } }
} } echo "<br><br>"; $query2 = mysql_query($sql2) or die("errore" . mysql_error()); if ($query2) { $num_fields = mysql_num_rows($query2); if (!$num_fields) { /*echo ""; */ } else { //tabella libri già venduti echo "Storico libri già venduti:<br>"; echo "<table class=\"booklist\"><tr><th>Titolo</th><th>Autori</th><th>Anno</th><th>Prezzo</th><th>Stato</th><th>Note</th><th>Data Aggiunta</th><th>Elimina</th></tr>"; $query = mysql_query($sql2) or die("errore" . mysql_error()); while ($riga = mysql_fetch_array($query)) { if ($riga[9] == 1) { echo "<tr><td>{$riga['1']}</td><td>{$riga['2']}</td><td>{$riga['3']}</td><td>{$riga['4']}</td>\n\t\t\t<td>" . quality($riga[5]) . "</td><td>{$riga['6']}</td><td title=\"" . date('H:i - d/m/Y', strtotime($riga[7])) . "\">" . convertDate(strtotime($riga[7])) . "</td>\n\t\t\t<td><a href=\"deletebook.php?id={$riga['0']}\"><img src=\"images/book_delete.png\"> Elimina</a></td></tr>"; } } echo "</tbody></table><br>"; echo "<a href=\"sell.php\"><img src=\"images/book_add.png\">Vendi un Libro</a>"; } } ?> <br> </div> <!--end div page--> </div> <!--end wrapper--> <br><br> <!-- inizio google ad --> <div style="text-align:center;"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<?php include_once 'dbconnect.inc.php'; include_once 'functions.inc.php'; date_default_timezone_set('Europe/Rome'); $search = mysql_real_escape_string($_GET['search']); $low = 0; $high = $low + 20; $sql = "SELECT title, author, year, price, status, user_books.date, user_books.ID \nFROM books, user_books\nWHERE user_books.bookid = books.ID\nAND user_books.venduto =0\nAND (\ntitle LIKE '%{$search}%'\nOR books.author LIKE '%{$search}%'\nOR books.isbn10 LIKE '%{$search}%'\nOR books.isbn13 LIKE '%{$search}%'\n)\n"; /*LIMIT $low,$high*/ $query = mysql_query($sql); if (!$query) { echo "errore query"; } else { //stampo tabella risultati if (mysql_num_rows($query) == 0) { echo "Nessun Risultato Trovato"; } else { echo "<tr><th>Titolo</th><th>Autori</th><th>Anno</th><th>Prezzo</th><th>Stato</th><th>Data Aggiunta</th></tr>"; while ($r = mysql_fetch_row($query)) { echo "<tr><td><a href=\"javascript:void(0);\"onclick=\"popup({$r['6']});\">" . $r[0] . "</a></td><td>" . $r[1] . "</td><td>" . $r[2] . "</td><td>" . $r[3] . "</td><td>" . quality($r[4]) . "</td><td title=\"" . date('H:i - d/m/Y', strtotime($r[5])) . "\">" . convertDate(strtotime($r[5])) . "</td>"; } } }
?> </td></tr> <tr><td><strong>Anno:</strong> <?php echo $year; ?> </td></tr> <tr><td><strong>ISBN10:</strong> <?php echo $isbn10; ?> </td></tr> <tr><td><strong>ISBN13:</strong> <?php echo $isbn13; ?> </td></tr> <tr><td><strong>Stato:</strong> <?php echo quality($status); ?> </td></tr> <tr><td><strong>Prezzo:</strong> €<?php echo $price; ?> </td></tr> <tr><td><strong>Note:</strong> <?php echo $notes; ?> </td></tr> <?php //visualizzo informazioni sul venditore solo se l'utente è collegato if (!isset($_SESSION['user'])) { echo "Per informazioni sul venditore devi fare prima <a href=\"login.php\">login</a>"; } else {