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,973
  • Latest: NonStop
Stats
  • Total Posts: 196,236
  • Total Topics: 21,353
  • Online today: 577
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 433
  • Total: 434
  • @rjen

shout box shows error (NEWBIE!)

Started by brynn, April 22, 2013, 10:16:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


lurkalot

OK thanks. You can turn it back on now.

What other blocks have you added yourself? Ones you've put code in and activated.  If you have any, then please turn them off one by one until you find the culprit.

brynn

It's not that I don't trust you.  It's that you could make changes that I can't understand, and I might not know how to undo them, if it became necessary.

If getting the shout box to work will take skill that I don't have, then I just won't have a shout box, until I either learn what I need to know, or run into someone who can teach me.  It's just that for the most part, the software has been pretty easy to use.  I thought this would be one of the questions you get asked all the time.  But even if it's not, I'd like to give it a try to get it going.  If it starts to look like a long battle, I'll just put it on the back burner for now.

But anyway, thanks again  :)

And you posted while I was typing.

I haven't put in any blocks that can't be configured through TP > Blocks.  Is that what you mean?  Or do you mean.....  Well, I'll try disabling them all, 1 by 1.  Then I'll post back.  Thanks  :)

brynn

Ok, I disabled each block, 1 at a time, but none of them caused any kind of change with the shout box error.

Should I either make a screenshot, or tell you how I have the shout box block configured?  Maybe I just didn't do it right?

lurkalot

OK, yes that's an idea. There's two places to check settings for shoutbox.  One is in TP Admin > Modules.  And the other is in "Manage blocks" 

lurkalot

brynn, if your interested, I posted instructions for adding a shoutbox block here a while back, might help, http://www.tinyportal.net/index.php?topic=34973.msg279505#msg279505

brynn

In Modules, TP Simple Shout is "on" (green)

I don't see a section called "Manage Blocks" specifically.  But the block where I've tried to put the shout box is like this:

Status: On (green)
Type: PHP code
Body:
global $settings, $db_prefix, $scripturl, $txt, $modSettings, $smcFunc;

// set the limit
$limit = 1;

$request =  $smcFunc['db_query]('', '
SELECT s.*, IFNULL(mem.real_name, s.value3) as realName,
mem.avatar, IFNULL(a.id_attach, 0) AS ID_ATTACH, a.filename, a.attachment_type as attachmentType
FROM {db_prefix}tp_shoutbox as s
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = s.value5)
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = s.value5 and a.attachment_type != 3)
WHERE s.value7 = 0
ORDER BY s.value2 DESC LIMIT {int:limit}',
array('limit' => $limit)
);
if ($smcFunc['db_num_rows']($request) > 0)
{
$nshouts= '<div>';
$ns=array();
while($row = tpdb_fetch_assoc($request))
{
$row['avatar'] = $row['avatar'] == '' ? ($row['ID_ATTACH'] > 0 ? '<img align="middle" style="width: 30px; height: 30px; margin-right: 4px;" src="' . (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img align="middle" style="width: 30px; height: 30px; margin-right: 4px;"  src="' . $row['avatar'] . '" alt="" border="0" />' : '<img align="middle" style="width: 30px; height: 30px; margin-right: 4px;"  src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" border="0" />');
$ns[] = '
<div style="padding-bottom: 5px;">
<div style="margin: 4px;">
<div style="padding: 3px; overflow: hidden; vertical-align: bottom;">
<div style="margin: 0 2px 2px 0; float: left;">' . $row['avatar'] . '</div>
<span class="smalltext">'. timeformat($row['value2']).'</span>
<b style="display: block; margin-top: 1px;"><a href="' . $scripturl. '?action=profile;u=' . $row['value5'] . '">' . strip_tags($row['realName']) . '</a> </b>
</div>
<div class="windowbg2" style="border-bottom: solid 1px #bbb; border-top: solid 1px #fff; padding: 5px;">
' . parse_bbc(censorText($row['value1'])) . '
</div>
</div>
</div>';
}
$nshouts .= implode("", $ns);
$nshouts .='</div>';

echo $nshouts;
$smcFunc['dbdb_free_result']($request);
}


Modules:  TP Simple Shout checked

All the other Blocks options seems to be display preferences.  But if not, let me know.  It's entirely possible I've misunderstood something  :)

OH!  Maybe I found the problem.  In your instructions, it says Type should be TP Module.  I used Insert Block Code Snippet > Single Shout > Insert code > overwrite.  Let me follow through with your instructions, and I'll report back.....

lurkalot

Quote from: brynn on April 25, 2013, 12:52:43 AM

OH!  Maybe I found the problem.  In your instructions, it says Type should be TP Module.  I used Insert Block Code Snippet > Single Shout > Insert code > overwrite.  Let me follow through with your instructions, and I'll report back.....

Yep, I reckon that's the problem. ;)

brynn

Happy Dance!  Looks like that did it  :D


brynn

It looks like I need to tweak some smileys or something..... 

Edit
Never mind -- I think I know what to do about those.  Thanks again for your help and patience  ;D

This website is proudly hosted on Crocweb Cloud Website Hosting.