Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Looking for work? Have a job and looking for that right person to fill your position? Post your resumes and open positions here! Does your company provide a service that the industry needs? Post your service here. Video Editing, blog writing, encoding, programming, the works.

 
Thread Tools
Old 12-17-2011, 12:37 PM   #1
Danmixz
Confirmed User
 
Industry Role:
Join Date: Sep 2010
Posts: 649
php programmer for quick fix

Anyone can fix this files for a quick $10 ??

Notice: Undefined variable: paid in /home/xxx/public_html/xxx/video.php on line 172

Notice: Undefined variable: paid in /home/xxx/public_html/xxx/video.php on line 206

PHP Code:
<?phpdefine('_VALID', true);require 'include/config.php';require 'include/function_global.php';require 'include/function_smarty.php';require 'classes/pagination.class.php';if ( $config['video_view'] == 'registered' ) {    require 'classes/auth.class.php';    Auth::check();}$pay = false;$vid = get_request_arg('video');if ( !$vid ) {    VRedirect::go($config['BASE_URL']. '/error/video_missing');}$active     = ( $config['approve'] == '1' ) ? " AND v.active = '1'" : NULL;$sql        = "SELECT v.VID, v.UID, v.title, v.channel, v.keyword, v.viewnumber, v.type,                      v.addtime, v.rate, v.ratedby, v.flvdoname, v.space, v.embed_code, v.width_sd, v.height_sd,v.hd,                      u.username, u.fname, v.credits               FROM video AS v, signup AS u WHERE v.VID = " .$vid. " AND v.UID = u.UID" .$active. " LIMIT 1";$rs         = $conn->execute($sql);if ( $conn->Affected_Rows() != 1 ) {    VRedirect::go($config['BASE_URL']. '/error/video_missing');}$hd = $rs->fields['hd'];$video_width        = $rs->fields['width_sd'];$video_height       = $rs->fields['height_sd'];$credits            = $rs->fields['credits'];$vid_uid            = $rs->fields['UID'];$player_width = 630;if ($hd==0)     {        $autoheight = round(630 * ($video_height/$video_width) + 22);        $player_width = 630;    }if ($hd==1)     {        $autoheight = round(960 * ($video_height/$video_width) + 22);        $player_width = 960;    }$video              = $rs->getrows();$video              = $video['0'];$guest_limit        = false;if ( !isset($_SESSION['uid']) && $config['guest_limit'] == '1' ) {    $remote_ip = ip2long($remote_ip);    require $config['BASE_DIR']. '/classes/bandwidth.class.php';    $guest_limit = VBandwidth::check($remote_ip, intval($video['space']));}$video['keyword']   = explode(' ', $video['keyword']);$uid                = ( isset($_SESSION['uid']) ) ? intval($_SESSION['uid']) : NULL;$is_friend          = true;if ( $video['type'] == 'private' && $uid != $video['UID'] ) {    $sql = "SELECT FID FROM friends            WHERE ((UID = " .intval($video['UID']). " AND FID = " .$uid. ")            OR (UID = " .$uid. " AND FID = " .intval($video['UID']). "))            AND status = 'Confirmed'            LIMIT 1";    $conn->execute($sql);    if ( $conn->Affected_Rows() == 0 ) {        $is_friend = false;    }}$sql        = "UPDATE video SET viewnumber = viewnumber+1, viewtime='" .date('Y-m-d H:i:s'). "' WHERE VID = " .$vid. " LIMIT 1";$conn->execute($sql);$sql        = "UPDATE signup SET video_viewed = video_viewed+1 WHERE UID = " .intval($video['UID']). " LIMIT 1";$conn->execute($sql);if ( isset($_SESSION['uid']) ) {    $sql    = "UPDATE signup SET watched_video = watched_video+1 WHERE UID = " .$uid. " LIMIT 1";    $conn->execute($sql);    $sql    = "SELECT UID FROM playlist WHERE UID = " .$uid. " AND VID = " .$vid. " LIMIT 1";    $conn->execute($sql);    if ( $conn->Affected_Rows() == 0 ) {        $sql    = "INSERT INTO playlist SET UID = '" .$uid. "' , VID = '" .$vid. "'";        $conn->execute($sql);    }}$sql_add        = NULL;if ( $video['keyword'] ) {    $sql_add   .= " OR (";    $sql_or     = NULL;        foreach ( $video['keyword'] as $keyword ) {        $sql_add .= $sql_or. " keyword LIKE '%" .mysql_real_escape_string($keyword). "%'";        $sql_or   = " OR ";    }    $sql_add   .= ")";}$sql_at     = NULL;$sql_delim  = ' WHERE';if ( $config['show_private_videos'] == '0' ) {    $sql_at    .= $sql_delim. " type = 'public'";    $sql_delim  = ' AND';}if ( $config['approve'] == '1' ) {    $sql_at    .= $sql_delim. " active = '1'";    $sql_delim  = ' AND';}$sql_at        .= $sql_delim;$sql            = "SELECT COUNT(VID) AS total_videos FROM video" .$sql_at. " channel = '" .$video['channel']. "' AND VID != " .$vid. "                   AND ( title LIKE '%" .mysql_real_escape_string($video['title']). "%' " .$sql_add. ")";$rsc            = $conn->execute($sql);$total_related  = $rsc->fields['total_videos'];if ( $total_related > 30 ) {    $total_related = 30;}$pagination     = new Pagination(10, 'p_related_videos_' .$video['VID']. '_');$limit          = $pagination->getLimit($total_related);$sql            = "SELECT VID, title, duration, addtime, rate, viewnumber, type, thumb, thumbs FROM video                   WHERE active = '1' AND channel = '" .$video['channel']. "' AND VID != " .$vid. "                   AND ( title LIKE '%" .mysql_real_escape_string($video['title']). "%' " .$sql_add. ")                   ORDER BY addtime DESC LIMIT " .$limit;$rs             = $conn->execute($sql);$videos         = $rs->getrows();$page_link      = $pagination->getPagination('video');$sql            = "SELECT COUNT(CID) AS total_comments FROM video_comments WHERE VID = " .$vid. " AND status = '1'";$rsc            = $conn->execute($sql);$total_comments = $rsc->fields['total_comments'];$pagination     = new Pagination(10);$limit          = $pagination->getLimit($total_comments);$sql            = "SELECT c.CID, c.UID, c.comment, c.addtime, s.username, s.photo, s.gender                   FROM video_comments AS c, signup AS s                    WHERE c.VID = " .$vid. " AND c.status = '1' AND c.UID = s.UID                    ORDER BY c.addtime DESC LIMIT " .$limit;$rs             = $conn->execute($sql);$comments       = $rs->getrows();$page_link_c    = $pagination->getPagination('video', 'p_video_comments_' .$video['VID']. '_');$page_link_cb   = $pagination->getPagination('video', 'pp_video_comments_' .$video['VID']. '_');$start_num      = $pagination->getStartItem();$end_num        = $pagination->getEndItem();$self_title         = $video['title'] . $seo['video_title'];$self_description   = $video['title'] . $seo['video_desc'];$self_keywords      = implode(', ', $video['keyword']) . $seo['video_keywords'];//var_dump($video);if($credits != 0 && $vid_uid!=$uid){    $sql = mysql_query("SELECT * FROM credits_transfer WHERE FROM_UID='$uid' AND VIDEO_ID='$vid'");    if(mysql_num_rows($sql)==1){        $paid = true;            } } else {    $paid = false;}   if($credits == 0){    $paid = true;}   $errors = array();if(isset($_POST['paynow'])){    //echo 'work!';}if($paid == false){    if(isset($users_credits)){        if($credits > $users_credits){            $errors[] = 'Not enough credits for this action. Visit credits page from your profile to charge up your account!';        }           } else {        $errors[] = 'You need to login before you can watch this video';    }   }$smarty->assign('errors',$errors);$smarty->assign('messages',$messages);$smarty->assign('menu', 'videos');$smarty->assign('submenu', '');$smarty->assign('view', true);$smarty->assign('autoheight',$autoheight);$smarty->assign('player_width',$player_width);$smarty->assign('hd',$hd);$smarty->assign('video', $video);$smarty->assign('self_title', $self_title);$smarty->assign('self_description', $self_description);$smarty->assign('self_keywords', $self_keywords);$smarty->assign('videos_total', $total_related);$smarty->assign('videos', $videos);$smarty->assign('page_link', $page_link);$smarty->assign('comments_total', $total_comments);$smarty->assign('comments', $comments);$smarty->assign('page_link_comments', $page_link_c);$smarty->assign('page_link_comments_bottom', $page_link_cb);$smarty->assign('start_num', $start_num);$smarty->assign('end_num', $end_num);$smarty->assign('is_friend', $is_friend);$smarty->assign('guest_limit', $guest_limit);$smarty->assign('credits',$credits);$smarty->assign('paid',$paid);$smarty->display('header.tpl');$smarty->display('errors.tpl');$smarty->display('messages.tpl');$smarty->display('video.tpl');$smarty->display('footer.tpl');$smarty->gzip_encode();?>
__________________
Danmixz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-17-2011, 04:27 PM   #2
Nevet
Registered User
 
Industry Role:
Join Date: Dec 2011
Posts: 10
It's being caused by a bit of faulty logic. Look at the block that starts:

PHP Code:
if($credits != && $vid_uid!=$uid) { 
That, and the other two conditionals, create a situation where sometimes "paid" could be undefined. Quick fix: put the following in front of the above line:

PHP Code:
$paid false
The code is somewhat shaky in a couple of other places as well.
Nevet is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-17-2011, 04:41 PM   #3
blackmonsters
Yo Mamma!
 
blackmonsters's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 19,917
Quote:
Originally Posted by Danmixz View Post
Anyone can fix this files for a quick $10 ??

Notice: Undefined variable: paid in /home/xxx/public_html/xxx/video.php on line 172

Notice: Undefined variable: paid in /home/xxx/public_html/xxx/video.php on line 206

PHP Code:
<?phpdefine('_VALID', true);require 'include/config.php';require 'include/function_global.php';require 'include/function_smarty.php';require 'classes/pagination.class.php';if ( $config['video_view'] == 'registered' ) {    require 'classes/auth.class.php';    Auth::check();}$pay = false;$vid = get_request_arg('video');if ( !$vid ) {    VRedirect::go($config['BASE_URL']. '/error/video_missing');}$active     = ( $config['approve'] == '1' ) ? " AND v.active = '1'" : NULL;$sql        = "SELECT v.VID, v.UID, v.title, v.channel, v.keyword, v.viewnumber, v.type,                      v.addtime, v.rate, v.ratedby, v.flvdoname, v.space, v.embed_code, v.width_sd, v.height_sd,v.hd,                      u.username, u.fname, v.credits               FROM video AS v, signup AS u WHERE v.VID = " .$vid. " AND v.UID = u.UID" .$active. " LIMIT 1";$rs         = $conn->execute($sql);if ( $conn->Affected_Rows() != 1 ) {    VRedirect::go($config['BASE_URL']. '/error/video_missing');}$hd = $rs->fields['hd'];$video_width        = $rs->fields['width_sd'];$video_height       = $rs->fields['height_sd'];$credits            = $rs->fields['credits'];$vid_uid            = $rs->fields['UID'];$player_width = 630;if ($hd==0)     {        $autoheight = round(630 * ($video_height/$video_width) + 22);        $player_width = 630;    }if ($hd==1)     {        $autoheight = round(960 * ($video_height/$video_width) + 22);        $player_width = 960;    }$video              = $rs->getrows();$video              = $video['0'];$guest_limit        = false;if ( !isset($_SESSION['uid']) && $config['guest_limit'] == '1' ) {    $remote_ip = ip2long($remote_ip);    require $config['BASE_DIR']. '/classes/bandwidth.class.php';    $guest_limit = VBandwidth::check($remote_ip, intval($video['space']));}$video['keyword']   = explode(' ', $video['keyword']);$uid                = ( isset($_SESSION['uid']) ) ? intval($_SESSION['uid']) : NULL;$is_friend          = true;if ( $video['type'] == 'private' && $uid != $video['UID'] ) {    $sql = "SELECT FID FROM friends            WHERE ((UID = " .intval($video['UID']). " AND FID = " .$uid. ")            OR (UID = " .$uid. " AND FID = " .intval($video['UID']). "))            AND status = 'Confirmed'            LIMIT 1";    $conn->execute($sql);    if ( $conn->Affected_Rows() == 0 ) {        $is_friend = false;    }}$sql        = "UPDATE video SET viewnumber = viewnumber+1, viewtime='" .date('Y-m-d H:i:s'). "' WHERE VID = " .$vid. " LIMIT 1";$conn->execute($sql);$sql        = "UPDATE signup SET video_viewed = video_viewed+1 WHERE UID = " .intval($video['UID']). " LIMIT 1";$conn->execute($sql);if ( isset($_SESSION['uid']) ) {    $sql    = "UPDATE signup SET watched_video = watched_video+1 WHERE UID = " .$uid. " LIMIT 1";    $conn->execute($sql);    $sql    = "SELECT UID FROM playlist WHERE UID = " .$uid. " AND VID = " .$vid. " LIMIT 1";    $conn->execute($sql);    if ( $conn->Affected_Rows() == 0 ) {        $sql    = "INSERT INTO playlist SET UID = '" .$uid. "' , VID = '" .$vid. "'";        $conn->execute($sql);    }}$sql_add        = NULL;if ( $video['keyword'] ) {    $sql_add   .= " OR (";    $sql_or     = NULL;        foreach ( $video['keyword'] as $keyword ) {        $sql_add .= $sql_or. " keyword LIKE '%" .mysql_real_escape_string($keyword). "%'";        $sql_or   = " OR ";    }    $sql_add   .= ")";}$sql_at     = NULL;$sql_delim  = ' WHERE';if ( $config['show_private_videos'] == '0' ) {    $sql_at    .= $sql_delim. " type = 'public'";    $sql_delim  = ' AND';}if ( $config['approve'] == '1' ) {    $sql_at    .= $sql_delim. " active = '1'";    $sql_delim  = ' AND';}$sql_at        .= $sql_delim;$sql            = "SELECT COUNT(VID) AS total_videos FROM video" .$sql_at. " channel = '" .$video['channel']. "' AND VID != " .$vid. "                   AND ( title LIKE '%" .mysql_real_escape_string($video['title']). "%' " .$sql_add. ")";$rsc            = $conn->execute($sql);$total_related  = $rsc->fields['total_videos'];if ( $total_related > 30 ) {    $total_related = 30;}$pagination     = new Pagination(10, 'p_related_videos_' .$video['VID']. '_');$limit          = $pagination->getLimit($total_related);$sql            = "SELECT VID, title, duration, addtime, rate, viewnumber, type, thumb, thumbs FROM video                   WHERE active = '1' AND channel = '" .$video['channel']. "' AND VID != " .$vid. "                   AND ( title LIKE '%" .mysql_real_escape_string($video['title']). "%' " .$sql_add. ")                   ORDER BY addtime DESC LIMIT " .$limit;$rs             = $conn->execute($sql);$videos         = $rs->getrows();$page_link      = $pagination->getPagination('video');$sql            = "SELECT COUNT(CID) AS total_comments FROM video_comments WHERE VID = " .$vid. " AND status = '1'";$rsc            = $conn->execute($sql);$total_comments = $rsc->fields['total_comments'];$pagination     = new Pagination(10);$limit          = $pagination->getLimit($total_comments);$sql            = "SELECT c.CID, c.UID, c.comment, c.addtime, s.username, s.photo, s.gender                   FROM video_comments AS c, signup AS s                    WHERE c.VID = " .$vid. " AND c.status = '1' AND c.UID = s.UID                    ORDER BY c.addtime DESC LIMIT " .$limit;$rs             = $conn->execute($sql);$comments       = $rs->getrows();$page_link_c    = $pagination->getPagination('video', 'p_video_comments_' .$video['VID']. '_');$page_link_cb   = $pagination->getPagination('video', 'pp_video_comments_' .$video['VID']. '_');$start_num      = $pagination->getStartItem();$end_num        = $pagination->getEndItem();$self_title         = $video['title'] . $seo['video_title'];$self_description   = $video['title'] . $seo['video_desc'];$self_keywords      = implode(', ', $video['keyword']) . $seo['video_keywords'];//var_dump($video);if($credits != 0 && $vid_uid!=$uid){    $sql = mysql_query("SELECT * FROM credits_transfer WHERE FROM_UID='$uid' AND VIDEO_ID='$vid'");    if(mysql_num_rows($sql)==1){        $paid = true;            } } else {    $paid = false;}   if($credits == 0){    $paid = true;}   $errors = array();if(isset($_POST['paynow'])){    //echo 'work!';}if($paid == false){    if(isset($users_credits)){        if($credits > $users_credits){            $errors[] = 'Not enough credits for this action. Visit credits page from your profile to charge up your account!';        }           } else {        $errors[] = 'You need to login before you can watch this video';    }   }$smarty->assign('errors',$errors);$smarty->assign('messages',$messages);$smarty->assign('menu', 'videos');$smarty->assign('submenu', '');$smarty->assign('view', true);$smarty->assign('autoheight',$autoheight);$smarty->assign('player_width',$player_width);$smarty->assign('hd',$hd);$smarty->assign('video', $video);$smarty->assign('self_title', $self_title);$smarty->assign('self_description', $self_description);$smarty->assign('self_keywords', $self_keywords);$smarty->assign('videos_total', $total_related);$smarty->assign('videos', $videos);$smarty->assign('page_link', $page_link);$smarty->assign('comments_total', $total_comments);$smarty->assign('comments', $comments);$smarty->assign('page_link_comments', $page_link_c);$smarty->assign('page_link_comments_bottom', $page_link_cb);$smarty->assign('start_num', $start_num);$smarty->assign('end_num', $end_num);$smarty->assign('is_friend', $is_friend);$smarty->assign('guest_limit', $guest_limit);$smarty->assign('credits',$credits);$smarty->assign('paid',$paid);$smarty->display('header.tpl');$smarty->display('errors.tpl');$smarty->display('messages.tpl');$smarty->display('video.tpl');$smarty->display('footer.tpl');$smarty->gzip_encode();?>
Try this :

Declare $paid to false at the very top of the code :

Quote:
<?php
$paid = false;

The rest of the code...
__________________
Camsoda pays :
Become a Cam Model or Sign up as a Webmaster

Last edited by blackmonsters; 12-17-2011 at 04:42 PM..
blackmonsters is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.