vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   Old school (WebBBS-style) quoting (https://vborg.vbsupport.ru/showthread.php?t=70733)

Martin CX 10-17-2004 10:00 PM

Old school (WebBBS-style) quoting
 
This is as much for my own benefit as others. The hack is working fine, but there is a known bug in that the quoting only applies to forum posts and not private messages.

In newreply.php just below the line...
Code:

                $pagetext = trim(strip_quotes($pagetext));
...insert the following
Code:

                // HACK BEGIN
                function word_wrap ($string)
                {
                        $cols = 80;
                        $prefix = "?";
                        $t_lines = split("\n", $string);
                        $outlines = "";
                        while(list(, $thisline) = each($t_lines))
                        {
                                $thisline = trim($thisline);
                                if(strlen($thisline) > $cols)
                                {
                                        $newline = "";
                                        $t_l_lines = split(" ", $thisline);
                                        while(list(, $thisword) = each($t_l_lines))
                                        {
                                                while((strlen($thisword) + strlen($prefix)) > $cols-15)
                                                {
                                                        $cur_pos = 0;
                                                        $outlines .= $prefix;
                                                        for($num=0; $num < $cols-16; $num++)
                                                        {
                                                                $outlines .= $thisword[$num];
                                                                $cur_pos++;
                                                        }
                                                        $outlines .= "\n";
                                                        $thisword = substr($thisword, $cur_pos, (strlen($thisword)-$cur_pos));
                                                }
                                                if((strlen($newline) + strlen($thisword)) > $cols-15)
                                                {
                                                        $outlines .= $prefix.$newline."\n";
                                                        $newline = $thisword." ";
                                                }
                                                else
                                                {
                                                        $newline .= $thisword." ";
                                                }
                                        }
                                        $outlines .= $prefix.$newline."\n";
                                }
                                else
                                {
                                        $outlines .= $prefix.$thisline."\n";
                                }
                        }
                        return $outlines;
                }
                $pagetext = word_wrap($pagetext);
                // HACK END

Screenshot attached.

Best wishes,

Edit: I forgot. In order to not make it look crazy, you have to leave the "newpost_quote"-template empty except for "$pagetext"

Polo 10-18-2004 10:26 PM

Thanks Martin CX for sharing your mod... i'm sure many will find it useful...

James T Brock 10-18-2004 11:14 PM

So this does nothing but change the way quotes look, so it looks like the old style quotes sytem on older software boards?

Do you still need to use quote tags and it just converts it, or would you need to use >>'s?

Martin CX 10-18-2004 11:28 PM

Quote:

Originally Posted by James T Brock
So this does nothing but change the way quotes look, so it looks like the old style quotes sytem on older software boards?

Do you still need to use quote tags and it just converts it, or would you need to use >>'s?

You don't need to use quote tags, it automatically >>'s the text from the post you are replying to.

In this case, had I replied to your message, this is what it would have given me:

?So this does nothing but change the way quotes look, so it looks
?like the old style quotes sytem on older software boards?
?
?Do you still need to use quote tags and it just converts it, or
?would you need to use >>'s?

BTW, I use the prefix '?' as I think it looks nice, but if you want to use '>' or '> ' you can just change it. (It is the prefix variable in the beginning of the script.) And if you want to change the number of characters before the line wraps it is the cols variable.

And thank you, Polo. I hope so.

Erwin 10-19-2004 12:18 AM

Great idea. Definitely old school. :)

Boofo 10-19-2004 01:46 AM

Is there a way to add the name of the person you are quoting also? ;)

Martin CX 10-19-2004 03:12 AM

Quote:

Originally Posted by Boofo
Is there a way to add the name of the person you are quoting also? ;)

Sure, but I think it is perhaps easiest achieved by just editing the "newpost_quote"-template and leave something like...
Code:

?(b)$originalposter wrote:(/b)
?
$pagetext

...or whatever you have in mind (brackets instead of parenthesis, of course).

Best wishes,

HiDeo 10-19-2004 03:39 AM

Nice hack !

Thanks Martin CX

/me installs

alkatraz 10-19-2004 07:49 AM

lovin the bbs style! =)


All times are GMT. The time now is 12:35 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.01222 seconds
  • Memory Usage 1,743KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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