Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules
Author Message
kenspa
Hangin' Around



Joined: Sep 24, 2005
Posts: 48
Location: Spain

PostPosted: Wed Nov 04, 2015 6:23 am Reply with quote

Hi
I am using video stream mod v 4.5 on raven nuke 2.51, All is ok except for the rating system, it won't trigger "You have alreadyvoted.."
Here goes the rate.php:

php Code:
if(!defined('MODULE_FILE')) { die("Illegal File Access Detected!!"); }

if(($ratingV == 1) && ($looker == "Anonymous")) {
echo ""._REGRATE."";
} else {
$rate = $_GET['rate'];
$id = $_GET['id'];
$vsratingcookie = $HTTP_COOKIE_VARS["video_stream_rating"];
$vsratingcookie = explode(':', $vsratingcookie);
if($rate != "1" && $rate != "2" && $rate != "3" && $rate != "4" && $rate != "5") {
echo "Error in voting!!";
} else {
if(array_search($id, $vsratingcookie) !== false) {
echo "You have already voted for this video";
} else {
$result = $db->sql_query("SELECT rates, rating FROM ".$prefix."_video_stream WHERE id='$id'");
$row = $db->sql_fetchrow($result);
$rates = $row['rates'];
$rating = $row['rating'];

$rates++;
$rating += $rate;

userpointsVS(5);
$result = $db->sql_query("UPDATE ".$prefix."_video_stream SET rates='$rates', rating='$rating' WHERE id='$id'");
$vsratingcookie = implode(':', $vsratingcookie);
$vsratingcookie = $vsratingcookie.":".$id;
//setcookie("video_stream_rating", $vsratingcookie, time()+(60*60*24*356));
setcookie("video_stream_rating", $vsratingcookie, time()+(60*60));
echo "<font color=\"#FF0000\">"._TYRATE."!!</font>";
}
}
}

?>




I've checked the cookie part in watch.php:

php Code:
if($ratingED == 1) {

if(($ratingED == 1) && !(($ratingV == 1) && ($looker == "Anonymous"))) {
//Check for Prev rating
$vsratingcookie = $HTTP_COOKIE_VARS["video_stream_rating"];
$vsratingcookie = explode(':', $vsratingcookie);
if(array_search($id, $vsratingcookie) !== false) {
echo "You have already voted for this video\n";
} else {


but I came to nothing
Any thoughts??
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Thu Nov 05, 2015 1:22 pm Reply with quote

$HTTP_COOKIE_VARS is deprecated in php5 and that could be the reason why it will not work.

Try to use: $_COOKIE["video_stream_rating"] instead of $HTTP_COOKIE_VARS["video_stream_rating"] but i guess there is much more to do to solve the issue on this old module.

_________________
Github: RavenNuke 
View user's profile Send private message
kenspa







PostPosted: Fri Nov 06, 2015 9:26 am Reply with quote

Cheers Neralex. Changing this all around the scripts made the trick. Wink
I've been tweaking this mod for 2 months so far, it Works great although it's not fully compliant!!
Thanks for your help, I really appreciate it!!
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Fri Nov 06, 2015 9:44 am Reply with quote

U will need to make changes as well in function.php

Code:
$disclaimersigned = $HTTP_COOKIE_VARS["vs_disclaimer"];


replace it with

Code:
$disclaimersigned = $_COOKIE["vs_disclaimer"];
 
View user's profile Send private message
kenspa







PostPosted: Fri Nov 06, 2015 9:54 am Reply with quote

I've already changed it in functions.php, and still looking for more deprecated stuff around all files. Thank you so much for your reply !!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©