• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Contributions (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

BBcode contribution

Post a bug fix, a new feature, a theme ...

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
6 posts • Page 1 of 1

Postby Nemako » Thu Feb 23, 2006 3:11 pm

Here is my contribution to add BBCode to pfc.
This contribution is based on the svn Revision 275.
How to do :

+ in /themes/default/templates/pfcclient.js.tpl.php
after
Code: Select all
    /* try to parse http adresses */
    rx = new RegExp('(http://[^ ]*)','ig');
    msg = msg.replace(rx, '<a href="$1"<?php if($openlinknewwindow) echo ' target="_blank"'; ?>>$1</a>');

add
Code: Select all
    /* try to parse bbcode */
    rx = new RegExp('\[b\](.+?)\[/b\]','ig');
    msg = msg.replace(rx, '<strong>$1</strong>');   
    rx = new RegExp('\[i\](.+?)\[/i\]','ig');
    msg = msg.replace(rx, '<em>$1</em>');
    rx = new RegExp('\[u\](.+?)\[/u\]','ig');
    msg = msg.replace(rx, '<span style="text-decoration: underline">$1</span>');
    rx = new RegExp('\[s\](.+?)\[/s\]','ig');
    msg = msg.replace(rx, '<del>$1</del>');
    rx = new RegExp('\[email\]([^[]*?)\[/email\]','ig');
    msg = msg.replace(rx, '<a href="mailto:$1">$1</a>');
    rx = new RegExp('\[email=([^[]*?)\](.*?)\[/email\]','ig');
    msg = msg.replace(rx, '<a href="mailto:$1">$2</a>');
    rx = new RegExp('\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]','ig');
    msg = msg.replace(rx, '<span style="color: $1">$2</span>');
Nemako
Nemako
Member
 
Posts: 44
Joined: Fri Feb 10, 2006 1:52 pm
  • Website
Top

Postby phpfreechat » Thu Feb 23, 2006 3:47 pm

That's great, I just integrated your contribution to the pfc source code.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby andrewbelcher » Tue Feb 28, 2006 1:49 am

Is this modification done to v0.8 of the Chatroom? As I've downloaded v0.7, and the file you changed wasn't even there :p

If so - is there any way I can get hold of v0.8, or is it still awaiting release?
andrewbelcher
Member
 
Posts: 32
Joined: Tue Feb 28, 2006 1:47 am
Top

Postby Nemako » Tue Feb 28, 2006 9:18 am

Hi andrewbelcher,

it will be available for pfc 0.8. But if you need it now, you can download the svn version http://www.phpfreechat.net/svn

By
Nemako
Nemako
Member
 
Posts: 44
Joined: Fri Feb 10, 2006 1:52 pm
  • Website
Top

Postby Mgccl » Sun Apr 16, 2006 9:46 pm

a question...
what's SVN means?
Mgccl
Member
 
Posts: 35
Joined: Sun Apr 16, 2006 9:40 pm
Top

Postby phpfreechat » Sun Apr 16, 2006 11:03 pm

It means subversion. (a CVS like)
(have a look at this topic : http://www.phpfreechat.net/forum/viewtopic.php?id=137)
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top


Post a reply
6 posts • Page 1 of 1

Return to Contributions (v1.x)

Who is online

Users browsing this forum: No registered users and 11 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub