PDA

View Full Version : Integrate ArticleLive with forums


roosevelt
02-20-2005, 09:00 PM
I looked all over the website and on different search engines, but is there anyway to integrate ArticleLive PHP with different forum softwares, such as vbulletin or IPB? Thank you in advance.

Chris S
02-24-2005, 11:05 PM
Hey,

It depends on what you're after.

If you want to just display the most recent threads somewhere then I can show you how to do that...

I looked all over the website and on different search engines, but is there anyway to integrate ArticleLive PHP with different forum softwares, such as vbulletin or IPB? Thank you in advance.

roosevelt
02-26-2005, 04:42 AM
I could actually do them myself by using SSI included in Invision Power Board, but i was looking for way to integrate the user database system of forums like IPB and vbulletin. Like the users don't have to register twice to use the site and the forums, one registration will do the task for both systems.

Chris S
03-07-2005, 12:09 AM
Ahh.

We don't really have an API to do this, but you can have a look at the al_users table and see what you need to include there.. the only thing you'll need to know is that if there is a username & password set, they are 'interactive' (ie they can log in)... permissions can be found in the admin/includes/classes/class.auth.php file - see the _SetupPermissions function for a description of each bit.

I could actually do them myself by using SSI included in Invision Power Board, but i was looking for way to integrate the user database system of forums like IPB and vbulletin. Like the users don't have to register twice to use the site and the forums, one registration will do the task for both systems.

Ozark
03-09-2005, 09:48 PM
Hey,

It depends on what you're after.

If you want to just display the most recent threads somewhere then I can show you how to do that...

Chris,

I would love to be shown how to do that. Just showing recent threads from VBulletin would be nice. :D

I am running the php version.

Chris S
03-17-2005, 11:20 PM
Hey,

I've attached a script for you.

You'll need to modify the following at the top:


define('XML_URL', 'http://www.yoursite.com/forum/external.php?type=rss2');


and possibly:

define('NUMBER_OF_ENTRIES_TO_SHOW', 5);
define('MAX_POST_LENGTH', 40);


depending on your needs.

Also you may need to change the html a little bit, adapt to your needs.

This assumes you have rss2 set up for vbulletin, it doesn't work for rss1 or atom feeds.

Then you just


include('/path/to/file.php');


where-ever you want it (eg in the right panel? edit the templates/template_name/Panels/DefaultRightColumn.php file) and then you access the 'mycontent' variable. For example:


include(dirname(__FILE__) . "/../../../forumposts.php");
$parsedPanelData .= $mycontent;


done..

Chris,

I would love to be shown how to do that. Just showing recent threads from VBulletin would be nice. :D

I am running the php version.

Ozark
03-18-2005, 03:23 AM
Thanks Chris!

Chris S
03-20-2005, 10:31 PM
No problems...

Thanks Chris!

Sola
04-19-2005, 08:32 PM
This looks like it will be my best shot at achieving this, if I can clarify a few things PLEASE Chris.

You'll need to modify the following at the top:

define('XML_URL', 'http://www.yoursite.com/forum/external.php?type=rss2');


ME: Done.

and possibly:

define('NUMBER_OF_ENTRIES_TO_SHOW', 5);
define('MAX_POST_LENGTH', 40);



ME: Good to go.

This assumes you have rss2 set up for vbulletin, it doesn't work for rss1 or atom feeds.
ME: Okay. VB3


include('/path/to/file.php');


ME: Is this path /home/user/public_html/vbulletin/forumposts.php?
OR: /home/user/public_html/templates/default/panel/forumposts.php?

Does it matter where you place the file you attached?
An example placement and path would be nice please.

where-ever you want it (eg in the right panel?
ME: Yes, right panel of the Default Stretched template.

edit the templates/template_name/Panels/DefaultRightColumn.php file) and then you access the 'mycontent' variable. For example:
ME: Sorry, not clear here. I take it you mean add it to one of these:
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("PopularAuthorsPanel1"); PLEASE give an example again.
And what is the $mycontent part of it?


include(dirname(__FILE__) . "/../../../forumposts.php");
$parsedPanelData .= $mycontent;

ME: Please see comments directly above.

Sorry for the inconvenience.
Thank you.

Chris S
04-20-2005, 01:22 AM
Hi Sola,

This looks like it will be my best shot at achieving this, if I can clarify a few things PLEASE Chris.


include('/path/to/file.php');


ME: Is this path /home/user/public_html/vbulletin/forumposts.php?
OR: /home/user/public_html/templates/default/panel/forumposts.php?

It depends on where you put the file. If you put the file in your vbulletin folder, then use that path. If you put the file in another folder, then reference it there.


Does it matter where you place the file you attached?
An example placement and path would be nice please.

No, it doesn't matter. If you leave it outside the templates folder then you can (more) easily access it from any of your templates, so for example:

/home/user/public_html/templates/forumposts.php

Then you can:

include('/home/user/public_html/templates/forumposts.php');


or you might want it inside your forums folder so any of your apps can reference it easily, it's up to you. Just remember where you put it ;)


edit the templates/template_name/Panels/DefaultRightColumn.php file) and then you access the 'mycontent' variable. For example:
ME: Sorry, not clear here. I take it you mean add it to one of these:
PLEASE give an example again.
And what is the $mycontent part of it?


include(dirname(__FILE__) . "/../../../forumposts.php");
$parsedPanelData .= $mycontent;

ME: Please see comments directly above.

Sorry for the inconvenience.
Thank you.
The file itself creates a '$mycontent' variable containing all of the data.

So exactly the way you have it, include the file then add it to your parsedpaneldata:


include(dirname(__FILE__) . "/../../../forumposts.php");
$parsedPanelData .= $mycontent;

Sola
04-20-2005, 04:07 AM
Thanks. I believe I have it, except for WHERE PRECISELY to place the code below inside defaultrightcolumpanel.php:

include(dirname(__FILE__) . "/../../../forumposts.php");
$parsedPanelData .= $mycontent;

All I get is "failed to open stream.." errors.

Can I email a defaultrightcolumpanel.php to you so you post an example in for me PLEASE? Or you could attach one temporarily to this thread. Or email it to me at krazitivity (at) yahoo.com

Yes, you guessed I'm no coder by now...(:

Chris S
04-21-2005, 12:45 AM
Hi Sola,

Where do you want it?

If you want it after the "ArticlesToReadPanel" then:


$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("ArticlesToReadPanel1");

// forum posts show after the "ArticlesToRead" panel.
include("/path/to/forumposts.php");
$parsedPanelData .= $mycontent;

$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("ArticleHistoryPanel1");



Move those few lines up and down until you're happy about where they show up.

Change the include() call to the right path (see my other post about this).

Thanks. I believe I have it, except for WHERE PRECISELY to place the code below inside defaultrightcolumpanel.php:

include(dirname(__FILE__) . "/../../../forumposts.php");
$parsedPanelData .= $mycontent;

All I get is "failed to open stream.." errors.

Can I email a defaultrightcolumpanel.php to you so you post an example in for me PLEASE? Or you could attach one temporarily to this thread. Or email it to me at krazitivity (at) yahoo.com

Yes, you guessed I'm no coder by now...(:

Sola
04-21-2005, 02:36 AM
Works like a charm. :)
Thanks for your patience. Saving this thread...

Christopher
04-21-2005, 07:35 PM
hm...I add in left panel:
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("RootArticleCategoriesPanel");
// MY PART
include("http://localhost/forum/last.php");
$parsedPanelData .= $mycontent;
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("SmallSearchPanel");

it`s work but recent 10 topics from my Invision Board appears in the header(before the logo), not after categories panel. Why? Help me please.

Chris S
04-22-2005, 01:05 AM
Hi,

It might be because of the way you're including it.

Where did the 'last.php' script come from?
Is it part of invision board ?

hm...I add in left panel:
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("RootArticleCategoriesPanel");
// MY PART
include("http://localhost/forum/last.php");
$parsedPanelData .= $mycontent;
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("SmallSearchPanel");

it`s work but recent 10 topics from my Invision Board appears in the header(before the logo), not after categories panel. Why? Help me please.

Christopher
04-22-2005, 02:07 PM
Chris (Interspire Staff), it`s a self-made hack for Invision Board.

Christopher
04-25-2005, 11:00 AM
and how to resolve this problem? A try to include other scripts like OneAdmin 3.0 and I have the same thing. Help me pliz! Thank you

Chris S
04-26-2005, 12:58 AM
Hi,

In your 'last.php' file, it looks like you're echo'ing out the result, something like:


echo $data;


That'll be the problem... You need to get it all into a string (if you're just displaying it) so then you can access it from the other script.

Without seeing that file though we're all only guessing.

and how to resolve this problem? A try to include other scripts like OneAdmin 3.0 and I have the same thing. Help me pliz! Thank you

Christopher
04-26-2005, 08:04 AM
Chris, my last.php in attach. Please help me.

DWA
04-26-2005, 06:00 PM
Christopher,

I accidently jump to this forum and saw that you have problem with include function
Either your PHP run as CGI or something else, I believe that you can solve your problem by doing as follow:

$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("RootArticleCategoriesPanel");

// YOUR PART
$parsedPanelData .= file_get_contents("http://localhost/forum/last.php");

$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("SmallSearchPanel");

____________________
Anyway,
this CMS looks interesting :)

Chris S
04-27-2005, 01:34 AM
Hi Chris,

Here's a new file.. I removed an unecessary switch and function to clean it up. Where do you start the table - at the end you have an < / td > < / tr > and so on ... .???

Anyway I changed it so it puts everything into a $forum_output variable and then in articlelive you can:


include('path/to/file.php');
$parsedpaneldata .= $forum_output;


Chris, my last.php in attach. Please help me.

Christopher
04-27-2005, 01:12 PM
DWA, yeah! with get_file_conten it WORKS! :-) Thank you, DWA. Thank you Chris.
The next problem. I want to add the Advanced Poll system, if I write:

$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("RootArticleCategoriesPanel");

// MY PART
include_once "h:/home/localhost/www/poll/booth.php";
echo $php_poll->poll_process(4);

$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("SmallSearchPanel");


it`s work but the poll appears in the header :-) Help me please.

I try to rewrite "MY PART" that way:

// MY PART
$parsedPanelData .= file_get_contents("h:/home/localhost/www/poll/booth.php");
echo $php_poll->poll_process(4);

but it can`t work. DWA, may be you can help me?

DWA
04-27-2005, 07:40 PM
What is echo $php_poll->poll_process(4); for?
Can booth.php appear in your browser when you type http://www.yourdomain.com/poll/booth.php?

Christopher
04-28-2005, 07:54 AM
DWA, echo $php_poll->poll_process(4) if for choosing the poll, for example poll number 4.
With typing http://www.yourdomain.com/poll/booth.php? I have a white screen :-(

DWA
04-28-2005, 01:26 PM
I wonder if you can produce a shortcut something like: http://www.yourdomain.com/poll/poll.php?do=showresults&pollid=4

It will be easier to parse

Chris S
04-29-2005, 01:01 AM
You could try:


ob_start();
echo $php_poll->poll_process(4);
$poll_display = ob_get_contents();
ob_end_clean();

$parsedPanelData .= $poll_display;


DWA, echo $php_poll->poll_process(4) if for choosing the poll, for example poll number 4.
With typing http://www.yourdomain.com/poll/booth.php? I have a white screen :-(

Christopher
05-01-2005, 03:00 PM
DWA, no it does not work. The new thread about poll integrating - http://www.interspire.com/forum/showthread.php?p=24404#post24404

Chris S
05-02-2005, 02:04 AM
Did you try my method?

http://www.interspire.com/forum/showthread.php?postid=24349#post24349

DWA, no it does not work. The new thread about poll integrating - http://www.interspire.com/forum/showthread.php?p=24404#post24404

Christopher
05-02-2005, 07:40 AM
No, it doesnt work. I write
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("SmallSearchPanel");
// MY PART
$parsedPanelData .= file_get_contents("http://localhost/poll/booth.php");
ob_start();
echo $php_poll->poll_process(4);
$poll_display = ob_get_contents();
ob_end_clean();
$parsedPanelData .= $poll_display;
//END OF MY PART
return $parsedPanelData;

but all I have is a white screen instead of my articlelive portal.

Chris S
05-02-2005, 07:49 AM
Try this.

$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("SmallSearchPanel");
include_once "h:/home/localhost/www/poll/booth.php";
ob_start();
echo $php_poll->poll_process(4);
$poll_display = ob_get_contents();
ob_end_clean();
$parsedPanelData .= $poll_display;
return $parsedPanelData;

No, it doesnt work. I write
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("SmallSearchPanel");
$parsedPanelData .= file_get_contents("http://localhost/poll/booth.php");
ob_start();
echo $php_poll->poll_process(4);
$poll_display = ob_get_contents();
ob_end_clean();
$parsedPanelData .= $poll_display;
return $parsedPanelData;

but all I have is a white screen instead of my articlelive portal.

Christopher
05-02-2005, 08:04 AM
No, Chris, really white screen I have. I attache booth.php in previous post. May be it can help. Thank you

DWA
05-02-2005, 05:53 PM
What if you put
echo $php_poll->poll_process(4);
at the last line of booth.php

The idea is to show the output whenever booth.php is called

If then http:/www.yourdomain.com/poll/booth.php show something, you can parse it with file_get_contents

Christopher
05-03-2005, 06:40 AM
DWA, yeah, I try it. It works but when I click results or vote button the information show in booth.php :-) not in index.php. Understand me?

DWA
05-03-2005, 02:32 PM
I understand now
But correct me if I'm wrong

1. ArticleLive doesn't have a poll system
2. You try to put a poll panel (as a plug in) on the right or left column of your 3 colums default/initial page
3. So user will be able to vote directly from the default/initial page
4. When user choose an option and the click the vote button, you expect the result will be shown either in the left/right or center column
5. booth.php is included into the index.php during the initial stage of index.php
6. If then you run the process of booth.php after index.php was loaded, the output will be a new page from your poll system (it's normal)
7. So you need to make your poll system output to be look like ArticleLive default page which is hard to do (I won't say impossible)
8. Or, the other way is get your pool system output directly from MySQL
Something like: file attached
9. Parse it by using $parsedPanelData .= file_get_contents("http://localhost/poll/MyPoll.php");
10. When user choose an option and click Vote button, poll database will be updated. To see the last result, index.php somehow must be refreshed

Chris S
05-04-2005, 02:16 AM
Hi,

9. Parse it by using $parsedPanelData .= file_get_contents("http://localhost/poll/MyPoll.php");

is wrong. That will include the OUTPUT of that include file - NOT include the script itself (so it can handle processing of the poll).

I understand now
But correct me if I'm wrong

1. ArticleLive doesn't have a poll system
2. You try to put a poll panel (as a plug in) on the right or left column of your 3 colums default/initial page
3. So user will be able to vote directly from the default/initial page
4. When user choose an option and the click the vote button, you expect the result will be shown either in the left/right or center column
5. booth.php is included into the index.php during the initial stage of index.php
6. If then you run the process of booth.php after index.php was loaded, the output will be a new page from your poll system (it's normal)
7. So you need to make your poll system output to be look like ArticleLive default page which is hard to do (I won't say impossible)
8. Or, the other way is get your pool system output directly from MySQL
Something like: file attached
9. Parse it by using $parsedPanelData .= file_get_contents("http://localhost/poll/MyPoll.php");
10. When user choose an option and click Vote button, poll database will be updated. To see the last result, index.php somehow must be refreshed

Chris S
05-04-2005, 02:17 AM
Hi,

Run

php -l filename.php

from a command line and see if you have any parse errors.

Of course change filename.php to the *real* filename.

No, Chris, really white screen I have. I attache booth.php in previous post. May be it can help. Thank you

Christopher
05-04-2005, 10:53 AM
DWA, :-) my script use text file, not mysql database :-)

Chris, what *.php I shoul run from command line, can`t undestand you.

Thank you, guys.

Chris S
05-05-2005, 01:18 AM
Download the .php file you're modifying to your computer (or somewhere you have command-line access). Make sure php is installed. then run:

php -l filename.php

To be honest you're better off getting a php developer in to help you, it would end up being a lot quicker for you. All of the suggestions made should have worked and you're probably getting frustrated that it doesn't seem like we're trying to help.

DWA, :-) my script use text file, not mysql database :-)

Chris, what *.php I shoul run from command line, can`t undestand you.

Thank you, guys.

Sola
06-22-2006, 06:13 AM
Anyone still got this working? I run the 1.5.2 version and its been broken since I upgraded. although I replicated the instructions here in my changed template. I wonder if the "$mycontent" is the problem.

Sola
07-13-2006, 07:26 PM
Can anyone help make the Defaultrightpanel code below that also pulls posts from my forum work please? This is from the current version - 1.5.2. Below it, I pasted (for comparison) the pre 1.5 version that worked perfectly and still works even now (though wrongly templated) with the current version. The change has broken my forum feed to the AL pages. The forum feed works fine. The break happens on this AL page from what I can deduce. Thanks.

New template, broken: <?php

/*******************************************\
* *
* Generic ArticleLive Panel Parsing Class *
* *
\*******************************************/

$panelClass = "AL_DEFAULTRIGHTCOLUMN_PANEL";

if(!class_exists($panelClass)){
CLASS AL_DEFAULTRIGHTCOLUMN_PANEL
{
var $_htmlFile;

function AL_DEFAULTRIGHTCOLUMN_PANEL($HTMLFile)
{
$this->_htmlFile = $HTMLFile;
}

function ParsePanel()
{
$htmlPanelData = "";
$parsedPanelData = "";

if(file_exists($this->_htmlFile))
{
if($fp = @fopen($this->_htmlFile, "rb"))
{
while(!feof($fp))
$htmlPanelData .= fgets($fp, 4096);

@fclose($fp);
}
}

/*
This template is comprised of up to 6 external panels, which we simply
parse and then return combined:

1. SiteMenuPanel
2. SmallArticleFavouritesPanel1
3. ArticlesToReadPanel1
4. ArticleHistoryPanel1
5. PopularArticlesPanel1
6. PopularAuthorsPanel1
*/

$GLOBALS["imagePath"] = AL_TPL_IMAGE_PATH;

$GLOBALS["SiteMenu"] = $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("SiteMenuPanel");
$GLOBALS["PopularArticles"] = $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("PopularArticlesPanel1");
$GLOBALS["PopularAuthors"] = $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("PopularAuthorsPanel1");
$GLOBALS["SmallArticleFavourites"] = $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("SmallArticleFavouritesPanel1");
$GLOBALS["ArticlesToRead"] = $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("ArticlesToReadPanel1");
// forum posts show after the "ArticlesToRead" panel. include("/home/*******/public_html/forumposts.php");
$parsedPanelData .= $mycontent;
$GLOBALS["ArticleHistory"] = $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("ArticleHistoryPanel1");
$parsedPanelData = $GLOBALS["AL_CLASS_TEMPLATE"]->ParseGL($htmlPanelData);
return $parsedPanelData;
}
}

}
?>

Pre 1.5 template, still pulls feed in a broken way: <?php

/*******************************************\
* *
* Generic ArticleLive Panel Parsing Class *
* *
\*******************************************/

$panelClass = "AL_DEFAULTRIGHTCOLUMN_PANEL";

CLASS AL_DEFAULTRIGHTCOLUMN_PANEL
{
var $_htmlFile;

function AL_DEFAULTRIGHTCOLUMN_PANEL($HTMLFile)
{
$this->_htmlFile = $HTMLFile;
}

function ParsePanel()
{
$parsedPanelData = "";

/*
This template is comprised of up to 6 external panels, which we simply
parse and then return combined:

1. SiteMenuPanel
2. SmallArticleFavouritesPanel1
3. ArticlesToReadPanel1
4. ArticleHistoryPanel1
5. PopularArticlesPanel1
6. PopularAuthorsPanel1
*/

$GLOBALS["imagePath"] = AL_TPL_IMAGE_PATH;

$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("SiteMenuPanel");
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("SmallArticleFavouritesPanel1");
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("ArticlesToReadPanel1");
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("ArticleHistoryPanel1");
// forum posts show after the "ArticlesToRead" panel.
include("/home/******/public_html/forumposts.php");
$parsedPanelData .= $mycontent;
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("PopularArticlesPanel1");
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("PopularAuthorsPanel1");

return $parsedPanelData;
}
}

?>

Sola
07-20-2006, 02:34 AM
6 days later...

Sola
07-28-2006, 03:45 AM
Are we getting the AL version that officially integrates the VB anytime soon? Can't wait. Any other feature addition is insignificant as far as MY NEEDS are concerned. Well, just thinking out loud, not that I expect any response, so...

Chris S
07-30-2006, 09:06 PM
Hi Sola,

Err, you know we don't support customisations right?

I did that patch originally for inclusion on our site, that's the only reason it was posted here.

Debugging php code can be tricky but anyone with some php experience should be able to help you.

6 days later...

Chris S
07-30-2006, 09:11 PM
Actually the new articlelive supports php includes.. check out

http://www.interspire.com/articlelive/install/

Look under "skins/templates" and it has a section called "include function".

See if that works for you.

6 days later...

ppc
07-31-2006, 06:19 PM
Actually the new articlelive supports php includes.. check out

http://www.interspire.com/articlelive/install/

Look under "skins/templates" and it has a section called "include function".

See if that works for you.

I assume I would need to create a new templeted HTML form to call the include funtion, but the section in the documentation on creating new HTML forms is lacking. I've created the form, now how do I call it?

Jordie
08-01-2006, 02:55 AM
Hi PPC,

You'll need to call it by using %%Panel.YourFormFilename%% in the template where you want it to show. Should you require further assistance, please shoot me a support ticket via your client area. Thanks!