Пример #1
0
							<input name="site" type="text" id="site" value="<?php 
echo $row_user_info['site'];
?>
" size="32" maxlength="255" /></td>
					</tr>
				</table></td>
		</tr>
	</table>
	<p>User Preferences:</p>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td class="bgTable"><table border="0" cellpadding="4" cellspacing="1">
					<?php 
$sql_get_prefs = "SELECT * FROM preferences";
$sth_get_prefs = @mysql_query($sql_get_prefs);
$user_prefs = getUserPrefs($_SESSION['id']);
while ($row_prefs = @mysql_fetch_assoc($sth_get_prefs)) {
    ?>
					<tr> 
						<td nowrap="nowrap" class="msgTitle"> 
							<?php 
    echo $row_prefs['descr'];
    ?>
						</td>
						<?php 
    switch ($row_prefs['type']) {
        case 'bit':
            ?>
						<td width="100%" class="msgText"> 
							<input name="p<?php 
            echo $row_prefs['id'];
Пример #2
0
require_once 'lib/utils.php';
require_once 'lib/config.php';
session_start();
authenticate();
# this is kind of dumb
define('RANDOMLY', 5);
define('LOOP', 6);
$message = trim(clean($_POST['message'], MAXMSGLENGTH));
$_SESSION['sub'] = $_POST['postsub'];
if ($message == '' or !isset($message)) {
    $_SESSION['error'] = "Post failed; blank message detected.";
    header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/main.php");
    exit;
}
switch (getUserPrefs($_SESSION['id'], 'TAGLINES')) {
    case RANDOMLY:
        $sql_get_tagline = "SELECT id FROM taglines WHERE user_id = " . $_SESSION['id'] . " ORDER BY RAND() LIMIT 1";
        $sth_get_tagline = @mysql_query($sql_get_tagline);
        if ($sth_get_tagline and @mysql_num_rows($sth_get_tagline) > 0) {
            $row_get_tagline = @mysql_fetch_assoc($sth_get_tagline);
            $tagline = $row_get_tagline['id'];
        }
        break;
    case LOOP:
        $sql_get_tagline = "SELECT t.id FROM taglines t, users u WHERE u.last_tagline = t.id AND u.id = " . $_SESSION['id'];
        $sth_get_tagline = @mysql_query($sql_get_tagline);
        if ($sth_get_tagline and @mysql_num_rows($sth_get_tagline) > 0) {
            $row_get_tagline = @mysql_fetch_assoc($sth_get_tagline);
            $tagline = $row_get_tagline['id'];
        } else {
Пример #3
0
 //note: clean up post before use
 //echo 'request > ', var_dump($request);
 if (isset($request['action'])) {
     $userId = $_SESSION['userId'];
     switch ($request['action']) {
         case 'get_notes':
             get_notes($userId);
             break;
         case 'save_notes':
             save_notes($userId, $request['notas']);
             break;
         case 'delete_notes':
             delete_notes($userId, $request['ids']);
             break;
         case 'getUserPrefs':
             getUserPrefs($userId);
             break;
         case 'setUserPrefs':
             setUserPrefs($userId, $request['arg']);
             break;
         case 'logout':
             logoutUser();
             break;
         default:
             $reply['errors'] = array('Invalid Action or no Action');
             replyJson($reply);
     }
 } else {
     $reply['errors'] = array('Error decoding POST: no action');
     //nota: simplify!
     replyJson($reply);
Пример #4
0
        <link type="text/css" href="../lib/css/ui-lightness/jquery-ui-1.7.2.custom.css" rel="Stylesheet" />
        <link type="text/css" href="css/user_view.css" rel="Stylesheet" />
        <script src="../lib/js/jquery-1.3.2.min.js">
        </script>
        <script src="../lib/js/jquery-ui-1.7.2.custom.min.js">
        </script>
        <script src="../lib/js/json2.js">
        </script>
        <script src="js/user.js">
        </script>
        <script src="js/action_bar.js">
        </script>
        <?
        echo '<script>';
        echo "NOTAS.prefs=";
        getUserPrefs($_SESSION['userId']);
        echo ";NOTAS.preloadedNotas=";
        get_notes($_SESSION['userId']);
        
        echo '</script>';
        ?>
        <title>
            <?php 
echo $_SESSION['userScreenName'] . "@Notas";
?>
        </title>
    </head>
    <body>
        <div id="topContainer">
            <div id="actionBar">
                <!--<span id="ajaxInProgress" style="float:right">ajax in progress...</span>--><span id="ajaxIcon" style="float:right">&nbsp</span>
Пример #5
0
if (isset($req['login'])) {
    if (isset($req['new'])) {
        echo "<p>{$_SESSION['alias']}, you are a n00b.</p>";
    } else {
        echo "<p>Hello again, <strong>{$_SESSION['alias']}</strong>.</p>";
    }
    $sql_new_questions = "SELECT count( DISTINCT vt.id ) , count( DISTINCT v.id ) \n\t\t\tFROM voting_topics vt, votes v WHERE user_id = " . $_SESSION['id'];
    $sth_new_questions = @mysql_query($sql_new_questions);
    $row_new_questions = @mysql_fetch_array($sth_new_questions);
    if ($row_new_questions[1] == 0 or $row_new_questions[0] > $row_new_questions[1]) {
        echo "<p><strong>There are new <a href=\"voting_booth.php\">voting topics</a>!</strong></p>";
    }
    if (getUserPrefs($_SESSION['id'], 'DISP_LASTUSERS')) {
        echo getLastUsers();
    }
    if (getUserPrefs($_SESSION['id'], 'DISP_AUTOMESS')) {
        echo getAutomessage();
    }
    if (isset($req['login'])) {
        echo "<p><strong>Beginning Newscan:</strong></p>";
    }
}
$order = isset($req['order']) ? $req['order'] : 'asc';
?>
<p class="subName"><?php 
echo $sub_name;
?>
 <span class="eene">
<?php 
if (!isset($req['newscan'])) {
    if ($order and $order == 'desc') {