Page Index Toggle Pages: 1 [2]  Send TopicPrint
Very Hot Topic (More than 25 Replies) Improved CODE Boxes (Read 6814 times)
Carsten
God Member
*****
Offline


...to much YaMS

Posts: 3281
Location: Langå
Joined: Aug 2nd, 2002
Gender: Male
Re: Improved CODE Boxes
Reply #15 - Jul 10th, 2004 at 3:52am
Print Post  
Working great! With the 'tabs' and 'wrapping' fixed this is "one giant leap" for exchanging code in a way that make sense using the Code box. With the consent of Michael this modification is now implemented in SP2  Smiley
  

If you knock your head against a brick wall and hear a hollow sound, it's not necessarily coming from the wall.
Back to top
 
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: Improved CODE Boxes
Reply #16 - Jul 10th, 2004 at 5:06am
Print Post  
Hi

Carsten wrote on Jul 10th, 2004 at 3:52am:
Working great! With the 'tabs' ...

Hmmm ... why the 'tabs' not work on my Board Shocked

lg XTC
  

Back to top
WWW  
IP Logged
 
Carsten
God Member
*****
Offline


...to much YaMS

Posts: 3281
Location: Langå
Joined: Aug 2nd, 2002
Gender: Male
Re: Improved CODE Boxes
Reply #17 - Jul 10th, 2004 at 5:23am
Print Post  
Can't tell from the info you give  Wink

Want a SP2 sneak peek/test? http://www.langaa-net.dk/cgi-bin/SP26/YaBB.pl?num=1089410917/0
  

If you knock your head against a brick wall and hear a hollow sound, it's not necessarily coming from the wall.
Back to top
 
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: Improved CODE Boxes
Reply #18 - Jul 10th, 2004 at 5:40am
Print Post  
Hi

Hmmm .... and so it looks on my testboard

http://www.xonder.at/cgi-bin/yabb13/YaBB.cgi?board=allgemein;action=display;num=...

why why why !?

lg XTC
  

Back to top
WWW  
IP Logged
 
Carsten
God Member
*****
Offline


...to much YaMS

Posts: 3281
Location: Langå
Joined: Aug 2nd, 2002
Gender: Male
Re: Improved CODE Boxes
Reply #19 - Jul 10th, 2004 at 6:13am
Print Post  
Looks very much like you missed the steps in Post.pl and/or ModifyMessage.pl
  

If you knock your head against a brick wall and hear a hollow sound, it's not necessarily coming from the wall.
Back to top
 
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: Improved CODE Boxes
Reply #20 - Jul 10th, 2004 at 6:21am
Print Post  
Hi

I have check and upload the file again ..... but no result !?

ModifyMessage.pl:
Code
Select All
	while($MIconURL[$i])
  {
		  if($icon eq $MIconURL[$i])
		  {
			  $ic[$i] = " selected"; }
		  $i++;
		  }

	$message =~ s/<br>/\n/ig;
	$message =~ s/ \  \  \ /\t/ig; 



Post.pl: >> The code is in the if($quotemsg ne '') !?
Code
Select All
		if($quotemsg ne '') {
			($msubject, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $mmessage, $mns) = split(/\|/,$messages[$quotemsg]);
			$message=$mmessage;
			$message =~ s~<br>~\n~g;
			$message =~ s/ \  \  \ /\t/ig;
			$message =~ s~\n{0,1}\[quote([^\]]*)\](.*?)\[/quote\]\n{0,1}~\n~isg;
			$message =~ s~\n*\[/*quote([^\]]*)\]\n*~~ig;

			$mname ||= $musername || $txt{'470'};
			$quotestart = int( $quotemsg / $maxmessagedisplay ) * $maxmessagedisplay;
			$message = qq~[quote author=$mname link=board=$currentboard;num=$threadid;start=$quotestart#$quotemsg date=$mdate\]$message\[/quote\]\n~;
			$msubject =~ s/\bre:\s+//ig;
			if ($mns eq "NS") {$nscheck="checked";}
		}
		else {
			($msubject, $mname, $memail, $mdate, $musername, $micon, $mattache, $mip, $mmessage, $mns) = split(/\|/,$messages[0]);
			$msubject =~ s/\bre:\s+//ig;
		} 



lg XTC

PS.: &nbsp; will not display here in the codebox
  

Back to top
WWW  
IP Logged
 
Carsten
God Member
*****
Offline


...to much YaMS

Posts: 3281
Location: Langå
Joined: Aug 2nd, 2002
Gender: Male
Re: Improved CODE Boxes
Reply #21 - Jul 10th, 2004 at 6:58am
Print Post  
Strange!
But another old problem not yet solved came to mind when looking at the code in the previous post - the & n b s p ; turning into a blank space after preview/modify. I remember trying to solve that one but gave up - and forgot about it. Michael?
  

If you knock your head against a brick wall and hear a hollow sound, it's not necessarily coming from the wall.
Back to top
 
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: Improved CODE Boxes
Reply #22 - Jul 10th, 2004 at 7:04am
Print Post  
Hi

@Carsten

Have you instal this mod also on your YaBB 1.3.1?

lg XTC
  

Back to top
WWW  
IP Logged
 
Carsten
God Member
*****
Offline


...to much YaMS

Posts: 3281
Location: Langå
Joined: Aug 2nd, 2002
Gender: Male
Re: Improved CODE Boxes
Reply #23 - Jul 10th, 2004 at 7:21am
Print Post  
..:X.T.C:.. wrote on Jul 10th, 2004 at 7:04am:
Hi

@Carsten

Have you instal this mod also on your YaBB 1.3.1?

lg XTC

Nope - maybe later (not sure), as i have Nicer Post Form on all of them, it would mean rewriting of yabbc.jc - and soon updating to SP2 i'm not in the mood for that - sorry.
  

If you knock your head against a brick wall and hear a hollow sound, it's not necessarily coming from the wall.
Back to top
 
IP Logged
 
Administrator
Forum Administrator
*****
Offline


Yummm

Posts: 7
Location: Modders Rile
Joined: Oct 7th, 2014
Gender: Male
Re: Improved CODE Boxes
Reply #24 - Jul 10th, 2004 at 11:46am
Print Post  
@Xonder: if it doesn't work for you then you must have some code which kills either the \t chars or the yabb replacement for it (3x &nbsp;). A good place to look for such a code is in YaBBC.pl sub DoUBBC and Subs.pl sub wrap and wrap2. Also make sure that the steps modifying sub wrap are applied properly.

About the disappearing &nbsp;:
Didn't notice this one yet, will look into it.

Please note that I don't like YaBB's current code parsing anyway. There is absolutly no need to turn \t into something else before saving it into the thread file. YaBB turns it into " &nbsp; &nbsp; &nbsp;". I'd remove that parsing code but then old threads would display incorrectly. So I simply turned the 3x &nbsp; back to \t. However it may be possible that someone posted a code with 3x &nbsp; as usual. That code will turn into \t too. I didn't find an example showing this problem yet though.
  

The Administrator.
Back to top
WWW  
IP Logged
 
Administrator
Forum Administrator
*****
Offline


Yummm

Posts: 7
Location: Modders Rile
Joined: Oct 7th, 2014
Gender: Male
Re: Improved CODE Boxes
Reply #25 - Jul 10th, 2004 at 12:35pm
Print Post  
Alright I've added the fix for the &nbsp; problem to the mod file, now version 2.1. Here is the important step:
Code
Select All
<edit file>
Sources/Post.pl
</edit file>

<search for>
	$message = $mess;
</search for>

<add after>
	&ToHTML($message);
</add after> 

  

The Administrator.
Back to top
WWW  
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: Improved CODE Boxes
Reply #26 - Jul 10th, 2004 at 12:42pm
Print Post  
Hi Michael

OK ... i have found the code killer Wink

1.) Post.pl: (Look at #$message)

Code
Select All
	if($hot_post && $action eq "post2" || $hot_post && $action eq "modify2" || $hot_im && $action eq "imsend2") {
		foreach (@hotlinks) {
			($htmpa,$htmpb) = @{$_};
			my($htmp, $htmpc, $htmpc2, $tmptarget);
			($htmp,$tmptarget) = split(/\,/,$htmpa,2);
			if($htmpb !~ m~\Ahttp://~) { $htmpb = qq~http:\/\/$htmpb~; }
			if($tmptarget) { $htmpc = qq(\[url=$htmpb\]$hfont1$hfont2); $htmpc2 = qq($hfont4$hfont3\[\/url\]); }
			else { $htmpc = qq(\[link=$htmpb\]$hfont1$hfont2); $htmpc2 = qq($hfont4$hfont3\[\/link\]); }
			#$message =~ s~ &nbsp; &nbsp; &nbsp;~\t~g;
			$message =~ s~<br>~\n~g;
			$message =~ s~(^|\s)($htmp)(?=$|\s|\.|\,|\;|\:|\?)~$1$htmpc$2$htmpc2~sgi;
			$message =~ s~(^|\s)(\[(?:b|i|u|s)\]$htmp\[\/(?:b|i|u|s)\])(?=$|\s|\.|\,|\;|\:|\?)~$1$htmpc$2$htmpc2~sgi;
		}
	} 





2.) Display.pl (Look at #$postmessage)

Code
Select All
		if($hot_post) {
			foreach (@hotlinks) {
				($htmpa,$htmpb) = @{$_};
				my($htmp, $htmpc, $htmpc2, $tmptarget);
				($htmp,$tmptarget) = split(/\,/,$htmpa,2);
				if($htmpb !~ m~\Ahttp://~) { $htmpb = qq~http:\/\/$htmpb~; }
				if($tmptarget) { $htmpc = qq(\[url=$htmpb\]$hfont1$hfont2); $htmpc2 = qq($hfont4$hfont3\[\/url\]); }
				else { $htmpc = qq(\[link=$htmpb\]$hfont1$hfont2); $htmpc2 = qq($hfont4$hfont3\[\/link\]); }
				#$postmessage =~ s~ &nbsp; &nbsp; &nbsp;~\t~g;
				$postmessage =~ s~<br>~\n~g;
				$postmessage =~ s~(^|\s)($htmp)(?=$|\s|\.|\,|\;|\:|\?)~$1$htmpc$2$htmpc2~sgi;
				$postmessage =~ s~(^|\s)(\[(?:b|i|u|s)\]$htmp\[\/(?:b|i|u|s)\])(?=$|\s|\.|\,|\;|\:|\?)~$1$htmpc$2$htmpc2~sgi;
			}
		} 



@Carsten

Is this Code from your "Hotlink Mod" ?

If YES .... what going on .... when i deactive this code!?

lg XTC
  

Back to top
WWW  
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: Improved CODE Boxes
Reply #27 - Jul 10th, 2004 at 12:55pm
Print Post  
Hi

Quote:
Alright I've added the fix for the &nbsp; problem to the mod file

Ohh .. works gread  Cheesy

I love this Mod ...
I love you ...
I love all!

Grin

lg XTC
  

Back to top
WWW  
IP Logged
 
JannoL
Full Member
***
Offline


I love YaBB 1G - SP1.31!

Posts: 165
Location: Home
Joined: Jul 27th, 2002
Gender: Male
Re: Improved CODE Boxes
Reply #28 - Aug 15th, 2004 at 11:21pm
Print Post  
I still think the font size is too small here at boardmod, is it just me ?
I would like the code to be just a little bit bigger, well that is not a problem cause I can choose size in my browser but thats what I think about that. Other than that, Prager, Carsten & co, you really know a few things.
Grin



I belive in God(s), YaBBGods
  

Code Destructionator
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint