Topic: Strange issue with news generator.

Simple description: I click on generate news, forum num is set to the right value, i get "News generated", and a 0 byte html news file.
Investigations:

1) This is not triggering

    if (!$db->num_rows($result))
        message('There are no topics to generate news based on in forum with ID = '.$forum_id.'.');

instead "message($db->num_rows($result));" returns 27.

2) File is opened and created successfully and there is no problem with output.
3) And this loop goes 0 (zero) times. So it cant fetch any rows somewhy. And it throws no errors.

    while ($cur_topic = $db->fetch_assoc($result))
    {....}

4) This is the only module that is not working. Every other part of forum works perfectly.


I cant understand why it tells there is 27 rows avialible, and cant fetch any. Is it db problem maybe?

Re: Strange issue with news generator.

Few more info.

    if (!$result)
        error("Result is NULL!");
    else if ($result=="")
        error("Result is EMPTY!");
    else
        message($result);

returns me some string "Object id #6". I guess it is normal, cause it identifies some object. But it cant fetch from it.

3 (edited by Beyonder 2006-05-23 06:55)

Re: Strange issue with news generator.

Heh. Found error.
Problem is in News Generator module or in Easy Smilies module. And i dunno which of them is more correct.

To fix in News Generator module, move this line before query.

require PUN_ROOT.'include/parser.php';

And to fix in Easy Smilies, change $result to $smilie_result in parser.php:

    $result = $db->query('SELECT * FROM '.$db->prefix.'smilies') or error('Unable to retrieve smilies', __FILE__, __LINE__, $db->error());
    while ($db_smilies = $db->fetch_assoc($result))