Files
Testing/user_list_new.php

132 lines
3.3 KiB
PHP
Raw Permalink Normal View History

2026-11-17 16:15:01 -05:00
<?php
/* $Id: user_poll_new.php 59 2009-02-13 03:25:54Z john $ */
$page = "general";
include "header.php";
if(isset($_POST['task'])) { $task = $_POST['task']; } elseif(isset($_GET['task'])) { $task = $_GET['task']; } else { $task = ""; }
$name = ( !empty($_POST['name']) ? $_POST['name'] : NULL );
$type = ( !empty($_POST['type']) ? $_POST['type'] : NULL );
$privacy = ( !empty($_POST['privacy']) ? $_POST['privacy'] : NULL );
if($user->user_info["user_level_id"]!=2&&$user->user_info["user_level_id"]!=7){
header("Location: /premium.php");
exit;
}
if($task=="dosave"){
if(trim($name)!=""&&$type!=""&&$privacy!=""){
$database->database_query("INSERT into batelist SET userid='".$user->user_info["user_id"]."', name='".$database->database_real_escape_string($name)."', type='".$database->database_real_escape_string($type)."', privacy='".$database->database_real_escape_string($privacy)."'");
header("Location: /user_lists.php");
exit;
}
else{$error=2;}
}
function general()
{
global $error, $name, $user, $privacy, $type;
if($error==2){echo "Please fill in all fields";}
?>
<div id="entry_main">
<form action="user_list_new.php" method="post" name="blogform" id="blogform">
<div>Name:</div>
<div><input type="text" name="name" class="form-control" size="50" maxlength="100" value="<?php echo $name;?>"></div><br>
<div>Type:</div><div>
<table cellpadding="0" cellspacing="0">
<tbody><tr>
<td>
<select name="type" class="form-control" onchange="">
<option value="0"></option>
<option value="1" <?php if($type==1){?>selected="selected"<?php }?>>
Videos</option>
<option value="2" <?php if($type==2){?>selected="selected"<?php }?>>
Pictures</option>
</select>
</td>
<td>
</td>
</tr>
</tbody></table>
</div><br>
<div id="settings_privacy" class="blog_settings" style="">
<b>Who can see this list?</b>
<table cellpadding="0" cellspacing="0">
<tbody><tr>
<td><input type="radio" name="privacy" id="privacy_31" value="31" <?php if($privacy==31){?>checked="checked"<?php }?>></td>
<td><label for="privacy_31">All Registered Users</label></td>
</tr>
<tr>
<td><input type="radio" name="privacy" id="privacy_3" value="3" <?php if($privacy==3){?>checked="checked"<?php }?>></td>
<td><label for="privacy_3">Only My Friends</label></td>
</tr>
<tr>
<td><input type="radio" name="privacy" id="privacy_1" value="1" <?php if($privacy==1){?>checked="checked"<?php }?>></td>
<td><label for="privacy_1">Only Me</label></td>
</tr>
</tbody></table>
<div class="clear"></div><br>
</div>
<table cellpadding="3" cellspacing="0">
<tbody><tr>
<td>
<input type="submit" name="save" class="button" value="Save"> <input type="hidden" name="task" id="task" value="dosave">
</td>
<td>
<form action="user_blog.php" method="post">
<input type="submit" class="button" value="Cancel"> </form>
</td>
</tr>
</tbody></table>
</form></div>
<?php
}
$smarty->assign('privacy_options', $privacy_options);
$smarty->assign('comment_options', $comment_options);
$smarty->assign('poll_title', $poll_title);
$smarty->assign('poll_desc', $poll_desc);
$smarty->assign('poll_options', $poll_options);
$smarty->assign('poll_comments', $poll_comments);
$smarty->assign('poll_privacy', $poll_privacy);
$smarty->assign('poll_search', $poll_search);
$smarty->assign('is_error', $is_error);
$smarty->assign('is_error_sprintf_1', $is_error);
include "footer.php";
?>