Copy-pasted messages

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
User avatar
alitokmen
Registered User
Posts: 21
Joined: Thu Dec 18, 2003 4:45 pm
Location: Grenoble, France || Ankara, Turkey || Bath, UK
Contact:

Copy-pasted messages

Post by alitokmen »

When people copy and then paste fwd mails to the forum, you will generally see those boring >>> >>>> things, weird line jumps, etc.

IDEA: add this code:

Code: Select all

function transform_fwd(){
	f1=["\ n\ r","\ r\ n","\ r"]
	t1=["\ n","\ n","\ n"]
	f2=["\ n\ n","\ n","  ","\ r","\ n\ n\ n"]
	t2=["\ r"," "," ","\ n\ n","\ n\ n"]
	a="\ n"+document.post.message.value+"\ n"
	for(i=0;i<f1.length;i++){
		while(a.indexOf(f1[i])!=-1){
			a=a.replace(f1[i],t1[i]);}}
	while(a.indexOf("\ n>")!=-1 || a.indexOf("\ n ")!=-1 || a.indexOf(" \ n")!=-1){
		a=a.replace("\ n>","\ n");
		a=a.replace("\ n ","\ n");
		a=a.replace(" \ n","\ n");}
	for(i=0;i<f2.length;i++){
		while(a.indexOf(f2[i])!=-1){
			a=a.replace(f2[i],t2[i]);}}
	document.post.message.value=a.substr(1,a.length-2)
	return false}
and somewhere put a link like "arrange this fwded e-mail message"

Also, adding a

Code: Select all

if (document.post.message.value.indexOf("\ n>") != -1) {
		return !window.confirm("bla bla bla press OK to correct your fwd message cancel to leave as is");
	}
in the checkForm() function makes forums even better :)

(ps: replace the \ ns with a real antislash_n (phpBB doesn't accept the original version.. BUG??)
S. Ali Tokmen
http://ali.tokmen.com" target="_blank
http://contact.ali.tokmen.com" target="_blank

User avatar
dhn
Registered User
Posts: 1518
Joined: Wed Jul 04, 2001 8:10 am
Location: Around the corner
Contact:

Re: Copy-pasted messages

Post by dhn »

alitokmen wrote:When people copy and then paste fwd mails to the forum, you will generally see those boring >>> >>>> things, weird line jumps, etc.
That's what quote is for. With a little CSS magic, you can have your ">" without having to bother with JS or php.
Image

User avatar
SHS`
Registered User
Posts: 1628
Joined: Wed Jul 04, 2001 9:13 am
Location: The Boonies, Hong Kong
Contact:

Re: Copy-pasted messages

Post by SHS` »

dhn wrote:
That's what quote is for. With a little CSS magic, you can have your ">" without having to bother with JS or php.
A certain stupid browser doesn't support CSS2 generated content. ;)

CSS3 is even cooler with:

Code: Select all

blockquote { margin: 0; padding: 0 0 0 2em; } 
blockquote > blockquote { margin-left: -1em; }
blockquote::line-marker { width: 2em; text-align: left; content: ">"; }
On a side note... code can have line number markers generated with CSS3... like so:

Code: Select all

pre { counter-reset: line; }
pre::line-marker { counter-increment: line; content: counter(line) "."; }
Jonathan “SHS`” Stanley • 史德信
phpBB™ 3.1.x, Bug/Security trackers
phpBB™ Bertie Bear 3.0 — prosilver Edition!Asking Questions The Smart Way

User avatar
dhn
Registered User
Posts: 1518
Joined: Wed Jul 04, 2001 8:10 am
Location: Around the corner
Contact:

Re: Copy-pasted messages

Post by dhn »

SHS` wrote:A certain stupid browser doesn't support CSS2 generated content. ;)
Yah, I meant background image, yuo. ;) You just have to make it the correct size corresponding to the text, give it a y-repeat, adjust the padding, and it will show the ">"'s correctly. But generated content came into mind, yes. Stupid IE.
Image

User avatar
alitokmen
Registered User
Posts: 21
Joined: Thu Dec 18, 2003 4:45 pm
Location: Grenoble, France || Ankara, Turkey || Bath, UK
Contact:

Re: Copy-pasted messages

Post by alitokmen »

> > >John Blanchard banktan ayaga kalkti, askeri
> > üniformasini düzeltti ve
> > >ana terminale giden insan kalabaligini inceledi.
> > Yüzünü degil, ama
> > >kalbini tanidigi ve üzerinde gül olan kizi aradi.
> > >Ona olan ilgisi 13 ay önce, Florida kütüphanesinde
> > baslamisti...
> > >Raftan aldigi bir kitabin içindeki yazilar degil
> > ama kenarinda gördügü,
> > >kursun kalemle yazilmis bir not onu etkilemisti.
> > Yumusak el yazisi
> > >düsünceli bir ruhu ve akilli bir zekayi
> > yansitiyordu
> > >Kitabin ön yüzünde, ilk sahibinin adini
> > farketmisti:
> > >Miss.Hollis Maynell.
> > >Uzun zaman çaba harcayarak adresini bulmustu. New
> > York'ta yasiyordu.
> > >Ona kendini tanitan bir mektup yazdi ve yazismayi
> > teklif etti.
> > >Bir sonraki gün II. Dünya
I'm not sure you trick is working... Hum?
S. Ali Tokmen
http://ali.tokmen.com" target="_blank
http://contact.ali.tokmen.com" target="_blank

User avatar
SHS`
Registered User
Posts: 1628
Joined: Wed Jul 04, 2001 9:13 am
Location: The Boonies, Hong Kong
Contact:

Re: Copy-pasted messages

Post by SHS` »

dhn wrote: Yah, I meant background image, yuo. ;) You just have to make it the correct size corresponding to the text, give it a y-repeat, adjust the padding, and it will show the ">"'s correctly.
Eeeeeeeeeeeeeeeeeewwww. :P
Jonathan “SHS`” Stanley • 史德信
phpBB™ 3.1.x, Bug/Security trackers
phpBB™ Bertie Bear 3.0 — prosilver Edition!Asking Questions The Smart Way

User avatar
alitokmen
Registered User
Posts: 21
Joined: Thu Dec 18, 2003 4:45 pm
Location: Grenoble, France || Ankara, Turkey || Bath, UK
Contact:

Re: Copy-pasted messages

Post by alitokmen »

dhn wrote:
alitokmen wrote:When people copy and then paste fwd mails to the forum, you will generally see those boring >>> >>>> things, weird line jumps, etc.
That's what quote is for. With a little CSS magic, you can have your ">" without having to bother with JS or php.

NOT WORKING!!! :oops:

(anyways I've fixed it on my forums so I don't care much, it's only for you!)
S. Ali Tokmen
http://ali.tokmen.com" target="_blank
http://contact.ali.tokmen.com" target="_blank

Post Reply