show with a picture when there are new post on a thread.

Started by xxx, January 02, 2006, 07:24:17 AM

Previous topic - Next topic

xxx

I have 1 speciale thread and a want to show with a icon (of something) that there is a new post on it elsewhere on my board.
The thread is hidden and the people entered it on a banner no.
Next the banner a want a icon that told when there are new postings on this thread.

I hope someone understand this.
http://www.xxxforum.be: 18+ forum!!!

Dannii

I'm not sure if this will work, and I'm sure it could be optimised a lot but try this:
$result = db_query("
SELECT
b.ID_BOARD, b.name, b.description, b.numTopics, b.numPosts,
m.posterName, m.posterTime, m.subject, m.ID_MSG, m.ID_TOPIC,
IFNULL(mem.realName, m.posterName) AS realName, " . (!$user_info['is_guest'] ? "
(IFNULL(lb.logTime, 0) >= b.lastUpdated) AS isRead," : "1 AS isRead,") . "
IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem2.ID_MEMBER, 0) AS ID_MODERATOR,
mem2.realName AS modRealName
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)" : '') . "
LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = mods.ID_MEMBER)
WHERE m.ID_TOPIC = YOURTOPICIDNUMBER
AND $user_info[query_see_board]", __FILE__, __LINE__);
while ($row_board = mysql_fetch_assoc($result))
{ $new = empty($row_board['isRead']) && $row_board['posterName'] != ''; }
mysql_free_result($result);
if $new echo 'IMAGE';
Change YOURTOPICIDNUMBER and IMAGE of course.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

xxx

I have this on my board:
Quoteecho '

<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="4"> ';
echo '
<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="6">
<tr><td class="windowbg2" width="100%" align="center">
<a href="http://www.xxxforum.be/index.php?topic=2263.0"><img src="http://www.xxxforum.be/kroeg.jpg" border="0" alt="Kroeg"/></a></td>
</tr></div>';       
echo '
</table></div>';

When there is a new post on the topic=2263.0  the image (...../kroeg.jpg) have to change in another image.

How can i do this with your Query???????
http://www.xxxforum.be: 18+ forum!!!

Dannii

      echo '

<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="4"> ';
echo '
<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="6">
<tr><td class="windowbg2" width="100%" align="center">
<a href="http://www.xxxforum.be/index.php?topic=2263.0">';
$result = db_query("
SELECT
b.ID_BOARD, b.name, b.description, b.numTopics, b.numPosts,
m.posterName, m.posterTime, m.subject, m.ID_MSG, m.ID_TOPIC,
IFNULL(mem.realName, m.posterName) AS realName, " . (!$user_info['is_guest'] ? "
(IFNULL(lb.logTime, 0) >= b.lastUpdated) AS isRead," : "1 AS isRead,") . "
IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem2.ID_MEMBER, 0) AS ID_MODERATOR,
mem2.realName AS modRealName
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)" : '') . "
LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = mods.ID_MEMBER)
WHERE m.ID_TOPIC = YOURTOPICIDNUMBER
AND $user_info[query_see_board]", __FILE__, __LINE__);
while ($row_board = mysql_fetch_assoc($result))
{ $new = empty($row_board['isRead']) && $row_board['posterName'] != ''; }
mysql_free_result($result);
if $new { echo 'OTHERIMAGE'; }
else { '<img src="http://www.xxxforum.be/kroeg.jpg" border="0" alt="Kroeg"/>'; }
echo '</a></td>
</tr></div>';       
echo '
</table></div>';
Again, I'm not sure that will work.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

xxx

QuoteTemplate Parse Error!
There was a problem loading the /Themes/helios/BoardIndex.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.


I try this:
Quoteecho '

<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="4"> ';
echo '
<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="6">
<tr><td class="windowbg2" width="100%" align="center">
<a href="http://www.xxxforum.be/index.php?topic=2263.0">';
$result = db_query("
SELECT
b.ID_BOARD, b.name, b.description, b.numTopics, b.numPosts,
m.posterName, m.posterTime, m.subject, m.ID_MSG, m.ID_TOPIC,
IFNULL(mem.realName, m.posterName) AS realName, " . (!$user_info['is_guest'] ? "
(IFNULL(lb.logTime, 0) >= b.lastUpdated) AS isRead," : "1 AS isRead,") . "
IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem2.ID_MEMBER, 0) AS ID_MODERATOR,
mem2.realName AS modRealName
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)" : '') . "
LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = mods.ID_MEMBER)
WHERE m.ID_TOPIC = 2263.0
AND $user_info[query_see_board]", __FILE__, __LINE__);
while ($row_board = mysql_fetch_assoc($result))
{ $new = empty($row_board['isRead']) && $row_board['posterName'] != ''; }
mysql_free_result($result);
if $new { echo '<img src="http://www.xxxforum.be/kroeg1.jpg" border="0" alt="Kg"/>'; }
else { '<img src="http://www.xxxforum.be/kroeg.jpg" border="0" alt="Kroeg"/>'; }
echo '</a></td>
</tr></div>';
echo '
</table></div>';


Where can I fix this????
http://www.xxxforum.be: 18+ forum!!!

Dannii

      echo '

<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="4"> ';
echo '
<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="6">
<tr><td class="windowbg2" width="100%" align="center">
<a href="http://www.xxxforum.be/index.php?topic=2263.0">';
$result = db_query("
SELECT
b.ID_BOARD, b.name, b.description, b.numTopics, b.numPosts,
m.posterName, m.posterTime, m.subject, m.ID_MSG, m.ID_TOPIC,
IFNULL(mem.realName, m.posterName) AS realName, " . (!$user_info['is_guest'] ? "
(IFNULL(lb.logTime, 0) >= b.lastUpdated) AS isRead," : "1 AS isRead,") . "
IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem2.ID_MEMBER, 0) AS ID_MODERATOR,
mem2.realName AS modRealName
FROM {$db_prefix}boards AS b
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)" : '') . "
LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = mods.ID_MEMBER)
WHERE m.ID_TOPIC = YOURTOPICIDNUMBER
AND $user_info[query_see_board]", __FILE__, __LINE__);
while ($row_board = mysql_fetch_assoc($result))
{ $new = empty($row_board['isRead']) && $row_board['posterName'] != ''; }
mysql_free_result($result);
if $new { echo '<img src="http://www.xxxforum.be/kroeg1.jpg" border="0" alt="Kg"/>'; }
else { echo '<img src="http://www.xxxforum.be/kroeg.jpg" border="0" alt="Kroeg"/>'; }
echo '</a></td>
</tr></div>';       
echo '
</table></div>';
Argh silly mistake, I left out an echo.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

xxx

Template Parse Error!

It seems to be more than just an echo :(

please can you fix it???
http://www.xxxforum.be: 18+ forum!!!

xxx

http://www.xxxforum.be: 18+ forum!!!

xxx

This is new but it gives a database error.
Quote
echo '

<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="4"> ';
echo '
<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="6">
<tr><td class="windowbg2" width="100%" align="center">
<a href="http://www.xxxforum.be/index.php?topic=2263.0">';
   $result = db_query("
      SELECT
         b.ID_BOARD, b.name, b.description, b.numTopics, b.numPosts,
         m.posterName, m.posterTime, m.subject, m.ID_MSG, m.ID_TOPIC,
         IFNULL(mem.realName, m.posterName) AS realName, " . (!$user_info['is_guest'] ? "
         (IFNULL(lb.logTime, 0) >= b.lastUpdated) AS isRead," : "1 AS isRead,") . "
         IFNULL(mem.ID_MEMBER, 0) AS ID_MEMBER, IFNULL(mem2.ID_MEMBER, 0) AS ID_MODERATOR,
         mem2.realName AS modRealName
      FROM {$db_prefix}boards AS b
         LEFT JOIN {$db_prefix}messages AS m ON (m.ID_MSG = b.ID_LAST_MSG)
         LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)" . (!$user_info['is_guest'] ? "
         LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER)" : '') . "
         LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = b.ID_BOARD)
         LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = mods.ID_MEMBER)
      WHERE m.ID_TOPIC = 2263.0
AND $user_info[query_see_board]", __FILE__, __LINE__);

while ($row_board = mysql_fetch_assoc($result))
{
$new = empty($row_board['isRead']) && $row_board['posterName'] != '';
}
mysql_free_result($result);
if ($new)
{
echo '<img src="<http://www.mijnforum.be/kroeg1.jpg>" border="0" alt="Kg"/>';
}
else
{
echo '<img src="<http://www.mijnforum.be/kroeg.jpg>" border="0" alt="Kroeg"/>';
}
echo '</a></td>
</tr></div>';
     
echo '
</table></div>';


Anyone???
http://www.xxxforum.be: 18+ forum!!!

Advertisement: