Exemple #1
0
            $order = 'u.registered';
            break;
        default:
            $order = 'u.username';
            break;
    }
    if (isset($_GET['order']) && $_GET['order'] == 'desc') {
        $order .= ' DESC';
    } else {
        $order .= ' ASC';
    }
} else {
    $order = 'u.username ASC';
}
$q = new DBSelect('users', array('u.username', 'u.num_posts', 'u.registered', 'g.g_title AS title'), ' u.id>0 AND u.username<>\'Guest\' ' . $sql . ($visible_groups == '' ? '' : ' AND u.group_id IN(' . $visible_groups . ')') . ' AND u.deleted=0', 'Failed to get users');
$q->table_as('u');
$join = new DBLeftJoin('user_groups', 'g', 'g.g_id=u.group_id');
$q->add_join($join);
$q->set_limit(($page - 1) * $per_page . ',' . $per_page);
$q->set_order($order);
$result = $q->commit();
unset($q);
while ($cur_user = $db->fetch_assoc($result)) {
    echo '<tr>
				<td><a href="' . $base_config['baseurl'] . '/users/' . rawurlencode(htmlspecialchars($cur_user['username'])) . '">' . htmlspecialchars($cur_user['username']) . '</a></td>
				<td>' . htmlspecialchars($cur_user['title']) . '</td>
				<td>' . $cur_user['num_posts'] . '</td>
				<td>' . user_date($cur_user['registered']) . '</td>
			</tr>';
}
?>
Exemple #2
0
 if (!$db->num_rows($result)) {
     httperror(404);
 }
 $forum_info = $db->fetch_assoc($result);
 if (!strstr($forum_info['view_groups'], '-' . $futurebb_user['group_id'] . '-')) {
     //don't try to get smart and view forums without permission
     httperror(403);
 }
 if ($forum_info['redirect_url'] != null) {
     redirect($base_config['baseurl'] . '/rss/forum/' . $forum_info['redirect_url']);
 }
 $title = $forum_info['name'] . ' - ' . $futurebb_config['board_title'];
 $q = new DBSelect('posts', array('p.id', 'p.parsed_content', 'u.username AS poster', 't.subject', 'p.posted'), 't.forum_id=' . $forum_info['id'], 'Failed to get posts');
 $q->add_join(new DBJoin('topics', 't', 't.id=p.topic_id', 'LEFT'));
 $q->add_join(new DBJoin('users', 'u', 'u.id=p.poster', 'LEFT'));
 $q->table_as('p');
 $q->set_order('p.posted DESC');
 $q->set_limit('20');
 $result = $q->commit();
 if (!$db->num_rows($result)) {
     httperror(404);
 }
 while ($post = $db->fetch_assoc($result)) {
     $output .= "\n\t" . '<item>' . "\n\t\t" . '<title><![CDATA[' . htmlspecialchars($forum_info['name']) . ' / ' . htmlspecialchars($post['subject']) . ']]></title>';
     $output .= "\n\t\t" . '<pubDate>' . gmdate('D, d M Y H:i:s', $post['posted']) . ' +0000</pubDate>';
     $output .= "\n\t\t" . '<link>' . $base_config['baseurl'] . '/posts/' . $post['id'] . '</link>';
     $output .= "\n\t\t" . '<guid>' . $base_config['baseurl'] . '/posts/' . $post['id'] . '</guid>';
     $output .= "\n\t\t" . '<author><![CDATA[' . htmlspecialchars($post['poster']) . ']]></author>';
     $output .= "\n\t\t" . '<description><![CDATA[' . strip_tags($post['parsed_content']) . ']]></description>';
     $output .= "\n\t" . '</item>';
 }
Exemple #3
0
<?php

$page_title = 'Interface Editing History';
$breadcrumbs = array(translate('administration') => 'admin', translate('interface') => 'admin/interface', 'History' => 'admin/interface/history');
$page_list = array();
$q = new DBSelect('pages', array('*'), '', 'Failed to get page list');
$result = $q->commit();
while ($page = $db->fetch_assoc($result)) {
    $page_list[$page['id']] = $page;
}
$q = new DBSelect('interface_history', array('h.*', 'u.username'), 'time>' . (time() - 60 * 60 * 24 * 60), 'Failed to retrieve history entries');
$q->set_order('time DESC');
$q->table_as('h');
$q->add_join(new DBJoin('users', 'u', 'u.id=h.user', 'LEFT'));
$result = $q->commit();
$page_edits = array();
$field_edits = array();
$lang_edits = array();
$lang_ids = array();
while ($entry = $db->fetch_assoc($result)) {
    if ($entry['area'] == 'pages') {
        if (!isset($page_edits[$entry['field']])) {
            $page_edits[$entry['field']] = array();
        }
        $page_edits[$entry['field']][] = array('time' => $entry['time'], 'old_value' => base64_decode($entry['old_value']), 'username' => $entry['username'], 'action' => $entry['action']);
    } else {
        if ($entry['area'] == 'interface') {
            if (!isset($field_edits[$entry['field']])) {
                $field_edits[$entry['field']] = array();
            }
            $field_edits[$entry['field']][] = array('time' => $entry['time'], 'old_value' => $entry['old_value'], 'username' => $entry['username'], 'action' => $entry['action']);
Exemple #4
0
    	<form action="<?php 
echo $base_config['baseurl'];
?>
/admin/forums/enhanced" method="post" enctype="multipart/form-data" id="theform">
            <h3><?php 
echo translate('editforums');
?>
</h3>
			<p><a style="text-decoration: underline;cursor:pointer" onclick="addCat();"><?php 
echo translate('addcat');
?>
</a></p>
			<div id="cat_container">
				<?php 
$q = new DBSelect('forums', array('c.name AS cat_name', 'c.sort_position AS cat_sort_position', 'f.id', 'c.id AS cat_id', 'f.sort_position', 'f.name AS forum_name'), 'c.id IS NOT NULL', 'Failed to get forum list');
$q->table_as('f');
$q->set_order('c.sort_position,f.sort_position');
$q->add_join(new DBJoin('categories', 'c', 'c.id=f.cat_id', 'right'));
$result = $q->commit();
$last_cat_id = -1;
$highest_sort_orders = array();
while ($forum = $db->fetch_assoc($result)) {
    if ($forum['cat_id'] != $last_cat_id) {
        if ($last_cat_id != -1) {
            echo '</table></div>';
        }
        $last_cat_id = $forum['cat_id'];
        echo '<div id="cat_' . $forum['cat_id'] . '"><h4><input type="hidden" name="cat_sort_order[' . $forum['cat_id'] . ']" value="' . $forum['cat_sort_position'] . '" /><input type="text" name="cat_title[' . $forum['cat_id'] . ']" value="' . htmlspecialchars($forum['cat_name']) . '" oninput="unlockSubmit();" /> <a onclick="moveCat(' . $forum['cat_id'] . ',\'up\');" style="cursor:pointer">&uarr;</a> <a onclick="moveCat(' . $forum['cat_id'] . ',\'down\');" style="cursor:pointer">&darr;</a> (<a onClick="addForum(' . $forum['cat_id'] . ');" style="cursor:pointer">&#10010 ' . translate('addforum') . '</a>) (<a onclick="prepareDeleteCat(' . $forum['cat_id'] . ');" style="cursor:pointer">&#10060;</a>)</h4><hr /><table border="0" id="table_cat_' . $forum['cat_id'] . '"><tr><th>' . translate('forumname') . '</th><th>Move</th><th>' . translate('delete') . '</th><th>' . translate('edit') . '</th><th>' . translate('changecategory') . '</th><th>' . translate('cancel') . '</th></tr>' . "\n";
    }
    if ($forum['id'] != '') {
        echo '<tr id="tr_' . $forum['id'] . '"><td><input type="hidden" name="cat[' . $forum['id'] . ']" id="catof_' . $forum['id'] . '" value="' . $forum['cat_id'] . '" /><input type="hidden" name="sort_order[' . $forum['id'] . ']" id="sort_order_' . $forum['id'] . '" value="' . $forum['sort_position'] . '" /><input type="text" name="title[' . $forum['id'] . ']" value="' . htmlspecialchars($forum['forum_name']) . '" oninput="unlockSubmit();" /></td><td><a onclick="move(' . $forum['id'] . ',\'up\');" style="cursor:pointer">&uarr;</a> <a onclick="move(' . $forum['id'] . ',\'down\');" style="cursor:pointer">&darr;</a></td><td><a onclick="prepareDelete(' . $forum['id'] . ');" style="cursor:pointer">&#10060;</a></td><td><a href="' . $base_config['baseurl'] . '/admin/forums/edit/' . $forum['id'] . '?popup=true" onclick="editForum(' . $forum['id'] . '); return false;" style="text-decoration:none" target="_BLANK">&#9998;</a></td><td><select id="changecat_' . $forum['id'] . '" onchange="changeCat(' . $forum['id'] . ', this.value);">' . $catlist_html . '</select></td><td></td></tr>' . "\n";