status != "approved" && USERID !=$image->user_id && !ISADMIN) { $smarty->assign("error","You can not view this non approved image."); $smarty->display(TEMPLATE_DIR . "gallery_template.tpl.smrt"); die(); } if ($submit && $vote = nBase::get_value("vote", $_GET, NULL, 0, 1)) { if (!USERID) { $smarty->assign("error","You must be logged in as a registered user to vote on an image."); } elseif ($image->user_id == USERID) { $smarty->assign("error","You can not vote for a case you own."); } else { db_save_image_vote($image_id, USERID, $vote); $smarty->assign("message","Vote Accepted.
"); // need to reupdate vote fields $image = db_get_image($image_id); } } // we want to add next/previous buttons and thumbnails for images if (!$single) { $closelimit = $limit - 2; if ($closelimit < 0) { $closelimit = 0; } list ($closeimages, $imagenum) = db_get_images($image->type, 0, $closelimit, $order); } if ($image->rank - floor($image->rank) > .5) { $rank_image = "rank_" . floor($image->rank) . "_5.jpg"; } else { $rank_image = "rank_" . floor($image->rank) . "_0.jpg"; } $smarty->assign("rank_image", $rank_image); $smarty->assign("CASEDISPLAY", true); $smarty->assign("limit",$limit); $smarty->assign("page",floor($limit/20) + 1); $smarty->assign("order",$order); $smarty->assign("closelimit",$closelimit); $smarty->assign("closeimages",$closeimages); $smarty->assign("single",$single); $smarty->assign("image", $image); $smarty->assign("PAGETITLE","View Gallery Images"); $smarty->assign("page_tpl",TEMPLATE_DIR . "gallery/view_gallery_images.tpl.smrt"); $smarty->display(TEMPLATE_DIR . "gallery_template.tpl.smrt");