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,231
  • Total Topics: 21,353
  • Online today: 651
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 160
  • Total: 160

Backslash in Shoutbox problem.

Started by welshdog, January 24, 2011, 06:12:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

welshdog

I'm sure I've asked this before but can't see any record of it or any other requests, but it must have happened to other people... so...

My Site: www.australianopinion.com.au

SMF 1.1.12; TinyPortal 1.0; Default Theme.

I've not included the entire info requested because everything in TP works perfectly as usual and is perfectly integrated. The only problem is the Shoutbox in which we have a backslash preceding every apostrophe. I can edit them out individually and when I save they don't reappear (which is a bit odd to my way of thinking but still... ) but I can't find out how to stop it happening to begin with.

A search in SMF support mentions something about Ajax integration... and also "Magic Quotes"... but I can only find a zipped file and I have no idea how to fix it anyway.

Is there something simple I can do to get rid of the backslashes??

IchBin

In tp-files/tp-modules/TPShout/Sources/TPShout.php

Find this code:
while($row = tpdb_fetch_assoc($request))
{

                        $row['avatar'] = $row['avatar'] == '' ? ($row['ID_ATTACH'] > 0 ? '<img src="' . (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="&nbsp;"  />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '" alt="&nbsp;" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="&nbsp;" />');
$ns[] = template_singleshout($row);
}


Replace with this:
while($row = tpdb_fetch_assoc($request))
{
            $row['value1'] = stripslashes($row['value1']);
$row['avatar'] = $row['avatar'] == '' ? ($row['ID_ATTACH'] > 0 ? '<img src="' . (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="&nbsp;"  />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '" alt="&nbsp;" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="&nbsp;" />');
$ns[] = template_singleshout($row);
}

Dramber

Thanks, I was looking for a fix for this. :)

welshdog

Quote from: IchBin on January 24, 2011, 03:20:46 PM
In tp-files/tp-modules/TPShout/Sources/TPShout.php

<snip>

Many thanks - I aplogise for the time taken to respond. My kids were on summer holiday and have only just gone back to school!

I'll go change the file and fix the problem.

By the way, Tiny Portal is still my favourite Mod... and your Themes are great! :)

welshdog

Quote from: welshdog on January 31, 2011, 07:27:44 AM
Quote from: IchBin on January 24, 2011, 03:20:46 PM
In tp-files/tp-modules/TPShout/Sources/TPShout.php

<snip>

Many thanks - I aplogise for the time taken to respond. My kids were on summer holiday and have only just gone back to school!

I'll go change the file and fix the problem.


Many thanks... all fixed. :)

This website is proudly hosted on Crocweb Cloud Website Hosting.