Customizing SMF > Modifications and Packages

SMFPacks Shoutbox [SMF 2.0.7 Supported - 1.0.5 Released]

<< < (343/493) > >>

phantomm:
How to add support for https URLs?
I guess it have to do something with this part of code:

--- Code: --- // find links to convert
if (strstr($msg, 'http://'))
{
$links = array();
foreach (explode(' ', $msg) as $w)
if (substr($w, 0, 7) == 'http://' && $smcFunc['strlen']($w) > 7)
$links[] = '<a href="' . $w . '" target="_blank">' . ($smcFunc['strlen']($w) > $shoutbox['maxLinkLenght'] ? substr($w, 0, $shoutbox['maxLinkLenght'] - 8) . '...' . substr($w, -8) : $w) . '</a>';
else
$links[] = $w;
$msg = implode(' ', $links);
}

--- End code ---

[Crash_Override]:
@phantom here is how to fix the SSL linking issue, it's not the best or the fastest method by any means but it works.

NOTE!!! This code appears twice in shoutbox.php and you need to edit it in both places:

find:

--- Code: --- // find links to convert
if (strstr($msg, 'http://'))
{
$links = array();
foreach (explode(' ', $msg) as $w)
if (substr($w, 0, 7) == 'http://' && $smcFunc['strlen']($w) > 7)
$links[] = '<a href="' . $w . '" target="_blank">' . ($smcFunc['strlen']($w) > $shoutbox['maxLinkLenght'] ? substr($w, 0, $shoutbox['maxLinkLenght'] - 8) . '...' . substr($w, -8) : $w) . '</a>';
else
$links[] = $w;
$msg = implode(' ', $links);
}

--- End code ---

Add After:

--- Code: ---
// find SSL links to convert
if (strstr($msg, 'https://'))
{
$links = array();
foreach (explode(' ', $msg) as $w)
if (substr($w, 0, 8) == 'https://' && $smcFunc['strlen']($w) > 8)
$links[] = '<a href="' . $w . '" target="_blank">' . ($smcFunc['strlen']($w) > $shoutbox['maxLinkLenght'] ? substr($w, 0, $shoutbox['maxLinkLenght'] - 9) . '...' . substr($w, -9) : $w) . '</a>';
else
$links[] = $w;
$msg = implode(' ', $links);
}

--- End code ---

phantomm:
Thanks, but this doesn't work :|

edit:

and it works...

Don't know why it didn't work earlier  :o

Thank you :)

remingtone:

--- Quote from: mikedijital on January 19, 2012, 03:20:16 PM ---I dont know if anyone uses ADK Portal but here is code for a custom Block that uses this shoutbox


Go to admin / adk portal / blocks / add a block

Choose php block.   
--- Code: ---<?php
--- End code ---
will already be there, delete it  and past this exactly


--- Code: ---<?php 
call_user_func(Shoutbox_Load);
if (function_exists('template_shoutbox')) template_shoutbox('main'); ?>
--- End code ---

--- End quote ---

nice, but that will be very nice for the log errors (sorry for my english) ;)

call_user_func('Shoutbox_Load');

AnilKumar123:
I've added the shoutbox to my custom theme, however it prints at the bottom of the forum, how to I make it appear at the top?

E.G.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version