Example #1
0
function forum_getmodFunctions($showtopic)
{
    global $_USER, $_CONF, $_TABLES, $LANG_GF03, $LANG_GF01, $page;
    $retval = '';
    $options = '';
    if (COM_isAnonUser()) {
        return $retval;
    }
    if (forum_modPermission($showtopic['forum'], $_USER['uid'], 'mod_edit')) {
        $options .= '<option value="editpost">' . $LANG_GF03['edit'] . '</option>';
        if ($showtopic['locked'] == 1) {
            $options .= '<option value="lockedpost">' . $LANG_GF03['lockedpost'] . '</option>';
        }
    }
    if (forum_modPermission($showtopic['forum'], $_USER['uid'], 'mod_delete')) {
        $options .= '<option value="deletepost">' . $LANG_GF03['delete'] . '</option>';
    }
    if (forum_modPermission($showtopic['forum'], $_USER['uid'], 'mod_ban')) {
        $options .= '<option value="banippost">' . $LANG_GF03['banippost'] . '</option>';
    }
    if (forum_modPermission($showtopic['forum'], $_USER['uid'], 'mod_ban')) {
        if (function_exists('BAN_for_plugins_check_access') and BAN_for_plugins_check_access()) {
            $iptobansql = DB_query("SELECT ip FROM {$_TABLES['forum_topic']} WHERE id='{$showtopic['id']}'");
            $forumpostipnum = DB_fetchArray($iptobansql);
            $ip_address = $forumpostipnum['ip'];
            if ($ip_address != '') {
                if (BAN_for_plugins_ban_found($ip_address)) {
                    $options .= '<option value="banip">' . $LANG_GF03['banipremove'] . '</option>';
                } else {
                    $options .= '<option value="banip">' . $LANG_GF03['banip'] . '</option>';
                }
            }
        }
    }
    if ($showtopic['pid'] == 0) {
        if (forum_modPermission($showtopic['forum'], $_USER['uid'], 'mod_move')) {
            $options .= '<option value="movetopic">' . $LANG_GF03['move'] . '</option>';
        }
    } elseif (forum_modPermission($showtopic['forum'], $_USER['uid'], 'mod_move')) {
        $options .= '<option value="movetopic">' . $LANG_GF03['split'] . '</option>';
    }
    if ($options != '') {
        $retval .= '<select name="modfunction">';
        $retval .= $options;
        if ($showtopic['pid'] == 0) {
            $msgpid = $showtopic['id'];
            $top = "yes";
        } else {
            $msgpid = $showtopic['pid'];
            $top = "no";
        }
        $retval .= '</select>&nbsp;&nbsp;';
        $retval .= '<input type="submit" name="submit" value="' . $LANG_GF01['GO'] . '!"' . XHTML . '>';
        $retval .= '<input type="hidden" name="fortopicid" value="' . $showtopic['id'] . '"' . XHTML . '>';
        $retval .= '<input type="hidden" name="forum" value="' . $showtopic['forum'] . '"' . XHTML . '>';
        $retval .= '<input type="hidden" name="msgpid" value="' . $msgpid . '"' . XHTML . '>';
        $retval .= '<input type="hidden" name="top" value="' . $top . '"' . XHTML . '>';
        $retval .= '<input type="hidden" name="page" value="' . $page . '"' . XHTML . '>';
    }
    return $retval;
}
Example #2
0
// IP info block
$block_title = "{$ip_addr} [" . $_GUS_Whois_URL_start . $ip_addr . $_GUS_Whois_URL_end . 'whois</a>]';
// Check to see if collect stats on this IP
$result = DB_query("SELECT COUNT(*) AS ignored\n\t\t\t\t\t\tFROM {$_TABLES['gus_ignore_ip']}\n\t\t\t\t\t\tWHERE '{$ip_addr}' LIKE ip\n\t\t\t\t\t\tLIMIT 1", 1);
$row = DB_fetchArray($result, FALSE);
$actionURL = $_SERVER['PHP_SELF'] . '?' . htmlentities($_SERVER['QUERY_STRING']);
$data = "<table width=\"100%\" cellspacing=0 cellpadding=0><tr class=header><td>{$block_title}</td></tr><tr><td>" . '<table cellspacing=0 cellpadding=0  style="border: 0px;"><tr>' . '<td class=col_right>Stats collection:</td>';
if ($row['ignored'] == '1') {
    $data .= '<td><span style="font-weight: bold;">off</span></td>' . "<td><form method='POST' action='" . $actionURL . "'>" . "<input type=submit value='Turn On'>" . "<input type='hidden' value='1' name='gus_ip_collect_data'>" . '</form></td>';
} else {
    $data .= '<td><span style="font-weight: bold;">on</span></td>' . "<td><form method='POST' action='" . $actionURL . "'>" . "<input type=submit value='Turn Off'>" . "<input type='hidden' value='0' name='gus_ip_collect_data'>" . '</form></td>';
}
$data .= '</tr><tr>' . '<td class=col_right>Ban IP:</td>';
// check for the Ban plugin
if (function_exists('BAN_for_plugins_check_access') and BAN_for_plugins_check_access()) {
    if (BAN_for_plugins_ban_found($ip_addr)) {
        $data .= '<td><span style="font-weight: bold;">on</span></td>' . "<td><form method='POST' action='" . $actionURL . "'>" . "<input type=submit value='Turn Off'>" . "<input type='hidden' value='0' name='gus_ip_ban'>" . '</form></td>';
    } else {
        $data .= '<td><span style="font-weight: bold;">off</span></td>' . "<td><form method='POST' action='" . $actionURL . "'>" . "<input type=submit value='Turn On'>" . "<input type='hidden' value='1' name='gus_ip_ban'>" . '</form></td>';
    }
} else {
    $data .= '<td colspan=2>[A compatible version of the <a href="http://code.google.com/p/geeklog/" target="_blank">ban plugin</a> is not installed or you do not have access]</td>';
}
$data .= '</tr></table></td><tr><td>';
// list the host names associated with this IP address
$sql = "SELECT DISTINCT( host ) \n\t\tFROM {$_TABLES['gus_userstats']} \n\t\tWHERE ip='{$ip_addr}' AND host <> '{$ip_addr}'";
$result = DB_query($sql);
$num_results = DB_numRows($result);
if ($num_results == 0) {
    $data .= "There are <b>no</b> host names associated with this IP address.";
} else {