vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Integration with vBulletin - OpenInviter Intergration (https://vborg.vbsupport.ru/showthread.php?t=211677)

BBR-APBT 04-19-2009 10:00 PM

OpenInviter Intergration
 
1 Attachment(s)
What is OpenInviterTM ?
Quote:

Open source OpenInviterTM (Open InviterTM) is an free import contacts (addressbook) script from email providers like Libero, Rambler, GMX.net, Mail.ru, Live/Hotmail, IndiaTimes, Azet, Web.de, FastMail, Lycos, Zapakmail, Hushmail, Evite, Yahoo!, Uk2, Mynet.com, Abv, OperaMail, Interia, Sapo.pt, Inbox.com, Mail.com, Clevergo, Rediff, Virgilio, Nz11, Doramail, Walla, Gawab, Wp.pt, Apropo, Popstarmail, AOL, Care2, Netaddress, Bigstring, GMail, Yandex, KataMail, Mail.in, 5Fm, Terra or social portals like Famiva, Orkut, Vimeo, Fdcareer, Flixster, Xing, Plaxo, Cyworld, Konnects, LinkedIn, Motortopia, Twitter, Last.fm, Kincafe, MySpace, Brazencareerist, Livejournal, Mydogspace, Tagged, Hyves, Skyrock, Hi5, Friendfeed, Flickr, Badoo, Lovento, Eons, Flingr, Bebo, Faces, Multiply, Friendster, Facebook, Perfspot, Mycatspace, Xuqa, Xanga, Plazes, Plurk, Mevio, Meinvz. This contacts importer script is integrating with content management systems (aka CMS) like phpFoX, SimpleMachines Forum (SMF), Joomla, JamRoom, Social Engine, Wordpress, phpizabi, myBB, joovili, jamit job, PhpBB, Boonex Dolphin, PunBB, Dating Pro, Joomla1.0, PHPMELODY, symfony, Drupal, vBulletin. Open Inviter is written in PHP 5 (no database required but cURL or wget required) and running on any webserver (tested on Apache) offering advanced tell a friend features. OpenInviterTM is a free self hosted solution that does not use a third party gateway (or API) to import contacts.

Install Instructions
1. Upload the oi_settings.php to the adminCP dir.
2. Import the product-openinviter.xml

Done for my side of things.

Go to: http://openinviter.com/
1.Sign up for an account and download the package for vbulletin.
2.copy the Openinviter folder to your root vBulletin
3.Do nothing with the oi_settings.php and product-openinvitervbulletinediti.xml that come with their version.

If you use theirs, there is a security hole which I have patched in mine. I am waiting for them to email me back.

What did I change?
Changed how it is displayed in misc.php not index.php.
Also changed how it is displayed on the page in its own table instead of above the header.
Made the admin panel page alot nicer to look at.
Fixed security issues.


Fixes for their code.
Code:

Their code for vbulletin is a little messed up go to the Openinviter folder.
Open frontend.php add (echo $oi_display) at the bottom before the php close tag(i.e. ?>).
In the same file search for $contents and replace with $oi_display


I hope you enjoy
Please Click install.
Note support will not be giving if you don't.

BBR-APBT 04-20-2009 01:15 AM

Reserved

hscorp 04-20-2009 01:49 AM

very nice but i think it would be better if you made a nice design for it not just like that

regards :)

dirtycrow 04-20-2009 02:12 AM

doesn't seem to create a menu link for me.

dirtycrow 04-20-2009 02:15 AM

i take that back, it's under "quick links" but when selected nothing is displayed, just a " Import your friends" header and nothing underneath.

BBR-APBT 04-20-2009 02:24 AM

Quote:

Originally Posted by dirtycrow (Post 1794881)
i take that back, it's under "quick links" but when selected nothing is displayed, just a " Import your friends" header and nothing underneath.

Did you follow all of the instructions?

BBR-APBT 04-20-2009 02:26 AM

Quote:

Originally Posted by hscorp (Post 1794871)
very nice but i think it would be better if you made a nice design for it not just like that

regards :)

I don't want to edit the frontend.php because you have to get that from openinviter.com.
I can not give out their whole package. You will have to ask them to change it or do that part your self.

Xencored 04-20-2009 02:44 AM

Tagged looks good mate

ill be keeping my eye on this one :up:

jacobomoya 04-20-2009 06:58 AM

Thanks for this mod!

With import, put auto the refered user?

Thanks a lot.

soletrader 04-20-2009 07:17 AM

Anyone with facebook connect, this hack wont work.

BBR-APBT 04-20-2009 09:45 AM

Quote:

Originally Posted by soletrader (Post 1794988)
Anyone with facebook connect, this hack wont work.

Whats the problem your having. I may be able to find a fix.

BBR-APBT 04-20-2009 09:49 AM

Quote:

Originally Posted by jacobomoya (Post 1794982)
Thanks for this mod!

With import, put auto the refered user?

Thanks a lot.

I am working on it later today to generate a Referral Link.

TimberFloorAu 04-20-2009 10:19 AM

*tagged*

nascartr 04-20-2009 02:17 PM

When I try to submit my invotes with Yahoo and Hotmail I get a security token error.

Quote:

Your submission could not be processed because a security token was missing.

If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error.
In the admin panel if I try to save my settings I get this error.

Quote:

Warning: file_put_contents([path]/admincp/../OpenInviter/config.php) [function.file-put-contents]: failed to open stream: Permission denied in [path]/admincp/oi_settings.php on line 89

F0xy 04-20-2009 02:37 PM

this would be so much better if it was implemented into the user registration. During registration through facebook, bebo and myspace etc this is thrown up during the registration process which would mean each new member would be emailing there mates while registering on your site.

dirtycrow 04-20-2009 02:46 PM

Quote:

Originally Posted by BBR-APBT (Post 1794883)
Did you follow all of the instructions?

yes, i do believe so.

dirtycrow 04-20-2009 02:51 PM

Quote:

Originally Posted by soletrader (Post 1794988)
Anyone with facebook connect, this hack wont work.

i used to have facebook connect, have since uninstalled it. could this be my issue?

nascartr 04-20-2009 02:56 PM

Quote:

Originally Posted by dirtycrow (Post 1795212)
i used to have facebook connect, have since uninstalled it. could this be my issue?


I did too, but uninstalled it a few months ago.

ICEEXOL 04-20-2009 03:19 PM

Invitations section does not appear.

https://vborg.vbsupport.ru/external/2009/04/51.jpg

dirtycrow 04-20-2009 03:26 PM

Quote:

Originally Posted by ICEEXOL (Post 1795233)
Invitations section does not appear.

https://vborg.vbsupport.ru/external/2009/04/51.jpg

yup, same boat.

amjadz4 04-20-2009 03:35 PM

nice mod! Thanks!

Having the same issue as above! Nothing shows in the Import friends page. Its empty!

:(

skylab 04-20-2009 04:09 PM

I could def use this however I do have Facebook Connect.
I'll keep an eye out for this.

nascartr 04-20-2009 04:37 PM

Make sure to apply the changes above to the frontend.php file in the Openinviter folder you downloaded from OpenInviter.com

Quote:

Their code for vbulletin is a little messed up go to the Openinviter folder.
Open frontend.php add
Code:

echo $oi_display
at the bottom before the php close tag(i.e.
Code:

?>
).
In the same file search for
Code:

$contents
and replace with
Code:

$oi_display


nascartr 04-20-2009 04:39 PM

I need someone that has got this working to let me know if they received the security token error and if the admin options are giving them problems too.

amjadz4 04-20-2009 04:49 PM

There are two $contents ... do we have to replace them both?

im getting the
Quote:

Your submission could not be processed because a security token was missing.
error too

nascartr 04-20-2009 06:16 PM

I just replaced one and received the same error.

BBR-APBT 04-20-2009 06:28 PM

Quote:

Originally Posted by nascartr (Post 1795176)
When I try to submit my invotes with Yahoo and Hotmail I get a security token error.



In the admin panel if I try to save my settings I get this error.

You have to edit the frontend.php I think I may release mine here in this post for people to use I have to email a moderator and ask if I can.


The error in the adminCP is you have to chmod config.php to 777.

nascartr 04-20-2009 06:32 PM

Quote:

Originally Posted by BBR-APBT (Post 1795372)
You have to edit the frontend.php I think I may release mine here in this post for people to use I have to email a moderator and ask if I can.


The error in the adminCP is you have to chmod config.php to 777.

Fixed the Admin CP problem by changing permissions. The frontend.php has been edited following your directions as I posted above but I still receive the security token error.

nascartr 04-20-2009 06:34 PM

Quote:

Originally Posted by amjadz4 (Post 1795305)
There are two $contents ... do we have to replace them both?

im getting the error too


I tried replacing both $contents with the $oi_display and still get the security token error.

BBR-APBT 04-20-2009 06:34 PM

Security token fix here. This is not my code I just fixed it up so it works and it looks a little nicer. The security token error was not my fault as I didn't code the frontend.php Thats right from them here is my version. below that works.


Remember to edit the second line below. path to forum global

Frontend.php
Code:

<?php
require_once('/path/to/your/forum/dir/global.php');
$oi_sectok = $vbulletin->userinfo['securitytoken'];
                                if (!$oi_sectok)
                                {
                                        $oi_sectok = 'none';
}
include('openinviter.php');
$inviter=new OpenInviter();
$oi_services=$inviter->getPlugins();
if (isset($_POST['provider_box']))
{
        if (isset($oi_services['email'][$_POST['provider_box']])) $plugType='email';
        elseif (isset($oi_services['social'][$_POST['provider_box']])) $plugType='social';
        else $plugType='';
}
else $plugType = '';
function ers($ers)
        {
        if (!empty($ers))
                {
                $oi_display="<table cellspacing='0' cellpadding='0' style='border:1px solid red;' align='center' class='tbErrorMsgGrad'><tr><td valign='middle' style='padding:3px' valign='middle' class='tbErrorMsg'><img src='/images/ers.gif'></td><td valign='middle' style='color:red;padding:5px;'>";
                foreach ($ers as $key=>$error)
                        $oi_display.="{$error}<br >";
                $oi_display.="</td></tr></table><br >";
                return $oi_display;
                }
        }
       
function oks($oks)
        {
        if (!empty($oks))
                {
                $oi_display="<table border='0' cellspacing='0' cellpadding='10' style='border:1px solid #5897FE;' align='center' class='tbInfoMsgGrad'><tr><td valign='middle' valign='middle' class='tbInfoMsg'><img src='/images/oks.gif' ></td><td valign='middle' style='color:#5897FE;padding:5px;'>        ";
                foreach ($oks as $key=>$msg)
                        $oi_display.="{$msg}<br >";
                $oi_display.="</td></tr></table><br >";
                return $oi_display;
                }
        }

if (!empty($_POST['step'])) $step=$_POST['step'];
else $step='get_contacts';

$ers=array();$oks=array();$import_ok=false;$done=false;
if ($_SERVER['REQUEST_METHOD']=='POST')
        {
        if ($step=='get_contacts')
                {
                if (empty($_POST['email_box']))
                        $ers['email']="Email missing";
                if (empty($_POST['password_box']))
                        $ers['password']="Password missing";
                if (empty($_POST['provider_box']))
                        $ers['provider']="Provider missing";
                if (count($ers)==0)
                        {
                        $inviter->startPlugin($_POST['provider_box']);
                        $internal=$inviter->getInternalError();
                        if ($internal)
                                $ers['inviter']=$internal;
                        elseif (!$inviter->login($_POST['email_box'],$_POST['password_box']))
                                {
                                $internal=$inviter->getInternalError();
                                $ers['login']=($internal?$internal:"Login failed. Please check the email and password you have provided and try again later");
                                }
                        elseif (false===$contacts=$inviter->getMyContacts())
                                $ers['contacts']="Unable to get contacts.";
                        else
                                {
                                $import_ok=true;
                                $step='send_invites';
                                $_POST['oi_session_id']=$inviter->plugin->getSessionID();
                                $_POST['message_box']='';
                                }
                        }
                }
        elseif ($step=='send_invites')
                {
                if (empty($_POST['provider_box'])) $ers['provider']='Provider missing';
                else
                        {
                        $inviter->startPlugin($_POST['provider_box']);
                        $internal=$inviter->getInternalError();
                        if ($internal) $ers['internal']=$internal;
                        else
                                {
                                if (empty($_POST['email_box'])) $ers['inviter']='Inviter information missing';
                                if (empty($_POST['oi_session_id'])) $ers['session_id']='No active session';
                                if (empty($_POST['message_box'])) $ers['message_body']='Message missing';
                                else $_POST['message_box']=strip_tags($_POST['message_box']);
                                $selected_contacts=array();$contacts=array();
                                $message=array('subject'=>$inviter->settings['message_subject'],'body'=>$inviter->settings['message_body'],'attachment'=>"\n\rAttached message: \n\r".$_POST['message_box']);
                                if ($inviter->showContacts())
                                        {
                                        foreach ($_POST as $key=>$val)
                                                if (strpos($key,'check_')!==false)
                                                        $selected_contacts[$_POST['email_'.$val]]=$_POST['name_'.$val];
                                                elseif (strpos($key,'email_')!==false)
                                                        {
                                                        $temp=explode('_',$key);$counter=$temp[1];
                                                        if (is_numeric($temp[1])) $contacts[$val]=$_POST['name_'.$temp[1]];
                                                        }
                                        if (count($selected_contacts)==0) $ers['contacts']="You haven't selected any contacts to invite";
                                        }
                                }
                        }
                if (count($ers)==0)
                        {
                        $sendMessage=$inviter->sendMessage($_POST['oi_session_id'],$message,$selected_contacts);
                        $inviter->logout();
                        if ($sendMessage===-1)
                                {
                                $message_footer="\r\n\r\nThis invite was sent using OpenInviter technology.";
                                $message_subject=$_POST['email_box'].$message['subject'];
                                $message_body=$message['body'].$message['attachment'].$message_footer;
                                $headers="From: {$_POST['email_box']}";
                                foreach ($selected_contacts as $email=>$name)
                                        vbmail($email, $message_subject, $message_body, true);
                                $oks['mails']="Mails sent successfully";
                                }
                        elseif ($sendMessage===false)
                                {
                                $internal=$inviter->getInternalError();
                                $ers['internal']=($internal?$internal:"There were errors while sending your invites.<br>Please try again later!");
                                }
                        else $oks['internal']="Invites sent successfully!";
                        $done=true;
                        }
                }
        }
else
        {
        $_POST['email_box']='';
        $_POST['password_box']='';
        $_POST['provider_box']='';
        }

$oi_display="<script type='text/javascript'>
        function toggleAll(element)
        {
        var form = document.forms.openinviter, z = 0;
        for(z=0; z<form.length;z++)
                {
                if(form[z].type == 'checkbox')
                        form[z].checked = element.checked;
                  }
        }
</script>";
$oi_display.="<form action='' method='POST' name='openinviter'>".ers($ers).oks($oks);
if (!$done)
        {
        if ($step=='get_contacts')
                {
                $oi_display.="<table align='center' class='thTable' cellspacing='0' cellpadding='3' style='border:none;'>
                        <tr><td align='left'><label for='email_box'><strong>Email</strong></label></td><td><label for='password_box'><strong>Password</strong></label></td><td><label for='provider_box'><strong>Email provider</strong></label></td></tr>
                        <tr><td><input type='text' name='email_box' value='{$_POST['email_box']}' autocomplete='off'>  </td><td><input type='password' name='password_box' value='{$_POST['password_box']}' autocomplete='off'>  </td><td><select name='provider_box'><option value=''></option>
                ";
                foreach ($oi_services as $type=>$providers)       
                        {
                        $oi_display.="<option disabled>".$inviter->pluginTypes[$type]."</option>";
                        foreach ($providers as $provider=>$details)
                                $oi_display.="<option value='{$provider}'".($_POST['provider_box']==$provider?' selected':'').">{$details['name']}</option>";
                        }
                $oi_display.="</select></td></tr>
                        <tr><td colspan='3' align='center'><input type='hidden' name='securitytoken' value='$oi_sectok'><input type='submit' name='import' value='Import Contacts'></td></tr>
                </table><input type='hidden' name='step' value='get_contacts'>";
                }
        else
                $oi_display.="<table cellspacing='0' cellpadding='0' style='border:none;' align='center'>
                                <tr><td align='left' valign='top'><label for='message_box'><strong>Message</strong></label><br /></td></tr>
                                <tr><td><textarea rows='5' cols='50' name='message_box' style='width:300px;'>{$_POST['message_box']}</textarea></td></tr>
                                <tr><td align='center'><input type='submit' name='send' value='Send Invites'><br /><br /></td></tr>
                        </table>";
        }
if (!$done)
        {
        if ($step=='send_invites')
                {
                if ($inviter->showContacts())
                        {
                        $oi_display.="<table class='tborder' align='center' cellspacing='0' cellpadding='3'><tr class='tcat'><td colspan='".($plugType=='email'? "3":"2")."'><strong>Your contacts</strong></td></tr>";
                        if (count($contacts)==0)
                                $oi_display.="<tr class='alt1'><td align='center' style='padding:20px;' colspan='".($plugType=='email'? "3":"2")."'>You do not have any contacts in your address book.</td></tr>";
                        else
                                {
                                $oi_display.="<tr class='alt2'><td><input type='checkbox' onChange='toggleAll(this)' name='toggle_all' title='Select/Deselect all' checked>on/off</td><td>Name</td>".($plugType == 'email' ?"<td>E-mail</td>":"")."</tr>";
                                $odd=true;$counter=0;
                                foreach ($contacts as $email=>$name)
                                        {
                                        $counter++;
                                        if ($odd) $class='alt1'; else $class='alt2';
                                        $oi_display.="<tr class='{$class}'><td><input name='check_{$counter}' value='{$counter}' type='checkbox' class='thCheckbox' checked><input type='hidden' name='email_{$counter}' value='{$email}'><input type='hidden' name='name_{$counter}' value='{$name}'></td><td>{$name}</td>".($plugType == 'email' ?"<td>{$email}</td>":"")."</tr>";
                                        $odd=!$odd;
                                        }
                                $oi_display.="<tr class='tfoot'><td colspan='".($plugType=='email'? "3":"2")."' style='padding:3px;' align='center'><input type='submit' name='send' value='Send invites' class='thButton'></td></tr>";
                                }
                        $oi_display.="</table>";
                        }
                $oi_display.="<input type='hidden' name='step' value='send_invites'>
            <input type='hidden' name='s' value='$session[sessionhash]'>
                        <input type='hidden' name='securitytoken' value='$oi_sectok'>
                        <input type='hidden' name='provider_box' value='{$_POST['provider_box']}'>
                        <input type='hidden' name='email_box' value='{$_POST['email_box']}'>
                        <input type='hidden' name='oi_session_id' value='{$_POST['oi_session_id']}'>";
                }
        }
$oi_display.="</form>";
echo $oi_display;
?>


BBR-APBT 04-20-2009 06:41 PM

Quote:

Originally Posted by amjadz4 (Post 1795305)
There are two $contents ... do we have to replace them both?

im getting the error too

In my instructions I said replace all of them. So yes both of them need to be replaced.
If the owner of that site would ever email me back I am going to try and make this the official vBulletin release for here and the site. You can tell he rushed through the vbulletin side of things. It never worked out the box.

I had to implant my own CSRF security token stuff my self in the above file.

nascartr 04-20-2009 06:43 PM

That gave me an ugly error!

Code:

Warning: require_once(/public_html/community/global.php) [function.require-once]: failed to open stream: No such file or directory in [path]/OpenInviter/frontend.php on line 2

Fatal error: require_once() [function.require]: Failed opening required '/public_html/community/global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/nascartr/public_html/community/OpenInviter/frontend.php on line 2

This is what my 2nd line was like.

Code:

require_once('/public_html/community/global.php');

BBR-APBT 04-20-2009 06:43 PM

Quote:

Originally Posted by dirtycrow (Post 1795240)
yup, same boat.

Quote:

Originally Posted by ICEEXOL (Post 1795233)
Invitations section does not appear.

https://vborg.vbsupport.ru/external/2009/04/51.jpg

The link is put in the Quick links tab. Says Invite Friends.

That used to only show when on index.php I had to fix that too.

BBR-APBT 04-20-2009 06:44 PM

Quote:

Originally Posted by nascartr (Post 1795388)
That gave me an ugly error!

Code:

Warning: require_once(/public_html/community/global.php) [function.require-once]: failed to open stream: No such file or directory in [path]/OpenInviter/frontend.php on line 2

Fatal error: require_once() [function.require]: Failed opening required '/public_html/community/global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/nascartr/public_html/community/OpenInviter/frontend.php on line 2

This is what my 2nd line was like.

Code:

require_once('/public_html/community/global.php');

Please enter the full path. home/user/public_html/community.

nascartr 04-20-2009 06:48 PM

Ok, that worked!

BBR-APBT 04-20-2009 06:49 PM

Quote:

Originally Posted by nascartr (Post 1795394)
Ok, that worked!

All set now?

nascartr 04-20-2009 06:49 PM

After sending the invites I had a blank image with an X. http://diecastcrazy.com/images/oks.gifMails sent successfully


Supposedly it leads to http://diecastcrazy.com/images/oks.gif but I do not have any image files, should they have been included with the OpenInviter package?

BBR-APBT 04-20-2009 06:54 PM

Yet another thing they have forgot oven at OpenInviter. Yes that should of came with the OpenInviter Package. I will make a x and a checkmark image here in a few minutes.

nascartr 04-20-2009 06:57 PM

Thanks!

BBR-APBT 04-20-2009 07:05 PM

1 Attachment(s)
Ok here are the missing images. I made them my self they are not the ones that came with OpenInviter. Feel free to make your own. Be sure to edit frontend.php to link to the new images.

Remember every one I said its in its beta stage. I am compiling all these post to make some new install instruction instructions.
Hopefully they email me back so I can include the frontend.php with this as it will hopefully be the official release. All the errors every one is getting is from OpenInviter code not mine. But hey at least I fixed it for every one here.


All times are GMT. The time now is 05:23 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01713 seconds
  • Memory Usage 1,897KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_code_printable
  • (21)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete