phpfreechat-svn Mailing List for phpFreeChat (Page 6)
Status: Beta
Brought to you by:
kerphi
You can subscribe to this list here.
2006 |
Jan
|
Feb
(2) |
Mar
|
Apr
(61) |
May
(56) |
Jun
(96) |
Jul
(23) |
Aug
(62) |
Sep
(76) |
Oct
(48) |
Nov
(28) |
Dec
(28) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(31) |
Feb
(40) |
Mar
(29) |
Apr
(11) |
May
(6) |
Jun
(18) |
Jul
(18) |
Aug
(108) |
Sep
(24) |
Oct
(6) |
Nov
(21) |
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
(16) |
Apr
|
May
(3) |
Jun
|
Jul
(7) |
Aug
(1) |
Sep
(3) |
Oct
|
Nov
(3) |
Dec
(2) |
2009 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ke...@us...> - 2007-08-29 12:18:21
|
Revision: 1154 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1154&view=rev Author: kerphi Date: 2007-08-29 05:18:19 -0700 (Wed, 29 Aug 2007) Log Message: ----------- remove useless debug directory Removed Paths: ------------- trunk/debug/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-08-28 21:15:43
|
Revision: 1153 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1153&view=rev Author: kerphi Date: 2007-08-28 14:15:39 -0700 (Tue, 28 Aug 2007) Log Message: ----------- Add some documentation for the parameters list Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2007-08-28 00:36:27 UTC (rev 1152) +++ trunk/src/pfcglobalconfig.class.php 2007-08-28 21:15:39 UTC (rev 1153) @@ -31,13 +31,74 @@ */ class pfcGlobalConfig { - var $serverid = ""; // this is the chat server id (comparable to the server host in IRC) + /** + * <p>This is the only mandatory parameter used to identify the chat server. + * You can compare it to the server ip/host like on an IRC server. + * If you don't know what to write, just try : <code>$params["serverid"] = md5(__FILE__);</code></p> + */ + var $serverid = ''; - // these parameters are dynamic (not cached) - var $nick = ""; // the initial nickname ("" means the user will be queried) + /** + * <p>Used to change the chat title that is visible just above the messages list. + * ("My Chat" by default)</p> + */ + var $title = ''; + + /** + * <p>If you have already identified the user (forum, portal...) you can force the user's nickname with this parameter. + * Defining a nick will skip the "Please enter your nickname" popup.</p> + * <p>Warning : Nicknames must be encoded in UTF-8. + * For example, if you get nicks from a databases where they are ISO-8859-1 encoded, + * you must convert it: <code>$params["nick"] = iconv("ISO-8859-1", "UTF-8", $bdd_nickname);</code> + * (of course, change the <code>$bdd_nickname</code> parameter for your needs)</p> + * <p>("" value by default, means users must choose a nickname when s/he connects)</p> + */ + var $nick = ""; + + /** + * <p>This is the maximum nickname length, a longer nickname is forbidden. + * ( 15 caracteres by default)</p> + */ + var $max_nick_len = 15; + + /** + * <p>Setting this to true will forbid the user to change his/her nickname later. + * (false value by default)</p> + */ + var $frozen_nick = false; + var $nickmeta = array(); // this is the nickname user's metadata, you can add : sexe, age, real name ... (ex: array('sexe'=>'f') ) var $nickmeta_private = array('ip'); // this is the meta that only admins can see + + /** + * <p>Used to create default rooms (auto-joined at startup). It contains an array of rooms names. + * (by default only one room is created named "My room")</p> + */ + var $channels = array(); + var $frozen_channels = array(); // if empty, allows users to create there own channels + var $max_channels = 10; // this the max number of allowed channels by users + var $privmsg = array(); // the joined private chat when opening the chat (the nicknames must be online) + var $max_privmsg = 5; // this the max number of allowed privmsg by users + + + /** + * <p>This is the time to wait between two refreshes. + * A refresh is a HTTP request which asks the server if there are new messages to display. + * If there are no new messages, then a empty HTTP response is returned. + * ( 5000 by default, 5000ms = 5s)</p> + */ + var $refresh_delay = 5000; + + /** + * <p>This is the time of inactivity to wait before to considere to disconnecte user (in milliseconds). + * A user is inactive only if he closed his chat windows. + * A user with a open chat window is not inactive because he sends each <code>refresh_delay</code> a HTTP request. + * ( 20000 by default, 20000ms = 20s)</p> + */ + var $timeout = 20000; + + var $isadmin = false; var $admins = array("admin" => ""); // the key is the nickname, the value is the password var $firstisadmin = false; // give admin rights to the first connected user on the server @@ -74,63 +135,178 @@ var $proxies_path_default = ""; // dirname(__FILE__).'/proxies' var $cmd_path = ""; // a custom commands path var $cmd_path_default = ""; // dirname(__FILE__).'/commands' - var $title = ""; // default is _pfc("My Chat") - var $channels = array(); // the default joined channels when opening the chat - var $frozen_channels = array(); // if empty, allows users to create there own channels - var $max_channels = 10; // this the max number of allowed channels by users - var $privmsg = array(); // the joined private chat when opening the chat (the nicknames must be online) - var $max_privmsg = 5; // this the max number of allowed privmsg by users - var $frozen_nick = false; // set it to true if you don't want the user to be able to change his nickname - var $max_nick_len = 15; - var $max_text_len = 400; - var $refresh_delay = 5000; // in mili-seconds (5 seconds) + + /** + * <p>This is the maximum message length, a longer message is forbidden. + * ( 250 characters by default)</p> + */ + var $max_text_len = 400; + + var $max_refresh_delay = 60000; // in mili-seconds (60 seconds) - var $timeout = 20000; // in mili-seconds (20 seconds) - var $max_msg = 20; // number of messages keept in the history (this is what you see when you reload the chat) + + /** + * <p>This is the number of messages keept in the history. + * This is what you see when you reload the chat. + * The number of messages s/he can see is defined by this parameter. + * (20 lines by default)</p> + */ + var $max_msg = 20; var $max_displayed_lines = 150; // maximum number of displayed lines (old lines will be deleted to save browser's memory) - var $quit_on_closedwindow = true; // could be annoying because the reload event is the same as a close event - var $focus_on_connect = true; - var $connect_at_startup = true; - var $start_minimized = false; - var $height = "440px"; - var $width = ""; - var $shownotice = 3; // show: 0 = nothing, 1 = just nickname changes, 2 = join/quit, 3 = 1+2 - var $nickmarker = true; // show/hide nicknames colors - var $clock = true; // show/hide dates and hours + + /** + * <p>Setting this to true will send a <code>/quit</code> command when the user close his window + * (doesn't work on Firefox). + * This parameter isn't true by default because on IE and Konqueror/Safari, + * reloading the window (F5) will generate the same event as closing the window which can be annoying. + * (false value by default)</p> + */ + var $quit_on_closedwindow = true; + + /** + * <p>Setting this to true will give the focus to the input text box when connecting to the chat. + * It can be usefull not touch the focus when integrating the chat into an existing website + * because when the focus is changed, the viewport follows the focus location. + * (true value by default)</p> + */ + var $focus_on_connect = true; + + /** + * <p>Setting this to false will oblige user to click on the connect button if s/he wants to chat. + * (true value by default, means when the chat web page is open, + * a connection to the chat is automaticaly performed)</p> + */ + var $connect_at_startup = true; + + /** + * <p>Setting it to true will start the chat minimized. + * (false value by default)</p> + */ + var $start_minimized = false; + + /** + * <p>Height of the chat area. + * ("440px" by default)</p> + */ + var $height = "440px"; + + /** + * <p><ul><li>Setting this to 0 will show nothing.</li> + * <li>Setting it to 1 will show nicknames changes.</li> + * <li>Setting it to 2 will show connect/disconnect notifications.</li> + * <li>Setting it to 3 (1+2) will show nicknames and connect/disconnect notifications.</li></ul> + * (3 by default)</p> + */ + var $shownotice = 3; + + /** + * <p>Setting it to false will disable nickname colorization. + * (true value by default)</p> + **/ + var $nickmarker = true; + + /** + * <p>Setting it to false will hide the date/hour column. + * (true value by default)</p> + */ + var $clock = true; + var $startwithsound = true; // start with sound enabled - var $openlinknewwindow = true; // used to open the links in a new window + + /** + * <p>Setting it to true will add the <code>target="_blank"</code> into parsed links. + * This attribute can be used to open the followed link in a new window. + * (true value by default)</p> + */ + var $openlinknewwindow = true; + var $notify_window = true; // true : appends a prefix to the window title with the number of new posted messages var $short_url = true; // true : shortens long urls entered by users in the chat area var $short_url_width = 40; // final width of the shortened url /** + * Used to hide the phpfreechat linkback logo. * Be sure that you are conform to the license page before setting this to false ! * http://www.phpfreechat.net/license.en.html */ - var $display_pfc_logo = true; + var $display_pfc_logo = true; var $displaytabimage = true; var $displaytabclosebutton = true; - var $showwhosonline = true; - var $showsmileys = true; - var $btn_sh_whosonline = true; // display show/hide button for who is online - var $btn_sh_smileys = true; // display show/hide button for smileys + + /** + * <p>Used to show/hide online users list at startup. + * (true value by default)</p> + */ + var $showwhosonline = true; + + /** + * <p>Used to show/hide the smiley selector at startup. + * (true value by default)</p> + */ + var $showsmileys = true; + + /** + * <p>Used to display or not the showwhosonline button. + * (true value by default)</p> + */ + var $btn_sh_whosonline = true; + + /** + * <p>Used to display or not the showsmileys button. + * (true value by default)</p> + */ + var $btn_sh_smileys = true; + var $bbcode_colorlist = array("#FFFFFF","#000000","#000055","#008000","#FF0000","#800000","#800080","#FF5500","#FFFF00","#00FF00","#008080","#00FFFF","#0000FF","#FF00FF","#7F7F7F","#D2D2D2"); var $nickname_colorlist = array('#CCCCCC','#000000','#3636B2','#2A8C2A','#C33B3B','#C73232','#80267F','#66361F','#D9A641','#3DCC3D','#1A5555','#2F8C74','#4545E6','#B037B0','#4C4C4C','#959595'); - - var $theme = "default"; + + /** + * <p>This parameter specifies which theme the chat will use. + * A theme is a package that make possible to completly change the chat appearance (CSS) and the chat dynamics (JS) + * You can found official themes in the <code>themes/</code> directory on your local phpfreechat distribution. + * ('default' by default)</p> + */ + var $theme = 'default'; var $theme_path = ''; var $theme_default_path = ''; var $theme_url = ''; var $theme_default_url = ''; + + /** + * <p>Used to translate the chat text and messages. Accepted values are the <code>i18n/</code> sub directories names. + * (by default this is the local server language)</p> + */ + var $language = ''; + + /** + * <p>Useful to set a sepcific encoding for chat labels. + * This is really useful when the Web page embedding the chat is not UTF-8 encoded. + * This parameter should be the same as the chat web page. + * Could be ISO-8859-1 or anything else but it must be supported by iconv php module. + * (UTF-8 by default )</p> + */ + var $output_encoding = 'UTF-8'; + + /** + * <p>Used to specify the chat container (chat database). + * Accepted containers are : File and Mysql (in the future maybe other). + * ("File" by default)</p> + */ + var $container_type = 'File'; + + /** + * <p>Used to specify the script which will handle asynchronous request. + * Very useful when the chat (client) script is resource consuming (ex: forum or portal chat integration). + * <code>server_script_url</code> must point to the server script browable url (useful when using url rewriting). + * (by default these parameters are calculated automaticaly)</p> + */ + var $server_script_path = ''; + var $server_script_url = ''; + + - var $language = ""; // could be something in i18n/* directory ("" means the language is guess from the server config) - var $output_encoding = "UTF-8"; // could be ISO-8859-1 or anything else (which must be supported by iconv php module) - var $container_type = "File"; - var $client_script_path = ""; - var $server_script_path = ""; - var $server_script_url = ""; // default is calculated from 'server_script_path' var $data_private_path = ""; // default is dirname(__FILE__)."/../data/private"; var $data_public_path = ""; // default is dirname(__FILE__)."/../data/public"; var $data_public_url = ""; // default is calculated from 'data_public_path' path This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-28 00:36:25
|
Revision: 1152 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1152&view=rev Author: gpinzone Date: 2007-08-27 17:36:27 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Added fix for PNG transparency on IE 5.5 and IE 6.0 to default theme. Does not affect any other browsers. Modified Paths: -------------- trunk/themes/default/style.css.php Added Paths: ----------- trunk/themes/default/iepngfix.htc trunk/themes/default/images/blank.gif Added: trunk/themes/default/iepngfix.htc =================================================================== --- trunk/themes/default/iepngfix.htc (rev 0) +++ trunk/themes/default/iepngfix.htc 2007-08-28 00:36:27 UTC (rev 1152) @@ -0,0 +1,71 @@ +<public:component> +<public:attach event="onpropertychange" onevent="doFix()" /> + +<script type="text/javascript"> + +// IE5.5+ PNG Alpha Fix v1.0RC4 +// (c) 2004-2005 Angus Turnbull http://www.twinhelix.com + +// This is licensed under the CC-GNU LGPL, version 2.1 or later. +// For details, see: http://creativecommons.org/licenses/LGPL/2.1/ + +// This must be a path to a blank image. That's all the configuration you need. +if (typeof blankImg == 'undefined') +{ + var blankImg = document.URL; + blankImg = blankImg.substring(0,blankImg.lastIndexOf("/")+1) + "images/blank.gif"; + //blankImg = blankImg + "/../images/blank.gif"; +} + +var f = 'DXImageTransform.Microsoft.AlphaImageLoader'; + +function filt(s, m) +{ + if (filters[f]) + { + filters[f].enabled = s ? true : false; + if (s) with (filters[f]) { src = s; sizingMethod = m } + } + else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")'; +} + +function doFix() +{ + // Assume IE7 is OK. + if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) || + (event && !/(background|src)/.test(event.propertyName))) return; + + var bgImg = currentStyle.backgroundImage || style.backgroundImage; + + if (tagName == 'IMG') + { + if ((/\.png$/i).test(src)) + { + if (currentStyle.width == 'auto' && currentStyle.height == 'auto') + style.width = offsetWidth + 'px'; + filt(src, 'scale'); + src = blankImg; + } + else if (src.indexOf(blankImg) < 0) filt(); + } + else if (bgImg && bgImg != 'none') + { + if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i)) + { + var s = RegExp.$1; + if (currentStyle.width == 'auto' && currentStyle.height == 'auto') + style.width = offsetWidth + 'px'; + style.backgroundImage = 'none'; + filt(s, 'crop'); + // IE link fix. + for (var n = 0; n < childNodes.length; n++) + if (childNodes[n].style) childNodes[n].style.position = 'relative'; + } + else filt(); + } +} + +doFix(); + +</script> +</public:component> \ No newline at end of file Added: trunk/themes/default/images/blank.gif =================================================================== (Binary files differ) Property changes on: trunk/themes/default/images/blank.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/themes/default/style.css.php =================================================================== --- trunk/themes/default/style.css.php 2007-08-27 19:55:29 UTC (rev 1151) +++ trunk/themes/default/style.css.php 2007-08-28 00:36:27 UTC (rev 1152) @@ -1,3 +1,7 @@ +img, div { + behavior: url("<?php echo $c->getFileUrlFromTheme('iepngfix.htc'); ?>"); +} + /* will break display (margins, paddings) on IE6 div#pfc_container * { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-27 19:55:28
|
Revision: 1151 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1151&view=rev Author: gpinzone Date: 2007-08-27 12:55:29 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Fix default smilies for IE 6.0. Modified Paths: -------------- trunk/themes/default/smileys/arrow_left.png trunk/themes/default/smileys/arrow_right.png trunk/themes/default/smileys/emoticon_evilgrin.png trunk/themes/default/smileys/emoticon_grin.png trunk/themes/default/smileys/emoticon_happy.png trunk/themes/default/smileys/emoticon_smile.png trunk/themes/default/smileys/emoticon_surprised.png trunk/themes/default/smileys/emoticon_tongue.png trunk/themes/default/smileys/emoticon_unhappy.png trunk/themes/default/smileys/emoticon_waii.png trunk/themes/default/smileys/emoticon_wink.png trunk/themes/default/smileys/exclamation.png trunk/themes/default/smileys/lightbulb.png trunk/themes/default/smileys/weather_clouds.png trunk/themes/default/smileys/weather_cloudy.png trunk/themes/default/smileys/weather_lightning.png trunk/themes/default/smileys/weather_rain.png trunk/themes/default/smileys/weather_snow.png trunk/themes/default/smileys/weather_sun.png Modified: trunk/themes/default/smileys/arrow_left.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/arrow_right.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/emoticon_evilgrin.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/emoticon_grin.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/emoticon_happy.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/emoticon_smile.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/emoticon_surprised.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/emoticon_tongue.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/emoticon_unhappy.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/emoticon_waii.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/emoticon_wink.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/exclamation.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/lightbulb.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/weather_clouds.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/weather_cloudy.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/weather_lightning.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/weather_rain.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/weather_snow.png =================================================================== (Binary files differ) Modified: trunk/themes/default/smileys/weather_sun.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-27 17:40:33
|
Revision: 1150 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1150&view=rev Author: gpinzone Date: 2007-08-27 10:40:35 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Optimized GIF file sizes Modified Paths: -------------- trunk/themes/default/images/bt_color.gif trunk/themes/default/images/bt_del.gif trunk/themes/default/images/bt_em.gif trunk/themes/default/images/bt_ins.gif trunk/themes/default/images/bt_mail.gif trunk/themes/default/images/bt_pre.gif trunk/themes/default/images/bt_strong.gif trunk/themes/default/images/clock-off.gif trunk/themes/default/images/close-whoisbox.gif trunk/themes/default/images/color-off.gif trunk/themes/default/images/maximize.gif trunk/themes/default/images/minimize.gif trunk/themes/default/images/online-separator.gif Modified: trunk/themes/default/images/bt_color.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/bt_del.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/bt_em.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/bt_ins.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/bt_mail.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/bt_pre.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/bt_strong.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/clock-off.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/close-whoisbox.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/color-off.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/maximize.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/minimize.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/online-separator.gif =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-27 16:53:29
|
Revision: 1147 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1147&view=rev Author: gpinzone Date: 2007-08-26 16:06:21 -0700 (Sun, 26 Aug 2007) Log Message: ----------- Updated double-space search and replace to use positive and negative lookahead. Modified Paths: -------------- trunk/data/public/js/pfcclient.js Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-08-26 16:23:20 UTC (rev 1146) +++ trunk/data/public/js/pfcclient.js 2007-08-26 23:06:21 UTC (rev 1147) @@ -1435,9 +1435,9 @@ msg = msg.replace(rx, '$1'); } - // replace double spaces by entity - rx = new RegExp(' ','g'); - msg = msg.replace(rx, ' '); + // Replace double spaces outside of tags by " " entity. + rx = new RegExp(' (?= )(?![^<]*>)','g'); + msg = msg.replace(rx, ' '); // try to parse bbcode rx = new RegExp('\\[b\\](.+?)\\[\/b\\]','ig'); @@ -1471,7 +1471,7 @@ { // We don't want to replace smiley strings inside of tags. // Use negative lookahead to search for end of tag. - rx = new RegExp(RegExp.escape(sl[i]) + "(?![^<]*>)",'g'); + rx = new RegExp(RegExp.escape(sl[i]) + '(?![^<]*>)','g'); msg = msg.replace(rx, '<img src="'+ smileys[sl[i]] +'" alt="' + sl[i] + '" title="' + sl[i] + '" />'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-27 16:20:48
|
Revision: 1149 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1149&view=rev Author: gpinzone Date: 2007-08-27 09:20:51 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Fixed newmsg.gif and oldmsg.gif problems with Opera browsers. Modified Paths: -------------- trunk/themes/default/images/newmsg.gif trunk/themes/default/images/oldmsg.gif Modified: trunk/themes/default/images/newmsg.gif =================================================================== (Binary files differ) Modified: trunk/themes/default/images/oldmsg.gif =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-27 14:21:00
|
Revision: 1148 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1148&view=rev Author: gpinzone Date: 2007-08-27 07:21:01 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Simplified nick completion. Modified Paths: -------------- trunk/data/public/js/pfcclient.js Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-08-26 23:06:21 UTC (rev 1147) +++ trunk/data/public/js/pfcclient.js 2007-08-27 14:21:01 UTC (rev 1148) @@ -660,7 +660,7 @@ } if (nick_match) { - w.value = non_nick_begin + nick_src.replace(nick_src, nick_replace) + non_nick_end; + w.value = non_nick_begin + nick_replace + non_nick_end; w.selStart = w.selEnd = non_nick_begin.length + nick_replace.length; // Move cursor to end of completed nick. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-24 15:25:12
|
Revision: 1145 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1145&view=rev Author: gpinzone Date: 2007-08-24 08:13:24 -0700 (Fri, 24 Aug 2007) Log Message: ----------- Added two new parameters to the globalconfigclass: $short_url and $short_url_width. Rewrote short URL algorithm to use these values and to deal with ridiculously small widths. Moved URL proceesing to read instead of write. Fixed issue with honoring target global setting from the last commit. Modified Paths: -------------- trunk/src/pfccontainer.class.php trunk/src/pfcglobalconfig.class.php trunk/src/pfcurlprocessing.php Modified: trunk/src/pfccontainer.class.php =================================================================== --- trunk/src/pfccontainer.class.php 2007-08-24 02:39:27 UTC (rev 1144) +++ trunk/src/pfccontainer.class.php 2007-08-24 15:13:24 UTC (rev 1145) @@ -382,9 +382,6 @@ $msgid = $this->_requestMsgId($chan); - // convert URLs to html - $param = pfc_make_hyperlink($param); - // format message $data = "\n"; $data .= $msgid."\t"; @@ -445,7 +442,8 @@ $data["timestamp"] = $formated_line[1]; $data["sender"] = $formated_line[2]; $data["cmd"] = $formated_line[3]; - $data["param"] = $formated_line[4]; + // convert URLs to html + $data["param"] = pfc_make_hyperlink($formated_line[4]); $datalist[$data["id"]] = $data; } } Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2007-08-24 02:39:27 UTC (rev 1144) +++ trunk/src/pfcglobalconfig.class.php 2007-08-24 15:13:24 UTC (rev 1145) @@ -100,6 +100,8 @@ var $startwithsound = true; // start with sound enabled var $openlinknewwindow = true; // used to open the links in a new window var $notify_window = true; // true : appends a prefix to the window title with the number of new posted messages + var $short_url = true; // true : shortens long urls entered by users in the chat area + var $short_url_width = 40; // final width of the shortened url /** * Be sure that you are conform to the license page before setting this to false ! Modified: trunk/src/pfcurlprocessing.php =================================================================== --- trunk/src/pfcurlprocessing.php 2007-08-24 02:39:27 UTC (rev 1144) +++ trunk/src/pfcurlprocessing.php 2007-08-24 15:13:24 UTC (rev 1145) @@ -1,13 +1,15 @@ <?php +require_once dirname(__FILE__).'/pfcglobalconfig.class.php'; + /** * Rewritten by Nathan Codding - Feb 6, 2001. * - Goes through the given string, and replaces xxxx://yyyy with an HTML <a> tag linking - * to that URL + * to that URL * - Goes through the given string, and replaces www.xxxx.yyyy[zzzz] with an HTML <a> tag linking - * to http://www.xxxx.yyyy[/zzzz] + * to http://www.xxxx.yyyy[/zzzz] * - Goes through the given string, and replaces xxxx@yyyy with an HTML mailto: tag linking - * to that email address + * to that email address * - Only matches these 2 patterns either after a space, or at the beginning of a line * * Notes: the email one might get annoying - it's easy to make it more restrictive, though.. maybe @@ -15,38 +17,41 @@ */ function pfc_make_hyperlink($text) { + $c =& pfcGlobalConfig::Instance(); + $openlinknewwindow = $c->openlinknewwindow; + if ($openlinknewwindow) $target = " onclick=\"window.open(this.href,\\'_blank\\');return false;\""; else - $target = ''; + $target = ""; $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); - // pad it with a space so we can match things at the start of the 1st line. - $ret = ' ' . $text; + // pad it with a space so we can match things at the start of the 1st line. + $ret = ' ' . $text; - // matches an "xxxx://yyyy" URL at the start of a line, or after a space. - // xxxx can only be alpha characters. - // yyyy is anything up to the first space, newline, comma, double quote or < - //$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); - $ret = preg_replace("#(^|[\n \]])([\w]+?://[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"\\2\"" . $target . ">' . pfc_shorten_url('\\2') . '</a>'", $ret); + // matches an "xxxx://yyyy" URL at the start of a line, or after a space. + // xxxx can only be alpha characters. + // yyyy is anything up to the first space, newline, comma, double quote or < + //$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); + $ret = preg_replace("#(^|[\n \]])([\w]+?://[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"\\2\"" . $target . ">' . pfc_shorten_url('\\2') . '</a>'", $ret); - // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing - // Must contain at least 2 dots. xxxx contains either alphanum, or "-" - // zzzz is optional.. will contain everything up to the first space, newline, - // comma, double quote or <. - //$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); - $ret = preg_replace("#(^|[\n \]])((www|ftp)\.[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"http://\\2\"" . $target . ">' . pfc_shorten_url('\\2') . '</a>'", $ret); + // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing + // Must contain at least 2 dots. xxxx contains either alphanum, or "-" + // zzzz is optional.. will contain everything up to the first space, newline, + // comma, double quote or <. + //$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); + $ret = preg_replace("#(^|[\n \]])((www|ftp)\.[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"http://\\2\"" . $target . ">' . pfc_shorten_url('\\2') . '</a>'", $ret); - // matches an email@domain type address at the start of a line, or after a space. - // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". - //$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); - $ret = preg_replace("#(^|[\n \]])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#ie", "'\\1<a href=\"mailto:\\2@\\3\">' . pfc_shorten_url('\\2@\\3') . '</a>'", $ret); + // matches an email@domain type address at the start of a line, or after a space. + // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". + //$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); + $ret = preg_replace("#(^|[\n \]])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#ie", "'\\1<a href=\"mailto:\\2@\\3\">' . pfc_shorten_url('\\2@\\3') . '</a>'", $ret); - // Remove our padding.. - $ret = substr($ret, 1); + // Remove our padding.. + $ret = substr($ret, 1); - return($ret); + return($ret); } /** @@ -57,19 +62,32 @@ */ function pfc_undo_make_hyperlink($text) { - $text = preg_replace("#<!-- BBCode auto-link start --><a href=\"(.*?)\" target=\"_blank\">.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text); - $text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\">.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text); + $text = preg_replace("#<!-- BBCode auto-link start --><a href=\"(.*?)\" target=\"_blank\">.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text); + $text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\">.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text); - return $text; + return $text; } function pfc_shorten_url($url) { + $c =& pfcGlobalConfig::Instance(); + + if (! $c->short_url) + return $url; + + // Short URL Width + $shurl_w = $c->short_url_width; + + $shurl_end_w = floor($shurl_w * .25) - 3; + if ($shurl_end_w < 3) $shurl_end_w = 3; + $shurl_begin_w = $shurl_w - $shurl_end_w - 3; + if ($shurl_begin_w < 3) $shurl_begin_w = 3; + $decodedurl = html_entity_decode($url, ENT_QUOTES); $len = strlen($decodedurl); - $short_url = ($len > 40) ? substr($decodedurl, 0, 30) . "..." . substr($decodedurl, -7) : $decodedurl; + $short_url = ($len > $shurl_w) ? substr($decodedurl, 0, $shurl_begin_w) . "..." . substr($decodedurl, -$shurl_end_w) : $decodedurl; return htmlentities($short_url, ENT_QUOTES); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-24 02:39:29
|
Revision: 1144 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1144&view=rev Author: gpinzone Date: 2007-08-23 19:39:27 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Added logic to honor $openlinknewwindow flag. CANNOT CURRENTLY FIND VALUE OF $openlinknewwindow. NEEDS TO BE FIXED. Modified Paths: -------------- trunk/src/pfcurlprocessing.php Modified: trunk/src/pfcurlprocessing.php =================================================================== --- trunk/src/pfcurlprocessing.php 2007-08-24 00:08:49 UTC (rev 1143) +++ trunk/src/pfcurlprocessing.php 2007-08-24 02:39:27 UTC (rev 1144) @@ -15,7 +15,12 @@ */ function pfc_make_hyperlink($text) { - $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); + if ($openlinknewwindow) + $target = " onclick=\"window.open(this.href,\\'_blank\\');return false;\""; + else + $target = ''; + + $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); // pad it with a space so we can match things at the start of the 1st line. $ret = ' ' . $text; @@ -24,14 +29,14 @@ // xxxx can only be alpha characters. // yyyy is anything up to the first space, newline, comma, double quote or < //$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); - $ret = preg_replace("#(^|[\n \]])([\w]+?://[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"\\2\" target=\"_blank\">' . pfc_shorten_url('\\2') . '</a>'", $ret); + $ret = preg_replace("#(^|[\n \]])([\w]+?://[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"\\2\"" . $target . ">' . pfc_shorten_url('\\2') . '</a>'", $ret); // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing // Must contain at least 2 dots. xxxx contains either alphanum, or "-" // zzzz is optional.. will contain everything up to the first space, newline, // comma, double quote or <. //$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); - $ret = preg_replace("#(^|[\n \]])((www|ftp)\.[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"http://\\2\" target=\"_blank\">' . pfc_shorten_url('\\2') . '</a>'", $ret); + $ret = preg_replace("#(^|[\n \]])((www|ftp)\.[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"http://\\2\"" . $target . ">' . pfc_shorten_url('\\2') . '</a>'", $ret); // matches an email@domain type address at the start of a line, or after a space. // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-24 00:08:51
|
Revision: 1143 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1143&view=rev Author: gpinzone Date: 2007-08-23 17:08:49 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Replaced the html_entity_decode for PHP <4.3.0 with the implementation from PHP_Compat. Modified Paths: -------------- trunk/src/pfctools.php Modified: trunk/src/pfctools.php =================================================================== --- trunk/src/pfctools.php 2007-08-23 21:02:56 UTC (rev 1142) +++ trunk/src/pfctools.php 2007-08-24 00:08:49 UTC (rev 1143) @@ -438,19 +438,52 @@ } /** - * html_entity_decode - * For users prior to PHP 4.3.0 + * Replace html_entity_decode() + * + * @category PHP + * @package PHP_Compat + * @link http://php.net/function.html_entity_decode + * @author David Irvine <da...@co...> + * @author Aidan Lister <ai...@ph...> + * @version $Revision: 1.8 $ + * @since PHP 4.3.0 + * @internal Setting the charset will not do anything + * @require PHP 4.0.0 (user_error) */ -if (!function_exists('html_entity_decode')) -{ - function html_entity_decode($string) + +if (!defined('ENT_NOQUOTES')) { + define('ENT_NOQUOTES', 0); +} + +if (!defined('ENT_COMPAT')) { + define('ENT_COMPAT', 2); +} + +if (!defined('ENT_QUOTES')) { + define('ENT_QUOTES', 3); +} + +if (!function_exists('html_entity_decode')) { + function html_entity_decode($string, $quote_style = ENT_COMPAT, $charset = null) { - // replace numeric entities - $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string); - $string = preg_replace('~&#([0-9]+);~e', 'chr("\\1")', $string); - // replace literal entities + if (!is_int($quote_style)) { + user_error('html_entity_decode() expects parameter 2 to be long, ' . + gettype($quote_style) . ' given', E_USER_WARNING); + return; + } + $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); + + // Add single quote to translation table; + $trans_tbl['''] = '\''; + + // Not translating double quotes + if ($quote_style & ENT_NOQUOTES) { + // Remove double quote from translation table + unset($trans_tbl['"']); + } + return strtr($string, $trans_tbl); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-23 21:02:54
|
Revision: 1142 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1142&view=rev Author: gpinzone Date: 2007-08-23 14:02:56 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Fixed issue with shortening URL when escaped HTML characters were being split improperly. Modified Paths: -------------- trunk/src/pfctools.php trunk/src/pfcurlprocessing.php Modified: trunk/src/pfctools.php =================================================================== --- trunk/src/pfctools.php 2007-08-23 19:40:15 UTC (rev 1141) +++ trunk/src/pfctools.php 2007-08-23 21:02:56 UTC (rev 1142) @@ -437,4 +437,22 @@ } } +/** + * html_entity_decode + * For users prior to PHP 4.3.0 + */ +if (!function_exists('html_entity_decode')) +{ + function html_entity_decode($string) + { + // replace numeric entities + $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string); + $string = preg_replace('~&#([0-9]+);~e', 'chr("\\1")', $string); + // replace literal entities + $trans_tbl = get_html_translation_table(HTML_ENTITIES); + $trans_tbl = array_flip($trans_tbl); + return strtr($string, $trans_tbl); + } +} + ?> \ No newline at end of file Modified: trunk/src/pfcurlprocessing.php =================================================================== --- trunk/src/pfcurlprocessing.php 2007-08-23 19:40:15 UTC (rev 1141) +++ trunk/src/pfcurlprocessing.php 2007-08-23 21:02:56 UTC (rev 1142) @@ -61,10 +61,12 @@ function pfc_shorten_url($url) { - $len = strlen($url); - $short_url = ($len > 40) ? substr($url, 0, 30) . "..." . substr($url, -7) : $url; + $decodedurl = html_entity_decode($url, ENT_QUOTES); - return $short_url; + $len = strlen($decodedurl); + $short_url = ($len > 40) ? substr($decodedurl, 0, 30) . "..." . substr($decodedurl, -7) : $decodedurl; + + return htmlentities($short_url, ENT_QUOTES); } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-23 19:40:14
|
Revision: 1141 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1141&view=rev Author: gpinzone Date: 2007-08-23 12:40:15 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Revised smiley bugfix to use negative lookahead since it's natively supported in JavaScript. Sort smiley keys by length (longest to shortest) to prevent shorter smileys from taking precedence over longer ones. Modified Paths: -------------- trunk/data/public/js/pfcclient.js Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-08-22 06:38:33 UTC (rev 1140) +++ trunk/data/public/js/pfcclient.js 2007-08-23 19:40:15 UTC (rev 1141) @@ -1455,14 +1455,14 @@ // try to parse smileys var smileys = this.res.getSmileyHash(); - var sl = smileys.keys(); + // Sort keys by longest to shortest. This prevents a smiley like :) from being used on >:) + var sl = smileys.keys().sort(function (a,b){return (b.unescapeHTML().length - a.unescapeHTML().length);}); for(var i = 0; i < sl.length; i++) { - // Emulate negative lookbehind in JavaScript. // We don't want to replace smiley strings inside of tags. - // See http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript for more info. - rx = new RegExp("(<[^>]*)?" + RegExp.escape(sl[i]),'g'); - msg = msg.replace(rx, function($0, $1){ return $1 ? $0 : '<img src="'+ smileys[sl[i]] +'" alt="' + sl[i] + '" title="' + sl[i] + '" />'; }); + // Use negative lookahead to search for end of tag. + rx = new RegExp(RegExp.escape(sl[i]) + "(?![^<]*>)",'g'); + msg = msg.replace(rx, '<img src="'+ smileys[sl[i]] +'" alt="' + sl[i] + '" title="' + sl[i] + '" />'); } // try to parse nickname for highlighting This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-08-22 06:38:31
|
Revision: 1140 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1140&view=rev Author: kerphi Date: 2007-08-21 23:38:33 -0700 (Tue, 21 Aug 2007) Log Message: ----------- To avoid functions name conflicts : prefix the function and file name with "pfc" or "pfc_" So that you can be almost sure that the functions pfc uses will not interact with other users libraries. Modified Paths: -------------- trunk/src/pfccontainer.class.php Added Paths: ----------- trunk/src/pfcurlprocessing.php Removed Paths: ------------- trunk/src/urlprocessing.php Modified: trunk/src/pfccontainer.class.php =================================================================== --- trunk/src/pfccontainer.class.php 2007-08-21 16:59:45 UTC (rev 1139) +++ trunk/src/pfccontainer.class.php 2007-08-22 06:38:33 UTC (rev 1140) @@ -21,7 +21,7 @@ */ require_once dirname(__FILE__)."/pfccontainerinterface.class.php"; - require_once dirname(__FILE__)."/urlprocessing.php"; + require_once dirname(__FILE__)."/pfcurlprocessing.php"; /** * pfcContainer is an abstract class which define interface @@ -383,7 +383,7 @@ $msgid = $this->_requestMsgId($chan); // convert URLs to html - $param = make_hyperlink($param); + $param = pfc_make_hyperlink($param); // format message $data = "\n"; Copied: trunk/src/pfcurlprocessing.php (from rev 1139, trunk/src/urlprocessing.php) =================================================================== --- trunk/src/pfcurlprocessing.php (rev 0) +++ trunk/src/pfcurlprocessing.php 2007-08-22 06:38:33 UTC (rev 1140) @@ -0,0 +1,70 @@ +<?php + +/** + * Rewritten by Nathan Codding - Feb 6, 2001. + * - Goes through the given string, and replaces xxxx://yyyy with an HTML <a> tag linking + * to that URL + * - Goes through the given string, and replaces www.xxxx.yyyy[zzzz] with an HTML <a> tag linking + * to http://www.xxxx.yyyy[/zzzz] + * - Goes through the given string, and replaces xxxx@yyyy with an HTML mailto: tag linking + * to that email address + * - Only matches these 2 patterns either after a space, or at the beginning of a line + * + * Notes: the email one might get annoying - it's easy to make it more restrictive, though.. maybe + * have it require something like xxxx@yyyy.zzzz or such. We'll see. + */ +function pfc_make_hyperlink($text) +{ + $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); + + // pad it with a space so we can match things at the start of the 1st line. + $ret = ' ' . $text; + + // matches an "xxxx://yyyy" URL at the start of a line, or after a space. + // xxxx can only be alpha characters. + // yyyy is anything up to the first space, newline, comma, double quote or < + //$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); + $ret = preg_replace("#(^|[\n \]])([\w]+?://[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"\\2\" target=\"_blank\">' . pfc_shorten_url('\\2') . '</a>'", $ret); + + // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing + // Must contain at least 2 dots. xxxx contains either alphanum, or "-" + // zzzz is optional.. will contain everything up to the first space, newline, + // comma, double quote or <. + //$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); + $ret = preg_replace("#(^|[\n \]])((www|ftp)\.[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"http://\\2\" target=\"_blank\">' . pfc_shorten_url('\\2') . '</a>'", $ret); + + // matches an email@domain type address at the start of a line, or after a space. + // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". + //$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); + $ret = preg_replace("#(^|[\n \]])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#ie", "'\\1<a href=\"mailto:\\2@\\3\">' . pfc_shorten_url('\\2@\\3') . '</a>'", $ret); + + // Remove our padding.. + $ret = substr($ret, 1); + + return($ret); +} + +/** + * Nathan Codding - Feb 6, 2001 + * Reverses the effects of make_clickable(), for use in editpost. + * - Does not distinguish between "www.xxxx.yyyy" and "http://aaaa.bbbb" type URLs. + * + */ +function pfc_undo_make_hyperlink($text) +{ + $text = preg_replace("#<!-- BBCode auto-link start --><a href=\"(.*?)\" target=\"_blank\">.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text); + $text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\">.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text); + + return $text; + +} + +function pfc_shorten_url($url) +{ + $len = strlen($url); + $short_url = ($len > 40) ? substr($url, 0, 30) . "..." . substr($url, -7) : $url; + + return $short_url; +} + +?> Deleted: trunk/src/urlprocessing.php =================================================================== --- trunk/src/urlprocessing.php 2007-08-21 16:59:45 UTC (rev 1139) +++ trunk/src/urlprocessing.php 2007-08-22 06:38:33 UTC (rev 1140) @@ -1,70 +0,0 @@ -<?php - -/** - * Rewritten by Nathan Codding - Feb 6, 2001. - * - Goes through the given string, and replaces xxxx://yyyy with an HTML <a> tag linking - * to that URL - * - Goes through the given string, and replaces www.xxxx.yyyy[zzzz] with an HTML <a> tag linking - * to http://www.xxxx.yyyy[/zzzz] - * - Goes through the given string, and replaces xxxx@yyyy with an HTML mailto: tag linking - * to that email address - * - Only matches these 2 patterns either after a space, or at the beginning of a line - * - * Notes: the email one might get annoying - it's easy to make it more restrictive, though.. maybe - * have it require something like xxxx@yyyy.zzzz or such. We'll see. - */ -function make_hyperlink($text) -{ - $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); - - // pad it with a space so we can match things at the start of the 1st line. - $ret = ' ' . $text; - - // matches an "xxxx://yyyy" URL at the start of a line, or after a space. - // xxxx can only be alpha characters. - // yyyy is anything up to the first space, newline, comma, double quote or < - //$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); - $ret = preg_replace("#(^|[\n \]])([\w]+?://[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"\\2\" target=\"_blank\">' . shorten_url('\\2') . '</a>'", $ret); - - // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing - // Must contain at least 2 dots. xxxx contains either alphanum, or "-" - // zzzz is optional.. will contain everything up to the first space, newline, - // comma, double quote or <. - //$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); - $ret = preg_replace("#(^|[\n \]])((www|ftp)\.[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"http://\\2\" target=\"_blank\">' . shorten_url('\\2') . '</a>'", $ret); - - // matches an email@domain type address at the start of a line, or after a space. - // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". - //$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); - $ret = preg_replace("#(^|[\n \]])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#ie", "'\\1<a href=\"mailto:\\2@\\3\">' . shorten_url('\\2@\\3') . '</a>'", $ret); - - // Remove our padding.. - $ret = substr($ret, 1); - - return($ret); -} - -/** - * Nathan Codding - Feb 6, 2001 - * Reverses the effects of make_clickable(), for use in editpost. - * - Does not distinguish between "www.xxxx.yyyy" and "http://aaaa.bbbb" type URLs. - * - */ -function undo_make_hyperlink($text) -{ - $text = preg_replace("#<!-- BBCode auto-link start --><a href=\"(.*?)\" target=\"_blank\">.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text); - $text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\">.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text); - - return $text; - -} - -function shorten_url($url) -{ - $len = strlen($url); - $short_url = ($len > 40) ? substr($url, 0, 30) . "..." . substr($url, -7) : $url; - - return $short_url; -} - -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-08-21 16:59:42
|
Revision: 1139 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1139&view=rev Author: kerphi Date: 2007-08-21 09:59:45 -0700 (Tue, 21 Aug 2007) Log Message: ----------- some tests to know if using opendir to get the filename with the higher integer is faster than to read a simple index file Added Paths: ----------- branches/pfc-comet/misc/opendir-perf-test/ branches/pfc-comet/misc/opendir-perf-test/dir_to_test/ branches/pfc-comet/misc/opendir-perf-test/dir_to_test/664 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/665 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/666 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/667 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/668 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/669 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/670 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/671 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/672 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/673 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/674 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/675 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/676 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/677 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/678 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/679 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/680 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/681 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/682 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/683 branches/pfc-comet/misc/opendir-perf-test/dir_to_test/684 branches/pfc-comet/misc/opendir-perf-test/indexfile-read.php branches/pfc-comet/misc/opendir-perf-test/indexfile-write.php branches/pfc-comet/misc/opendir-perf-test/indexfile_to_test/ branches/pfc-comet/misc/opendir-perf-test/indexfile_to_test/index branches/pfc-comet/misc/opendir-perf-test/opendir-read.php branches/pfc-comet/misc/opendir-perf-test/opendir-write.php Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/664 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/665 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/666 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/667 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/668 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/669 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/670 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/671 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/672 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/673 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/674 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/675 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/676 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/677 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/678 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/679 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/680 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/681 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/682 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/683 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/dir_to_test/684 =================================================================== Added: branches/pfc-comet/misc/opendir-perf-test/indexfile-read.php =================================================================== --- branches/pfc-comet/misc/opendir-perf-test/indexfile-read.php (rev 0) +++ branches/pfc-comet/misc/opendir-perf-test/indexfile-read.php 2007-08-21 16:59:45 UTC (rev 1139) @@ -0,0 +1,22 @@ +<?php + +require_once dirname(__FILE__)."/../../src/pfctools.php"; + +$uid = md5(uniqid(rand(), true)); +$indexfile = dirname(__FILE__)."/indexfile_to_test/index"; +$delay = 1000; // 1000 = 1 ms + +$time = 0; +while(1) +{ + + $time = microtime(); + if (!file_exists($indexfile)) die(); + + $max = file_get_contents_flock($indexfile); + + echo "[".$uid."] max is ".$max.", dtime = ".(microtime()-$time)."\n"; + usleep($delay); +} + +?> Added: branches/pfc-comet/misc/opendir-perf-test/indexfile-write.php =================================================================== --- branches/pfc-comet/misc/opendir-perf-test/indexfile-write.php (rev 0) +++ branches/pfc-comet/misc/opendir-perf-test/indexfile-write.php 2007-08-21 16:59:45 UTC (rev 1139) @@ -0,0 +1,24 @@ +<?php + +require_once dirname(__FILE__)."/../../src/pfctools.php"; + +$uid = md5(uniqid(rand(), true)); +$indexfile = dirname(__FILE__)."/indexfile_to_test/index"; +$delay = 1000000; // 1000 = 1 ms + +$time = 0; +while(1) +{ + + $time = microtime(); + if (!file_exists($indexfile)) die(); + + $max = file_get_contents_flock($indexfile); + $max++; + file_put_contents($indexfile, $max, LOCK_EX); + + echo "[".$uid."] max is ".$max.", dtime = ".(microtime()-$time)."\n"; + usleep($delay); +} + +?> Added: branches/pfc-comet/misc/opendir-perf-test/indexfile_to_test/index =================================================================== --- branches/pfc-comet/misc/opendir-perf-test/indexfile_to_test/index (rev 0) +++ branches/pfc-comet/misc/opendir-perf-test/indexfile_to_test/index 2007-08-21 16:59:45 UTC (rev 1139) @@ -0,0 +1 @@ +136 \ No newline at end of file Added: branches/pfc-comet/misc/opendir-perf-test/opendir-read.php =================================================================== --- branches/pfc-comet/misc/opendir-perf-test/opendir-read.php (rev 0) +++ branches/pfc-comet/misc/opendir-perf-test/opendir-read.php 2007-08-21 16:59:45 UTC (rev 1139) @@ -0,0 +1,35 @@ +<?php + +$uid = md5(uniqid(rand(), true)); +$dir = dirname(__FILE__)."/dir_to_test"; +$delay = 1000; // 1000 = 1 ms + +$time = 0; +while(1) +{ + + $time = microtime(); + if (!is_dir($dir)) return false; + + $list = array(); + if ($dh = opendir($dir)) + { + while (($file = readdir($dh)) !== false) + if ($file != '.' && $file != '..' && $file != '.svn') + $list[] = $file; + closedir($dh); + } + + sort($list); + if (count($list)>0) + $max = $list[count($list)-1]; + else + $max = -1; + //foreach($list as $i) + // if ($max == -1 || $max < $i) + // $max = $i; + echo "[".$uid."] max is ".$max.", dtime = ".(microtime()-$time)."\n"; + usleep($delay); +} + +?> Added: branches/pfc-comet/misc/opendir-perf-test/opendir-write.php =================================================================== --- branches/pfc-comet/misc/opendir-perf-test/opendir-write.php (rev 0) +++ branches/pfc-comet/misc/opendir-perf-test/opendir-write.php 2007-08-21 16:59:45 UTC (rev 1139) @@ -0,0 +1,36 @@ +<?php + +$dir = dirname(__FILE__)."/dir_to_test"; +$limit = 20; + +while(1) +{ + if (!is_dir($dir)) return false; + + $list = array(); + if ($dh = opendir($dir)) + { + while (($file = readdir($dh)) !== false) + if ($file != '.' && $file != '..' && $file != '.svn') + $list[] = $file; + closedir($dh); + } + + sort($list); + if (count($list)>0) + { + $min = $list[0]; + $max = $list[count($list)-1]; + } + else + { + $max = 0; + $min = 0; + } + touch($dir.'/'.($max+1)); + @unlink($dir.'/'.($max-$limit)); + echo "min = $min, max = $max\n"; + sleep(1); +} + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-21 02:16:15
|
Revision: 1138 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1138&view=rev Author: gpinzone Date: 2007-08-20 19:16:16 -0700 (Mon, 20 Aug 2007) Log Message: ----------- Fixed new regex for smileys. Phew! Modified Paths: -------------- trunk/data/public/js/pfcclient.js Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-08-21 01:46:09 UTC (rev 1137) +++ trunk/data/public/js/pfcclient.js 2007-08-21 02:16:16 UTC (rev 1138) @@ -1461,8 +1461,8 @@ // Emulate negative lookbehind in JavaScript. // We don't want to replace smiley strings inside of tags. // See http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript for more info. - rx = new RegExp('(<[^>]*)?' + RegExp.escape(sl[i]),'g'); - msg = msg.replace(rx, function($0, $1){ return $1 ? $0 : $1 + '<img src="'+ smileys[sl[i]] +'" alt="' + sl[i] + '" title="' + sl[i] + '" />'; }); + rx = new RegExp("(<[^>]*)?" + RegExp.escape(sl[i]),'g'); + msg = msg.replace(rx, function($0, $1){ return $1 ? $0 : '<img src="'+ smileys[sl[i]] +'" alt="' + sl[i] + '" title="' + sl[i] + '" />'; }); } // try to parse nickname for highlighting This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-21 01:46:07
|
Revision: 1137 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1137&view=rev Author: gpinzone Date: 2007-08-20 18:46:09 -0700 (Mon, 20 Aug 2007) Log Message: ----------- Fix for parse smileys: No longer replace smileys inside of HTML tags. Tested on Firefox only. Modified Paths: -------------- trunk/data/public/js/pfcclient.js Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-08-20 21:22:57 UTC (rev 1136) +++ trunk/data/public/js/pfcclient.js 2007-08-21 01:46:09 UTC (rev 1137) @@ -1458,8 +1458,11 @@ var sl = smileys.keys(); for(var i = 0; i < sl.length; i++) { - rx = new RegExp(RegExp.escape(sl[i]),'g'); - msg = msg.replace(rx, '<img src="'+ smileys[sl[i]] +'" alt="' + sl[i] + '" title="' + sl[i] + '" />'); + // Emulate negative lookbehind in JavaScript. + // We don't want to replace smiley strings inside of tags. + // See http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript for more info. + rx = new RegExp('(<[^>]*)?' + RegExp.escape(sl[i]),'g'); + msg = msg.replace(rx, function($0, $1){ return $1 ? $0 : $1 + '<img src="'+ smileys[sl[i]] +'" alt="' + sl[i] + '" title="' + sl[i] + '" />'; }); } // try to parse nickname for highlighting This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-20 21:22:59
|
Revision: 1136 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1136&view=rev Author: gpinzone Date: 2007-08-20 14:22:57 -0700 (Mon, 20 Aug 2007) Log Message: ----------- Fixed commenting of old code to make IE and Opera JavaScript engine happy. Modified Paths: -------------- trunk/data/public/js/pfcgui.js Modified: trunk/data/public/js/pfcgui.js =================================================================== --- trunk/data/public/js/pfcgui.js 2007-08-20 20:40:46 UTC (rev 1135) +++ trunk/data/public/js/pfcgui.js 2007-08-20 21:22:57 UTC (rev 1136) @@ -441,11 +441,12 @@ elt.onclick = function(){ pfc.switch_text_color(this.bbc); } clist.appendChild(elt); } +/* }, -/* buildChat is not used. Use templates instead. */ +// buildChat is not used. Use templates instead. -/* buildChat: function() + buildChat: function() { var container = $('pfc_container'); @@ -759,6 +760,6 @@ var soundcontainerbox = document.createElement('div'); soundcontainerbox.setAttribute('id', 'pfc_sound_container'); container.appendChild(soundcontainerbox); + */ } - */ }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-20 20:40:45
|
Revision: 1135 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1135&view=rev Author: gpinzone Date: 2007-08-20 13:40:46 -0700 (Mon, 20 Aug 2007) Log Message: ----------- Added URL shortening to URL linking. Now all browsers work the same. Modified Paths: -------------- trunk/src/urlprocessing.php Modified: trunk/src/urlprocessing.php =================================================================== --- trunk/src/urlprocessing.php 2007-08-20 19:36:14 UTC (rev 1134) +++ trunk/src/urlprocessing.php 2007-08-20 20:40:46 UTC (rev 1135) @@ -24,19 +24,19 @@ // xxxx can only be alpha characters. // yyyy is anything up to the first space, newline, comma, double quote or < //$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); - $ret = preg_replace("#(^|[\n \]])([\w]+?://[\w\#$%&~/.\-;:=,?@+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); + $ret = preg_replace("#(^|[\n \]])([\w]+?://[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"\\2\" target=\"_blank\">' . shorten_url('\\2') . '</a>'", $ret); // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing // Must contain at least 2 dots. xxxx contains either alphanum, or "-" // zzzz is optional.. will contain everything up to the first space, newline, // comma, double quote or <. //$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); - $ret = preg_replace("#(^|[\n \]])((www|ftp)\.[\w\#$%&~/.\-;:=,?@+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); + $ret = preg_replace("#(^|[\n \]])((www|ftp)\.[\w\#$%&~/.\-;:=,?@+]*)#ise", "'\\1<a href=\"http://\\2\" target=\"_blank\">' . shorten_url('\\2') . '</a>'", $ret); // matches an email@domain type address at the start of a line, or after a space. // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". //$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); - $ret = preg_replace("#(^|[\n \]])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); + $ret = preg_replace("#(^|[\n \]])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#ie", "'\\1<a href=\"mailto:\\2@\\3\">' . shorten_url('\\2@\\3') . '</a>'", $ret); // Remove our padding.. $ret = substr($ret, 1); @@ -59,4 +59,12 @@ } +function shorten_url($url) +{ + $len = strlen($url); + $short_url = ($len > 40) ? substr($url, 0, 30) . "..." . substr($url, -7) : $url; + + return $short_url; +} + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-20 19:36:11
|
Revision: 1134 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1134&view=rev Author: gpinzone Date: 2007-08-20 12:36:14 -0700 (Mon, 20 Aug 2007) Log Message: ----------- Needed to change function name to resolve conflict with phpBB. Modified Paths: -------------- trunk/src/pfccontainer.class.php trunk/src/urlprocessing.php Modified: trunk/src/pfccontainer.class.php =================================================================== --- trunk/src/pfccontainer.class.php 2007-08-20 17:41:46 UTC (rev 1133) +++ trunk/src/pfccontainer.class.php 2007-08-20 19:36:14 UTC (rev 1134) @@ -383,7 +383,7 @@ $msgid = $this->_requestMsgId($chan); // convert URLs to html - $param = make_clickable($param); + $param = make_hyperlink($param); // format message $data = "\n"; Modified: trunk/src/urlprocessing.php =================================================================== --- trunk/src/urlprocessing.php 2007-08-20 17:41:46 UTC (rev 1133) +++ trunk/src/urlprocessing.php 2007-08-20 19:36:14 UTC (rev 1134) @@ -13,7 +13,7 @@ * Notes: the email one might get annoying - it's easy to make it more restrictive, though.. maybe * have it require something like xxxx@yyyy.zzzz or such. We'll see. */ -function make_clickable($text) +function make_hyperlink($text) { $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); @@ -50,7 +50,7 @@ * - Does not distinguish between "www.xxxx.yyyy" and "http://aaaa.bbbb" type URLs. * */ -function undo_make_clickable($text) +function undo_make_hyperlink($text) { $text = preg_replace("#<!-- BBCode auto-link start --><a href=\"(.*?)\" target=\"_blank\">.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text); $text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\">.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-20 17:49:22
|
Revision: 1133 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1133&view=rev Author: gpinzone Date: 2007-08-20 10:41:46 -0700 (Mon, 20 Aug 2007) Log Message: ----------- Moved autolink feature out of JavaScript and put it into PHP. Removed email bbcode and button since it's not needed. Modified Paths: -------------- trunk/data/public/js/pfcclient.js trunk/src/pfccontainer.class.php trunk/themes/default/chat.html.tpl.php Added Paths: ----------- trunk/src/urlprocessing.php Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-08-20 02:19:47 UTC (rev 1132) +++ trunk/data/public/js/pfcclient.js 2007-08-20 17:41:46 UTC (rev 1133) @@ -1387,7 +1387,7 @@ parseMessage: function(msg) { var rx = null; - +/* // parse urls var rx_url = new RegExp('(^|[^\\"])([a-z]+\:\/\/[a-z0-9.\\~\\/\\?\\=\\&\\-\\_\\#:;%,@]*[a-z0-9\\/\\?\\=\\&\\-\\_\\#])([^\\"]|$)','ig'); var ttt = msg.split(rx_url); @@ -1428,7 +1428,7 @@ // replace double spaces by entity rx = new RegExp(' ','g'); msg = msg.replace(rx, ' '); - +*/ // try to parse bbcode rx = new RegExp('\\[b\\](.+?)\\[\/b\\]','ig'); msg = msg.replace(rx, '<span style="font-weight: bold">$1</span>'); @@ -1440,10 +1440,12 @@ msg = msg.replace(rx, '<span style="text-decoration: line-through">$1</span>'); // rx = new RegExp('\\[pre\\](.+?)\\[\/pre\\]','ig'); // msg = msg.replace(rx, '<pre>$1</pre>'); +/* rx = new RegExp('\\[email\\]([A-z0-9][\\w.-]*@[A-z0-9][\\w\\-\\.]+\\.[A-z0-9]{2,6})\\[\/email\\]','ig'); msg = msg.replace(rx, '<a href="mailto: $1">$1</a>'); rx = new RegExp('\\[email=([A-z0-9][\\w.-]*@[A-z0-9][\\w\\-\\.]+\\.[A-z0-9]{2,6})\\](.+?)\\[\/email\\]','ig'); msg = msg.replace(rx, '<a href="mailto: $1">$2</a>'); +*/ rx = new RegExp('\\[color=([a-zA-Z]+|\\#?[0-9a-fA-F]{6}|\\#?[0-9a-fA-F]{3})](.+?)\\[\/color\\]','ig'); msg = msg.replace(rx, '<span style="color: $1">$2</span>'); // parse bbcode colors twice because the current_text_color is a bbcolor Modified: trunk/src/pfccontainer.class.php =================================================================== --- trunk/src/pfccontainer.class.php 2007-08-20 02:19:47 UTC (rev 1132) +++ trunk/src/pfccontainer.class.php 2007-08-20 17:41:46 UTC (rev 1133) @@ -21,6 +21,7 @@ */ require_once dirname(__FILE__)."/pfccontainerinterface.class.php"; + require_once dirname(__FILE__)."/urlprocessing.php"; /** * pfcContainer is an abstract class which define interface @@ -381,6 +382,9 @@ $msgid = $this->_requestMsgId($chan); + // convert URLs to html + $param = make_clickable($param); + // format message $data = "\n"; $data .= $msgid."\t"; Added: trunk/src/urlprocessing.php =================================================================== --- trunk/src/urlprocessing.php (rev 0) +++ trunk/src/urlprocessing.php 2007-08-20 17:41:46 UTC (rev 1133) @@ -0,0 +1,62 @@ +<?php + +/** + * Rewritten by Nathan Codding - Feb 6, 2001. + * - Goes through the given string, and replaces xxxx://yyyy with an HTML <a> tag linking + * to that URL + * - Goes through the given string, and replaces www.xxxx.yyyy[zzzz] with an HTML <a> tag linking + * to http://www.xxxx.yyyy[/zzzz] + * - Goes through the given string, and replaces xxxx@yyyy with an HTML mailto: tag linking + * to that email address + * - Only matches these 2 patterns either after a space, or at the beginning of a line + * + * Notes: the email one might get annoying - it's easy to make it more restrictive, though.. maybe + * have it require something like xxxx@yyyy.zzzz or such. We'll see. + */ +function make_clickable($text) +{ + $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); + + // pad it with a space so we can match things at the start of the 1st line. + $ret = ' ' . $text; + + // matches an "xxxx://yyyy" URL at the start of a line, or after a space. + // xxxx can only be alpha characters. + // yyyy is anything up to the first space, newline, comma, double quote or < + //$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); + $ret = preg_replace("#(^|[\n \]])([\w]+?://[\w\#$%&~/.\-;:=,?@+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); + + // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing + // Must contain at least 2 dots. xxxx contains either alphanum, or "-" + // zzzz is optional.. will contain everything up to the first space, newline, + // comma, double quote or <. + //$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); + $ret = preg_replace("#(^|[\n \]])((www|ftp)\.[\w\#$%&~/.\-;:=,?@+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); + + // matches an email@domain type address at the start of a line, or after a space. + // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".". + //$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); + $ret = preg_replace("#(^|[\n \]])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); + + // Remove our padding.. + $ret = substr($ret, 1); + + return($ret); +} + +/** + * Nathan Codding - Feb 6, 2001 + * Reverses the effects of make_clickable(), for use in editpost. + * - Does not distinguish between "www.xxxx.yyyy" and "http://aaaa.bbbb" type URLs. + * + */ +function undo_make_clickable($text) +{ + $text = preg_replace("#<!-- BBCode auto-link start --><a href=\"(.*?)\" target=\"_blank\">.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text); + $text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\">.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text); + + return $text; + +} + +?> Modified: trunk/themes/default/chat.html.tpl.php =================================================================== --- trunk/themes/default/chat.html.tpl.php 2007-08-20 02:19:47 UTC (rev 1132) +++ trunk/themes/default/chat.html.tpl.php 2007-08-20 17:41:46 UTC (rev 1133) @@ -127,6 +127,7 @@ class="pfc_bt_delete" onclick="pfc.insert_text('[s]','[/s]',true)" /> </div> +<!-- <div id="pfc_bt_mail_btn" class="pfc_btn"> <img src="<?php echo $c->getFileUrlFromTheme('images/bt_mail.gif'); ?>" id="pfc_bt_mail" @@ -135,6 +136,7 @@ class="pfc_bt_mail" onclick="pfc.insert_text('[email]','[/email]',true)" /> </div> +--> <div id="pfc_bt_color_btn" class="pfc_btn"> <img src="<?php echo $c->getFileUrlFromTheme('images/bt_color.gif'); ?>" alt="<?php echo _pfc("Color"); ?>" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-20 02:19:45
|
Revision: 1132 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1132&view=rev Author: gpinzone Date: 2007-08-19 19:19:47 -0700 (Sun, 19 Aug 2007) Log Message: ----------- Cleanup of old/bad code. Modified Paths: -------------- trunk/data/public/js/pfcgui.js trunk/src/containers/file.class.php Modified: trunk/data/public/js/pfcgui.js =================================================================== --- trunk/data/public/js/pfcgui.js 2007-08-17 23:44:26 UTC (rev 1131) +++ trunk/data/public/js/pfcgui.js 2007-08-20 02:19:47 UTC (rev 1132) @@ -443,7 +443,9 @@ } }, - buildChat: function() +/* buildChat is not used. Use templates instead. */ + +/* buildChat: function() { var container = $('pfc_container'); @@ -758,4 +760,5 @@ soundcontainerbox.setAttribute('id', 'pfc_sound_container'); container.appendChild(soundcontainerbox); } + */ }; Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2007-08-17 23:44:26 UTC (rev 1131) +++ trunk/src/containers/file.class.php 2007-08-20 02:19:47 UTC (rev 1132) @@ -67,7 +67,6 @@ return $errors; } - function setMeta($group, $subgroup, $leaf, $leafvalue = NULL) { $c =& pfcGlobalConfig::Instance(); @@ -217,120 +216,6 @@ return $ret; } - - function popMeta($group, $subgroup, $leaf) - { - $c =& pfcGlobalConfig::Instance(); - if ($c->debug) - file_put_contents("/tmp/debug", "\npopMeta(".$group.",".$subgroup.",".$leaf.")", FILE_APPEND | LOCK_EX); - - // create directories - $dir_base = $c->container_cfg_server_dir; - $dir = $dir_base.'/'.$group.'/'.$subgroup; - if (!is_dir($dir)) mkdir_r($dir); - - // create or replace metadata file - $leaffilename = $dir."/".$leaf; - - // create return array - $ret = array(); - $ret["timestamp"] = array(); - $ret["value"] = array(); - - // read and increment data from metadata file - clearstatcache(); - if (file_exists($leaffilename)) - { - $fh = fopen($leaffilename, 'r+'); - for($i = 0; $i < 10; $i++) // Try 10 times until an exclusive lock can be obtained - { - if (flock($fh, LOCK_EX)) - { - $ret["value"][] = chop(fread($fh, filesize($leaffilename))); - $ret["timestamp"][] = filemtime($leaffilename); - $leafvalue = array_pop($ret); - // check if array is now empty - if (count($ret) == 0) - { - fclose($fh); - unlink($leaffilename); - break; - } - rewind($fh); - fwrite($fh, $ret); - fflush($fh); - ftruncate($fh, ftell($fh)); - flock($fh, LOCK_UN); - fclose($fh); - break; - } - // If flock is working properly, this will never be reached - $delay = rand(0, pow(2, ($i+1)) - 1) * 5000; // Exponential backoff - usleep($delay); - } - $ret = $leafvalue; - } - else - { - // return empty array - return $ret; - } - return $ret; - } - - - function pushMeta($group, $subgroup, $leaf, $leafvalue = NULL) - { - $c =& pfcGlobalConfig::Instance(); - if ($c->debug) - file_put_contents("/tmp/debug", "\npushMeta(".$group.",".$subgroup.",".$leaf.",".$leafvalue.")", FILE_APPEND | LOCK_EX); - - // create directories - $dir_base = $c->container_cfg_server_dir; - $dir = $dir_base.'/'.$group.'/'.$subgroup; - if (!is_dir($dir)) mkdir_r($dir); - - // create or replace metadata file - $leaffilename = $dir."/".$leaf; - - // read and increment data from metadata file - clearstatcache(); - if ( $leafexists = file_exists($leaffilename) ) - { - $fh = fopen($leaffilename, 'r+'); - for($i = 0; $i < 10; $i++) // Try 10 times until an exclusive lock can be obtained - { - if (flock($fh, LOCK_EX)) - { - if ( $leafvalue == NULL ) $leafvalue = ''; - $leafvaltmp = chop(fread($fh, filesize($leaffilename))); - array_push($leafvaltmp, $leafvalue); - rewind($fh); - fwrite($fh, $leafvaltmp); - fflush($fh); - ftruncate($fh, ftell($fh)); - flock($fh, LOCK_UN); - break; - } - // If flock is working properly, this will never be reached - $delay = rand(0, pow(2, ($i+1)) - 1) * 5000; // Exponential backoff - usleep($delay); - } - fclose($fh); - } - else - { - file_put_contents($leaffilename, $leafvalue, LOCK_EX); - } - - if ($leafexists) - return 1; // value overwritten - else - return 0; // value created - } - - - function rmMeta($group, $subgroup = null, $leaf = null) { $c =& pfcGlobalConfig::Instance(); @@ -376,7 +261,6 @@ return true; } - /** * Used to encode UTF8 strings to ASCII filenames */ @@ -392,7 +276,5 @@ { return urldecode($str); } - } - ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-17 23:44:25
|
Revision: 1131 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1131&view=rev Author: gpinzone Date: 2007-08-17 16:44:26 -0700 (Fri, 17 Aug 2007) Log Message: ----------- Updated chat template to use new IDs. Fixed missing button ID. Modified Paths: -------------- trunk/data/public/js/pfcgui.js trunk/themes/default/chat.html.tpl.php Modified: trunk/data/public/js/pfcgui.js =================================================================== --- trunk/data/public/js/pfcgui.js 2007-08-17 23:29:41 UTC (rev 1130) +++ trunk/data/public/js/pfcgui.js 2007-08-17 23:44:26 UTC (rev 1131) @@ -680,9 +680,11 @@ // bbcode del var btn = document.createElement('div'); + btn.setAttribute('id', 'pfc_bt_delete_btn'); btn.setAttribute('class', 'pfc_btn') btn.setAttribute('className', 'pfc_btn'); // for IE6 var img = document.createElement('img'); + img.setAttribute('id', 'pfc_bt_delete'); img.setAttribute('class', 'pfc_bt_delete'); img.setAttribute('className', 'pfc_bt_delete'); // for IE6 img.setAttribute('title', pfc.res.getLabel("Delete")); Modified: trunk/themes/default/chat.html.tpl.php =================================================================== --- trunk/themes/default/chat.html.tpl.php 2007-08-17 23:29:41 UTC (rev 1130) +++ trunk/themes/default/chat.html.tpl.php 2007-08-17 23:44:26 UTC (rev 1131) @@ -1,151 +1,157 @@ - <img id="pfc_minmax" onclick="pfc.swap_minimize_maximize()" src="<?php echo $c->getFileUrlFromTheme('images/'.($start_minimized?'maximize':'minimize').'.gif'); ?>" alt=""/> - <h2 id="pfc_title"><?php echo $title; ?></h2> - - <div id="pfc_content_expandable"> - - <div id="pfc_channels"> - <ul id="pfc_channels_list"></ul> - <div id="pfc_channels_content"></div> - </div> - - <div id="pfc_input_container"> - - <table style="margin:0;padding:0;border-collapse:collapse;"> - <tbody> - <tr> - <td class="pfc_td1"> - <p id="pfc_handle" - title="<?php echo _pfc("Enter your nickname here"); ?>" - onclick="pfc.askNick('')"><?php echo $u->nick; ?></p> - </td> - <td class="pfc_td2"> - <input type="text" - id="pfc_words" - title="<?php echo _pfc("Enter your message here"); ?>" - maxlength="<?php echo $max_text_len; ?>"/> - </td> - <td class="pfc_td3"> - <input type="button" - id="pfc_send" - value="<?php echo _pfc("Send"); ?>" - title="<?php echo _pfc("Click here to send your message"); ?>" - onclick="pfc.doSendMessage()"/> - </td> - </tr> - </tbody> - </table> - - <div id="pfc_cmd_container"> -<?php if ($display_pfc_logo) { ?> - <a href="http://www.phpfreechat.net" - id="pfc_logo"<?php if($openlinknewwindow) echo ' onclick="window.open(this.href,\'_blank\');return false;"'; ?>> - <img src="http://www.phpfreechat.net/pub/logo_80x15.gif" - alt="<?php echo _pfc("PHP FREE CHAT [powered by phpFreeChat-%s]", $version); ?>" - title="<?php echo _pfc("PHP FREE CHAT [powered by phpFreeChat-%s]", $version); ?>" /> - </a> -<?php } ?> - <span id="pfc_ping" title="<?php echo _pfc("Ping"); ?>"></span> - - <div class="pfc_btn"> - <img src="<?php echo $c->getFileUrlFromTheme('images/logout.gif'); ?>" - alt="" title="" - id="pfc_loginlogout" - onclick="pfc.connect_disconnect()" /> - </div> - - <div class="pfc_btn"> - <img src="<?php echo $c->getFileUrlFromTheme('images/color-on.gif'); ?>" - alt="" title="" - id="pfc_nickmarker" - onclick="pfc.nickmarker_swap()" /> - </div> - - <div class="pfc_btn"> - <img src="<?php echo $c->getFileUrlFromTheme('images/clock-on.gif'); ?>" - alt="" title="" - id="pfc_clock" - onclick="pfc.clock_swap()" /> - </div> - - <div class="pfc_btn"> - <img src="<?php echo $c->getFileUrlFromTheme('images/sound-on.gif'); ?>" - alt="" title="" - id="pfc_sound" - onclick="pfc.sound_swap()" /> - </div> - - <?php if ($c->btn_sh_smileys) { ?> - <div class="pfc_btn"> - <img src="<?php echo $c->getFileUrlFromTheme('images/smiley-on.gif'); ?>" - alt="" title="" - id="pfc_showHideSmileysbtn" - onclick="pfc.showHideSmileys()" /> - </div> - <?php } ?> - - <?php if ($c->btn_sh_whosonline) { ?> - <div class="pfc_btn"> - <img src="<?php echo $c->getFileUrlFromTheme('images/online-on.gif'); ?>" - alt="" title="" - id="pfc_showHideWhosOnlineBtn" - onclick="pfc.showHideWhosOnline()" /> - </div> - <?php } ?> - - </div> - - <div id="pfc_bbcode_container"> - <div class="pfc_btn"> - <img src="<?php echo $c->getFileUrlFromTheme('images/bt_strong.gif'); ?>" - alt="<?php echo _pfc("Bold"); ?>" - title="<?php echo _pfc("Bold"); ?>" - class="pfc_bt_strong" - onclick="pfc.insert_text('[b]','[/b]',true)" /> - </div> - <div class="pfc_btn"> - <img src="<?php echo $c->getFileUrlFromTheme('images/bt_em.gif'); ?>" - alt="<?php echo _pfc("Italics"); ?>" - title="<?php echo _pfc("Italics"); ?>" - class="pfc_bt_strong" - onclick="pfc.insert_text('[i]','[/i]',true)" /> - </div> - <div class="pfc_btn"> - <img src="<?php echo $c->getFileUrlFromTheme('images/bt_ins.gif'); ?>" - alt="<?php echo _pfc("Underline"); ?>" - title="<?php echo _pfc("Underline"); ?>" - class="pfc_bt_strong" - onclick="pfc.insert_text('[u]','[/u]',true)" /> - </div> - <div class="pfc_btn"> - <img src="<?php echo $c->getFileUrlFromTheme('images/bt_del.gif'); ?>" - alt="<?php echo _pfc("Delete"); ?>" - title="<?php echo _pfc("Delete"); ?>" - class="pfc_bt_strong" - onclick="pfc.insert_text('[s]','[/s]',true)" /> - </div> - <div class="pfc_btn"> - <img src="<?php echo $c->getFileUrlFromTheme('images/bt_mail.gif'); ?>" - alt="<?php echo _pfc("Mail"); ?>" - title="<?php echo _pfc("Mail"); ?>" - class="pfc_bt_strong" - onclick="pfc.insert_text('[email]','[/email]',true)" /> - </div> - <div class="pfc_btn"> - <img src="<?php echo $c->getFileUrlFromTheme('images/bt_color.gif'); ?>" - alt="<?php echo _pfc("Color"); ?>" - title="<?php echo _pfc("Color"); ?>" - id="pfc_bt_color" - onclick="pfc.minimize_maximize('pfc_colorlist','inline')" /> - </div> - <div id="pfc_colorlist"></div> - </div> <!-- pfc_bbcode_container --> - - </div> - - <div id="pfc_errors"></div> - - <div id="pfc_smileys"></div> - - </div> - - <div id="pfc_sound_container"></div> + <img id="pfc_minmax" onclick="pfc.swap_minimize_maximize()" src="<?php echo $c->getFileUrlFromTheme('images/'.($start_minimized?'maximize':'minimize').'.gif'); ?>" alt=""/> + <h2 id="pfc_title"><?php echo $title; ?></h2> + + <div id="pfc_content_expandable"> + + <div id="pfc_channels"> + <ul id="pfc_channels_list"></ul> + <div id="pfc_channels_content"></div> + </div> + + <div id="pfc_input_container"> + + <table style="margin:0;padding:0;border-collapse:collapse;"> + <tbody> + <tr> + <td class="pfc_td1"> + <p id="pfc_handle" + title="<?php echo _pfc("Enter your nickname here"); ?>" + onclick="pfc.askNick('')"><?php echo $u->nick; ?></p> + </td> + <td class="pfc_td2"> + <input type="text" + id="pfc_words" + title="<?php echo _pfc("Enter your message here"); ?>" + maxlength="<?php echo $max_text_len; ?>"/> + </td> + <td class="pfc_td3"> + <input type="button" + id="pfc_send" + value="<?php echo _pfc("Send"); ?>" + title="<?php echo _pfc("Click here to send your message"); ?>" + onclick="pfc.doSendMessage()"/> + </td> + </tr> + </tbody> + </table> + + <div id="pfc_cmd_container"> +<?php if ($display_pfc_logo) { ?> + <a href="http://www.phpfreechat.net" + id="pfc_logo"<?php if($openlinknewwindow) echo ' onclick="window.open(this.href,\'_blank\');return false;"'; ?>> + <img src="http://www.phpfreechat.net/pub/logo_80x15.gif" + alt="<?php echo _pfc("PHP FREE CHAT [powered by phpFreeChat-%s]", $version); ?>" + title="<?php echo _pfc("PHP FREE CHAT [powered by phpFreeChat-%s]", $version); ?>" /> + </a> +<?php } ?> + <span id="pfc_ping" title="<?php echo _pfc("Ping"); ?>"></span> + + <div class="pfc_btn"> + <img src="<?php echo $c->getFileUrlFromTheme('images/logout.gif'); ?>" + alt="" title="" + id="pfc_loginlogout" + onclick="pfc.connect_disconnect()" /> + </div> + + <div class="pfc_btn"> + <img src="<?php echo $c->getFileUrlFromTheme('images/color-on.gif'); ?>" + alt="" title="" + id="pfc_nickmarker" + onclick="pfc.nickmarker_swap()" /> + </div> + + <div class="pfc_btn"> + <img src="<?php echo $c->getFileUrlFromTheme('images/clock-on.gif'); ?>" + alt="" title="" + id="pfc_clock" + onclick="pfc.clock_swap()" /> + </div> + + <div class="pfc_btn"> + <img src="<?php echo $c->getFileUrlFromTheme('images/sound-on.gif'); ?>" + alt="" title="" + id="pfc_sound" + onclick="pfc.sound_swap()" /> + </div> + + <?php if ($c->btn_sh_smileys) { ?> + <div class="pfc_btn"> + <img src="<?php echo $c->getFileUrlFromTheme('images/smiley-on.gif'); ?>" + alt="" title="" + id="pfc_showHideSmileysbtn" + onclick="pfc.showHideSmileys()" /> + </div> + <?php } ?> + + <?php if ($c->btn_sh_whosonline) { ?> + <div class="pfc_btn"> + <img src="<?php echo $c->getFileUrlFromTheme('images/online-on.gif'); ?>" + alt="" title="" + id="pfc_showHideWhosOnlineBtn" + onclick="pfc.showHideWhosOnline()" /> + </div> + <?php } ?> + + </div> + + <div id="pfc_bbcode_container"> + <div id="pfc_bt_strong_btn" class="pfc_btn"> + <img src="<?php echo $c->getFileUrlFromTheme('images/bt_strong.gif'); ?>" + id="pfc_bt_strong" + alt="<?php echo _pfc("Bold"); ?>" + title="<?php echo _pfc("Bold"); ?>" + class="pfc_bt_strong" + onclick="pfc.insert_text('[b]','[/b]',true)" /> + </div> + <div id="pfc_bt_italics_btn" class="pfc_btn"> + <img src="<?php echo $c->getFileUrlFromTheme('images/bt_em.gif'); ?>" + id="pfc_bt_italics" + alt="<?php echo _pfc("Italics"); ?>" + title="<?php echo _pfc("Italics"); ?>" + class="pfc_bt_italics" + onclick="pfc.insert_text('[i]','[/i]',true)" /> + </div> + <div id="pfc_bt_underline_btn" class="pfc_btn"> + <img src="<?php echo $c->getFileUrlFromTheme('images/bt_ins.gif'); ?>" + id="pfc_bt_underline" + alt="<?php echo _pfc("Underline"); ?>" + title="<?php echo _pfc("Underline"); ?>" + class="pfc_bt_underline" + onclick="pfc.insert_text('[u]','[/u]',true)" /> + </div> + <div id="pfc_bt_delete_btn" class="pfc_btn"> + <img src="<?php echo $c->getFileUrlFromTheme('images/bt_del.gif'); ?>" + id="pfc_bt_delete" + alt="<?php echo _pfc("Delete"); ?>" + title="<?php echo _pfc("Delete"); ?>" + class="pfc_bt_delete" + onclick="pfc.insert_text('[s]','[/s]',true)" /> + </div> + <div id="pfc_bt_mail_btn" class="pfc_btn"> + <img src="<?php echo $c->getFileUrlFromTheme('images/bt_mail.gif'); ?>" + id="pfc_bt_mail" + alt="<?php echo _pfc("Mail"); ?>" + title="<?php echo _pfc("Mail"); ?>" + class="pfc_bt_mail" + onclick="pfc.insert_text('[email]','[/email]',true)" /> + </div> + <div id="pfc_bt_color_btn" class="pfc_btn"> + <img src="<?php echo $c->getFileUrlFromTheme('images/bt_color.gif'); ?>" + alt="<?php echo _pfc("Color"); ?>" + title="<?php echo _pfc("Color"); ?>" + id="pfc_bt_color" + class="pfc_bt_color" + onclick="pfc.minimize_maximize('pfc_colorlist','inline')" /> + </div> + <div id="pfc_colorlist"></div> + </div> <!-- pfc_bbcode_container --> + + </div> + + <div id="pfc_errors"></div> + + <div id="pfc_smileys"></div> + + </div> + + <div id="pfc_sound_container"></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gpi...@us...> - 2007-08-17 23:29:38
|
Revision: 1130 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1130&view=rev Author: gpinzone Date: 2007-08-17 16:29:41 -0700 (Fri, 17 Aug 2007) Log Message: ----------- Added IDs for buttons and DIVs for future template mods. Modified Paths: -------------- trunk/data/public/js/pfcgui.js Modified: trunk/data/public/js/pfcgui.js =================================================================== --- trunk/data/public/js/pfcgui.js 2007-08-17 11:59:00 UTC (rev 1129) +++ trunk/data/public/js/pfcgui.js 2007-08-17 23:29:41 UTC (rev 1130) @@ -552,6 +552,7 @@ // button login/logout var btn = document.createElement('div'); + btn.setAttribute('id', 'pfc_loginlogout_btn'); btn.setAttribute('class', 'pfc_btn') btn.setAttribute('className', 'pfc_btn'); // for IE6 var img = document.createElement('img'); @@ -563,6 +564,7 @@ // button nickname color on/off var btn = document.createElement('div'); + btn.setAttribute('id', 'pfc_nickmarker_btn'); btn.setAttribute('class', 'pfc_btn'); btn.setAttribute('className', 'pfc_btn'); // for IE6 var img = document.createElement('img'); @@ -574,6 +576,7 @@ // button clock on/off var btn = document.createElement('div'); + btn.setAttribute('id', 'pfc_clock_btn'); btn.setAttribute('class', 'pfc_btn'); btn.setAttribute('className', 'pfc_btn'); // for IE6 var img = document.createElement('img'); @@ -585,6 +588,7 @@ // button sound on/off var btn = document.createElement('div'); + btn.setAttribute('id', 'pfc_sound_btn'); btn.setAttribute('class', 'pfc_btn'); btn.setAttribute('className', 'pfc_btn'); // for IE6 var img = document.createElement('img'); @@ -598,6 +602,7 @@ if (pfc_btn_sh_smileys) { var btn = document.createElement('div'); + btn.setAttribute('id', 'pfc_showHideSmileysbtn_btn'); btn.setAttribute('class', 'pfc_btn'); btn.setAttribute('className', 'pfc_btn'); // for IE6 var img = document.createElement('img'); @@ -612,6 +617,7 @@ if (pfc_btn_sh_whosonline) { var btn = document.createElement('div'); + btn.setAttribute('id', 'pfc_showHideWhosOnlineBtn_btn'); btn.setAttribute('class', 'pfc_btn'); btn.setAttribute('className', 'pfc_btn'); // for IE6 var img = document.createElement('img'); @@ -629,9 +635,11 @@ // bbcode strong var btn = document.createElement('div'); + btn.setAttribute('id', 'pfc_bt_strong_btn'); btn.setAttribute('class', 'pfc_btn'); btn.setAttribute('className', 'pfc_btn'); // for IE6 var img = document.createElement('img'); + img.setAttribute('id', 'pfc_bt_strong'); img.setAttribute('class', 'pfc_bt_strong'); img.setAttribute('className', 'pfc_bt_strong'); // for IE6 img.setAttribute('title', pfc.res.getLabel("Bold")); @@ -642,9 +650,11 @@ // bbcode italics var btn = document.createElement('div'); + btn.setAttribute('id', 'pfc_bt_italics_btn'); btn.setAttribute('class', 'pfc_btn'); btn.setAttribute('className', 'pfc_btn'); // for IE6 var img = document.createElement('img'); + img.setAttribute('id', 'pfc_bt_italics'); img.setAttribute('class', 'pfc_bt_italics'); img.setAttribute('className', 'pfc_bt_italics'); // for IE6 img.setAttribute('title', pfc.res.getLabel("Italics")); @@ -655,9 +665,11 @@ // bbcode underline var btn = document.createElement('div'); + btn.setAttribute('id', 'pfc_bt_underline_btn'); btn.setAttribute('class', 'pfc_btn'); btn.setAttribute('className', 'pfc_btn'); // for IE6 var img = document.createElement('img'); + img.setAttribute('id', 'pfc_bt_underline'); img.setAttribute('class', 'pfc_bt_underline'); img.setAttribute('className', 'pfc_bt_underline'); // for IE6 img.setAttribute('title', pfc.res.getLabel("Underline")); @@ -681,9 +693,11 @@ // bbcode mail var btn = document.createElement('div'); + btn.setAttribute('id', 'pfc_bt_mail_btn'); btn.setAttribute('class', 'pfc_btn'); btn.setAttribute('className', 'pfc_btn'); // for IE6 var img = document.createElement('img'); + img.setAttribute('id', 'pfc_bt_mail'); img.setAttribute('class', 'pfc_bt_mail'); img.setAttribute('className', 'pfc_bt_mail'); // for IE6 img.setAttribute('title', pfc.res.getLabel("Mail")); @@ -694,9 +708,11 @@ // bbcode color var btn = document.createElement('div'); + btn.setAttribute('id', 'pfc_bt_color_btn'); btn.setAttribute('class', 'pfc_btn'); btn.setAttribute('className', 'pfc_btn'); // for IE6 var img = document.createElement('img'); + img.setAttribute('id', 'pfc_bt_color'); img.setAttribute('class', 'pfc_bt_color'); img.setAttribute('className', 'pfc_bt_color'); // for IE6 img.setAttribute('title', pfc.res.getLabel("Color")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@gm...> - 2007-08-17 12:29:57
|
Does it means pfc works with IE 5.5 ? I thought prototype js librairy was not compatible with IE 5.5, am I wrong = ? (I don't have IE5.5 to test ...) On 8/17/07, gpi...@us... <gpi...@us...> wrote: > Revision: 1129 > http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=3D1129&= view=3Drev > Author: gpinzone > Date: 2007-08-17 04:59:00 -0700 (Fri, 17 Aug 2007) > > Log Message: > ----------- > IE 5.5 fix needed fixing. > > Modified Paths: > -------------- > trunk/data/public/js/pfcprompt.js > > Modified: trunk/data/public/js/pfcprompt.js > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- trunk/data/public/js/pfcprompt.js 2007-08-16 23:40:18 UTC (rev 1128= ) > +++ trunk/data/public/js/pfcprompt.js 2007-08-17 11:59:00 UTC (rev 1129= ) > @@ -104,7 +104,8 @@ > this.bgbox.style.left =3D pos[0]+'px'; > /* Some older IE browsers (e.g., IE 5.5) need scrollHeight/scrollWid= th. > See: http://www.quirksmode.org/viewport/compatibility.html */ > - if (this.container.scrollHeight > this.container.offsetHeight) > + if (this.container.scrollHeight > this.container.offsetHeight > + || this.container.scrollWidth > this.container.offsetWidth) > { > this.bgbox.style.height =3D this.container.scrollHeight+'px'; > this.bgbox.style.width =3D this.container.scrollWidth+'px'; > > > This was sent by the SourceForge.net collaborative development platform, = the world's largest Open Source development site. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Phpfreechat-svn mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpfreechat-svn > --=20 St=E9phane GULLY http://www.zeitoun.net |