File: /home/httpd/html/baretube.com/admin/unassigned_content.php
<?
require "header.php";
if($_POST['list']) {
foreach($_POST['list'] as $i) {
if(is_numeric($i)) {
if($_POST[action] == 'remove') {
mysql_query("UPDATE content SET pornstartmp = '' WHERE record_num = '$i'");
}
if($_POST[action] == 'setpornstar') {
mysql_query("INSERT INTO content_pornstars (content, pornstar) VALUES ('$i','$_POST[setpornstar]')");
mysql_query("UPDATE content SET pornstartmp = '' WHERE record_num = '$i'");
}
}
}
}
?>
<?php
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
?>
<script language="javascript">
function processList(spanid) {
if(spanid == 'setpornstar') {
document.getElementById('setpornstar').style.display = 'inline-block';
document.getElementById('setchannel').style.display = 'none';
document.getElementById('setchannelwarning').style.display = 'none';
}
else {
document.getElementById('setpornstar').style.display = 'none';
document.getElementById('setchannel').style.display = 'none';
document.getElementById('setchannelwarning').style.display = 'none';
}
}
</script>
<div id="right_column">
<div id="right_top">
<div id="right_home"></div>
<div id="right_right">
<a href="index.php">Admin Home</a>
<span><a href="unassigned_content.php">Unassigned Content</a></span>
</div>
</div>
<div id="right_bg">
<h2>Unassigned<strong>Content</strong></h2>
<p>This is content that is not assigned to any pornstar. Removing the video here does not remove it from the database, it simply removes it from this list.</p>
<div id="index_left" style='width: 100%;'>
<p><? echo $error; ?></p>
<form id="form1" name="form1" method="post" action="">
<?
if(!isset($_GET['page']) || $_GET[page] == '') {
$page = 1;
} else {
$page = $_GET['page'];
}
if(!is_numeric($_GET[setmax])) { $max_results = 100; } else { $max_results = $_GET[setmax]; }
$from = (($page * $max_results) - $max_results);
$bgcolor = '#ffffff';
$q = "SELECT content.* FROM content WHERE pornstartmp != '' ORDER BY encoded_date DESC LIMIT $from,$max_results";
//echo $q;
$result_count = mysql_query("SELECT content.record_num FROM content WHERE pornstartmp != ''") or die(mysql_error());
$result = mysql_query($q) or die(mysql_error().$q);
$total_results = mysql_num_rows($result_count);
$total_pages = ceil($total_results / $max_results);
?>
<table width="750" border="0" align="center" cellpadding="3" cellspacing="0" class='pagetable'>
<thead>
<tr class='menutop'>
<th width="120" align='left'>Thumb</th>
<th align='left'>Info</th>
<th width="21" align="center"> </th>
<th width="20" align="center"> </th>
<th width="55" align="center">Select</th>
</tr>
</thead>
<tr >
<td> </td>
<td colspan="3" align="right">Select All</td>
<td align="center" ><input type="checkbox" name="allbox" id="checkAll" onclick="CheckAll(document.form1)" /></td>
</tr>
<?
while($row = mysql_fetch_array($result)) {
$videotitle = str_replace(' ','-',$row[title]);
$videotitle = str_replace("'",'',$videotitle);
$videotitle = str_replace('"','',$videotitle);
$videotitle = str_replace('&','and',$videotitle);
$videotitle = strtolower($videotitle);
$link = "$site_url/videos/$videotitle-$row[record_num].html";
$dirname = str_replace('.flv','',$row[orig_filename]);
$subdir = $row[filename][0].'/'.$row[filename][1].'/'.$row[filename][2].'/'.$row[filename][3].'/'.$row[filename][4].'/';
$dirname = $subdir.$dirname;
?>
<tr bgcolor = '<? echo $bgcolor; ?>' id='record<? echo $row[record_num]; ?>'>
<td valign="top" class="style4"><a href='<? echo $link; ?>' target='_blank'>
<? if($row[approved] == 2) { ?>
<?
if($row[photos] == 1) { ?>
<img src="<? echo $gallery_url; ?>/<? echo $row[filename]; ?>/thumbs/<? echo $row[thumbnail]; ?>" alt="<? echo $row[title]; ?>" name="<? echo $row[orig_filename]; ?>" id='<? echo $row[orig_filename]; ?>' height="120" width="160" border=0 />
<? }
else {
if($row[embed]) {
?>
<img src="<? echo $thumb_url; ?>/embedded/<? echo $row[record_num]; ?>.jpg" alt="<? echo $row[title]; ?>" name="<? echo $row[orig_filename]; ?>" id='<? echo $row[orig_filename]; ?>' height="120" width="160" border=0 />
<?
}
else {
?>
<script language="javascript">
$(document).ready(function(){
$("#thumb<? echo $row[record_num]; ?>").colorbox({width:"580px", height:"250px", inline:true, href:"#selectthumbs<? echo $row[record_num]; ?>"});
});
</script>
<img src="<? echo $thumb_url; ?>/<? echo $dirname; ?>/<? echo $row[orig_filename]; ?>-<? echo $row[main_thumb]; ?>.jpg" alt="<? echo $row[title]; ?>" name="<? echo $row[orig_filename]; ?>" id='thumb<? echo $row[record_num]; ?>' height="120" width="160" border=0 />
<? }
}
?>
<? } else { ?>
Content In Approval Queue. No thumb created yet!
<? } ?></td>
<td valign="top" class="style4"><strong><? echo $row[title]; ?></strong><br />
<strong>Description:</strong>
<? if(strlen($row[description]) > 150) { echo substr($row[description],0,147).'...'; } else { echo $row[description]; } ?>
<br>
<strong>Keywords:</strong> <? echo str_replace(',',', ',$row[keywords]); ?><br />
<strong>Views:</strong> <? echo $row[views]; ?><br>
<strong>Date Added:</strong> <? echo $row[encoded_date]; ?><br />
<strong>Possible Pornstar</strong>: <? echo $row[pornstartmp]; ?><br />
</td>
<td align="center" valign="top" >
<a href='edit_<? if($row[photos] == 1) { echo 'photo_'; } ?>content.php?id=<? echo $row[record_num]; ?>'><img src='icons/zoom.png' border=0 /></a></td>
<td width="20" align="center" valign="top" ><a onClick="javascript:unassignRow('<? echo $row[record_num]; ?>'); return false;" href="#"><img src='icons/cancel.png' border=0 /></a></td>
<td align="center" valign="top"><input name="list[]" type="checkbox" class="style4" value="<? echo $row[record_num]; ?>" /></td>
</tr>
<div style='display: none;'>
<div style='padding-top: 10px;' id='selectthumbs<? echo $row[record_num]; ?>'>
<?
for($i = 1; $i <= 10; $i++) {
$dirname = str_replace('.flv','',$row[orig_filename]);
$subdir = $row[filename][0].'/'.$row[filename][1].'/'.$row[filename][2].'/'.$row[filename][3].'/'.$row[filename][4].'/';
$dirname = $subdir.$dirname;
?>
<a style='padding: 2px;' onClick="swapThumb(<? echo $row[record_num]; ?>,'<? echo $thumb_url; ?>/<? echo $dirname; ?>/<? echo $row[orig_filename]; ?>-<? echo $i; ?>.jpg',<? echo $i; ?>); return false;" href='#'><img border=0 src='<? echo $thumb_url; ?>/<? echo $dirname; ?>/<? echo $row[orig_filename]; ?>-<? echo $i; ?>.jpg' width=100 height=75></a>
<? } ?>
</div>
</div>
<?
if($bgcolor == '#ffffff') { $bgcolor = "#EBEBEB"; } else { $bgcolor = '#ffffff'; }
}
?>
<tr bgcolor = '<? echo $bgcolor; ?>'>
<td colspan="7" class="style4"><center><br />
<span>
<select name="action" id="action" onChange='processList(this.value);'>
<option value="remove">Remove From List</option>
<option value='setpornstar'>Assign To Pornstar</option>
</select>
</span>
<span id='setpornstar' style='display: none;'>
<select name="setpornstar">
<? $result1 = mysql_query("SELECT * FROM pornstars ORDER BY name ASC");
while($row1 = mysql_fetch_array($result1)) {
echo "<option value='$row1[record_num]'>$row1[name]</option>";
}
?>
</select>
</span>
<input name="Submit" type="submit" class="style4" value="Process Selected" />
<br />
<span id='setchannelwarning' style='display: none;'>
Please Note: Assigning a channel from this page removes all other channels this media is set for!
</span>
</center></td>
</tr>
</table>
<p> </p>
<?
if($page > 1){
$prev = ($page - 1);
if($prev == 1) { $prev = '1'; }
echo " <a style='font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; color: #000000' href=\"unassigned_content.php?page=$prev&setmax=$max_results&keywords=$_REQUEST[keywords]&pornstars=$_REQUEST[pornstars]&paysite=$_REQUEST[paysite]&niche=$_REQUEST[niche]&type=$_REQUEST[type]&Submit2=true\">« Prev</a> / ";
}
for($i = 1; $i <= $total_pages; $i++){
if(($page) == $i){
echo "<span style='font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold;' >$i</span> / ";
} else {
if($i == 1) { $link = '1'; } else { $link = $i; }
echo " <a style='font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold;' href=\"unassigned_content.php?page=$link&setmax=$max_results&keywords=$_REQUEST[keywords]&pornstars=$_REQUEST[pornstars]&paysite=$_REQUEST[paysite]&niche=$_REQUEST[niche]&type=$_REQUEST[type]&Submit2=true\">$i</a> / ";
}
}
// Build Next Link
if($page < $total_pages){
$next = ($page + 1);
echo " <a style='font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; color: #000000' href=\"unassigned_content.php?page=$next&setmax=$max_results&keywords=$_REQUEST[keywords]&pornstars=$_REQUEST[pornstars]&paysite=$_REQUEST[paysite]&niche=$_REQUEST[niche]&type=$_REQUEST[type]&Submit2=true\">Next »</a> ";
}
?>
</form>
</div>
</div>
<div id="right_bottom"></div>
</div>
</div>
</div>
<? require "footer.php"; ?>