PDA

View Full Version : Conflicting error I think



Angelus
11-24-2005, 04:30 PM
Hi. first of all, this script is awesome. A big load of my shoulders when it comes to updating news on my site an stuff. So thanks. However, ive come across a problem with the script which I cant seem to fix. It occurs whenever I try to run TWO news sources on the one page. one for the main area of the home page, and another on the right hand navigation bar for just updates and stuff. I get this error whenever I put news source 1 and 2 generated code on the same page:

Warning: implode(): Bad arguments. in /home/vhosts/sonicstreet.dkmhosting.com/forum-news/classes/sources/Forum/phpBB_2.php on line 90
No posts found in selected forum category.

No idea what it means by this :huh: help would be much appreciated Cheers ;)

Patrick
11-24-2005, 07:12 PM
Some questions:

1. What version are you using of EP-Dev Forum News? Find out on the update page in admin panel.
2. What is the specific generated code that you are using?
3. Are you having problems when you display only the source 1? What about when you display only the source 2?

Angelus
12-06-2005, 11:23 AM
I am using the latest version of EP-Dev Forum News.

<?php include_once("URL");
$forum_obj = new EP_Dev_Forum_News();
$forum_obj->display_News("5", "1", "0", "0"); ?>

Im able to run any News Source on its own. Ive run News Source 2 and 3 on their own, and they work fine, however the problem occurs whenever I try to run two at once. Any ideas? Cheers ;)

Patrick
12-06-2005, 10:06 PM
Wow, that is a bug that hasn't been stumbled upon yet.

Another bug squashed, although it took some time to track it down (had to start with forum module and work backwards).

Your error has to do with an incorrect use of empty($variable) where !is_numeric($variable) should be used. As you may know (I don't know how much you do with PHP coding), empty($var) returns true on a number of inputs, including number 0. Unfortunately, this results in forum 0 being interpreted as empty ("") and therefore calling all forums enabled.

Confusing I suppose, but the fix is easy:

Open forum-news/news.php:
Replace the following (on line # 219):

if (empty($forums))
with:

if (!is_numeric($forums))

And replace (on line # 240):

if (empty($ids))
with:

if (!is_numeric($ids))

There should only be two replacements total (one for each of the above).

I planned alot of the script out on paper. Unfortunately, I didn't have the numbering system down until last second, and it was inevitable that there would be a bug somewhere with the arrays. Obviously, this is a rare bug as no one has come across it until this moment. Nevertheless, it is also a major bug as it impacts the entire script.

This bug will be fixed in the next version as well. There are also several other improvements in the next version so keep an eye out.

Patrick
12-06-2005, 10:16 PM
Another question (that has nothing to do with the bug):

Are you using the News Sources correctly?

News Source 1 = Forum Script 1 (such as http://www.first-site.com/forum)
News Source 2 = Forum Script 2 (such as http://www.second-site.com/forum )
and so on...

You do NOT need two sources if you are simply pull news from different categories (sometimes referred to as forums in the Forum Scripts themselves). Instead, you should just specify which categories you want to display at the Generate Code page.

In other words, if you have the exact same forum details for two different News Sources then you have it configured incorrectly ;).

I just wanted to make sure that you understood that point, as I could only find one forum installed on your site (unless you are pulling news from a second website that I do not see).