News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Displaying Messages in Messageindex.php with RC.1

Started by digitalgraal, November 13, 2005, 12:27:09 PM

Previous topic - Next topic

digitalgraal

Hello,

i have been trying my application CM2F, which integrates mailinglists into SMF, with the last RC version, but i am having a problem that i am not understanding or to solve.
In the previous Beta versions, Cm2F was working almost fine, with the exception of the modification of the email by the admin username in the posted messages. The messages where displayed correctly.
But now, although the messages are imported correctly in the database, because i am seeing them in the tables topics and messages, there is no possibility to have shawn in the forum by the messageindex.php

I have been able to trace the code upto where the Select query is made, and there it seems that it is detecting all the messages in the table, but afterwards it is only displaying the default SMF Welcome message.

Could any one help me figuring out what is happening?

Regards,
D.
CM4F Groups
Community Messaging 4 Forums
Bridging Worlds Mail-Forum-CMS
http://www.digitalgraal.net

digitalgraal

Any one to help me? It is very important that i am able to understand what is going on with RC1.

Regards,
D.
CM4F Groups
Community Messaging 4 Forums
Bridging Worlds Mail-Forum-CMS
http://www.digitalgraal.net

digitalgraal

Hi,

here is the lines of code where the functions is failing.

$result = db_query("
      SELECT
         t.ID_TOPIC, t.numReplies, t.locked, t.numViews, t.isSticky, t.ID_POLL,
         " . ($user_info['is_guest'] ? "0" : "IFNULL(lt.logTime, IFNULL(lmr.logTime, 0))") . " AS isRead,
         t.ID_LAST_MSG, ml.posterTime AS lastPosterTime, ml.modifiedTime AS lastModifiedTime,
         ml.subject AS lastSubject, ml.icon AS lastIcon, ml.posterName AS lastMemberName,
         ml.ID_MEMBER AS lastID_MEMBER, IFNULL(meml.realName, ml.posterName) AS lastDisplayName,
         t.ID_FIRST_MSG, mf.posterTime AS firstPosterTime, mf.modifiedTime AS firstModifiedTime,
         mf.subject AS firstSubject, mf.icon AS firstIcon, mf.posterName AS firstMemberName,
         mf.ID_MEMBER AS firstID_MEMBER, IFNULL(memf.realName, mf.posterName) AS firstDisplayName,
         LEFT(ml.body, 384) AS lastBody, LEFT(mf.body, 384) AS firstBody, ml.smileysEnabled AS lastSmileys,
         mf.smileysEnabled AS firstSmileys
      FROM {$db_prefix}topics AS t, {$db_prefix}messages AS ml, {$db_prefix}messages AS mf
         LEFT JOIN {$db_prefix}members AS meml ON (meml.ID_MEMBER = ml.ID_MEMBER)
         LEFT JOIN {$db_prefix}members AS memf ON (memf.ID_MEMBER = mf.ID_MEMBER)" . ($user_info['is_guest'] ? '' : "
         LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
         LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = $board AND lmr.ID_MEMBER = $ID_MEMBER)"). "
      WHERE t.ID_BOARD = $board
         AND ml.ID_MSG = t.ID_LAST_MSG
         AND mf.ID_MSG = t.ID_FIRST_MSG
      ORDER BY
         " . (!empty($modSettings['enableStickyTopics']) ? 't.isSticky' . ($fake_ascending ? '' : ' DESC') . ',
         ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . "
      LIMIT $start, $maxindex", __FILE__, __LINE__);
   // Begin 'printing' the message index for current board.
   $context['topics'] = array();
   $topic_ids = array();
   
   while ($row = mysql_fetch_assoc($result))
   {


if I make an echo of the db_query and then run the query with phpmyadmin, the result will include the messages integrated using CM2F. But it ran from the function, only one row is returned.

Can someone help me?

Regards,
D.
CM4F Groups
Community Messaging 4 Forums
Bridging Worlds Mail-Forum-CMS
http://www.digitalgraal.net

digitalgraal

Is SMF having some kind of support to third party addons?


I am trying to have some help without success, if addons are not supported, just tell me, and I will take my application somewhere else.


Regards,
D.
CM4F Groups
Community Messaging 4 Forums
Bridging Worlds Mail-Forum-CMS
http://www.digitalgraal.net

Grudge

digitalgraa,

We do want to help add-on authors, but please be aware that up until last week there was only one developer left on the team who clearly has a lot of work todo.

What would be more helpful is if you could post what your application is inserting. The main reasons why it would fail I expect would be because your app is either:

1) Not setting ID_BOARD to the correct board
2) Not setting ID_FIRST_MSG to a valid message
3) Not setting ID_LAST_MSG to a valid messaeg

If any of those three are wrong it won't return anything. Also, running "Repair" from the admin maintenance menu may report any errors in the database to help you debug the exact problem.
I'm only a half geek really...

digitalgraal

Hi Grudge,

it seems that we have the same problem. I am currently alone with CM2F development, which is sometimes quite stressy.

I have the problem fixed by replacing the messageindex.php from the RC1 version with the Beta3 one.

I don't know which was creating the problem. I thought in just dropping the overall RC1 and get back only to the beta, when i decided, to first try only the file messageindex.php. To my surprise it worked fine and now i have CM4F importing correctly the messages into SMF again.

Do you know if there are important changes between the file messageindex.php in the beta3 and RC1 version?

Thank you for the support.

Regards,
D.
CM4F Groups
Community Messaging 4 Forums
Bridging Worlds Mail-Forum-CMS
http://www.digitalgraal.net

Grudge

I don't think there was anything major. You may be able to get an old copy of Beta3 from the download page here (Under archive) and do a diff on them to see what has changed. I still believe it must be that RC1 is less forgiving with the data, repair boards didn't show anything?
I'm only a half geek really...

Advertisement: