Skip to content
Permalink
Browse files

fixed #60: error msg after returning to mytop5 via browser-back

  • Loading branch information...
following
following committed May 4, 2013
1 parent 3dfe45a commit 19d1c3bfcb8fe3fd22ce7f04acdfaf01bfa3dcf7
Showing with 15 additions and 7 deletions.
  1. +15 −7 htdocs/mytop5.php
@@ -22,13 +22,21 @@
$cache_id = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid']+0 : 0;
sql("DELETE FROM `cache_rating` WHERE `cache_id`='&1' AND `user_id`='&2'", $cache_id, $login->userid);
if (sql_affected_rows() == 0)
$tpl->error(ERROR_UNKNOWN);
$rs = sql("SELECT `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `cachename` FROM `caches` WHERE `caches`.`cache_id`='&1'", $cache_id);
$deletedItem = sql_fetch_assoc($rs);
$tpl->assign('deleted', true);
$tpl->assign('deletedItem', $deletedItem);
sql_free_result($rs);
{
// will happen if
// 1. we delete a recommendation
// 2. we view another recommended cache
// 3. we return to mytop5 via browser "back" button
// -> ignore
}
else
{
$rs = sql("SELECT `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `cachename` FROM `caches` WHERE `caches`.`cache_id`='&1'", $cache_id);
$deletedItem = sql_fetch_assoc($rs);
$tpl->assign('deleted', true);
$tpl->assign('deletedItem', $deletedItem);
sql_free_result($rs);
}
}
$rs = sql("SELECT `cache_rating`.`cache_id` AS `cacheid`, `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `cachename`, `caches`.`type` AS `type`, `caches`.`status` AS `status`

0 comments on commit 19d1c3b

Please sign in to comment.
You can’t perform that action at this time.