Esempio n. 1
0
			req.send('');
			
			req.onreadystatechange = function() {
				if (req.readyState==4 && req.status==200) {
					document.getElementById('notificationsdropdown').innerHTML = req.responseText;
				} else {
					//failure
				}
			 }
		}
	}
	//]]>
	</script>
	<$other_head_stuff/>
	<?php 
ExtensionConfig::run_hooks('load_header', array());
?>
</head>

<body>

<div id="futurebb">
	<div class="forum_header">
		<div>
			<?php 
if ($futurebb_user['id'] != 0) {
    // If logged in
    //user button
    echo '<a class="userbutton" href="' . $base_config['baseurl'] . '/users/' . $futurebb_user['username'] . '">';
    if (file_exists(FORUM_ROOT . '/static/avatars/' . $futurebb_user['id'] . '.' . $futurebb_user['avatar_extension'])) {
        echo '<img src="' . $base_config['baseurl'] . '/static/avatars/' . $futurebb_user['id'] . '.' . $futurebb_user['avatar_extension'] . '" width="36px" height="36px" alt="avatar" />';
Esempio n. 2
0
				<?php 
    ExtensionConfig::run_hooks('bbcode_toolbar');
    ?>
				<p><?php 
    if ($cur_topic['closed'] || $cur_topic['forum_archived']) {
        echo '<span class="closedlabel">' . translate('topicisclosed') . '</span><br />';
    }
    ?>
				<textarea name="message" id="message" rows="10" cols="70"<?php 
    if ($cur_topic['closed'] || $cur_topic['forum_archived']) {
        echo ' style="background-color: #DDD; border-color: #AAA;"';
    }
    ?>
></textarea></p>
                <?php 
    ExtensionConfig::run_hooks('bbcode_toolbar_bottom');
    ?>
				<p><a href="<?php 
    echo $base_config['baseurl'];
    ?>
/bbcodehelp"><?php 
    echo translate('bbcode');
    ?>
</a>: <?php 
    if ($futurebb_config['enable_bbcode']) {
        echo translate('on');
    } else {
        echo translate('off');
    }
    ?>
, <a href="<?php 
Esempio n. 3
0
while ($f = readdir($handle)) {
    if ($f != '.' && $f != '..') {
        $f = htmlspecialchars($f);
        echo '<option value="' . $f . '">' . $f . '</option>';
    }
}
?>
</select></th>
		</tr>
		<tr>
			<th><?php 
echo translate('timezone');
?>
</th>
			<td><select name="timezone"><?php 
$timezones = DateTimeZone::listIdentifiers();
foreach ($timezones as $key => $val) {
    echo '<option value="' . $key . '">' . $val . '</option>';
}
?>
			</select></td>
		</tr>
	</table>
	<?php 
ExtensionConfig::run_hooks('show_captcha');
?>
	<p><input type="submit" name="form_sent" value="<?php 
echo translate('submit');
?>
" /></p>
</form>
Esempio n. 4
0
                    echo '<input type="checkbox" name="user_list[' . $id . ']" id="user_list_' . $id . '" value="' . $id . '"';
                    if (in_array($id, $visible_groups)) {
                        echo ' checked="checked"';
                    }
                    echo ' /> <label for="user_list_' . $id . '">' . htmlspecialchars($name) . '</label><br />';
                }
            }
            ?>
<br /><?php 
            echo translate('userlistvisgrpsdesc');
            ?>
					</td>
				</tr>
                <?php 
        }
        ExtensionConfig::run_hooks('group_options_bottom');
        ?>
			</table>
            <?php 
        if ($group_id != 2 && $group_id != 1) {
            //hide for guests/admins
            ?>
			<p><?php 
            echo translate('promoteto');
            ?>
 <select name="config[g_promote_group]"><option value="0"><?php 
            echo translate('dontpromote');
            ?>
</option><?php 
            foreach ($user_groups as $id => $name) {
                if ($id != intval($dirs[3]) && !$group_info[$id]['guest']) {
Esempio n. 5
0
<?php

$db->query('DELETE FROM `#^bans` WHERE expires<=' . time()) or enhanced_error('Failed to delete old bans', true);
//delete any bans that have already expired
if ($ban_type == 'ban') {
    $page_title = translate('banned');
    $result = $db->query('SELECT * FROM `#^bans` WHERE (username=\'' . $db->escape($futurebb_user['username']) . '\' OR ip=\'' . $db->escape($_SERVER['REMOTE_ADDR']) . '\') AND (expires>' . time() . ' OR expires IS NULL)') or error('Failed to check for bans', __FILE__, __LINE__, $db->error());
    $cur_ban = $db->fetch_assoc($result);
    $ban_page_replaced = false;
    //this sets up for a hook, where the ban page can be replaced
    ExtensionConfig::run_hooks('ban_page', array('ban_info' => $cur_ban, 'type' => $ban_type));
    if (!$ban_page_replaced) {
        ?>
		<h2><?php 
        echo translate('banned');
        ?>
</h2>
		<p><?php 
        echo translate('bannedmsg1');
        if ($cur_ban['expires'] != null) {
            echo ' ' . translate('until') . ' ' . user_date($cur_ban['expires']);
        }
        ?>
. <?php 
        echo translate('bannedmsg2');
        ?>
<br /><b><?php 
        echo htmlspecialchars($cur_ban['message']);
        ?>
</b><br /><?php 
        echo translate('bannedmsg3', $futurebb_config['admin_email']);
Esempio n. 6
0
 static function CheckPromotion()
 {
     global $futurebb_user, $db;
     if ($futurebb_user['g_promote_group'] == 0) {
         return;
     }
     $num_posts = $futurebb_user['num_posts'];
     $days_registered = floor((time() - $futurebb_user['registered']) / 60 / 60 / 24);
     if ($futurebb_user['g_promote_operator'] == 1) {
         $promote = $num_posts >= $futurebb_user['g_promote_posts'] && $days_registered >= $futurebb_user['g_promote_days'];
     } else {
         $promote = $num_posts >= $futurebb_user['g_promote_posts'] || $days_registered >= $futurebb_user['g_promote_days'];
     }
     if ($promote) {
         $db->query('UPDATE `#^users` SET group_id=' . $futurebb_user['g_promote_group'] . ' WHERE id=' . $futurebb_user['id']) or error('Failed to update user group', __FILE__, __LINE__, $db->error());
         ExtensionConfig::run_hooks('user_promoted', array());
     }
 }
Esempio n. 7
0
    set_config('maintenance', 1);
    set_config('turn_on_maint', 0);
}
if ($futurebb_config['turn_off_maint'] > 0 && $futurebb_config['turn_off_maint'] < time() && $futurebb_config['maintenance']) {
    set_config('maintenance', 0);
    set_config('turn_off_maint', 0);
}
if ($futurebb_config['maintenance'] && !$futurebb_user['g_admin_privs'] && strpos(str_replace($base_config['basepath'], '', $_SERVER['REQUEST_URI']), '/styles') !== 0 && strpos(str_replace($base_config['basepath'], '', $_SERVER['REQUEST_URI']), '/login') !== 0) {
    httperror('maint');
}
if (isset($page_info['admin']) && !$futurebb_user['g_admin_privs']) {
    httperror(403);
}
if (isset($page_info['mod']) && !$futurebb_user['g_mod_privs']) {
    httperror(403);
}
//automatically check for updates
if (ini_get('allow_url_fopen')) {
    if ($futurebb_config['last_update_check'] < time() - 60 * 60 * 24 && !$futurebb_config['new_version']) {
        $version = file_get_contents('http://futuresight.org/api/getversion/futurebb');
        if ($version > FUTUREBB_VERSION) {
            translate('<addfile>', 'admin');
            $q = new DBInsert('reports', array('post_type' => 'special', 'reason' => translate('newversionmsg'), 'time_reported' => time()), 'Failed to insert update notification');
            $q->commit();
            set_config('new_version', 1);
        }
        set_config('last_update_check', time());
    }
}
ExtensionConfig::run_hooks('startup', array());