TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 207
  • Total: 207

Recent Topics block error??

Started by pvcblue, June 26, 2010, 11:42:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pvcblue

Quote from: ZarPrime on July 02, 2010, 03:25:47 PM
Thanks Les.  I'm hoping that we can put this topic to bed now once and for all. ;) :D O0

ZarPrime

you and me both! LOL!!!! ;D ;D

"Smurfs, Smurfs, and More Smurfs!"

pvcblue

I have been researching the other error that first alerted me to this as well - the J.parentNode error - and have found it is a issue with the script of the swfobject.js file, there is extra wording added to it that causes this error and when you edit it out it fixes that error.

"Smurfs, Smurfs, and More Smurfs!"

ZarPrime

Good work on that, so it was indeed the the flash javascript obviously. O0

ZarPrime

pvcblue

Quote from: ZarPrime on July 02, 2010, 03:55:46 PM
Good work on that, so it was indeed the the flash javascript obviously. O0

ZarPrime

I think so, from what I have read, I am work right now so I cant edit my files until I get home.  :-\

"Smurfs, Smurfs, and More Smurfs!"

Freddy

QuoteFreddy can you work this up so it doesn't have to use Nice Tool Tips and have Hover effects??

Here you go pvc....

// *********************************************************************
// A PHP block by Freddy888
// Simply shows subject, board and member.
// This version : 2 July 2010
// Note that this version is ONLY for SMF2.
// *********************************************************************

// Configuration, set the number of posts to show:

$num_recent = 8;

// Config end.


global $scripturl, $settings, $modSettings, $db_prefix, $user_info;

// leave out the recycle board, if any
if(isset($modSettings['recycle_board']))
$exclude = array($modSettings['recycle_board']);
else
$exclude = array();

   
if ($exclude === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude = array($modSettings['recycle_board']);
else
$exclude = empty($exclude) ? array() : $exclude;

// Icons...
$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless', 'clip');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// Find all the posts in distinct topics.  Newer ones will have higher IDs.
// Stripped down from SSI.php ssi_recentTopics() function.

$request = tp_query("
SELECT
ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.name AS board_name,
IFNULL(mem.real_name, m.poster_name) AS poster_name, " . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_MODIFIED AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from') . "
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)
LEFT JOIN {$db_prefix}members AS mem ON (mem.id_member = m.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 = {$context['user']['id']})
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {$context['user']['id']})" : '') . "
WHERE t.id_last_msg >= " . ($modSettings['maxMsgID'] - 35 * min($num_recent, 5)) . "
AND t.id_last_msg = m.id_msg
AND b.id_board = t.id_board" . (empty($exclude) ? '' : "
AND b.id_board NOT IN (" . implode(', ', $exclude) . ")") . "
AND $user_info[query_see_board]
AND ms.id_msg = t.id_first_msg
ORDER BY t.id_last_msg DESC
LIMIT $num_recent", __FILE__, __LINE__);


$posts = array();

while ($row = tpdb_fetch_assoc($request))
{
// Build the array.
$posts[] = array(
'board' => array(
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['board_name'] . '</a>'
),
'topic' => $row['id_topic'],
'poster' => array(
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'
),
'subject' => $row['subject'],
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new">' . $row['subject'] . '</a>',
'new' => !empty($row['is_read']),
);
}

tpdb_free_result($request);


// Now for the output...

echo '
<table border="0" width="100%" cellspacing="1" cellpadding="3" class="bordercolor">
<tr class="titlebg">
<td align="center">Subject</td>
<td align="center">Board</td>
<td align="center">Member</td>
</tr>';

$bg=false;

foreach ($posts as $topic)
{
echo '
<tr class="windowbg' , $bg ? '2' : '' , '">';

$bg = !$bg;
   
echo '
<td>
<a href="' , $topic['href'] , '">' , $topic['subject'] , '</a>';

    // Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt['new'], '" border="0" align="right", valign="absmiddle" /></a>';

echo '
</td>
<td align="middle">' , $topic['board']['link'], '</td>';

echo '
<td align="middle">', $topic['poster']['link'], '</td>
</tr>';
}

echo '
</table>';

IchBin

I'll put it to bed...

* IchBin hovers mouse over the lock button.

:P

pvcblue

#56
Quote from: Freddy on July 02, 2010, 05:11:49 PM
QuoteFreddy can you work this up so it doesn't have to use Nice Tool Tips and have Hover effects??

Here you go pvc....

// *********************************************************************
// A PHP block by Freddy888
// Simply shows subject, board and member.
// This version : 2 July 2010
// Note that this version is ONLY for SMF2.
// *********************************************************************

// Configuration, set the number of posts to show:

$num_recent = 8;

// Config end.


global $scripturl, $settings, $modSettings, $db_prefix, $user_info;

// leave out the recycle board, if any
if(isset($modSettings['recycle_board']))
$exclude = array($modSettings['recycle_board']);
else
$exclude = array();

   
if ($exclude === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude = array($modSettings['recycle_board']);
else
$exclude = empty($exclude) ? array() : $exclude;

// Icons...
$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless', 'clip');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// Find all the posts in distinct topics.  Newer ones will have higher IDs.
// Stripped down from SSI.php ssi_recentTopics() function.

$request = tp_query("
SELECT
ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.name AS board_name,
IFNULL(mem.real_name, m.poster_name) AS poster_name, " . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_MODIFIED AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from') . "
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)
LEFT JOIN {$db_prefix}members AS mem ON (mem.id_member = m.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 = {$context['user']['id']})
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {$context['user']['id']})" : '') . "
WHERE t.id_last_msg >= " . ($modSettings['maxMsgID'] - 35 * min($num_recent, 5)) . "
AND t.id_last_msg = m.id_msg
AND b.id_board = t.id_board" . (empty($exclude) ? '' : "
AND b.id_board NOT IN (" . implode(', ', $exclude) . ")") . "
AND $user_info[query_see_board]
AND ms.id_msg = t.id_first_msg
ORDER BY t.id_last_msg DESC
LIMIT $num_recent", __FILE__, __LINE__);


$posts = array();

while ($row = tpdb_fetch_assoc($request))
{
// Build the array.
$posts[] = array(
'board' => array(
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['board_name'] . '</a>'
),
'topic' => $row['id_topic'],
'poster' => array(
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'
),
'subject' => $row['subject'],
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new">' . $row['subject'] . '</a>',
'new' => !empty($row['is_read']),
);
}

tpdb_free_result($request);


// Now for the output...

echo '
<table border="0" width="100%" cellspacing="1" cellpadding="3" class="bordercolor">
<tr class="titlebg">
<td align="center">Subject</td>
<td align="center">Board</td>
<td align="center">Member</td>
</tr>';

$bg=false;

foreach ($posts as $topic)
{
echo '
<tr class="windowbg' , $bg ? '2' : '' , '">';

$bg = !$bg;
   
echo '
<td>
<a href="' , $topic['href'] , '">' , $topic['subject'] , '</a>';

    // Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt['new'], '" border="0" align="right", valign="absmiddle" /></a>';

echo '
</td>
<td align="middle">' , $topic['board']['link'], '</td>';

echo '
<td align="middle">', $topic['poster']['link'], '</td>
</tr>';
}

echo '
</table>';


Freddy I get this error with this code - Parse error: syntax error, unexpected T_STRING in /2inchpvc/Sources/Load.php(2105) : eval()'d code(95) : eval()'d code on line 23

"Smurfs, Smurfs, and More Smurfs!"

Freddy

Works fine here.  Have you upgraded yet.  Maybe try doing it again in case you copied it wrong.

pvcblue

Quote from: Freddy on July 03, 2010, 12:38:04 PM
Works fine here.  Have you upgraded yet.  Maybe try doing it again in case you copied it wrong.

Yeah dummy me I don't know what I did, :idiot2: had to be a copy paste wrong, I guess, lol, :-[ but I did it again and works just fine! Thank You!!

"Smurfs, Smurfs, and More Smurfs!"

Freddy

No problem, glad we got you sorted out in the end :)

This website is proudly hosted on Crocweb Cloud Website Hosting.