Esempio n. 1
0
function ban_theme()
{
    global $globals, $mysql, $theme, $done, $error, $errors, $l;
    // Get all data of the user, whether to allow
    // him to view or enter the board.
    // user level, user permissions
    global $user, $notice;
    global $board, $replies;
    global $qu;
    // boards will be listed here, get data from DB
    // Board table, having, board_id, board_name, board_desc,
    // user_id who started board(admin or moderator),
    // number of replies in Reply table
    // who replied etc, replies to a board_id in reply table
    // name of board, which username started board,
    // how many posts in board
    error_handler($error);
    if (!empty($notice)) {
        notice_handler($notice);
        return;
    }
    if ($qu) {
        echo '
			<center>
			<table border="1" >
				<tr id="disp_table">
					<td>
						' . $l['ban_uid'] . '
					</td>
					<td>
						' . $l['ban_uname'] . '
					</td>
				</tr>
			';
        for (; $i = mysql_fetch_assoc($qu);) {
            echo '
				<tr>
					<td>
						' . $i['ban_uid'] . '
					</td>
					<td>
						' . $i['username'] . '
					</td>
				</tr>';
        }
        echo '
			</table>
			</center>
		';
    } else {
        noData();
    }
}
Esempio n. 2
0
function friendsList_theme()
{
    global $globals, $mysql, $done, $error, $errors, $notice;
    global $l, $notice, $qu;
    global $show;
    error_handler($error);
    notice_handler($notice);
    $str = '';
    if ($show) {
        if (mysql_num_rows($qu) > 0) {
            $str .= '<center><div><b>' . $l['frnds'] . '</b> <br />';
            while ($row = mysql_fetch_assoc($qu)) {
                $str .= "<p>" . null . "<span>\n\t\t\t\t\t\t{$row['username']} | \n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t{$row['email']} | \n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t{$row['url']} \n\t\t\t\t\t</span>\n\t\t\t\t</p>";
            }
            $str .= '</div></center>';
        }
    }
    echo $str;
}
Esempio n. 3
0
function addReply_theme()
{
    global $globals, $mysql, $theme, $done, $errors, $error, $notice;
    // Get all data of the user, whether to allow
    // him to view or enter the board.
    // user level, user permissions
    global $user, $l;
    global $board, $replies, $row;
    // boards will be listed here, get data from DB
    // Board table, having, board_id, board_name, board_desc,
    // user_id who started board(admin or moderator),
    // number of replies in Reply table
    // who replied etc, replies to a board_id in reply table
    // name of board, which username started board,
    // how many posts in board
    error_handler($error);
    notice_handler($notice);
    $subject = '';
    // if not isset $_GET[post], that means it is not a createTopic, it only an addReply
    // if isset $_GET[post], that means it is a createTopic event
    if (!isset($_GET['post'])) {
        $subject = '<tr>
					<td valign="center">' . $l['subj'] . '</td>
					<td><input type="text" name="subject" value="Re: ' . $row['tname'] . '"></td>
			</tr>';
    }
    echo '
		<form method="post" action="">
			<table align="center">
			' . $subject . '
					<tr>
						<td valign="top">' . $l['reply'] . '</td>
						<td><textarea name="reply" rows="6" cols="35"></textarea></td>
					</tr>
				</table>
			<center><input class="mun-button-default" type="submit" name="reply_sub" value="Reply"></center>
		</form>
	';
}
Esempio n. 4
0
function viewProfile_theme()
{
    global $globals, $mysql, $theme, $done, $errors, $notice;
    global $user, $reqPrivs;
    global $q, $qu, $l;
    error_handler($errors);
    notice_handler($notice);
    $row = mysql_fetch_assoc($qu[1]);
    $str = '';
    $str .= '<center>
	<h3>' . $l['usr_prof'] . '</h3>
	<table border="1">';
    foreach ($row as $k => $v) {
        if ($k == 'salt' || $k == 'password') {
            unset($row[$k]);
            continue;
        }
        $k = str_replace("_", " ", $k);
        $k = ucfirst($k);
        $str .= "\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{$k}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{$v}\n\t\t\t</td>\n\t\t</tr>\n\t\t";
    }
    $uid = isset($_GET['uid']) ? (int) check_input($_GET['uid']) : $user['uid'];
    if (mysql_num_rows($qu[2]) == 1) {
        $row2 = mysql_fetch_assoc($qu[2]);
        foreach ($row2 as $ke => $va) {
            // taking directly the, DB column name
            // as the column name for the html table
            // so replacing, underscore, in the DB column names,
            // and showing it here as it is.
            $ke = str_replace("_", " ", $ke);
            $ke = ucfirst($ke);
            $str .= "<tr>\n\t\t\t\t<td>\n\t\t\t\t\t{$ke}\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t{$va}\n\t\t\t\t</td>\n\t\t\t</tr>";
        }
    }
    $str .= '</table><br /><br />';
    $str .= '<a href="index.php?action=wall&uid=' . $uid . '">' . $l['wall'] . '</a>
	| <a href="index.php?action=modifyprofile&uid=' . $uid . '">' . $l['mod_prof'] . '</a>';
    // if he is the admin, and it is admins profile, dont show ban link
    // but, if he is admin, and the profile is of someone else, u show Ban link.
    // g_priv & reqPrivs is delete, then show it.
    if ((int) $user['g_priv'] & (int) $reqPrivs['delete']['a_priv'] && $uid != 1) {
        if (isset($row2['banned']) && $row2['banned']) {
            $str .= ' | <a href="index.php?action=unban&uid=' . $uid . '">' . $l['unban'] . '</a>';
        } else {
            $str .= ' | <a href="index.php?action=ban&uid=' . $uid . '">' . $l['ban'] . '</a>';
        }
    }
    $friends = array();
    $friends = explode(',', $user['friends_list']);
    // if the $uid (i.e. $_GET['uid']) != user[uid] which is logged in user, logged in user cant add himself
    if ($uid != $user['uid']) {
        if (!in_array($_GET['uid'], $friends)) {
            $str .= ' | <a href="index.php?action=addFriend&uid=' . $_GET['uid'] . '">' . $l['add_frnd'] . '</a>';
        } else {
            $str .= ' | <a href="index.php?action=unFriend&uid=' . $_GET['uid'] . '">' . $l['unfrnd'] . '</a>';
        }
    }
    $str .= '</center>';
    echo $str;
    // emptying the string contained in $str, in order to free PHP memory.
    $str = '';
}