Recent Topics

1 Feb 14, 2008 10:02    

Hi,

As I was not really satisfied with the way the linkblog-widget displayed the posts I changed it a little.

Now it displays the linkblog in the following way

[link to linked page]...(number of comments)

You can take a look at it here (at the bottom, sorry for the mess, CSS not ready yet):
http://www.geencommentaar.nl/GCv5/

Therefore I changed the linkblog-part in _widget.class.php. Instead of the ItemListLight I retrieve the ItemList2 (because comments are only accessible there).

All seems to work fine. It shows the linkblog ok, with the number of comments (as can be seen in the example).

But a problem arises when you try to open a ?disp= page. For example, try
http://www.geencommentaar.nl/GCv5/index.php?disp=arcdir

Then I get a MySQL- error:

SELECT comment_post_ID, comment_type, comment_status, COUNT(*) AS type_count FROM evo_comments WHERE comment_post_ID IN ()

As you can see the comment_post_ID's are not present.

Any idea why?

This was also a problem in the 1.x versions that I used (1.6 and 1.9), but then I just hardcoded that the linkblogs would not load when at a "disp"-page. This time I want to find the cause :-)

I am not entirely sure if it is a bug, but I think that doing this should be possible.

I hope you can help me!

[update, I am developing in 2.3 (will go to 2.4 soon) and using PHP 4]

2 Feb 17, 2008 22:51

No bug after all I think: I found the problem.
It turned out that the fault was in the function "generic_ctp_number".

The globals $postIDlist and $postIDarray were not set. Why these were not set when calling a '?disp=' page is unknown to me, as it works when retrieving ordinary pages. (so this could be a bug after all?)

In the end I solved it by adding a few lines to the widget (after the $Linkbloglist->query() call:

global $postIDlist;
$postIDlist = $LinkblogList->get_page_ID_list();
global $postIDarray;
$postIDarray = $LinkblogList->get_page_ID_array();

This solved the problem.


Form is loading...