File: //home/httpd/mech_ftp/baretube.com/admin/text_feed.php
<?php
require "db.php";
?>
<? require "header.php"; ?>
<div class="content-page">
<div class="header-area">
<div class="breadcrumbs">
<a href="index.php">Admin Home</a>
<span><a href="text_feed.php">Create Text Feed</a></span>
</div>
</div>
<div class="content-outer">
<h2>Create<strong>Text Feeds</strong></h2>
<div class="content-inner">
<? echo getMessages(); ?>
<form method="POST" action="" enctype="multipart/form-data" class="form" novalidate autocomplete="off">
<table class="pagetable">
<thead>
<tr>
<th colspan="2">Create Text Feed</th>
</tr>
</thead>
<tr>
<td>Format</td>
<td>
<?
if(!$_POST['feed']) {
$_POST['feed'] = 'id|username|url|length|title|description|keywords|channels|pornstars|main_thumb|all_thumbs';
}
?>
<input name="feed" type="text" placeholder="id|username|url|length|title|description|keywords|channels" value="<? echo $_POST['feed']; ?>" required />
<p class="hint">Valid Tags:<br />id username url length title description keywords channels pornstars main_thumb all_thumbs embed</p>
</td>
</tr>
<tr>
<td>utm_source</td>
<td><input name="utm_source" type="text" placeholder="" value="<? echo htmlentities($_POST['utm_source']); ?>" /></td>
</tr>
<tr>
<td>utm_medium</td>
<td><input name="utm_medium" type="text" placeholder="" value="<? echo htmlentities($_POST['utm_medium']); ?>" /></td>
</tr>
<tr>
<td>utm_campaign</td>
<td><input name="utm_campaign" type="text" placeholder="" value="<? echo htmlentities($_POST['utm_campaign']); ?>" /></td>
</tr>
<tr>
<td>Amount</td>
<td><input name="amount" type="text" value="1000" required /></td>
</tr>
<tr>
<td>Ordered By</td>
<td>
<select name='orderBy'>
<option <? if($_POST['orderBy'] == 'encoded_date') { echo 'selected'; } ?> value='encoded_date'>Publish Date</option>
<option <? if($_POST['orderBy'] == 'views') { echo 'selected'; } ?> value='views'>Views</option>
<option <? if($_POST['orderBy'] == 'length') { echo 'selected'; } ?> value='length'>Duration</option>
</select>
<select name='orderDirection'>
<option <? if($_POST['orderDirection'] == 'desc') { echo 'selected'; } ?> value='desc'>Descending</option>
<option <? if($_POST['orderDirection'] == 'asc') { echo 'selected'; } ?> value='asc'>Ascending<option>
</select>
</td>
</tr>
<tr>
<td>Categories</td>
<td>
<select name="niche[]" multiple="multiple" class="full-width">
<?php
$presult = dbQuery("SELECT * FROM niches ORDER BY name ASC", false);
foreach ($presult as $srow) {
?>
<option<?php echo in_array($srow['record_num'], $_POST['niche']) ? ' selected' : ''; ?> value="<?php echo $srow['record_num']; ?>"><?php echo $srow['name']; ?></option>
<?php } ?>
</select><br>
(Hold ctrl to select multiple. Leave blank for all categories)
</td>
</tr>
<tr class="item submit">
<td colspan="2">
<input type="hidden" name="formSubmit" value="1" />
<button type="submit" class="btn action-search">Generate Feed URL</button>
</td>
</tr>
</table>
</form>
<?
if($_POST['feed'] && $_POST['amount'] && $_POST['orderBy'] && $_POST['orderDirection']) {
?>
<h2>Feed URL</h2>
<textarea style='width: 100%; height: 70px;'><? echo $basehttp; ?>/index.php?controller=wmfeed&format=<? echo htmlentities($_POST['feed']); ?>&limit=<? echo (int)$_POST['amount']; ?>&orderBy=<? echo htmlentities($_POST['orderBy']); ?>&orderDirection=<? echo htmlentities($_POST['orderDirection']); ?>&channels=<? echo implode(",",$_POST['niche']); ?>&utm_source=<? echo htmlentities($_POST['utm_source']); ?>&utm_medium=<? echo htmlentities($_POST['utm_medium']); ?>&utm_campaign=<? echo htmlentities($_POST['utm_campaign']); ?></textarea>
<? } ?>
</div>
</div>
</div>
<?php require "footer.php"; ?>