Welcome Guest, Not a member yet? Register   Sign In
Invite friend application
#11

[eluser]garymardell[/eluser]
Have you loaded it?
Or how have you loaded it?
#12

[eluser]Dam1an[/eluser]
You need to be more specific, can we see the code where you load and use it?
Where did you save the library, Did you follow the proper guidelines for the case of the name?

Edit: At least I didn't get beat by the Fuzz for once Smile
#13

[eluser]evil_penguin[/eluser]
the library is :
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class importer
{
var $ci;
var $imported;

public function __construct()
{
$this->ci=&get;_instance();
}

public function grab_contacts($plugin,$username,$password)
{
require_once($this->ci->config->item('base_url').'libraries/openinviter/openinviter.php');

$oi = new OpenInviter();

$oi->startPlugin($plugin);
$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;
}
}

private function _store_invited()
{
foreach($this->imported as $mail=>$name)
{
$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);
}
}
}
?>


and this is the controller where i m loading it...


<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends Controller {

function Welcome()
{
parent::Controller();
$this->load->helper('url');

}

function index()
{
//$this->load->view('example');
$this->load->library('email');
$this->load->library('importer');
$this->load->view('postinstall');
//$this->load->view('example');
}
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */
#14

[eluser]garymardell[/eluser]
Okay, and where have you got the openinviter files?

Also once loading the library you haven't actually done anything with it.
So what was the error you were experiencing?
#15

[eluser]evil_penguin[/eluser]
I have downloaded the openinviter package from OpenInviter.com.
In the package there in two class 1>openinviter.php 2> openinviter_base.php.
There is one postinstall.php file and one example.php.And some plugins.
I have kept the openinviter.php and openinviter_base.php in library file.
and postinstall and example.php in view. In imopter.php the openinviter.php is included.
I created a controller and i have loaded the library importer.php and postinstall.php.
It is working properly on my localhost. but not working on my dev site??
#16

[eluser]evil_penguin[/eluser]
does openinviter work with php 4.3.9
#17

[eluser]Dam1an[/eluser]
There's this wonderful thing called a FAQ on the site!
I think Q5 will be of interest to you
#18

[eluser]evil_penguin[/eluser]
[quote author="Dam1an" date="1247065694"]There's this wonderful thing called a FAQ on the site!
I think Q5 will be of interest to you[/quote] Thanks for ur wonderful suggestion :coolsmirk:




Theme © iAndrew 2016 - Forum software by © MyBB