vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Shoutbox Linebreak (<br>) removal? (https://vborg.vbsupport.ru/showthread.php?t=56394)

Aaron1 08-21-2003 07:59 AM

Shoutbox Linebreak (<br>) removal?
 
It would be very handy if the shoutbox doesn't support or automatically removes linebreaks, just to prevent the shout get's enormous 'heights' on the forum home page.

Is this possible to do that with javascript or through PHP?

I have already set a maximum number of characters in the shoutbox. But that doesn't prevent people from doing something like this:

Hey
this
shoutbox
is
very
cool
thanks
for
that!


This type of shout really messes up my forumhome page...

Someone knows how to do that?
Thanks!

Aaron

Aaron1 08-22-2003 08:54 AM

i did some investigation myself, and I think I found the right script for this, but i don't know how to combine it with the Shoutbox.php...

http://groups.google.com/groups?hl=n...com%26rnum%3D1

This is the script that should work:

PHP Code:

$foo "This is
   a string with
   line breaks"
;

echo 
$string;

$bar preg_replace ("/(\r?\n)/"""$foo);

echo 
"\n\n";
echo 
$bar

But how do i combine this with the shoutbox script:

PHP Code:

$shout_text  bbcodeparse($shout_text); 

Do i need to make a substring?
If someone is experienced with php, please give me a hand...

pie 08-22-2003 11:52 AM

try sticking this before that code

$shout_text = preg_replace ("/(\r?\n)/", "", $shout_text);

Aaron1 08-22-2003 11:56 AM

Cool!
That works thanks alot!


All times are GMT. The time now is 08:17 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01027 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete