Skip to content

Commit

Permalink
Finalized v3.0.0
Browse files Browse the repository at this point in the history
Dont show an AA if it has no first rank
Modified htaccess to hide template and other files
Added favicon and touch icons
Added commas to a bunch of displayed numbers
Can search bazaar by seller name (thanks croco)
Added a "Store" link to the side profile menu to see items the player
sells
Hide the association between guild/player when they are anon
Add item/augment icons to the item inspect windows
Add stack sizes to item icons
Added a way to easily replace what's displayed on the main page (renamed
home.template to home.php, then edit)
Removed error reporting for self registration
Added a view to the server page that shows activity in the last 30 days
(can configure)
Fixed issue that caused dynamic images to not display on newer PHP
versions
Added ZOrdering to popup windows, made it dynamically add the effect
based on class
  • Loading branch information
maudigan committed Apr 4, 2020
1 parent 9d5b5df commit 4f3ef92
Show file tree
Hide file tree
Showing 51 changed files with 815 additions and 243 deletions.
6 changes: 5 additions & 1 deletion .htaccess
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
RewriteEngine On
RewriteCond %{THE_REQUEST} ^GET\ ([^#?\ ]+)cbsig/
RewriteRule ^cbsig/([A-Za-z0-9\-]+)/([A-Za-z0-9\-]+)/([A-Za-z0-9\-]+)/([A-Za-z0-9\-]+)/([A-Za-z0-9\-]+)/([A-Za-z0-9\-]+)/([A-Za-z0-9\-]+).png$ %1sig.php?one=$1&two=$2&epic=$3&stat=$4&border=$5&background=$6&char=$7 [L]


<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak|tpl|register|template)$">
Order Allow,Deny
Deny from all
</FilesMatch>

33 changes: 33 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
v3.0.0
----------------------------------------------------------------------
finalized the 2.9.0 changes after testing/feedback

Aprile 4, 2020 - Dont show an AA if it has no first rank
Modified htaccess to hide template and other files
Added favicon and touch icons
Added commas to a bunch of displayed numbers
Can search bazaar by seller name (thanks croco)
Added a "Store" link to the side profile menu to see
items the player sells
Hide the association between guild/player when they
are anon
Add item/augment icons to the item inspect windows
Add stack sizes to item icons
Added a way to easily replace what's displayed on
the main page (renamed home.template to home.php,
then edit)
Removed error reporting for self registration
Added a view to the server page that shows activity
in the last 30 days (can configure)
Fixed issue that caused dynamic images to not
display on newer PHP versions
Added ZOrdering to popup windows, made it
dynamically add the effect based on class


v2.9.0
----------------------------------------------------------------------
massive rewrite
Expand All @@ -20,6 +47,12 @@ Mar 31, 2020 - Made all windows drag
added mitigation ac to the inventory window
removed autocorrect from all the search fields
made search fields submit on pressing enter
version stamps css and js files so users dont
cache and old version
made cb_message_die output an error image for image
scripts
normalized a lot of the html to make it more SEO
and screen reader friendly


v2.8.2
Expand Down
5 changes: 5 additions & 0 deletions aas.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
* modularized the profile menu output
* March 22, 2020 - Maudigan
* impemented common.php
* April 3, 2020 - Maudigan
* dont show AAs if they dont have a first rank, some custom server
* hide AA by deleting their ranks
*
***************************************************************************/

Expand Down Expand Up @@ -170,6 +173,8 @@ function getRankCost($first_rank, $value)
{
//calculate all the values
$first_rank_id = $row['first_rank_id'];
//skip this one if there is no first rank data
if (!array_key_exists($first_rank_id, $aa_ranks)) continue;
$cur = intval($character_aas[$first_rank_id]['aa_value']);
$cost = getRankCost($first_rank_id, $cur);
$max = getTotalRanks($first_rank_id);
Expand Down
Binary file added apple-touch-icon-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 28 additions & 4 deletions bazaar.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
* Modified database to use a class.
* March 22, 2020 - Maudigan
* impemented common.php
* April 2, 2020 - Maudigan
* search by seller name (thanks croco/kinglykrab)
* April 3, 2020 - Maudigan
* add icons to inspect
* added number_format to prices
*
***************************************************************************/

Expand All @@ -55,6 +60,7 @@
$pricemin = $_GET['pricemin'];
$pricemax = $_GET['pricemax'];
$item = $_GET['item'];
$seller = $_GET['char'];
$direction = (($_GET['direction']=="DESC") ? "DESC" : "ASC");

$perpage=25;
Expand All @@ -64,6 +70,7 @@

//security against sql injection
if (!IsAlphaSpace($item)) cb_message_die($language['MESSAGE_ERROR'],$language['MESSAGE_ITEM_ALPHA']);
if (!IsAlphaSpace($seller)) cb_message_die($language['MESSAGE_ERROR'],$language['MESSAGE_NAME_ALPHA']);
if (!IsAlphaSpace($orderby)) cb_message_die($language['MESSAGE_ERROR'],$language['MESSAGE_ORDER_ALPHA']);
if (!is_numeric($start)) cb_message_die($language['MESSAGE_ERROR'],$language['MESSAGE_START_NUMERIC']);
if (!is_numeric($pricemin) && $pricemin != "") cb_message_die($language['MESSAGE_ERROR'],$language['MESSAGE_PRICE_NUMERIC']);
Expand All @@ -87,6 +94,10 @@
$where .= $divider."items.Name LIKE '%".str_replace("_", "%", str_replace(" ","%",$item))."%'";
$divider = " AND ";
}
if ($seller) {
$where .= $divider."character_data.name = '".$seller."'";
$divider = " AND ";
}
if ($pricemin) {
$modprice = $pricemin * 1000;
$where .= $divider."trader.item_cost >= $modprice";
Expand Down Expand Up @@ -153,6 +164,16 @@
include(__DIR__ . "/include/header.php");


/*********************************************
DROP PROFILE MENU
*********************************************/
//if you're looking at a players store, treat it like
//a profile page
if ($seller) {
output_profile_menu($seller, 'bazaar');
}


/*********************************************
POPULATE BODY
*********************************************/
Expand All @@ -171,6 +192,8 @@

$cb_template->assign_vars(array(
'ITEM' => $item,
'SELLER' => $seller,
'STORENAME' => ($seller) ? " - ".$seller : "",
'ORDER_LINK' => $baselink."&start=$start&direction=".(($direction=="ASC") ? "DESC":"ASC"),
'PAGINATION' => cb_generate_pagination("$baselink&orderby=$orderby&direction=$direction", $totalitems, $perpage, $start, true),
'PRICE_MIN' => $pricemin,
Expand All @@ -195,17 +218,18 @@
foreach($lots as $lot) {
$tempitem = new item($lot);
$price = $lot["tradercost"];
$plat = floor($price/1000);
$plat = number_format(floor($price/1000));
$price = $price % 1000;
$gold = floor($price/100);
$gold = number_format(floor($price/100));
$price = $price % 100;
$silver = floor($price/10);
$copper = $price % 10;
$silver = number_format(floor($price/10));
$copper = number_format($price % 10);
$cb_template->assign_both_block_vars("items", array(
'SELLER' => $lot['charactername'],
'PRICE' => (($plat)?$plat."p ":"").(($silver)?$silver."s ":"").(($gold)?$gold."g ":"").(($copper)?$copper."c ":""),
'NAME' => $tempitem->name(),
'ID' => $tempitem->id(),
'ICON' => $tempitem->icon(),
'LINK' => QuickTemplate($link_item, array('ITEM_ID' => $tempitem->id())),
'HTML' => $tempitem->html(),
'SLOT' => $slotcounter)
Expand Down
98 changes: 55 additions & 43 deletions character.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
* prepared for implementation of dynamic guild ranks
* March 22, 2020 - Maudigan
* impemented common.php
* April 2, 2020 - Maudigan
* dont show anon guild members names
* show stack size code
* added item icon and stacksize to the item stat/inspect windows
*
***************************************************************************/

Expand Down Expand Up @@ -82,44 +86,46 @@
//get character info
$class = $char->GetValue('class');

/* this will get implemented in the server code soon, uncomment and remove the code below
//load guild name
$tpl = <<<TPL
SELECT guilds.name, guild_ranks.title
FROM guilds
JOIN guild_members
ON guilds.id = guild_members.guild_id
JOIN guild_ranks
ON guild_members.rank = guild_ranks.rank
AND guild_members.guild_id = guild_ranks.guild_id
WHERE guild_members.char_id = '%s'
LIMIT 1
if ($char->GetValue('anon') != 1 || $showguildwhenanon || $charbrowser_is_admin_page) {
/* this will get implemented in the server code soon, uncomment and remove the code below
//load guild name
$tpl = <<<TPL
SELECT guilds.name, guild_ranks.title
FROM guilds
JOIN guild_members
ON guilds.id = guild_members.guild_id
JOIN guild_ranks
ON guild_members.rank = guild_ranks.rank
AND guild_members.guild_id = guild_ranks.guild_id
WHERE guild_members.char_id = '%s'
LIMIT 1
TPL;
$query = sprintf($tpl, $charID);
$result = $cbsql->query($query);
if($cbsql->rows($result))
{
$row = $cbsql->nextrow($result);
$guild_name = $row['name'];
$guild_rank = $row['title'];
}*/

//load guild name statically
$tpl = <<<TPL
SELECT guilds.name, guild_members.rank
FROM guilds
JOIN guild_members
ON guilds.id = guild_members.guild_id
WHERE guild_members.char_id = '%s'
LIMIT 1
TPL;
$query = sprintf($tpl, $charID);
$result = $cbsql->query($query);
if($cbsql->rows($result))
{
$row = $cbsql->nextrow($result);
$guild_name = $row['name'];
$guild_rank = $row['title'];
}*/

//load guild name statically
$tpl = <<<TPL
SELECT guilds.name, guild_members.rank
FROM guilds
JOIN guild_members
ON guilds.id = guild_members.guild_id
WHERE guild_members.char_id = '%s'
LIMIT 1
TPL;
$query = sprintf($tpl, $charID);
$result = $cbsql->query($query);
if($cbsql->rows($result))
{
$row = $cbsql->nextrow($result);
$guild_name = $row['name'];
$guild_rank = $guildranks[$row['rank']];
$query = sprintf($tpl, $charID);
$result = $cbsql->query($query);
if($cbsql->rows($result))
{
$row = $cbsql->nextrow($result);
$guild_name = $row['name'];
$guild_rank = $guildranks[$row['rank']];
}
}


Expand Down Expand Up @@ -358,7 +364,8 @@
if ($value->type() != INVENTORY) continue;
$cb_template->assign_block_vars("invitem", array(
'SLOT' => $value->slot(),
'ICON' => $value->icon())
'ICON' => $value->icon(),
'STACK' => $value->stack())
);
if ($value->slotcount() > 0) {
$cb_template->assign_block_vars("invitem.switch_is_bag", array());
Expand All @@ -370,7 +377,8 @@
if ($value->type() != EQUIPMENT) continue;
$cb_template->assign_block_vars("equipitem", array(
'SLOT' => $value->slot(),
'ICON' => $value->icon())
'ICON' => $value->icon(),
'STACK' => $value->stack())
);
}
//BANK
Expand All @@ -379,7 +387,8 @@
if ($value->type() != BANK) continue;
$cb_template->assign_block_vars("bankitem", array(
'SLOT' => $value->slot(),
'ICON' => $value->icon())
'ICON' => $value->icon(),
'STACK' => $value->stack())
);
if ($value->slotcount() > 0) {
$cb_template->assign_block_vars("bankitem.switch_is_bag", array());
Expand All @@ -392,7 +401,8 @@
if ($value->type() != SHAREDBANK) continue;
$cb_template->assign_block_vars("sharedbankitem", array(
'SLOT' => $value->slot(),
'ICON' => $value->icon())
'ICON' => $value->icon(),
'STACK' => $value->stack())
);
if ($value->slotcount() > 0) {
$cb_template->assign_block_vars("sharedbankitem.switch_is_bag", array());
Expand Down Expand Up @@ -428,7 +438,8 @@
$cb_template->assign_block_vars("bags.bagitems", array(
'BI_SLOT' => $subvalue->slot(),
'BI_RELATIVE_SLOT' => $subvalue->vslot(),
'BI_ICON' => $subvalue->icon())
'BI_ICON' => $subvalue->icon(),
'STACK' => $subvalue->stack())
);
}
}
Expand All @@ -450,7 +461,8 @@
$cb_template->assign_both_block_vars("item", array(
'SLOT' => $value->slot(),
'ICON' => $value->icon(),
'NAME' => $value->name(),
'NAME' => $value->name(),
'STACK' => $value->stack(),
'ID' => $value->id(),
'LINK' => QuickTemplate($link_item, array('ITEM_ID' => $value->id())),
'HTML' => $value->html())
Expand Down
Binary file added favicon.ico
Binary file not shown.
Loading

0 comments on commit 4f3ef92

Please sign in to comment.