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: 199
  • Total: 199

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

OMG!! The freaking Error is back!!!! ARGH!!! I don't get what the problem is!? I went thru and turned off every block but this one and it is this block causing the error, even all by itself.  :uglystupid2:

"Smurfs, Smurfs, and More Smurfs!"

Freddy

Did it just start doing this again by itself - I mean you didn't edit the code or anything beforehand ?

pvcblue

Quote from: Freddy on July 02, 2010, 10:36:58 AM
Did it just start doing this again by itself - I mean you didn't edit the code or anything beforehand ?

I had the number of posts to show set at 15, and decided to change it to 20 and it started shosing the error again, so I changed it back to 15 and it is still doing it, I don't know what the problem is now.

"Smurfs, Smurfs, and More Smurfs!"

pvcblue

this is the error -



Line: 647
Char: 50
Error: Unterminated string constant
Code: 0
URL: http://www.2inchpvc.com/index.php



this is the code (I can't see where there is a unterminated string) -



// *********************************************************************
// A PHP block by Freddy888 and MrCare
// Simply shows subject, board and member.
// Used alongside the NiceToolTips mod, will show
// recent topics in a table with tool tip previews.

// @SMF Mods : http://custom.simplemachines.org/mods/index.php?mod=2115
// @Tiny Portal : http://www.tinyportal.net/index.php?topic=31642

// This version : 1 July 2010 Update to work with SMF2RC3
// Note that this version is ONLY for SMF2.
// *********************************************************************

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

$num_recent = 15;

// Config end.


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

// First get all the NiceToolTip javascript in place if it's needed.
// The javascript is not needed when we are in a board as the NiceToolTip module
// will already have loaded it. We just need to add it if we are elsewhere...

// So add the code if we are not in a board
// OR When viewing a topic the board is also set,
// so we need to add the javascript then too...

if (!isset($_GET['board']) || isset($_GET['topic']))
echo '
<style type="text/css">
.nice_tooltip_fgclass {
background-color: ' . $modSettings['NiceTooltips_FGCOLOR'] . ';
opacity: ' . $modSettings['NiceTooltips_OPACITY'] / 100 . ';
}
.nice_tooltip_bgclass {
background-color: ' . $modSettings['NiceTooltips_BGCOLOR'] . ';
opacity: ' . $modSettings['NiceTooltips_OPACITY'] / 100 . ';
}
</style>

<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . (!empty($modSettings['NiceTooltips_scripturl']) ? '/' . $modSettings['NiceTooltips_scripturl'] : '') . '/overlib_mini.js"></script>

<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . (!empty($modSettings['NiceTooltips_scripturl']) ? '/' . $modSettings['NiceTooltips_scripturl'] : '') . '/overlib_adaptive_width.js"></script>
';


// 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') . ",
LEFT(m.body, ". (!empty($modSettings['NiceTooltips_lenght']) ? $modSettings['NiceTooltips_lenght'] : 384) .") AS body, m.smileys_enabled
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'],
'preview' => $row['body'],
'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)
{
// Generate the popup.
$popup = NiceTooltip($topic['preview'], $topic['subject']);

echo '
<tr class="windowbg' , $bg ? '2' : '' , '">';

$bg = !$bg;

echo '
<td>
<a href="' , $topic['href'] , '"' , $popup , '>' , $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>';



"Smurfs, Smurfs, and More Smurfs!"

Freddy

Yeah the error is not in the PHP code.  I'm guessing it's a javascript error which unfortunately I know nothing about so can't help.  :(

Can you set it up in a PHP article instead and then link me to it, so I can see if it affects me too ?

pvcblue

Quote from: Freddy on July 02, 2010, 11:56:38 AM
Yeah the error is not in the PHP code.  I'm guessing it's a javascript error which unfortunately I know nothing about so can't help.  :(

Can you set it up in a PHP article instead and then link me to it, so I can see if it affects me too ?

Well if you are using IE 7 it should, here is the link - http://www.2inchpvc.com/index.php?page=4

"Smurfs, Smurfs, and More Smurfs!"

Freddy

Can't see that until you assign the article..

pvcblue

Quote from: Freddy on July 02, 2010, 02:17:51 PM
Can't see that until you assign the article..

ok now try, I don't use the article feature normally, so I hope this works! LOL!!

"Smurfs, Smurfs, and More Smurfs!"

Freddy

Well that works fine in IE8 and Chrome.

I am stumped then, I don't know about javascript.  Perhaps try asking the person that made the ToolTips mod as that is likely the cause as it's not working with only the one block on the front page.

Or just forget about using tool tips I guess.

IchBin

Well you are a version behind now. 5.2 has been released, and it has fixed quite a few errors in the way that code was saved to the database. I see a bunch of errors in my IE8 here at work. But I see something like this in your source:
alt=\&quot;&amp;#58;smurf_wave&amp;#58;\&quot;


As you can see some of the HTML entities are not converted properly. I'm betting this is causing your errors.

This website is proudly hosted on Crocweb Cloud Website Hosting.