big_smile looks a lot easier yes

I guess this will have to be checked somehow aswell

        // Is this users own profile
        $forum_page['own_profile'] = ($forum_user['id'] == $id) ? true : false;
    // Make sure we are allowed to send user info
    if ($forum_user['id'] != $id &&
        $forum_user['g_id'] != FORUM_ADMIN &&
        ($forum_user['g_moderator'] != '1' || $forum_user['g_mod_edit_users'] == '0' || $user['g_id'] == FORUM_ADMIN || $user['g_moderator'] == '1'))
        message($lang_common['No permission']);

wondering if I'd put a link to post http here (lines 1663...) profile.php

<?php ($hook = get_hook('pf_change_details_about_pre_user_private_info')) ? eval($hook) : null; ?>
<?php if (!empty($forum_page['user_private'])): ?>
            <div id="private-profile" class="ct-set data-set set<?php echo ++$forum_page['item_count'] ?>">
                <div class="ct-box data-box">
                    <h3 class="ct-legend hn"><span><?php echo $lang_profile['Private info'] ?></span></h3>
                    <ul class="data-list">
                        <?php echo implode("\n\t\t\t\t\t\t", $forum_page['user_private'])."\n" ?>
                    </ul>
                </div>
            </div>
<?php endif; ?>

777

(6 replies, posted in PunBB 1.3 troubleshooting)

What kind of values do you see in phpmyadmin for

    search_cache                          
    search_matches            
    search_words

maybe import them from backup db if empty... (excl. 1 one  above)

This might help you
http://www.webmasterworld.com/php/3644628.htm
Q: can you use the email adress you want the forum registrations to come from standalone? i.e. is it fully operational...

btw: if you could install the stopforumspam extension I'd be interested if that solves the spam problem - should there be one that is (and as temp solution while your issue is solved)

Just been checking out the submissions part of stopforumspam: (red what it's called in punbb)

Looking for ideas how to extract the profile username, registration_ip and email


You can automate submissions by making an HTTP POST to the following URL, with the following parameters:

http://www.stopforumspam.com/add.php
?username=USERNAME   $user['username']
&ip_addr=IPADDRESS       $user['registration_ip']
&email=EMAILADDRESS     $user['email']
&api_key=ZZZZZZZZZZZZZZZ

To verify, check the HTTP status code returned. a 200 will indicate a successful submission, whereas a 403 will indicate an unsuccessful attempt. A reason will be given (inside a paragraph tag) for unsuccessful attempts. Nothing will be returned for a successful submission.


Here's what I found about getting php to http post ...

<?php
function do_post_request($url, $data, $optional_headers = null)
{
  $params = array('http' => array(
              'method' => 'POST',
              'content' => $data
            ));
  if ($optional_headers !== null) {
    $params['http']['header'] = $optional_headers;
  }
  $ctx = stream_context_create($params);
  $fp = @fopen($url, 'rb', false, $ctx);
  if (!$fp) {
    throw new Exception("Problem with $url, $php_errormsg");
  }
  $response = @stream_get_contents($fp);
  if ($response === false) {
    throw new Exception("Problem reading data from $url, $php_errormsg");
  }
  return $response;
}

source: http://wezfurlong.org/blog/2006/nov/htt … thout-curl


or maybe something like this?

//extract data from the post 
extract($_POST);

//set POST variables 
$url = 'http://domain.com/get-post.php';
$fields = array( 
            'lname'=>urlencode($last_name),    
            'fname'=>urlencode($first_name),
            'title'=>urlencode($title),
            'company'=>urlencode($institution),
            'age'=>urlencode($age),
            'email'=>urlencode($email),
            'phone'=>urlencode($phone) 
        );

//url-ify the data for the POST 
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } 
rtrim($fields_string,'&');

//open connection 
$ch = curl_init();

//set the url, number of POST vars, POST data 
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);

//execute post 
$result = curl_exec($ch);

//close connection 
curl_close($ch);

source: http://davidwalsh.name/execute-http-post-php-curl

780

(7 replies, posted in PunBB 1.3 extensions)

Thanks! Will try it...
(PS: split this off into seperate topic..)

[EDIT]
for the record : how another script does it... for auroraGPT
[code=php]
< ?php
///////////////////////////////////////////////////////////////////
// AuroraGPT BotScout mod (basic version) for AuroraGpt 4-mrV3   //
// This mod assembled by aussiebob - rod@qifn.net - 19 Aug 2010  //
// As used on http://www.buxbunny.com - AuroraGpt 4-mrV3         //
///////////////////////////////////////////////////////////////////

// This mod will verify all new signups against external databases of
// known scammers, spammers, bots, and general pains in the ass!

// HOW IT WORKS - when the bot or registerant clicks the button the
// email and IP address are checked against the http://botscout.com
// database of known bots. If a record is found then the signup simply
// fails and the details are written to your admin site log.
// If it's a genuine signup, then the registeration goes through as normal.
// We recommend you check out the http://botscout.com site, (BTW: we are NOT
// affilated with BotScout, we just use the handy free service provided)
// NOTE: We intentionally do NOT check by username as they are too generic
// ie: a genuine signup with username holly would be rejected as a bot

// DISCLAIMER: We cannot be held accountable for any losses due to the
// misuse of this script nor any incorrect data returned from Botscout.
// Your daily signup numbers will drop as bots are detected!


// INSTRUCTIONS:
// 1- Edit the CONFIGURATION section of this file.
// 2- Place this file (botscout.php) in your members directory.
// 3- Edit the file members/join.php
// and add this line - include('botscout.php');
// directly below line $co = lookupIp($vip); so it looks like this

// $co = lookupIp($vip);
// include('botscout.php');

// Thats all folks - enjoy

// ---- CONFIGURATION BEGIN  ----
// NOTE: This is optional, but without an API KEY you can only do 20 lookups daily
// Register for a FREE API KEY at http://botscout.com/getkey.htm

// Enter your Free API KEY you received by email from http://botscout.com/
$APIKEY = 'YOUR-API-KEY';
// ---- CONFIGURATION END ----

// --------------------------------------------------------------------------
// ---- DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!! ----
// --------------------------------------------------------------------------

// init vars
$botdata='';
$returned_data='';

// get the registerants IP address
$XIP = $_SERVER['REMOTE_ADDR'];

// get the registerants username
$XUSER = $uUsername;

// get the registerants email
$XMAIL = urlencode($uEmail);

// Assemble the query to send to BotScout.com using the registerants email and IP addresses only
$apiquery = "http://botscout.com/test/?multi&mail=$XMAIL&ip=$XIP";

// Add your BotScout.com registered user API KEY to the query
if($APIKEY != ''){
    $apiquery = "$apiquery&key=$APIKEY";
}

// Send the query to BotScout.com using either file_get_contents() or cURL
if(function_exists('file_get_contents')){
// Use file_get_contents
$returned_data = file_get_contents($apiquery);
}else{
    // Use cURL
$ch = curl_init($apiquery);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$returned_data = curl_exec($ch);
curl_close($ch);
}

// Parse returned data array values
$botdata = explode('|', $returned_data);

// Display error message should there be a problem accessing the Botscout.com database.
if(substr($returned_data, 0,1) == '!'){
// if the first character is an exclamation mark, an error has occurred
print "Verification Error: $returned_data - Please try again later.";
exit;
}

// Check if the signup email and IP appear in the returned BotScout.com data values.
if($botdata[3] > 0 || $botdata[5] > 0){

// perform IP - Country lookup
    $sql=  'SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE i.ip < INET_ATON("'.$XIP.'") AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1';
    $temp1=mysql_query($sql);
    list($countrylist) =mysql_fetch_row($temp1);
    $cntry="$countrylist" ;

// insert details into site logs
    $sql=$Db1->query("INSERT INTO logs SET username='".$XUSER."', log='Bot Signup Failed - $XUSER - $uEmail x $botdata[5] records - $XIP x $botdata[3] records - $cntry', dsub='".time()."'");

// Generate a fake Error number (Looks more credible)
$errorfake = round(rand(1100, 20000));

// Give credit to BotScout.com and display an error message to the bot smile
print "<h3>ERROR: $errorfake</h3>
        <p><a href=\"http://botscout.com\" title=\"More Info...\" >Registerant Identified as a Bot</a> - Registration Failed! - Exiting process.</p>";

// halt the signup process
exit;

}
// NOTE: We have added an extra mySQL table called users_rejected and actually add the rejects to it.
// Then we can display the info both in the admin and on the public Rejects page.
// This is an optional extra - fig it yourself - or ask for help in the EMS forum - Private

?>
[/code]

781

(7 replies, posted in PunBB 1.3 extensions)

Okay cool thx. Just testing this to see if it works on botscout aswell.
http://www.mediafire.com/file/gb89b8l3l … tscout.zip  (basically same ext just minus the 'last_seen')

If it does catch stuff maybe one could merge the two, i.e. send query to one, then depending on answer, send another query to the other bot db....

782

(7 replies, posted in PunBB 1.3 extensions)

Beta Extension
v.0.0.3

============================
historic:

btw if I want to add an API key in $url
?ip='.$ip&key=xxxxxxxx;
does it go there
or before the = , or do I need to put it somewhere different and call it another way?

(this would be for botscout which needs the API key if more than 20 queries are done a day...)

EDIT: FYI, this is from http://botscout.com/api.htm

IP - Check an IP Address: 
http://botscout.com/test/?ip=84.16.230.111&key=xxxxxxxx

783

(2 replies, posted in PunBB 1.3 discussion)

http://punbb.informer.com/forums/topic/ … penid-110/

You might want to talk to the guy who made the above open ID extension...

I'm very happy with it.

Also: the more users start installing it, and giving feedback to SFS about which spammers are still getting though, the better the hit ratio will be.

So it's important that a few other people start adding IPs, emails of spammers to the SFS database (the sooner we get a one-click submit button in punapproval or a improved extension to do that, the smaller the chances any spammers will get though) big_smile

785

(4 replies, posted in PunBB 1.3 extensions)

Сообщение в разделе
Неверный запрос. Ссылка, по которой вы пришли, неверна или устарела.

So maybe upload it to mediafire.com (etc) or to wiki here?

Yes please feel free to do it! I'll close this topic as soon as you publish it in extensions...

Brilliant, can confirm this is working !!

This in my phpmyadmin table this morning big_smile

    ip    bot_visit    lastseen    frequency
            91.124.99.4    2010-07-20 03:47:12    2010-07-19 12:59:41    2
            84.111.37.26    2010-07-20 05:07:58    2010-07-19 21:02:55    260
            193.105.210.175    2010-07-20 05:27:29    2010-06-30 18:30:42    1

Fantastic will let you know asap how its going, thanks Grez and Slavok
and Slavok please try it here! big_smile

EDIT:        

Ext code wrote:

//maybe we could log this somewhere? (email, maybe), but I don't think it's 'that' important

I agree in principle. But especially after installing it would be good to see some feedback....


EDIT 2: We got this covered ? smile

pedigree (stopforumspam) wrote:

Im not familiar with the internals of punbb but I hope

$query = array(
'INSERT'   => 'ip, bot_visit, lastseen, frequency',
'INTO'     => 'stopforumspam',
  'VALUES'   => '\''.$ip.'\', NOW(), \''.$xml["response"]

handles duplicate primary key inserts/updates

Doesn't exist for 1.3.x atm.
It has been requested though:
http://punbb.informer.com/wiki/punbb13/ … n_requests



EDIT:

See this post also please!

http://punbb.informer.com/forums/topic/ … for-money/

Once again thanks a lot
Are the two queries not aloud to be at the beginning of the register.php?

Tried this and gives error:

    <![CDATA[
        $schema = array(
            'FIELDS'    =>    array(
                'ip'            => array(
                    'datatype'        =>    'VARCHAR(15)',
                    'allow_null'    =>    false,
                    'default'        =>    '\'0.0.0.0\''
                ),
                'lastseen'        => array(
                    'datatype'        => 'DATETIME',
                    'allow_null'    => false,
                    'default'        => '0'
                ),
                'frequency'        => array(
                    'datatype'        => 'SMALLINT UNSIGNED',
                    'allow_null'    => false,
                    'default'        => '0'
                )
            ),
            'PRIMARY KEY'        =>    array('ip')
        );
        $forum_db->create_table('stopforumspam', $schema);
      ]]>
    </install>
    
    <uninstall>
        <![CDATA[
            $forum_db->drop_table('stopforumspam');
        ]]>
    </uninstall>

    <hooks>
        <hook id="rg_start"><![CDATA[

                $register_head['sfs'] = '<script type="text/php" src="'.$ext_info['url'].'/sfs.php"></script>';

          $query = array(
            'SELECT'   => 'ip',
            'FROM'     => 'stopforumspam',
            'WHERE'    => 'ip='.get_remote_address(),
            'LIMIT'    => '1'
          );
          $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
          if($forum_db->num_rows($result) > 0) {
            //die('You are spammer')
          } else {
              //Request to to SFS.com
                  //Insert to db
          }
          
          $query = array(
            'INSERT'   => 'ip, last_seen, frequency',
            'INTO'     => 'stopforumspam',
            'VALUES'   => '\''.$bot["ip"].'\', \''.$bot["lastseen"].'\', \''.$bot["frequency"].'\''
          );
            $forum_db->query_build($query) or error(__FILE__, __LINE__);
        
    ]]></hook>

okay big_smile

how do I inserat the values from sfs though into my table?

<?php
        if (!$forum_db->table_exists('sfs'))
        {
            $schema = array(
                'FIELDS'        => array(
                    'ip'    => array(
                        'datatype'        => 'VARCHAR(39)',
                        'allow_null'    => false,
                        'default'        => '\'0.0.0.0\''
                    ),
                    'appears'        => array(
                        'datatype'        => 'INT(10) UNSIGNED',
                        'allow_null'    => false,
                        'default'        => '0'
                    ),
                    'last_seen'        => array(
                        'datatype'        => 'INT(10) UNSIGNED',
                        'allow_null'    => false,
                        'default'        => '0'
                    ),
                    'frequency'        => array(
                        'datatype'        => 'INT(10) UNSIGNED',
                        'allow_null'    => false,
                        'default'        => '0'
                    ),
                    
            );

            $forum_db->create_table('sfs', $schema);
        }

    $insert_query = array(
        'INSERT'    =>    'ip, appears, last_seen , frequency',
        'INTO'        =>    'sfs',
        'VALUES'      =>   
?>

792

(85 replies, posted in Supported extensions)

http://keydogbb.info/img/sfs-punapproval.png

Talking of improvements;
I'd love to a see a Pun Approval Plus with the above illustrated possibility to send spam registrations to the Stopforumspam db.

Ok it seems it isnt working (all the time anyway).... any ideas why not?
An IP just registered that is in their db over 200x...

EDIT: Following my discussion with pedigree over at sfs I found out 2 things , 1 this is over my head big_smile two we need to incorporate caching as his mod for vbulletin does like so

// This function returns true if a spambot is found in the cache database.
// It first purges old records
function sfsCacheHit ($data, $field) {
    global $vbulletin, $sfsPurged, $sfsCacheHit;
    
    $sfsCacheHit = false;
    
    if (!$sfsPurged) {
            // purge cache database of old records
            $sql = "DELETE FROM " . TABLE_PREFIX . "vbstopforumspam_remotecache WHERE date < DATE_SUB(NOW(), INTERVAL " . (int)$vbulletin->options['vbstopforumspam_remote_cache'] . " MINUTE);";
            $vbulletin->db->query($sql);
            $sfsPurged = true;
    }
        
    // get rows from database that contain the data (cache hit)
    $sql = "SELECT spambot FROM " . TABLE_PREFIX . "vbstopforumspam_remotecache WHERE field = '$field' AND data = '" . addslashes($data) . "' LIMIT 1 ;";
    $result = $vbulletin->db->query($sql);

    $line = $vbulletin->db->fetch_array($result);
  if (!empty($line)) {            
        $sfsCacheHit = true;
      
          // if we have data in the results, check if we have a spam hit
          if ($line['spambot'] > 0) return VBSFS_FAIL;
          if ($line['spambot'] == 0) return VBSFS_HIT_BUT_PASS;
          // return VBSFS_FAIL if we have a spam hit or all return 2 if we have a hit but its not a spambot              
  }  
    return VBSFS_PASS;
}

// This function returns true if a spambot is found in the cache database.
// It first purges old records
function sfsCacheHit ($data, $field) {
    global $vbulletin, $sfsPurged, $sfsCacheHit;
    
    $sfsCacheHit = false;
    
    if (!$sfsPurged) {
            // purge cache database of old records
            $sql = "DELETE FROM " . TABLE_PREFIX . "vbstopforumspam_remotecache WHERE date < DATE_SUB(NOW(), INTERVAL " . (int)$vbulletin->options['vbstopforumspam_remote_cache'] . " MINUTE);";
            $vbulletin->db->query($sql);
            $sfsPurged = true;
    }
        
    // get rows from database that contain the data (cache hit)
    $sql = "SELECT spambot FROM " . TABLE_PREFIX . "vbstopforumspam_remotecache WHERE field = '$field' AND data = '" . addslashes($data) . "' LIMIT 1 ;";
    $result = $vbulletin->db->query($sql);

    $line = $vbulletin->db->fetch_array($result);
  if (!empty($line)) {            
        $sfsCacheHit = true;
      
          // if we have data in the results, check if we have a spam hit
          if ($line['spambot'] > 0) return VBSFS_FAIL;
          if ($line['spambot'] == 0) return VBSFS_HIT_BUT_PASS;
          // return VBSFS_FAIL if we have a spam hit or all return 2 if we have a hit but its not a spambot              
  }  
    return VBSFS_PASS;
}

the code continues...
(functions_vbsfs.php)
see discussion in this thread
http://www.stopforumspam.com/forum/t159 … rying-Your
download his mod for *analysis* http://www.fizzleblood.net/vbStopForumSpam_v0.61.zip

okay....  maybe you'd need to take apart these in oxygen.css and assign different font sizes....
Default: (line 43)

.brd h1,.brd h2,.brd h3, .brd h4, .brd h5, .brd h6 {
    font-size: 1em;
    font-weight: normal;
    }

to

.brd h1 {
    font-size: 1em;
    font-weight: normal;
    }
.brd h2 {
    font-size: 1.2em;
    font-weight: normal;
    }

etc.

Anyone correct me if I'm wrong

http://www.mediafire.com/file/h3m93qaao … s_v0.1.zip

I believe you'd need to change
extension/pun_stop_bots/views/question_page.php

In the extension the question is h2 class hn

which is defined in style/oxygen.css   

so either change the question_page.php to h3 or someother style that you like the size of
or
change oxygen.css (that will likely make things bigger, you don't want though!)

Thanks.

Slavok can you install that extension here?
I'd  be very curious to see how many can register and add signatures once it's checking that db.

KeyDog wrote:

I uploaded the Beta extension here

Hide URL from guests

http://punbb.informer.com/forums/topic/ … or-guests/

Thanks, won't we have to create a table in the db first.
I want to be able to go and check what IPs are blocked...

I saw in pun_approval that tables are created like this?

        if (!$forum_db->table_exists('sfs'))
        {
            $schema = array(
                'FIELDS'        => array(
                    'ip'    => array(
                        'datatype'        => 'VARCHAR(39)',
                        'allow_null'    => false,
                        'default'        => '\'0.0.0.0\''
                    ),
                    'last_seen'        => array(
                        'datatype'        => 'INT(10) UNSIGNED',
                        'allow_null'    => false,
                        'default'        => '0'
                    ),
                    
            );

            $forum_db->create_table('sfs', $schema);
        }

I agree, that won't be a prob.

What I would like though is to store this data that is returned from sfs

<response success="true">
     <type>ip</type>
     <appears>yes</appears>
     <lastseen>2007-09-18 05:48:53</lastseen>
     <frequency>2</frequency>
</response>

smile how would you do that?
plus the IP that was queried...