Hi all,
Even though everything works fine, I've stumbled upon a very annoying spam related issue by using Avea Media and TinyPortal ShoutBox on my site. Users can currently post e.g. youtube links in the shoutbox, and they are automatically parsed to youtube video's. The issue is that while I'd like to keep the size of avea video's big, my users are spamming the shoutbox with way to big embed vids. I know this is not a strictly TP related issue, neither is it strictly Avea Media related. Is there a way to totally prevent the video links from being parsed into embed video's within the shoutbox?
I don't see how providing any extra info can help with resolving this spam related issue, so I'm hoping some PHP genies can give this rookie some advice here :)
The problem is likely that Aeva hooks into the parse_bbc() function somewhere. The shouts are run through the same function which is why Aeva then adds the giant video embed into your shout. I don't know how Aeva really works and don't have much time to look at it unfortunately.
I have looked at the avea files myself a while back by manually parsing it and quickly overlooking the instruction files. It seems to be rather simply (although I don't rly understand it). Is it not possible to add an exception to it so that it wouldn't display within the shoutbox? I have been trying this myself but I don't rly know any PHP. (good I always make backup files :p)
Took a quick look at the code. Aeva does exactly what I thought it did. It puts a few changes in to the parse_bbc function and that's where aeva does it's embedding stuff from what I can tell. The only option you probably have is to strip this stuff from the shoutbox posts before outputting them. What does the code look like in a post that has a video embedded?
it looks like a simple youtube url, and gets automatically parsed into a video (without any BBC involved). one of my site members with more PHP knowledge then myself suggests to strip all "http://" from links in the shoutbox.
Yes, but the problem is the "parsed" part. lol The output in the post is more than a URL if you look at the actually code after it's been rendered. With the shout having run through the same routines that Aeva is modifying, we will need to strip the parsed content out somehow. That's why I wanted to see what the output is. Do you have a link to one of the video's posted on your site so I can look at it?
I do believe that Aeva parses both links with and without a http:// in them. I could be wrong, but that is what I remember.
wowmod.eu/index.php/topic,4701.msg113811/topicseen.html#new
here is a music video thread, plenty of examples :)
also i tested and it doesn't seem to parse without http:// before it
You were right. I thought that Aeva did the parsing at a different time. Looks like removing the http:// does the trick if you want to do that on your site.
Open Themes/default/TPShout.template.php and change this crazy line of code towards the very bottom:
' . (parse_bbc(censorText(strip_tags(html_entity_decode($row['value1']))),true)) . '
To this:
' . (parse_bbc(censorText(strip_tags(html_entity_decode(str_replace('http://', '', $row['value1'])))),true)) . '
This didn't do the trick,
I've added the code, cleared site cache and posted a youtube link in the shoutbox, it got parsed to a video still.
And when I go to TPShouts admin section (where you can remove shouts), I can see there still is http:// in front of the link.
It worked for me. Post your file and I'll test it.
Ok here you go :)
Are links still getting processed by Aeva even without the http:// in them? Using your file on my site removed any http:// posted in the shoutbox. Maybe we could do this another way by stripping the http before we insert it into the database.
Open tp-files/tp-modules/TPShout/Sources/TPShout.php and find this line:
$oldshout = strip_tags(substr($_POST['tp_shout'], 0, 300));
Replace with this:
$oldshout = strip_tags(str_replace('http://', '', substr($_POST['tp_shout'], 0, 300)));
See if that works.
That didn't work either, but I noticed it still parses if theres www. in front of it.
By removing that too it works fine so I changed to this:
$oldshout = strip_tags(str_replace('http://www.', '', substr($_POST['tp_shout'], 0, 300)));
And it works flawlessly :)
Thanks very much for your support :)