Welcome Guest, Not a member yet? Register   Sign In
OpenInviter.com library wrapper
#11

[eluser]designfellow[/eluser]
Hi,
I am creating one like this.
Thanks for the inspiration Smile

Thanks
DesignFellow
#12

[eluser]cruzanmo[/eluser]
In regard to the error message others have reported. There is a simple fix: just run the postinstall.php file in the final directory that you are saving it in, and then delete the postinstall file (per the plugin's instructions).
#13

[eluser]steven dobbelaere[/eluser]
[quote author="hikari" date="1248798760"]Got a little problem here I used the Twisted1919 mods but I get a fatal error. any Idea what the problem is?


A PHP Error was encountered

Severity: Notice

Message: Undefined property: OpenInviter::$plugin

Filename: OpenInviter/openinviter.php

Line Number: 391

Fatal error: Call to a member function isEmail() on a non-object in /home/advancg6/public_html/taiwanoutlet/ci/OpenInviter/openinviter.php on line 391[/quote]

I had the same error but my stats weren't enabled in the config file. I just forgot to delete the postinstall.php file in de openinviter folder. This only became clear to me when I tried to use the example file.
#14

[eluser]Aaron L.[/eluser]
Okay, so I'm getting a similar error. It looks like it's actually able to log-in, etc. When I print out the OI array, I get all of my contacts but I still get the errors posted below.

My stats are disabled in /openinviter/config.php and I ran then deleted postinstall.php and everything looked good. Still no dice.

Here are the errors:
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined index: facebook

Filename: openinviter/openinviter.php

Line Number: 146
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined index: facebook

Filename: openinviter/openinviter.php

Line Number: 181
Code:
A Database Error Occurred

Error Number: 1146

Table 'db65438_mysite.ospc_imported' doesn't exist

INSERT INTO `ospc_imported` (`name`, `email_address`, `status`, `time_imported`) VALUES ('Bob Brown', 10234127, 0, 1262899937)

I run into the same errors regardless of the plugin that's being used.
Anyone have any ideas? Thanks if you can help Smile
#15

[eluser]Firestorm Creative Studios[/eluser]
looks like the invter wrapper library doesnt call a spcific function to let the OpenInviter object know which plugins are available. just add the code at line 19(ish) and it should start working:

Code:
18 $oi = new OpenInviter();
19 $oi_services = $oi->getPlugins();
20 $oi->startPlugin($plugin);

also, comment out line 30 if you don't have the database setup yet to handle the imported data:

Code:
30 //$this->_store_invited();

also note, without looking to deep, if you downloaded the core from OpenInviter, it came with all the plugins. i'm not sure if the getPlugins() function loads all the plugins or not, but it might be wise to remove the ones from the plugins folder you don't need just to make sure the footprint for the OpenInviter object doesnt get too big.

please disregard spelling mistakes. english is my first language.
#16

[eluser]The Wizard[/eluser]
@Firestorm Creative Studios: it did the trick Smile

thank you!
#17

[eluser]bondjp[/eluser]
1- So basically this will get the emails and save the array on the DB.

2- We then have to build our email and use the names on the DB or the array to send the invitation.

3- This will not send that message on openinviter/config.php : "You are invited to yourdomain.com" and " is inviting you to yourdomain.com"

Is this correct?
Thanks.
#18

[eluser]Muser[/eluser]
I am really interested with this implementation

It seems that there have been some changes to the class....

Can someone post a working version of it?

Thank you
#19

[eluser]Unknown[/eluser]
i am new to codeigniter. I used this code.But i am getting error. i used 'aol' as plugin name. But its giving error as 'Undefined index: aol'..

Then i entered into the function grab_contacts($plugin,$username,$password) and made a small change which is shown below in order to echo the error.

$this->plugin=new _hosted($plugin_name);
return $this->plugin;
exit();

Now i am getting error as shown below.

_hosted Object ( [login_ok:private] => [showContacts] => 1 [internalError] => [requirement] => [allowed_domains] => [service] => aol [timeout] => 60 [session_id:protected] => [curl:private] => [has_errors:private] => [debug_buffer:private] => Array ( ) [service_user] => [service_password] => [settings] => [messageDelay:private] => [maxMessages:private] => )


Can anybody help me by saying where i went wrong...Please.
#20

[eluser]Unknown[/eluser]
[quote author="Twisted1919" date="1247534707"]Hi , this wrapper works with the following changes :

The inviter Class

Code:
<?php
/* [email protected] inviter.php Fri May 22 04:00:19 GMT 2009 */

class inviter
{
    var $ci;
    var $imported;
    
    public function __construct()
    {
        $this->ci=& get_instance();
    }

    public function grab_contacts($plugin,$username,$password)
    {
        require_once($this->ci->config->item('absolute_url').'OpenInviter/openinviter.php');
        
        $oi    = new OpenInviter();
        
        $oi->startPlugin($plugin);
        //First modification , added the if clause
        if($oi->login($username,$password))
        {
            $array        =     $oi->getMyContacts();
            
            if(is_array($array) && count($array)>=1)
            {
                $this->imported        =    $array;
                
                $this->_store_invited();
                
                return($this->imported);
            }else{
                return;
            }
        }
        else
        {
        return 'ERROR on login.';
        }
    }
    
    private function _store_invited()
    {
        foreach($this->imported as $mail=>$name)
        {
            //Second modification , commented out the user_id /

            $a    =    array(   /* 'user_id'        =>    ospc_user_id(),*/
                            'name'            =>    $name,
                            'email_address'    =>    $mail,
                            'status'        =>    0,
                            'time_imported'    =>    time()    );
                            
            $this->ci->db->insert('ospc_imported',$a);
            
            unset($a);
        }
    }
}
?>
Notice that i commented out the user_id key from $a array , just because it showed errors when was not commented .
Also i added an if clause for login , because previously , when the login failed there where some nasty errors but now, when login fails , it shows "ERROR on login." ans the script stops .

I tried as follows , in one of my controllers
Code:
function openinviter()
    {
    ini_set('display_errors',1);
    error_reporting(E_ALL);    
    $this->load->library('Inviter');    
    $plugin = 'yahoo';
    $username = $this->input->post('username');
    $password = $this->input->post('password');
    if(empty($username) || empty($password))
        {
        echo '<form action="" method="post">
        Username :<input type="text" name="username" />
        <br />
        Password:&lt;input type="text" name="password" /&gt;
        <br />
        &lt;input type="submit" name="submit" value="send"/&gt;
        &lt;/form&gt;';
        }
    else
        {
        $users = $this->inviter->grab_contacts($plugin,$username,$password)   ;
        echo '<pre>';
        print_r($users);
        echo '</pre>';
        }    
    }

And everything went ok ,it printed the array with the needed values .

Hope that helps someone Smile[/quote]

Dear Twisted1919
I used ur code in my CI but its not working..i get following error

error 1--&gt;Message: file_put_contents(/tmp/oi_plugins.php) [function.file-put-contents]: failed to open stream: No such file or directory

Filename: OpenInviter/openinviter.php

Line Number: 343

Error 2--&gt;Message: fopen(/tmp\oi.1286100386.8284.cookie) [function.fopen]: failed to open stream: No such file or directory

Filename: plugins/_base.php

Line Number: 261

Error 3--&gt;Message: fclose(): supplied argument is not a valid stream resource

Filename: plugins/_base.php

Line Number: 262

Error 4--&gt;Message: fopen(/tmp/log_error.log) [function.fopen]: failed to open stream: No such file or directory

Filename: plugins/_base.php

Line Number: 514

Please Help.
Thank you




Theme © iAndrew 2016 - Forum software by © MyBB