[Phpfreechat-svn] SF.net SVN: phpfreechat: [679] trunk/src
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-08-18 16:40:33
|
Revision: 679 Author: kerphi Date: 2006-08-18 09:40:23 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=679&view=rev Log Message: ----------- - Bug fix: the phpfreechat logo was hidden on IE6 - Add an error message in the static html if no javascript is loaded. This error message is just removed by the javascript code if the chat is created correctly. Modified Paths: -------------- trunk/src/client/chat.js.tpl.php trunk/src/client/pfcgui.js trunk/src/pfci18n.class.php trunk/src/phpfreechat.class.php Modified: trunk/src/client/chat.js.tpl.php =================================================================== --- trunk/src/client/chat.js.tpl.php 2006-08-18 15:03:13 UTC (rev 678) +++ trunk/src/client/chat.js.tpl.php 2006-08-18 16:40:23 UTC (rev 679) @@ -1,3 +1,4 @@ +var pfc_version = '<?php echo $version; ?>'; var pfc_nickname = '<?php echo addslashes($u->nick); ?>'; var pfc_clientid = '<?php echo md5(uniqid(rand(), true)); ?>'; var pfc_title = '<?php echo addslashes($title); ?>'; @@ -80,10 +81,11 @@ "Delete", "Mail", "Color", + "PHP FREE CHAT [powered by phpFreeChat-%s]", ); foreach($labels_to_load as $l) { - echo "pfc.res.setLabel('".$l."','".addslashes(_pfc($l))."');\n"; + echo "pfc.res.setLabel('".$l."','".addslashes(_pfc2($l))."');\n"; } $fileurl_to_load = Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-08-18 15:03:13 UTC (rev 678) +++ trunk/src/client/pfcgui.js 2006-08-18 16:40:23 UTC (rev 679) @@ -320,8 +320,7 @@ { var container = $('pfc_container'); - // move the logo - var logo = $('pfc_logo'); + // clean the chat box container.innerHTML = ''; // minimize/maximize button @@ -378,8 +377,18 @@ inputcontainer.appendChild(cmdcontainer); // move the phpfreechat logo into the cmd container box - cmdcontainer.appendChild(logo); - + var a = document.createElement('a'); + a.setAttribute('id', 'pfc_logo'); + a.setAttribute('href','http://www.phpfreechat.net'); + if (pfc_openlinknewwindow) + a.onclick = function(){ window.open(this.href,'_blank'); return false; } + var img = document.createElement('img'); + img.setAttribute('src', 'http://www.phpfreechat.net/pub/logo_80x15.gif'); + img.setAttribute('alt', pfc.res.getLabel("PHP FREE CHAT [powered by phpFreeChat-%s]",pfc_version)); + img.title = img.alt; + a.appendChild(img); + cmdcontainer.appendChild(a); + // handle box : <input id="pfc_handle" type="button" ... var handle = document.createElement('p'); handle.setAttribute('id', 'pfc_handle'); Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2006-08-18 15:03:13 UTC (rev 678) +++ trunk/src/pfci18n.class.php 2006-08-18 16:40:23 UTC (rev 679) @@ -32,6 +32,20 @@ "_".$args[0]."_"; return call_user_func_array('sprintf', $args); } +/** + * Just like _pfc but just return the raw translated string, keeping the %s into it + * (used byt the javascript resources (i18n) class) + */ +function _pfc2() +{ + $args = func_get_args(); + $args[0] = isset($GLOBALS["i18n"][$args[0]]) && $GLOBALS["i18n"][$args[0]] != "" ? + ($GLOBALS["output_encoding"] == "UTF-8" ? + $GLOBALS["i18n"][$args[0]] : + iconv("UTF-8", $GLOBALS["output_encoding"], $GLOBALS["i18n"][$args[0]])) : + "_".$args[0]."_"; + return $args[0]; +} class pfcI18N { Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-08-18 15:03:13 UTC (rev 678) +++ trunk/src/phpfreechat.class.php 2006-08-18 16:40:23 UTC (rev 679) @@ -175,7 +175,8 @@ // or keep a backling to http://www.phpfreechat on your partner page // it helps phpfreechat promotion over the Web. // (remember it's a free program) - $output .= "<a href=\"http://www.phpfreechat.net\" id=\"pfc_logo\"".($c->openlinknewwindow ? ' onclick="window.open(this.href,\'_blank\');return false;"' : '')."><img src=\"http://www.phpfreechat.net/pub/logo_80x15.gif\" alt=\""._pfc("PHP FREE CHAT [powered by phpFreeChat-%s]", $c->version)."\" title=\""._pfc("PHP FREE CHAT [powered by phpFreeChat-%s]", $c->version)."\" /></a>"; + $output .= "<p>"._pfc("Error: the chat cannot be loaded, check the public directory rights or ask some help on the forum")." <a href=\"http://www.phpfreechat.net/forum/\">www.phpfreechat.net/forum</a></p>"; + $output .= "<a href=\"http://www.phpfreechat.net\"><img src=\"http://www.phpfreechat.net/pub/logo_80x15.gif\" alt=\"PHP FREE CHAT [powered by phpFreeChat-".$c->version."]\" title=\"PHP FREE CHAT [powered by phpFreeChat-".$c->version."]\" /></a>"; $output .= "</div>"; $output .= "<script type=\"text/javascript\">\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |