You are not logged in.

#1 2010-05-09 5:42 pm

MasterZuFu
Member
Registered: 2010-05-09
Posts: 5

MyBB cURL Help?

Hi. I'm trying to install THIS plugin:

http://community.mybboard.net/thread-63 … #pid500777

I have it installed, it works on my MyBB forum. But I'm wanting the check boxes they're talking about. They keep talking about cURL's. I have absolutely no idea what that is or how to use it or implement it. I asked them if they could give me an example (I'm almost positive the code will be the same for everyone except the API code so I don't know what the big deal is with them not posting a default code I can use and change...>_>)

Anyways, can someone help me with this please? Thanks.

Offline

#2 2010-05-09 6:17 pm

diabolic.bg
Member
From: Bulgaria, Eastern Europe
Registered: 2008-11-03
Posts: 589
Website

Re: MyBB cURL Help?

cURL is option in PHP on your server. You must ask server admins for it. If the option is not included, is unlikely to included it in your desire.

http://en.wikipedia.org/wiki/CURL

Last edited by diabolic.bg (2010-05-09 6:20 pm)


Funiest jokes and pics

Offline

#3 2010-05-10 7:18 am

MasterZuFu
Member
Registered: 2010-05-09
Posts: 5

Re: MyBB cURL Help?

I'm still pretty much lost on how to actually make the code or what i need to do in this particular instance and how a cURL interacts with SFP.

Offline

#4 2010-05-10 11:08 am

diabolic.bg
Member
From: Bulgaria, Eastern Europe
Registered: 2008-11-03
Posts: 589
Website

Re: MyBB cURL Help?

MasterZuFu wrote:

I'm still pretty much lost on how to actually make the code or what i need to do in this particular instance and how a cURL interacts with SFP.

Meke a php file with content and name info.php

<?php
phpinfo();
?>

Upload it in your root directory (http:// your_site.c0m)
and stert in your browser the address:

http://your_site.com/info.php

In the result you can see that cURL is enabled or no.

If cURL is enabled, you can install plug-in without problems. If cURL is not used, I can give you advice.

Last edited by diabolic.bg (2010-05-10 11:14 am)


Funiest jokes and pics

Offline

#5 2010-05-10 11:12 am

MasterZuFu
Member
Registered: 2010-05-09
Posts: 5

Re: MyBB cURL Help?

It's enabled. But I still don't know which code to make with a cURL that involves stopforumspam and it's layout in regards to this plugin.

Offline

#6 2010-05-10 11:14 am

diabolic.bg
Member
From: Bulgaria, Eastern Europe
Registered: 2008-11-03
Posts: 589
Website

Re: MyBB cURL Help?

Also you must see at the first time this topic.
Maybe this is a better.


Funiest jokes and pics

Offline

#7 2010-05-10 11:20 am

MasterZuFu
Member
Registered: 2010-05-09
Posts: 5

Re: MyBB cURL Help?

*sigh*, that thread didn't help my problem at all, but thanks smile I've already visited all of those links. It just seems to me like everyone's just beating around the bush instead of just answering my question directly. All I want to do is figure out what the actual CODE is for the cURL that I have to put in my file. That's it, that's all I need, that's all I've asked for the entire time I've been here, and everyone just keeps telling me how a cURL works. I understand how it works, somewhat, but that STILL doesn't tell me a darned thing about exactly HOW to write the code and WHAT CODE I need to write to complete this part of the plugin.

Offline

#8 2010-05-10 11:36 am

diabolic.bg
Member
From: Bulgaria, Eastern Europe
Registered: 2008-11-03
Posts: 589
Website

Re: MyBB cURL Help?

There are not many developers. There's also a language barrier. I do no know MyBB. I tried to help as much as possible. I regret that I did not succeed.


Funiest jokes and pics

Offline

#9 2010-05-10 11:40 am

pedigree
uıɐbɐ ʎɐqǝ ɯoɹɟ pɹɐoqʎǝʞ ɐ buıʎnq ɹǝʌǝu ɯ,ı
From: New Zealand
Registered: 2008-04-16
Posts: 7,056

Re: MyBB cURL Help?

This is my cURL code from my mod

function getSFSXML($url) {
        global $vbulletin;

        $curl_installed = (function_exists('curl_init'));
        $curl_failed = false;
                        
    if (($vbulletin->options['vbstopforumspam_curluse']) && ($curl_installed)) {

        $cUrl = curl_init();
        curl_setopt($cUrl, CURLOPT_URL, $url);
        curl_setopt($cUrl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($cUrl, CURLOPT_TIMEOUT, '15');
      
        $pageContent = curl_exec($cUrl);   
        if (curl_errno($cUrl)) {             
             // curl failed, close the object and fail back to get_file_contents
            curl_close($cUrl);   
                    if (!($pageContent = @file_get_contents($url)))     return VBSFS_REMOTE_ERROR;        
        } else {            
              // be safe, close the curl object
                curl_close($cUrl);
        }
    } else {        
            if (!($pageContent = @file_get_contents($url))) return VBSFS_REMOTE_ERROR;
    }
    
    // parse with php4
        $parser = xml_parser_create('UTF-8');
        xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); 
        xml_parse_into_struct($parser, $pageContent, $vals, $index); 
        xml_parser_free($parser);    
    
    // result will (well, at time of coding, should) always return a appears value
    $appears = ($vals[$index['APPEARS'][0]]['value']);
    
        // test to see if we have a conncetion or page error - basic test is "is the result valid XML with a appears in the schema"
    if (!$appears) return VBSFS_REMOTE_ERROR;
    
    if ( $appears == 'yes') {
      // let mysql do the datediff as all dates are in mysql format anyway
        $lastseen = $vals[$index['LASTSEEN'][0]]['value'];
        $sql = "SELECT DATEDIFF(NOW(), '" . $lastseen . "') AS DAYS;";
        $result = $vbulletin->db->query($sql);
        $line = $vbulletin->db->fetch_array($result);
        $days = $line['DAYS'];        
        $spambot = ($days < $vbulletin->options['vbstopforumspam_expire_day']) ;
    } else 
        $spambot = VBSFS_PASS;
    
    return $spambot;
}

Offline

Board footer

Powered by FluxBB

Close
Close