mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
Rating and Comments. Like and Dislike buttons are now functional.
This commit is contained in:
35
rate.php
35
rate.php
@@ -42,11 +42,36 @@ if(!e_AJAX_REQUEST) // Legacy method.
|
||||
exit;
|
||||
}
|
||||
else // Ajax Used.
|
||||
{
|
||||
$table = $tp->toDB($_POST['table']);
|
||||
$itemid = intval($_POST['id']);
|
||||
$rate = intval($_POST['score']) * 2;
|
||||
echo e107::getRate()->submitVote($table,$itemid,$rate);
|
||||
{
|
||||
if($_POST['mode'] == 'thumb')
|
||||
{
|
||||
if(vartrue($_GET['type']) !='up' && vartrue($_GET['type']) !='down')
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
$table = $tp->toDB($_GET['table']);
|
||||
$itemid = intval($_GET['id']);
|
||||
$type = $_GET['type'];
|
||||
|
||||
if($result = e107::getRate()->submitLike($table,$itemid,$type))
|
||||
{
|
||||
echo $result;
|
||||
}
|
||||
else // already liked/disliked
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
elseif($_POST['table'])
|
||||
{
|
||||
$table = $tp->toDB($_POST['table']);
|
||||
$itemid = intval($_POST['id']);
|
||||
$rate = intval($_POST['score']) * 2;
|
||||
echo e107::getRate()->submitVote($table,$itemid,$rate);
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user