121 lines
4.9 KiB
PHP
121 lines
4.9 KiB
PHP
<?php
|
|
|
|
|
|
|
|
/* $Id: user_report.php 42 2009-01-29 04:55:14Z john $ */
|
|
|
|
|
|
|
|
include "header.php";
|
|
|
|
$page = "user_list";
|
|
|
|
|
|
if(isset($_POST['task'])) { $task = $_POST['task']; } else { $task = "main"; }
|
|
if(isset($_POST['favorites'])) { $favorites = $_POST['favorites']; } elseif(isset($_GET['favorites'])) { $favorites = $_GET['favorites']; } else { $favorites = ""; }
|
|
|
|
|
|
if(isset($_POST['return_url'])) { $return_url = $_POST['return_url']; } elseif(isset($_GET['return_url'])) { $return_url = $_GET['return_url']; } else { $return_url = ""; }
|
|
if(isset($_POST['list'])) { $list = $_POST['list']; } elseif(isset($_GET['list'])) { $list = $_GET['list']; } else { $list = ""; }
|
|
if(isset($_POST['type'])) { $type = $_POST['type']; } elseif(isset($_GET['type'])) { $type = $_GET['type']; } else { $type = ""; }
|
|
if($type=="video"){
|
|
if(isset($_POST['objectid'])) { $objectid = $_POST['objectid']; } elseif(isset($_GET['objectid'])) { $objectid = $_GET['objectid']; } else { $objectid = $_GET["video_id"]; }
|
|
|
|
if(isset($_POST['ownerid'])) { $ownerid = $_POST['ownerid']; } elseif(isset($_GET['ownerid'])) { $ownerid = $_GET['ownerid']; } else { $ownerid = $owner->user_info["user_id"]; }
|
|
}
|
|
if($type=="groupvideo"){
|
|
if(isset($_POST['objectid'])) { $objectid = $_POST['objectid']; } elseif(isset($_GET['objectid'])) { $objectid = $_GET['objectid']; } else { $objectid = $_GET["video_id"]; }
|
|
if(isset($_POST['ownerid'])) { $ownerid = $_POST['ownerid']; } elseif(isset($_GET['ownerid'])) { $ownerid = $_GET['ownerid']; } else { $ownerid = $_GET["group_id"]; }
|
|
|
|
}
|
|
if($type=="photo"){
|
|
if(isset($_POST['objectid'])) { $objectid = $_POST['objectid']; } elseif(isset($_GET['objectid'])) { $objectid = $_GET['objectid']; } else { $objectid = $_GET["media_id"]; }
|
|
if(isset($_POST['ownerid'])) { $ownerid = $_POST['ownerid']; } elseif(isset($_GET['ownerid'])) { $ownerid = $_GET['ownerid']; } else { $ownerid = $owner->user_info["user_id"]; }
|
|
|
|
}
|
|
if($type=="groupphoto"){
|
|
if(isset($_POST['objectid'])) { $objectid = $_POST['objectid']; } elseif(isset($_GET['objectid'])) { $objectid = $_GET['objectid']; } else { $objectid = $_GET["groupmedia_id"]; }
|
|
if(isset($_POST['ownerid'])) { $ownerid = $_POST['ownerid']; } elseif(isset($_GET['ownerid'])) { $ownerid = $_GET['ownerid']; } else { $ownerid = $_GET["group_id"]; }
|
|
|
|
}
|
|
if(isset($_POST['list'])) { $batelistid = $_POST['list']; } elseif(isset($_GET['list'])) { $batelistid = $_GET['list']; } else { $batelistid = ""; }
|
|
|
|
// EXIT IF USER IS NOT LOGGED IN
|
|
|
|
if( !$user->user_exists ) { exit(); }
|
|
|
|
|
|
|
|
// MAKE SURE RETURN URL IS SET
|
|
|
|
//if($return_url == "") { exit(); }
|
|
|
|
if(isset($_POST["list"])||$favorites=="addto"){
|
|
|
|
if($_POST["list"]=="favorites"||$favorites=="addto")
|
|
{
|
|
//mail("leprakhauns@gmail.com", "AAA", "SELECT * FROM favorites WHERE user='".$user->user_info["user_id"]."' AND type='".$type."' AND owner='".$owner->user_info["user_id"]."' AND objectid='".$objectid."'");
|
|
|
|
$query=$database->database_query("SELECT * FROM favorites WHERE user='".$user->user_info["user_id"]."' AND type='".$database->database_real_escape_string($type)."' AND owner='".$database->database_real_escape_string($ownerid)."' AND objectid='".$database->database_real_escape_string($objectid)."'");
|
|
|
|
if($database->database_num_rows($query)==0){
|
|
$database->database_query("INSERT INTO favorites SET user='".$user->user_info["user_id"]."', type='".$database->database_real_escape_string($type)."', owner='".$database->database_real_escape_string($ownerid)."', objectid='".$database->database_real_escape_string($objectid)."'");
|
|
}
|
|
}
|
|
else{if($_POST["list"]!=""){
|
|
$query=$database->database_query("SELECT * FROM batelist WHERE id='".$database->database_real_escape_string($batelistid)."' AND userid='".$user->user_info["user_id"]."'");
|
|
if($database->database_num_rows($query)==0){exit;}
|
|
$database->database_query("INSERT INTO batelistcontent SET batelistid='".$database->database_real_escape_string($batelistid)."', type='".$database->database_real_escape_string($type)."', owner='".$database->database_real_escape_string($ownerid)."', objectid='".$database->database_real_escape_string($objectid)."'");
|
|
|
|
}}
|
|
}
|
|
|
|
|
|
// ENCODE RETURN URL
|
|
|
|
$return_url = urldecode($return_url);
|
|
|
|
$return_url = str_replace("&", "&", $return_url);
|
|
|
|
|
|
|
|
// SET VARS
|
|
|
|
$submitted = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function batelistoptions()
|
|
{
|
|
global $database, $type, $owner, $user;
|
|
if($type=="groupvideo"||$type=="introvideo"||$type=="video")
|
|
{
|
|
$query=$database->database_query("SELECT * FROM batelist WHERE type='1' AND userid='".$user->user_info["user_id"]."'");
|
|
|
|
}
|
|
else{ $query=$database->database_query("SELECT * FROM batelist WHERE type='2' AND userid='".$user->user_info["user_id"]."'");}
|
|
while($row=$database->database_fetch_array($query))
|
|
{
|
|
?><option value="<?php echo $row["id"];?>"><?php echo $row["name"];?></option>
|
|
<?php
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ASSIGN SMARTY VARIABLES AND INCLUDE FOOTER
|
|
$smarty->assign('type', $type);
|
|
$smarty->assign('list', $list);
|
|
$smarty->assign('objectid', $objectid);
|
|
$smarty->assign('ownerid', $ownerid);
|
|
|
|
include "footer.php";
|
|
|
|
?>
|