Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Dickenson committed Jun 28, 2015
1 parent bac48dc commit 061c2ba
Show file tree
Hide file tree
Showing 29 changed files with 300 additions and 173 deletions.
16 changes: 8 additions & 8 deletions admin/boards.php
Expand Up @@ -25,20 +25,20 @@
{
foreach ($_POST['delete'] as $k => $v)
{
$v = intval($v);
$query = "DELETE FROM " . $DBPrefix . "community WHERE id = " . $v;
$system->check_mysql(mysql_query($query), $query, __LINE__, __FILE__);
$query = "DELETE FROM " . $DBPrefix . "comm_messages WHERE boardid = " . $v;
$system->check_mysql(mysql_query($query), $query, __LINE__, __FILE__);
$query = "DELETE FROM " . $DBPrefix . "community WHERE id = :id";
$params = array(array(':id', $v, 'int'));
$db->query($query, $params);
$query = "DELETE FROM " . $DBPrefix . "comm_messages WHERE boardid = :id";
$params = array(array(':id', $v, 'int'));
$db->query($query, $params);
}
$ERR = $MSG['5044'];
}

// get list of boards
$query = "SELECT * FROM " . $DBPrefix . "community ORDER BY name";
$res = mysql_query($query);
$system->check_mysql($res, $query, __LINE__, __FILE__);
while ($row = mysql_fetch_array($res))
$db->direct_query($query);
while ($row = $db->result())
{
$template->assign_block_vars('boards', array(
'ID' => $row['id'],
Expand Down
17 changes: 11 additions & 6 deletions admin/buyitnow.php
Expand Up @@ -27,14 +27,19 @@
if ($bn_only_percent > $system->SETTINGS['bn_only_percent'])
{
$query = "UPDATE " . $DBPrefix . "users SET bn_only = 'y' WHERE id = bn_only = 'n'";
$system->check_mysql(mysql_query($query), $query, __LINE__, __FILE__);
$db->direct_query($query);
}
$query = "UPDATE " . $DBPrefix . "settings SET
buy_now = " . intval($_POST['buy_now']) . ",
bn_only = '" . $_POST['bn_only'] . "',
bn_only_disable = '" . $_POST['bn_only_disable'] . "',
bn_only_percent = " . $bn_only_percent;
$system->check_mysql(mysql_query($query), $query, __LINE__, __FILE__);
buy_now = :buy_now,
bn_only = :bn_only,
bn_only_disable = :disable,
bn_only_percent = :percent";
$params = array();
$params[] = array(':buy_now', $_POST['buy_now'], 'int');
$params[] = array(':bn_only', $_POST['bn_only'], 'str');
$params[] = array(':disable', $_POST['bn_only_disable'], 'str');
$params[] = array(':percent', $bn_only_percent, 'str');
$db->query($query, $params);
$system->SETTINGS['buy_now'] = $_POST['buy_now'];
$system->SETTINGS['bn_only'] = $_POST['bn_only'];
$system->SETTINGS['bn_only_disable'] = $_POST['bn_only_disable'];
Expand Down
2 changes: 1 addition & 1 deletion admin/viewaccessstats.php
Expand Up @@ -47,7 +47,7 @@
}
else
{
$month = date('m');
$month = date('n');
$year = date('Y');
$query = "SELECT * FROM " . $DBPrefix . "currentaccesses WHERE month = :month AND year = :year ORDER BY LENGTH(day), day ASC";
$params[] = array(':month', $month, 'int');
Expand Down
2 changes: 1 addition & 1 deletion admin/viewbrowserstats.php
Expand Up @@ -28,7 +28,7 @@
$MAX = 0;
$TOTAL = 0;
$BROWSERS = array();
while ($row = fetch())
while ($row = $db->fetch())
{
$BROWSERS[$row['browser']] = $row['counter'];
$TOTAL = $TOTAL + $row['counter'];
Expand Down
4 changes: 2 additions & 2 deletions browse.php
Expand Up @@ -72,8 +72,8 @@
else
{
// Retrieve the translated category name
$par_id = $category['parent_id'];
$current_cat_name = $category_names[$par_id];
$cat_id = $category['cat_id'];
$current_cat_name = $category_names[$cat_id];
$TPL_categories_string = '';
$crumbs = $catscontrol->get_bread_crumbs($category['left_id'], $category['right_id']);
for ($i = 0; $i < count($crumbs); $i++)
Expand Down
2 changes: 1 addition & 1 deletion buy_now.php
Expand Up @@ -151,7 +151,7 @@
{
$ERR = $ERR_711;
}
// check qty
// check auction still has items left to buy
if (isset($qty) && $qty > $Auction['quantity'])
{
$ERR = $ERR_608;
Expand Down
16 changes: 9 additions & 7 deletions cron.php
Expand Up @@ -108,6 +108,7 @@
// send email to seller - to notify him
// create a "report" to seller depending of what kind auction is
$atype = intval($Auction['auction_type']);
// Standard auction
if ($atype == 1)
{
if ($num_bids > 0 && ($Auction['current_bid'] >= $Auction['reserve_price'] || $Auction['sold'] == 's'))
Expand All @@ -118,7 +119,6 @@
$winner_present = true;
}

// Standard auction
if ($winner_present)
{
$report_text = $Winner['nick'] . "\n";
Expand All @@ -139,8 +139,9 @@
}

// Add winner's data to "winners" table
$query = "INSERT INTO " . $DBPrefix . "winners VALUES
(NULL, :auc_id, :seller_id, :winner_id, :current_bid, :time, 0, 0, 1, 0, :bf_paid, :ff_paid)";
$query = "INSERT INTO " . $DBPrefix . "winners
(auction, seller, winner, bid, closingdate, feedback_win, feedback_sel, qty, paid, bf_paid, ff_paid, shipped) VALUES
(:auc_id, :seller_id, :winner_id, :current_bid, :time, 0, 0, 1, 0, :bf_paid, :ff_paid, 0)";
$params = array();
$params[] = array(':auc_id', $Auction['id'], 'int');
$params[] = array(':seller_id', $Seller['id'], 'int');
Expand All @@ -156,9 +157,9 @@
$report_text = $MSG['429'];
}
}
else
// Dutch Auction
elseif ($atype == 2)
{
// Dutch Auction
// find out winners sorted by bid
$query = "SELECT *, MAX(bid) AS maxbid
FROM " . $DBPrefix . "bids WHERE auction = :auc_id GROUP BY bidder
Expand Down Expand Up @@ -220,8 +221,9 @@
}

// Add winner's data to "winners" table
$query = "INSERT INTO " . $DBPrefix . "winners VALUES
(NULL, :auc_id, :seller_id, :winner_id, :current_bid, :time, 0, 0, :items_got, 0, :bf_paid, :ff_paid)";
$query = "INSERT INTO " . $DBPrefix . "winners
(auction, seller, winner, bid, closingdate, feedback_win, feedback_sel, qty, paid, bf_paid, ff_paid, shipped) VALUES
(:auc_id, :seller_id, :winner_id, :current_bid, :time, 0, 0, :items_got, 0, :bf_paid, :ff_paid, 0)";
$params = array();
$params[] = array(':auc_id', $Auction['id'], 'int');
$params[] = array(':seller_id', $Seller['id'], 'int');
Expand Down
5 changes: 5 additions & 0 deletions docs/changes.txt
Expand Up @@ -10,5 +10,10 @@
- Fixed shipping fee not being added to cost of item (Bug #454)
- Fixed link in pay.php to contact seller (Bug #445) (Thanks pani100)
- Fixed admin invoices view
- Fixed browse categories header name
- Added admin warnings for if fees are not set up correctly
- Added confirmation notices when you do an action in user control panel
- Moved the add new news button in admin so its visable
- Fixed buy it now not setting an auction to close if all item have been purchased

for older changes check out http://www.webidsupport.com/wiki/Change_Log
2 changes: 1 addition & 1 deletion inc/captcha/securimage.php
Expand Up @@ -86,7 +86,7 @@ class Securimage {
*
* @var int
*/
var $image_width = 175;
var $image_width = 250;

/**
* The desired width of the CAPTCHA image.
Expand Down
2 changes: 1 addition & 1 deletion includes/class_MPTTcategories.php
Expand Up @@ -484,7 +484,7 @@ function build_sql($data)
}
else
{
$data[$k] = '`' . $k . '` = \'' . mysql_real_escape_string($v) . '\'';
$data[$k] = '`' . $k . '` = \'' . $v . '\'';
}
}
return implode(', ', $data);
Expand Down

0 comments on commit 061c2ba

Please sign in to comment.