Hi,

I've tried to output a url ie www.cnn.com and changed my plain text filter to 'convert url to links'

Please, how do I show a link in the shoutbox?

Looking forward to any reply.

CommentFileSizeAuthor
#9 shoutbox.jpg22.66 KBsnsace

Comments

dcomfort’s picture

I've tried putting links into shoutbox and I cannot generate html links. There is no option in Shoutbox 7.x.1.x-dev to choose which input filter to use at admin/config/shoutbox

drupik’s picture

You can do it by hardcode ;)

in shoutbox.theme.inc replace line 103
$post .= '<span class="shoutbox-shout">' . $shout->shout . $approval_message . '</span>';
with
$post .= '<span class="shoutbox-shout">' .check_markup(($shout->shout), 'html') . $approval_message . '</span>';

'html' is yours text format, eg. for plain text will be: 'plain_text'

dcomfort’s picture

Thanks! That works.

snsace’s picture

How do you set BBcode as input filter?

snsace’s picture

This module doesn't seem to be working for anything but plain text. I also tried #2 and still did not get url's to realize. The only thing I can figure is need more details on the correct arrangement of text format filters (although I've tried several combinations).

I have only tried alpha 2.
Is there a difference in the 7.x-1.x-dev and alpha 2 code right now? I figured not since the same release dates.

drupik’s picture

@ssace You must install bbcode first and enable it in input filters.

I have the solution #2 for the past few months, I know that it is not perfect, but it works. Any filter You want will work, even smileys.

snsace’s picture

I do have bbcode enabled. Here are the bbcode filters enabled and in this order:

Convert line breaks into HTML
Convert BBCode to HTML
Convert URLs into links
Smileys filter

---------------------------------------------------------

My input formats are arranged in this order:

Filtered HTML
PHP code
Full HTML
BBCode
Plain text

----------------------------------------------------------

If this all looks right. My only other question is how to enable the bbcode filter in the shoutbox. Would I use #2 above but put bbcode in the check markup?

Thank you,
AJ

drupik’s picture

No, just put in check markup name of filter with bbcode enabled. 'filtered_html' , or 'full_html' ....
so if you have BBcode filter enabled and configured, change line 103:

$post .= '<span class="shoutbox-shout">' .check_markup(($shout->shout), 'bbcode') . $approval_message . '</span>';

snsace’s picture

StatusFileSize
new22.66 KB

When I change line 103, my shouts disappear from the shoutbox and only shows the user's name that posted the shout. like this:

drupik’s picture

Check that input filter on node, maybe something wrong with it, try another filter like 'full_html'.

snsace’s picture

The BBCode input filter is working fine on nodes. Smileys, URL's, email addresses all work correctly in my nodes & comments.

drupik’s picture

So I don't know how to help u. I tried all my formats and it work, not working only when I put incorrect name of input format, then I see the same view like on Your screenshot.
Make sure You put correct name of filter, when You go to edit filter page, on address bar see:
http://localhost/admin/config/content/formats/full_html

The last word after slash is your input filter name, in this case: full_html.

Here there is nothing to non-functioning, 'check_markup' is a standard Drupal feature, it must work.

Sry 4 my poor English ;P

snsace’s picture

It works! Thank you! very much drupik. #12 clued me in to find my problem...

The input filter name was wrong. I'm sure other's will have the same problem. I am working off a fresh install of Drupal 7.

For me the filter names are a follows:

Filtered HTML: input name is '1'
found at: admin/config/content/formats/1

PHP code: input name is '2'
found at: admin/config/content/formats/2

Full HTML: input name is '3'
found at: admin/config/content/formats/3

BBCode: input name is '4'
found at: admin/config/content/formats/4

Plain text: input name is '6'
found at: admin/config/content/formats/6

Not sure why my filter names are not spelled out descriptively as mentioned earlier. Maybe because I'm not using Pathauto module.

coderintherye’s picture

Would shoutbox maintainers accept a patch?

If so, how about we use #2 except variable_get here for the filter, and have an admin setting to set it. It could default to the site's default filter. I'll make the patch if there's a chance of it getting in.

aschiwi’s picture

#2 works but the code is in a theme.inc, which means there is no need to hack the module's file, you can put the function that contains that part in your theme's template.php.

micahw156’s picture

Marked #1811134: Extra feature as a duplicate of this issue.

micahw156’s picture

Marked #1445410: smiley's not showing in shouts as a duplicate of this issue.

micahw156’s picture

Marked #1386180: Input format as a duplicate of this issue.

Delivron_dg’s picture

For me check_markup didn't solve the problem, but htmlspecialchars_decode did it. Finally I decided to use both these functions - the second for fixing the problem and the first by security reasons:

. check_markup(htmlspecialchars_decode($shout->shout), 'filtered_html') .

Still I wonder what part or the code (apart of the text formats) may screen links like this: &lt;a href="about"&gt;about&lt;/a&gt; Any suggestions?

Northern_Girl’s picture

Issue summary: View changes

Hi,

will the output of url in live links will be committed to a new version?

Thanks.

vitalblue’s picture

Hi,
hopefully yes I will do my best :-)

thanks a lot

Northern_Girl’s picture

:) cool!

Happiness is a complete shoutbox!

By the way, I found Shoutbox more intesting than Statuses because we can erase old shouts. Also, someone somewhere asked for a counter of remaining characters. Statuses has a counter... could it be used to code faster a counter for Shoutbox?

NG

Yezid’s picture

Thank You very much for relevant informations – IT WORKS!;)

miroslaw.krawczyk’s picture

The problem still exists, because the _shoutbox_filter_form () function is disabled (in shoutbox.module):

function _shoutbox_filter_form() {
  /* $form = filter_form(variable_get('shoutbox_filter_format', 'FILTER_FORMAT_DEFAULT'), NULL, array('shoutbox_filter_format')); */
  // filter_admin_overview
  /* global $user; */
  /* $formats = filter_formats($user); */

  /* if (count($formats) > 1) { */
  /*   $form['#title'] = t('Shoutbox input format'); */
  /* } */

  /* return $form; */
}

My solution, in shoutbox.module replace line 950
$shout->shout = check_plain($shout->shout);
with
$shout->shout = check_markup(($shout->shout), 'full_html');
It works perfectly :)

vitalblue’s picture

Hi, I will do that today and upload a new version.

Thanks a lot

  • vitalblue committed e248084 on 7.x-1.x
    Issue #1402326 by miroslaw.krawczyk,: Added feature to define if shouts...
vitalblue’s picture

Hi , to all.
Added new feature to define if shouts are going to escape all HTML or not. In the configuration section (SHOUTBOX INPUT FORMAT) you enable or disable this feature.

New version will be soon available :-)

vitalblue’s picture

Assigned: Unassigned » vitalblue
Status: Active » Fixed
vitalblue’s picture

Version: 7.x-1.x-dev » 7.x-1.0
Status: Fixed » Closed (fixed)