phpfreechat-svn Mailing List for phpFreeChat (Page 19)
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...> - 2006-10-08 19:02:27
|
Revision: 827 http://svn.sourceforge.net/phpfreechat/?rev=827&view=rev Author: kerphi Date: 2006-10-08 12:02:16 -0700 (Sun, 08 Oct 2006) Log Message: ----------- [en] Add a blink effect to the tab's notifications. [45min] [fr] Ajout d'un effet de clignotement ?\195?\160 la notification des onglets. [45min] Modified Paths: -------------- trunk/src/client/chat.js.tpl.php trunk/src/client/pfcgui.js trunk/src/pfcglobalconfig.class.php trunk/themes/default/style.css Modified: trunk/src/client/chat.js.tpl.php =================================================================== --- trunk/src/client/chat.js.tpl.php 2006-10-07 18:30:07 UTC (rev 826) +++ trunk/src/client/chat.js.tpl.php 2006-10-08 19:02:16 UTC (rev 827) @@ -21,6 +21,8 @@ var pfc_debug = <?php echo $json->encode($debug); ?>; var pfc_btn_sh_smileys = <?php echo $json->encode($btn_sh_smileys); ?>; var pfc_btn_sh_whosonline = <?php echo $json->encode($btn_sh_whosonline); ?>; +var pfc_displaytabimage = <?php echo $json->encode($displaytabimage); ?>; +var pfc_displaytabclosebutton = <?php echo $json->encode($displaytabclosebutton); ?>; var pfc_connect_at_startup = <?php echo $json->encode($connect_at_startup); ?>; var pfc_notify_window = <?php echo $json->encode($notify_window); ?>; var pfc_defaultchan = <?php echo $json->encode($c->channels); ?>; Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-10-07 18:30:07 UTC (rev 826) +++ trunk/src/client/pfcgui.js 2006-10-08 19:02:16 UTC (rev 827) @@ -8,6 +8,7 @@ initialize: function() { +// this.builder = new pfcGuiBuilder(); this.current_tab = ''; this.current_tab_id = ''; this.tabs = Array(); @@ -210,40 +211,48 @@ li_title.setAttribute('id', 'pfc_channel_title'+tabid); var li_div = document.createElement('div'); + li_div.setAttribute('id', 'pfc_tabdiv'+tabid); li_title.appendChild(li_div); - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_tabimg'+tabid); - if (type == 'ch') - img.setAttribute('src', pfc.res.getFileUrl('images/ch.gif')); - if (type == 'pv') - img.setAttribute('src', pfc.res.getFileUrl('images/pv.gif')); var a1 = document.createElement('a'); - // Element.addClassName(a1, 'pfc_tabtitle'); a1.setAttribute('class', 'pfc_tabtitle'); a1.setAttribute('className', 'pfc_tabtitle'); // for IE6 - a1.appendChild(img); - a1.appendChild(document.createTextNode(name)); a1.setAttribute('href', '#'); a1.pfc_tabid = tabid; a1.onclick = function(){pfc.gui.setTabById(this.pfc_tabid); return false;} li_div.appendChild(a1); + + if (pfc_displaytabimage) + { + var img = document.createElement('img'); + img.setAttribute('id', 'pfc_tabimg'+tabid); + if (type == 'ch') + img.setAttribute('src', pfc.res.getFileUrl('images/ch.gif')); + if (type == 'pv') + img.setAttribute('src', pfc.res.getFileUrl('images/pv.gif')); + a1.appendChild(img); + } - var a2 = document.createElement('a'); - a2.pfc_tabid = tabid; - a2.onclick = function(){ - var res = confirm(pfc.res.getLabel('Do you really want to leave this room ?')); - if (res == true) pfc.sendRequest('/leave', this.pfc_tabid); return false; + // on ajoute le nom du channel + a1.appendChild(document.createTextNode(name)); + + if (pfc_displaytabclosebutton) + { + var a2 = document.createElement('a'); + a2.pfc_tabid = tabid; + a2.onclick = function(){ + var res = confirm(pfc.res.getLabel('Do you really want to leave this room ?')); + if (res == true) pfc.sendRequest('/leave', this.pfc_tabid); return false; + } + a2.alt = pfc.res.getLabel('Close this tab'); + a2.title = a2.alt; + a2.setAttribute('class', 'pfc_tabclose'); + a2.setAttribute('className', 'pfc_tabclose'); // for IE6 + var img = document.createElement('img'); + img.setAttribute('src', pfc.res.getFileUrl('images/tab_remove.gif')); + a2.appendChild(img); + li_div.appendChild(a2); } - a2.alt = pfc.res.getLabel('Close this tab'); - a2.title = a2.alt; - // Element.addClassName(a2, 'pfc_tabclose'); - a2.setAttribute('class', 'pfc_tabclose'); - a2.setAttribute('className', 'pfc_tabclose'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('src', pfc.res.getFileUrl('images/tab_remove.gif')); - a2.appendChild(img); - li_div.appendChild(a2); var div_content = document.createElement('div'); div_content.setAttribute('id', 'pfc_channel_content'+tabid); @@ -291,6 +300,8 @@ { var tabpos = indexOf(this.tabids, tabid); var tabtype = this.tabtypes[tabpos]; + + // handle the tab's image modification var img = $('pfc_tabimg'+tabid); if (img) { @@ -299,6 +310,24 @@ if (tabtype == 'pv') img.src = pfc.res.getFileUrl('images/pv-active.gif'); } + + // handle the blicking effect + var div = $('pfc_tabdiv'+tabid); + if (div) + { + if (div.blinkstat == true) + { + div.setAttribute('class', 'pfc_tabblink1'); + div.setAttribute('className', 'pfc_tabblink1'); // for IE6 + } + else + { + div.setAttribute('class', 'pfc_tabblink2'); + div.setAttribute('className', 'pfc_tabblink2'); // for IE6 + } + div.blinkstat = !div.blinkstat; + div.blinktimeout = setTimeout('pfc.gui.notifyTab(\''+tabid+'\');', 500); + } }, /** @@ -308,6 +337,8 @@ { var tabpos = indexOf(this.tabids, tabid); var tabtype = this.tabtypes[tabpos]; + + // restore the tab's image var img = $('pfc_tabimg'+tabid); if (img) { @@ -316,6 +347,15 @@ if (tabtype == 'pv') img.src = pfc.res.getFileUrl('images/pv.gif'); } + + // stop the blinking effect + var div = $('pfc_tabdiv'+tabid); + if (div) + { + div.removeAttribute('class'); + div.removeAttribute('className'); // for IE6 + clearTimeout(div.blinktimeout); + } }, loadSmileyBox: function() Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-10-07 18:30:07 UTC (rev 826) +++ trunk/src/pfcglobalconfig.class.php 2006-10-08 19:02:16 UTC (rev 827) @@ -78,6 +78,8 @@ 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 $displaytabimage = true; + var $displaytabclosebutton = true; var $showwhosonline = true; var $showsmileys = true; var $btn_sh_whosonline = true; // display show/hide button for who is online Modified: trunk/themes/default/style.css =================================================================== --- trunk/themes/default/style.css 2006-10-07 18:30:07 UTC (rev 826) +++ trunk/themes/default/style.css 2006-10-08 19:02:16 UTC (rev 827) @@ -81,6 +81,10 @@ margin-left: 4px; cursor: pointer; } +/* blinking stuff (tab notifications) */ +ul#pfc_channels_list li div.pfc_tabblink2 { + background-color: #FFF; +} div.pfc_chat { @@ -105,10 +109,11 @@ /* height: 100%;*/ color: #000; /* colors can be overriden by js nickname colorization */ background-color: #FFF; + + /* borders are drawn by this image background */ background-image: url("proxy.php?p=default/images/online-separator.gif"); background-position: left; background-repeat: repeat-y; - /* borders are drawn by the javascript routines */ } div.pfc_online ul { list-style-type: none; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-07 18:30:29
|
Revision: 826 http://svn.sourceforge.net/phpfreechat/?rev=826&view=rev Author: kerphi Date: 2006-10-07 11:30:07 -0700 (Sat, 07 Oct 2006) Log Message: ----------- [en] Bug fix: correct problems with timeout disconnections and with channels user lists. [1h] [fr] Bug fix : corrections d'incoherances au moment de deconnecter les utilisateurs par timeout et au moment de mettre a jour la liste des utilisateurs. [1h] Modified Paths: -------------- trunk/src/commands/update.class.php trunk/src/pfccontainer.class.php Modified: trunk/src/commands/update.class.php =================================================================== --- trunk/src/commands/update.class.php 2006-10-07 18:20:15 UTC (rev 825) +++ trunk/src/commands/update.class.php 2006-10-07 18:30:07 UTC (rev 826) @@ -30,7 +30,7 @@ } $cmdp = $p; - + // update the user nickname timestamp on the server $cmd =& pfcCommand::Factory("updatemynick"); $cmdp["recipient"] = NULL; @@ -43,12 +43,14 @@ { $cmdp["recipient"] = $chan["recipient"]; $cmdp["recipientid"] = $id; + $cmdp["param"] = ''; // don't forward the parameter because it will be interpreted as a channel name $cmd->run($xml_reponse, $cmdp); } foreach( $u->privmsg as $id => $pv ) { $cmdp["recipient"] = $pv["recipient"]; $cmdp["recipientid"] = $id; + $cmdp["param"] = ''; // don't forward the parameter because it will be interpreted as a channel name $cmd->run($xml_reponse, $cmdp); } Modified: trunk/src/pfccontainer.class.php =================================================================== --- trunk/src/pfccontainer.class.php 2006-10-07 18:20:15 UTC (rev 825) +++ trunk/src/pfccontainer.class.php 2006-10-07 18:30:07 UTC (rev 826) @@ -73,10 +73,15 @@ if ($chan == NULL) $chan = 'SERVER'; + $deleted_user = array(); + $deleted_user["nick"] = array(); + $deleted_user["nickid"] = array(); + $deleted_user["timestamp"] = array(); + $timestamp = $this->getMeta("channelid-to-nickid", $this->encode('SERVER'), $nickid); + if (count($timestamp["timestamp"]) == 0) return $deleted_user; $timestamp = $timestamp["timestamp"][0]; - $deleted_user = array(); $deleted_user["nick"][] = $this->getNickname($nickid); $deleted_user["nickid"][] = $nickid; $deleted_user["timestamp"][] = $timestamp; @@ -184,9 +189,8 @@ } /** - * Remove (disconnect/quit) the timeouted nickname from the server or from a channel - * Notice: this function must remove all nicknames which are not uptodate from the given channel or from the server - * @param $chan if NULL then check obsolete nick on the server, otherwise just check obsolete nick on the given channel + * Remove (disconnect/quit) the timeouted nicknames + * Notice: this function will remove all nicknames which are not uptodate from all his joined channels * @param $timeout * @return array("nickid"=>array("nickid1", ...),"timestamp"=>array(timestamp1, ...)) contains all disconnected nickids and there timestamp */ @@ -194,13 +198,11 @@ { $c =& $this->c; - $chan = 'SERVER'; - $deleted_user = array('nick'=>array(), 'nickid'=>array(), 'timestamp'=>array(), 'channels'=>array()); - $ret = $this->getMeta("channelid-to-nickid", $this->encode($chan)); + $ret = $this->getMeta("channelid-to-nickid", $this->encode('SERVER')); for($i = 0; $i<count($ret['timestamp']); $i++) { $timestamp = $ret['timestamp'][$i]; @@ -212,10 +214,19 @@ $ret2 = $this->getMeta("nickid-to-channelid",$nickid); foreach($ret2["value"] as $userchan) { - // disconnect the user from each joined channels - $du = $this->removeNick($this->decode($userchan), $nickid); - $channels[] = $this->decode($userchan); + $userchan = $this->decode($userchan); + if ($userchan != 'SERVER') + { + // disconnect the user from each joined channels + $this->removeNick($userchan, $nickid); + $channels[] = $userchan; + } } + // now disconnect the user from the server + // (order is important because the SERVER channel has timestamp informations) + $du = $this->removeNick('SERVER', $nickid); + $channels[] = 'SERVER'; + $deleted_user["nick"] = array_merge($deleted_user["nick"], $du["nick"]); $deleted_user["nickid"] = array_merge($deleted_user["nickid"], $du["nickid"]); $deleted_user["timestamp"] = array_merge($deleted_user["timestamp"], $du["timestamp"]); @@ -245,6 +256,7 @@ // get timestamp from the SERVER channel $timestamp = $this->getMeta("channelid-to-nickid", $this->encode('SERVER'), $nickid); + if (count($timestamp['timestamp']) == 0) continue; $timestamp = $timestamp['timestamp'][0]; $online_user["nick"][] = $this->getNickname($nickid); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-07 18:20:22
|
Revision: 825 http://svn.sourceforge.net/phpfreechat/?rev=825&view=rev Author: kerphi Date: 2006-10-07 11:20:15 -0700 (Sat, 07 Oct 2006) Log Message: ----------- [en] Improve the debug routines. [15min] [fr] Ameliore les routines de debogage. [15min] Modified Paths: -------------- trunk/src/client/chat.js.tpl.php trunk/src/client/pfcclient.js trunk/src/phpfreechat.class.php Modified: trunk/src/client/chat.js.tpl.php =================================================================== --- trunk/src/client/chat.js.tpl.php 2006-10-06 07:55:10 UTC (rev 824) +++ trunk/src/client/chat.js.tpl.php 2006-10-07 18:20:15 UTC (rev 825) @@ -1,7 +1,6 @@ <?php require_once(dirname(__FILE__)."/../../lib/json/JSON.php"); $json = new Services_JSON(); - ?> <?php $nick = $u->nick != "" ? $json->encode($u->nick) : $json->encode($c->nick); ?> @@ -137,6 +136,28 @@ text = s.escapeHTML(); rx = new RegExp('<','g'); text = text.replace(rx, '\n<'); - $('debugxajax').innerHTML += '\n---------------\n' + text; + $('pfc_debugxajax').innerHTML += '\n---------------\n' + text; } - <?php } ?> +<?php } ?> + +<?php if ($debug) { ?> +var pfc_debug_color = true; +function trace(text) { + var s = new String(text); + text = s.escapeHTML(); + rx = new RegExp('<','g'); + text = text.replace(rx, '\n<'); + var color = ''; + if (pfc_debug_color) + { + color = '#BBB'; + pfc_debug_color = false; + } + else + { + color = '#DDD'; + pfc_debug_color = true; + } + $('pfc_debug').innerHTML += '<p style="margin:0;border-bottom:1px solid #555;background-color:'+color+'">' + text + '</p>'; +} +<?php } ?> Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-10-06 07:55:10 UTC (rev 824) +++ trunk/src/client/pfcclient.js 2006-10-07 18:20:15 UTC (rev 825) @@ -138,6 +138,8 @@ */ handleResponse: function(cmd, resp, param) { + if (pfc_debug) + if (cmd != "update") trace('handleResponse: '+cmd + "-"+resp+"-"+param); if (cmd == "connect") { //alert(cmd + "-"+resp+"-"+param); @@ -830,7 +832,7 @@ var recipientid = this.gui.getTabId(); var req = cmd+" "+this.clientid+" "+(recipientid==''?'0':recipientid)+(param?" "+param : ""); if (pfc_debug) - if (cmd != "/update") alert(req); + if (cmd != "/update") trace('sendRequest: '+req); return eval('pfc_handleRequest(req);'); }, Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-10-06 07:55:10 UTC (rev 824) +++ trunk/src/phpfreechat.class.php 2006-10-07 18:20:15 UTC (rev 825) @@ -192,6 +192,18 @@ $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>"; + if ($c->debug) + { + $output .= '<div id="pfc_debug">'; + $output .= '</div>'; + } + + if ($c->debugxajax) + { + $output .= '<div id="pfc_debugxajax">'; + $output .= '</div>'; + } + $output .= "<script type=\"text/javascript\">\n"; $output .= " // <![CDATA[\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-06 07:55:18
|
Revision: 824 http://svn.sourceforge.net/phpfreechat/?rev=824&view=rev Author: kerphi Date: 2006-10-06 00:55:10 -0700 (Fri, 06 Oct 2006) Log Message: ----------- [en] Use JSON lib to convert PHP variables to JS. [30min] [fr] Simplification de la communication php/javascript : utilisation de la librairie JSON [30min] Modified Paths: -------------- trunk/src/client/chat.js.tpl.php Modified: trunk/src/client/chat.js.tpl.php =================================================================== --- trunk/src/client/chat.js.tpl.php 2006-10-06 07:53:24 UTC (rev 823) +++ trunk/src/client/chat.js.tpl.php 2006-10-06 07:55:10 UTC (rev 824) @@ -1,56 +1,36 @@ -<?php function quoteandescape($v) { return "'".addslashes($v)."'"; } ?> -<?php $nick = $u->nick != "" ? addslashes($u->nick) : addslashes($c->nick); ?> +<?php +require_once(dirname(__FILE__)."/../../lib/json/JSON.php"); +$json = new Services_JSON(); -var pfc_nickname = '<?php echo ($GLOBALS["output_encoding"]=="UTF-8" ? $nick : iconv("UTF-8", $GLOBALS["output_encoding"],$nick)); ?>'; -var pfc_nickid = '<?php echo $u->nickid; ?>'; -var pfc_version = '<?php echo $version; ?>'; -var pfc_clientid = '<?php echo md5(uniqid(rand(), true)); ?>'; -var pfc_title = '<?php echo addslashes($title); ?>'; -var pfc_refresh_delay = <?php echo $refresh_delay; ?>; -var pfc_start_minimized = <?php echo $start_minimized ? "true" : "false"; ?>; -var pfc_nickmarker = <?php echo $nickmarker ? "true" : "false"; ?>; -var pfc_clock = <?php echo $clock ? "true" : "false"; ?>; -var pfc_showsmileys = <?php echo $showsmileys ? "true" : "false"; ?>; -var pfc_showwhosonline = <?php echo $showwhosonline ? "true" : "false"; ?>; -var pfc_focus_on_connect = <?php echo $focus_on_connect ? "true" : "false"; ?>; -var pfc_max_text_len = <?php echo $max_text_len; ?>; -var pfc_quit_on_closedwindow = <?php echo $quit_on_closedwindow ? "true" : "false"; ?>; -var pfc_debug = <?php echo $debug ? "true" : "false"; ?>; -var pfc_btn_sh_smileys = <?php echo $btn_sh_smileys ? "true" : "false"; ?>; -var pfc_btn_sh_whosonline = <?php echo $btn_sh_whosonline ? "true" : "false"; ?>; -var pfc_connect_at_startup = <?php echo $connect_at_startup ? "true" : "false"; ?>; -var pfc_notify_window = <?php echo $notify_window ? "true" : "false"; ?>; -var pfc_defaultchan = Array(<?php - $list = array(); foreach($c->channels as $item) {$list[] = $item; } - $list = array_map("quoteandescape",$list); - echo implode(",", $list); - ?>); -var pfc_userchan = Array(<?php - $list = array(); foreach($u->channels as $item) {$list[] = $item["name"];} - $list = array_map("quoteandescape",$list); - echo implode(",", $list); - ?>); -var pfc_defaultprivmsg = Array(<?php - $list = array(); foreach($c->privmsg as $item) {$list[] = $item; } - $list = array_map("quoteandescape",$list); - echo implode(",", $list); - ?>); -var pfc_userprivmsg = Array(<?php - $list = array(); foreach($u->privmsg as $item) {$list[] = $item["name"];} - $list = array_map("quoteandescape",$list); - echo implode(",", $list); - ?>); -var pfc_openlinknewwindow = <?php echo $openlinknewwindow ? "true" : "false"; ?>; -var pfc_bbcode_color_list = Array(<?php - $list = array(); foreach($bbcode_colorlist as $v) {$list[] = substr($v,1);} - $list = array_map("quoteandescape",$list); - echo implode(",", $list); - ?>); -var pfc_nickname_color_list = Array(<?php - $list = array(); foreach($nickname_colorlist as $v) {$list[] = $v;} - $list = array_map("quoteandescape",$list); - echo implode(",", $list); - ?>); +?> +<?php $nick = $u->nick != "" ? $json->encode($u->nick) : $json->encode($c->nick); ?> + +var pfc_nickname = <?php echo ($GLOBALS["output_encoding"]=="UTF-8" ? $nick : iconv("UTF-8", $GLOBALS["output_encoding"],$nick)); ?>; +var pfc_nickid = <?php echo $json->encode($u->nickid); ?>; +var pfc_version = <?php echo $json->encode($version); ?>; +var pfc_clientid = <?php echo $json->encode(md5(uniqid(rand(), true))); ?>; +var pfc_title = <?php echo $json->encode($title); ?>; +var pfc_refresh_delay = <?php echo $json->encode($refresh_delay); ?>; +var pfc_start_minimized = <?php echo $json->encode($start_minimized); ?>; +var pfc_nickmarker = <?php echo $json->encode($nickmarker); ?>; +var pfc_clock = <?php echo $json->encode($clock); ?>; +var pfc_showsmileys = <?php echo $json->encode($showsmileys); ?>; +var pfc_showwhosonline = <?php echo $json->encode($showwhosonline); ?>; +var pfc_focus_on_connect = <?php echo $json->encode($focus_on_connect); ?>; +var pfc_max_text_len = <?php echo $json->encode($max_text_len); ?>; +var pfc_quit_on_closedwindow = <?php echo $json->encode($quit_on_closedwindow); ?>; +var pfc_debug = <?php echo $json->encode($debug); ?>; +var pfc_btn_sh_smileys = <?php echo $json->encode($btn_sh_smileys); ?>; +var pfc_btn_sh_whosonline = <?php echo $json->encode($btn_sh_whosonline); ?>; +var pfc_connect_at_startup = <?php echo $json->encode($connect_at_startup); ?>; +var pfc_notify_window = <?php echo $json->encode($notify_window); ?>; +var pfc_defaultchan = <?php echo $json->encode($c->channels); ?>; +var pfc_userchan = <?php $list = array(); foreach($u->channels as $item) {$list[] = $item["name"];} echo $json->encode($list); ?>; +var pfc_defaultprivmsg = <?php echo $json->encode($c->privmsg); ?>; +var pfc_userprivmsg = <?php $list = array(); foreach($u->privmsg as $item) {$list[] = $item["name"];} echo $json->encode($list); ?>; +var pfc_openlinknewwindow = <?php echo $json->encode($openlinknewwindow); ?>; +var pfc_bbcode_color_list = <?php $list = array(); foreach($bbcode_colorlist as $v) {$list[] = substr($v,1);} echo $json->encode($list); ?>; +var pfc_nickname_color_list = <?php echo $json->encode($nickname_colorlist); ?>; var pfc_proxy_url = '<?php echo $data_public_url."/".$serverid."/proxy.php"; ?>'; @@ -98,7 +78,7 @@ ); foreach($labels_to_load as $l) { - echo "pfc.res.setLabel('".$l."','".addslashes(_pfc2($l))."');\n"; + echo "pfc.res.setLabel(".$json->encode($l).",".$json->encode(_pfc2($l)).");\n"; } $fileurl_to_load = @@ -135,12 +115,12 @@ foreach($fileurl_to_load as $f) { - echo "pfc.res.setFileUrl('".$f."',pfc_proxy_url+'".$c->getFileUrlByProxy($f,false)."');\n"; + echo "pfc.res.setFileUrl(".$json->encode($f).",pfc_proxy_url+'".$c->getFileUrlByProxy($f,false)."');\n"; } foreach($smileys as $s_file => $s_str) { for($j = 0; $j<count($s_str) ; $j++) { - echo "pfc.res.setSmiley('".$s_str[$j]."',pfc_proxy_url+'".$c->getFileUrlByProxy($s_file,false)."');\n"; + echo "pfc.res.setSmiley(".$json->encode($s_str[$j]).",pfc_proxy_url+'".$c->getFileUrlByProxy($s_file,false)."');\n"; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-06 07:53:30
|
Revision: 823 http://svn.sourceforge.net/phpfreechat/?rev=823&view=rev Author: kerphi Date: 2006-10-06 00:53:24 -0700 (Fri, 06 Oct 2006) Log Message: ----------- [en] Bug fix: try to fix slow loading (>60sec) with gzip php output module [1h00] [fr] Bug fix : essai de r?\195?\169solution du probl?\195?\168me de chargement lent (>60sec) lorsque le module gzip est activ?\195?\169 dans php [1h00] Modified Paths: -------------- trunk/src/client/proxy.php.tpl Modified: trunk/src/client/proxy.php.tpl =================================================================== --- trunk/src/client/proxy.php.tpl 2006-10-06 06:35:09 UTC (rev 822) +++ trunk/src/client/proxy.php.tpl 2006-10-06 07:53:24 UTC (rev 823) @@ -1,5 +1,10 @@ <?php +// gzip compression should not be used because it can slowdown a lot the page loading (>60 seconds!) +ini_set('zlib.output_compression','Off'); + +ob_start(); // start capturing output + $rootpath = dirname(__FILE__)."/../../"; $allowedpath = array(); @@ -29,15 +34,27 @@ else $file = $found; +// setup the HTTP cache +// @todo understand how it really works +session_cache_limiter('public'); + +// output the file content +readfile($file); + +// output HTTP headers $contenttype = "text/plain"; -$contentlength = filesize($file); +//$contentlength = filesize($file); if (preg_match("/.js$/", $file)) $contenttype = "text/javascript"; else if (preg_match("/.css$/", $file)) $contenttype = "text/css"; +header("Content-Type: ".$contenttype); +$contentlength = ob_get_length(); header("Content-Length: ".$contentlength); -header("Content-Type: ".$contenttype); -session_cache_limiter('public'); -echo file_get_contents($file); -flush(); // needed to fix problems with gzhandler enabled + +// As far as I can tell the only way to mimic ob_flush()'s behaviour on PHP < 4.2.0 is calling ob_end_flush() followed by ob_start(). +// http://fr.php.net/manual/en/function.ob-flush.php#28477 +ob_end_flush(); +ob_start(); + ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-06 06:35:24
|
Revision: 822 http://svn.sourceforge.net/phpfreechat/?rev=822&view=rev Author: kerphi Date: 2006-10-05 23:35:09 -0700 (Thu, 05 Oct 2006) Log Message: ----------- remive useless themeurl stuff : only themepath is necessary since proxy.php is used Modified Paths: -------------- trunk/demo/demo21_with_hardcoded_urls.php trunk/src/pfcglobalconfig.class.php Modified: trunk/demo/demo21_with_hardcoded_urls.php =================================================================== --- trunk/demo/demo21_with_hardcoded_urls.php 2006-10-04 20:10:12 UTC (rev 821) +++ trunk/demo/demo21_with_hardcoded_urls.php 2006-10-06 06:35:09 UTC (rev 822) @@ -10,8 +10,6 @@ $params["data_public_url"] = "../data/public"; $params["client_script_url"] = "./demo21_with_hardcoded_urls.php"; $params["server_script_url"] = "./demo21_with_hardcoded_urls.php"; -$params["themeurl"] = "../themes"; -$params["themeurl_default"] = "../themes"; // setup paths $params["container_type"] = "File"; Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-10-04 20:10:12 UTC (rev 821) +++ trunk/src/pfcglobalconfig.class.php 2006-10-06 06:35:09 UTC (rev 822) @@ -87,9 +87,7 @@ var $theme = "default"; var $themepath = ""; - var $themeurl = ""; var $themepath_default = ""; - var $themeurl_default = ""; 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) @@ -364,11 +362,6 @@ // copy the themes into the public directory // $this->errors = array_merge($this->errors, @install_dir($this->themepath_default, $this->data_public_path."/themes")); // $this->errors = array_merge($this->errors, @install_dir($this->themepath, $this->data_public_path."/themes")); - // calculate the corresponding theme url - if ($this->themeurl_default == "") - $this->themeurl_default = relativePath($this->client_script_path, $this->data_public_path."/themes"); - if ($this->themeurl == "") - $this->themeurl = relativePath($this->client_script_path, $this->data_public_path."/themes"); // --- @@ -463,7 +456,7 @@ continue; else if (preg_match("/^([a-z_\-0-9]*(\.gif|\.png))(.*)$/i",$line,$res)) { - $smiley_file = 'smileys/'.$res[1];//$this->getFileUrlFromTheme('smileys/'.$res[1]); + $smiley_file = 'smileys/'.$res[1]; $smiley_str = trim($res[3])."\n"; $smiley_str = str_replace("\n", "", $smiley_str); $smiley_str = str_replace("\t", " ", $smiley_str); @@ -583,18 +576,7 @@ else die(_pfc("Error: '%s' could not be found, please check your themepath '%s' and your theme '%s' are correct", $file, $this->themepath, $this->theme)); } - - function getFileUrlFromTheme($file) - { - if (file_exists($this->themepath."/".$this->theme."/".$file)) - return $this->themeurl."/".$this->theme."/".$file; - else - if (file_exists($this->themepath_default."/default/".$file)) - return $this->themeurl_default."/default/".$file; - else - die(_pfc("Error: '%s' could not be found, please check your themepath '%s' and your theme '%s' are correct", $file, $this->themepath, $this->theme)); - } - + function getFilePathFromTheme($file) { if (file_exists($this->themepath."/".$this->theme."/".$file)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 20:13:15
|
Revision: 821 http://svn.sourceforge.net/phpfreechat/?rev=821&view=rev Author: kerphi Date: 2006-10-04 13:10:12 -0700 (Wed, 04 Oct 2006) Log Message: ----------- remove the :/ smiley in order to parse correctly the urls Modified Paths: -------------- trunk/themes/default/smileys/theme Modified: trunk/themes/default/smileys/theme =================================================================== --- trunk/themes/default/smileys/theme 2006-10-04 11:26:16 UTC (rev 820) +++ trunk/themes/default/smileys/theme 2006-10-04 20:10:12 UTC (rev 821) @@ -8,7 +8,7 @@ emoticon_smile.png :-) ^_^ :) emoticon_evilgrin.png >( -emoticon_surprised.png :S :s :-S :-s :/ :-/ +emoticon_surprised.png :S :s :-S :-s :-/ emoticon_grin.png :-D :D emoticon_unhappy.png :'( :-( :o( :-< :( emoticon_happy.png :lol: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 11:26:22
|
Revision: 820 http://svn.sourceforge.net/phpfreechat/?rev=820&view=rev Author: kerphi Date: 2006-10-04 04:26:16 -0700 (Wed, 04 Oct 2006) Log Message: ----------- [en] Bandwidth optimization: store user's list in cache and send it to the browser only when it changes. [30min] [fr] Optimisation de la bande passante : la liste des utilisateurs est mise en cache et n'est envoy?\195?\169e au navigateur que lorsqu'elle a chang?\195?\169. [30min] Modified Paths: -------------- trunk/src/commands/who.class.php trunk/src/commands/who2.class.php Modified: trunk/src/commands/who.class.php =================================================================== --- trunk/src/commands/who.class.php 2006-10-04 09:40:34 UTC (rev 819) +++ trunk/src/commands/who.class.php 2006-10-04 11:26:16 UTC (rev 820) @@ -20,7 +20,6 @@ * Boston, MA 02110-1301 USA */ -require_once(dirname(__FILE__)."/../../lib/json/JSON.php"); require_once(dirname(__FILE__)."/../pfccommand.class.php"); class pfcCommand_who extends pfcCommand @@ -44,7 +43,15 @@ $recipient = pfcCommand_join::GetRecipient($param); $recipientid = pfcCommand_join::GetRecipientId($param); } + + $chanmeta = $this->_getChanMeta($recipient, $recipientid); + $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', ".$chanmeta.");"); + } + + function _getChanMeta($recipient, $recipientid) + { + $c =& $this->c; $ct =& $c->getContainerInstance(); $chanmeta = array(); $chanmeta['chan'] = $recipient; @@ -55,9 +62,10 @@ $chanmeta['meta']['users']['nick'] = $users['nick']; $chanmeta['meta']['users']['nickid'] = $users['nickid']; + require_once(dirname(__FILE__)."/../../lib/json/JSON.php"); $json = new Services_JSON(); $js = $json->encode($chanmeta); - $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', ".$js.");"); + return $js; } } Modified: trunk/src/commands/who2.class.php =================================================================== --- trunk/src/commands/who2.class.php 2006-10-04 09:40:34 UTC (rev 819) +++ trunk/src/commands/who2.class.php 2006-10-04 11:26:16 UTC (rev 820) @@ -24,6 +24,40 @@ class pfcCommand_who2 extends pfcCommand_who { + + function run(&$xml_reponse, $p) + { + $clientid = $p["clientid"]; + $param = $p["param"]; + $sender = $p["sender"]; + $recipient = $p["recipient"]; + $recipientid = $p["recipientid"]; + + $c =& $this->c; + $u =& $this->u; + + if ($param != "") + { + require_once dirname(__FILE__)."/join.class.php"; + $recipient = pfcCommand_join::GetRecipient($param); + $recipientid = pfcCommand_join::GetRecipientId($param); + } + + $chanmeta = $this->_getChanMeta($recipient, $recipientid); + + // check if info didn't change since last call + $sid = "pfc_who2_".$c->getId()."_".$clientid."_".$recipientid; + if (isset($_SESSION[$sid]) && $chanmeta == $_SESSION[$sid]) + { + // do not send the response to save bandwidth + //$xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'unchanged', '');"); + } + else + { + $_SESSION[$sid] = $chanmeta; + $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', ".$chanmeta.");"); + } + } } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 09:40:52
|
Revision: 819 http://svn.sourceforge.net/phpfreechat/?rev=819&view=rev Author: kerphi Date: 2006-10-04 02:40:34 -0700 (Wed, 04 Oct 2006) Log Message: ----------- [en] New API function (pfcinfo) used to rehash (clear the cache). [10min] [fr] Nouvelle fonction dans l'API pfcinfo permettant de vider le cache (rehash). [10min] Modified Paths: -------------- trunk/src/pfcinfo.class.php Modified: trunk/src/pfcinfo.class.php =================================================================== --- trunk/src/pfcinfo.class.php 2006-10-04 09:34:53 UTC (rev 818) +++ trunk/src/pfcinfo.class.php 2006-10-04 09:40:34 UTC (rev 819) @@ -56,6 +56,10 @@ return $users; } + /** + * Return the last $nb message from the $channel room. + * The messages format is very basic, it's raw data (it will certainly change in future) + */ function getLastMsg($channel, $nb) { // to be sure the $nb params is a positive number @@ -70,6 +74,16 @@ $lastmsg_raw = $container->read($channel, $lastmsg_id-$nb); return $lastmsg_raw; } + + /** + * Rehash the server config (same as /rehash command) + * Usefull to take into account new server's parameters + */ + function rehash() + { + $destroyed = $this->destroyCache(); + return $destroyed; + } } -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 09:34:59
|
Revision: 818 http://svn.sourceforge.net/phpfreechat/?rev=818&view=rev Author: kerphi Date: 2006-10-04 02:34:53 -0700 (Wed, 04 Oct 2006) Log Message: ----------- [en] Bug fix: complete nicknames function was broken [15min] [fr] Bug fix : la completion des pseudonymes ne fonctionnait plus [15min] Modified Paths: -------------- trunk/src/client/pfcclient.js Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-10-04 09:28:29 UTC (rev 817) +++ trunk/src/client/pfcclient.js 2006-10-04 09:34:53 UTC (rev 818) @@ -69,7 +69,9 @@ if (pfc_notify_window) this.detectactivity.onunactivate = this.gui.unnotifyWindow.bindAsEventListener(this.gui); /* the events callbacks */ - Event.observe(this.el_words, 'keypress', this.callbackWords_OnKeypress.bindAsEventListener(this), false); + this.el_words.onkeypress = this.callbackWords_OnKeypress.bindAsEventListener(this); +// don't use this line because when doing completeNick the "return false" doesn't work (focus is lost) +// Event.observe(this.el_words, 'keypress', this.callbackWords_OnKeypress.bindAsEventListener(this), false); Event.observe(this.el_words, 'keydown', this.callbackWords_OnKeydown.bindAsEventListener(this), false); Event.observe(this.el_words, 'focus', this.callbackWords_OnFocus.bindAsEventListener(this), false); Event.observe(this.el_handle, 'keydown', this.callbackHandle_OnKeydown.bindAsEventListener(this), false); @@ -535,7 +537,7 @@ if (nick_src != '') { var tabid = this.gui.getTabId(); - var n_list = this.nicklist[tabid]; + var n_list = this.chanmeta[tabid]['users']['nick']; for (var i=0; i<n_list.length; i++) { var nick = n_list[i]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 09:28:50
|
Revision: 817 http://svn.sourceforge.net/phpfreechat/?rev=817&view=rev Author: kerphi Date: 2006-10-04 02:28:29 -0700 (Wed, 04 Oct 2006) Log Message: ----------- [en] Bug fix: when user quit a channel and join again this channel, the join message was not shown. [20min] [fr] Bug fix : lorsqu'un utilisateur quittait un salon puis revenait, le message signalant qu'il est revenu n'?\195?\169tait pas affich?\195?\169. [20min] Modified Paths: -------------- trunk/src/commands/quit.class.php Modified: trunk/src/commands/quit.class.php =================================================================== --- trunk/src/commands/quit.class.php 2006-10-04 09:23:21 UTC (rev 816) +++ trunk/src/commands/quit.class.php 2006-10-04 09:28:29 UTC (rev 817) @@ -15,17 +15,13 @@ $c =& $this->c; $u =& $this->u; - // set the chat inactive - $u->active = false; - $u->saveInCache(); - // then remove the nickname file - $container =& $c->getContainerInstance(); + $ct =& $c->getContainerInstance(); $quitmsg = $param == "" ? _pfc("%s quit", $u->nick) : _pfc("%s quit (%s)", $u->nick, $param); // from the channels foreach( $u->channels as $id => $chandetail ) - if ($container->removeNick($chandetail["recipient"], $u->nickid)) + if ($ct->removeNick($chandetail["recipient"], $u->nickid)) { $cmdp = $p; $cmdp["param"] = $id; @@ -36,7 +32,7 @@ } // from the private messages foreach( $u->privmsg as $id => $pvdetail ) - if ($container->removeNick($pvdetail["recipient"], $u->nickid)) + if ($ct->removeNick($pvdetail["recipient"], $u->nickid)) { $cmdp = $p; $cmdp["param"] = $id; @@ -46,8 +42,12 @@ $cmd->run($xml_reponse, $cmdp); } // from the server - $container->removeNick(NULL, $u->nickid); + $ct->removeNick(NULL, $u->nickid); + // then set the chat inactive + $u->active = false; + $u->saveInCache(); + $xml_reponse->addScript("pfc.handleResponse('quit', 'ok', '');"); if ($c->debug) pxlog("/quit (a user just quit -> nick=".$u->nick.")", "chat", $c->getId()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 09:23:40
|
Revision: 816 http://svn.sourceforge.net/phpfreechat/?rev=816&view=rev Author: kerphi Date: 2006-10-04 02:23:21 -0700 (Wed, 04 Oct 2006) Log Message: ----------- [en] Bug fix : the user's metadata was not correctly updated when it was changed dynamicaly. [15min] [fr] Bug fix : les m?\195?\169ta donn?\195?\169es utilisateur n'?\195?\169taient pas correctement mise ?\195?\160 jour lorsqu'elle ?\195?\169taient chang?\195?\169es dynamiquement. [15min] Modified Paths: -------------- trunk/src/pfccommand.class.php Modified: trunk/src/pfccommand.class.php =================================================================== --- trunk/src/pfccommand.class.php 2006-10-03 19:19:22 UTC (rev 815) +++ trunk/src/pfccommand.class.php 2006-10-04 09:23:21 UTC (rev 816) @@ -150,7 +150,7 @@ $otherids = array(); foreach($channels as $chan) { - $ret = $ct->getOnlineNick($chan); + $ret = $ct->getOnlineNick($ct->decode($chan)); $otherids = array_merge($otherids, $ret['nickid']); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 01:48:44
|
Revision: 808 http://svn.sourceforge.net/phpfreechat/?rev=808&view=rev Author: kerphi Date: 2006-09-30 16:09:40 -0700 (Sat, 30 Sep 2006) Log Message: ----------- reorder smileys Modified Paths: -------------- trunk/themes/default/smileys/theme Modified: trunk/themes/default/smileys/theme =================================================================== --- trunk/themes/default/smileys/theme 2006-09-30 23:07:38 UTC (rev 807) +++ trunk/themes/default/smileys/theme 2006-09-30 23:09:40 UTC (rev 808) @@ -8,13 +8,9 @@ emoticon_smile.png :-) ^_^ :) emoticon_evilgrin.png >( -arrow_right.png => -> --> ==> >>> -arrow_left.png <= <- <-- <== <<< emoticon_surprised.png :S :s :-S :-s :/ :-/ emoticon_grin.png :-D :D emoticon_unhappy.png :'( :-( :o( :-< :( -exclamation.png :!: -lightbulb.png *) 0= emoticon_happy.png :lol: emoticon_waii.png :{} :-{} :razz: :} :-} emoticon_wink.png ;-) ;o) ;) @@ -25,3 +21,7 @@ weather_clouds.png :""": :cloud: :clouds: weather_cloudy.png :"O": :cloudly: weather_lightning.png :$: +arrow_right.png => -> --> ==> >>> +arrow_left.png <= <- <-- <== <<< +exclamation.png :!: +lightbulb.png *) 0= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 01:48:42
|
Revision: 806 http://svn.sourceforge.net/phpfreechat/?rev=806&view=rev Author: kerphi Date: 2006-09-30 15:47:11 -0700 (Sat, 30 Sep 2006) Log Message: ----------- [en] Add demo50 which shows how to use user metadata : add avatar (images) to each connected users. [40min] [fr] Ajout de la demo50 qui montre comment utiliser les m?\195?\169tadonn?\195?\169es utilisateurs : ajout d'un avatar (image) dans la boite whois de chaque utilisateur connect?\195?\169. [40min] Modified Paths: -------------- trunk/demo/index.php Added Paths: ----------- trunk/demo/demo50_customized_usermetadata.php trunk/demo/demo50_data/ trunk/demo/demo50_data/avatar1.jpg trunk/demo/demo50_data/avatar2.jpg trunk/demo/demo50_data/avatar3.jpg trunk/demo/demo50_data/avatar4.jpg trunk/demo/demo50_data/avatar5.jpg trunk/demo/demo50_data/avatar6.jpg trunk/demo/demo50_data/avatar7.jpg trunk/demo/demo50_data/avatar8.jpg trunk/demo/demo50_data/avatar9.jpg trunk/demo/demo50_data/mytheme/ trunk/demo/demo50_data/mytheme/customize.js trunk/demo/demo50_data/mytheme/style.css Added: trunk/demo/demo50_customized_usermetadata.php =================================================================== --- trunk/demo/demo50_customized_usermetadata.php (rev 0) +++ trunk/demo/demo50_customized_usermetadata.php 2006-09-30 22:47:11 UTC (rev 806) @@ -0,0 +1,40 @@ +<?php + +require_once dirname(__FILE__)."/../src/phpfreechat.class.php"; + +$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat +$params["title"] = "A chat which shows how to use user metadata : add avatar (images) to each connected users"; +$params["nick"] = "guest".rand(1,1000); +$params["nickmeta"] = array("avatar" => "demo50_data/avatar".rand(1,10).".jpg"); +$params["themepath"] = dirname(__FILE__)."/demo50_data"; +$params["theme"] = "mytheme"; +$chat = new phpFreeChat( $params ); + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <title>phpFreeChat demo</title> + + <?php $chat->printJavascript(); ?> + <?php $chat->printStyle(); ?> + + </head> + + <body> + <?php $chat->printChat(); ?> + +<?php + // print the current file + echo "<h2>The source code</h2>"; + $filename = __FILE__; + echo "<p><code>".$filename."</code></p>"; + echo "<pre style=\"margin: 0 50px 0 50px; padding: 10px; background-color: #DDD;\">"; + $content = file_get_contents($filename); + echo htmlentities($content); + echo "</pre>"; +?> + + </body> +</html> \ No newline at end of file Added: trunk/demo/demo50_data/avatar1.jpg =================================================================== (Binary files differ) Property changes on: trunk/demo/demo50_data/avatar1.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/demo/demo50_data/avatar2.jpg =================================================================== (Binary files differ) Property changes on: trunk/demo/demo50_data/avatar2.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/demo/demo50_data/avatar3.jpg =================================================================== (Binary files differ) Property changes on: trunk/demo/demo50_data/avatar3.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/demo/demo50_data/avatar4.jpg =================================================================== (Binary files differ) Property changes on: trunk/demo/demo50_data/avatar4.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/demo/demo50_data/avatar5.jpg =================================================================== (Binary files differ) Property changes on: trunk/demo/demo50_data/avatar5.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/demo/demo50_data/avatar6.jpg =================================================================== (Binary files differ) Property changes on: trunk/demo/demo50_data/avatar6.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/demo/demo50_data/avatar7.jpg =================================================================== (Binary files differ) Property changes on: trunk/demo/demo50_data/avatar7.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/demo/demo50_data/avatar8.jpg =================================================================== (Binary files differ) Property changes on: trunk/demo/demo50_data/avatar8.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/demo/demo50_data/avatar9.jpg =================================================================== (Binary files differ) Property changes on: trunk/demo/demo50_data/avatar9.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/demo/demo50_data/mytheme/customize.js =================================================================== --- trunk/demo/demo50_data/mytheme/customize.js (rev 0) +++ trunk/demo/demo50_data/mytheme/customize.js 2006-09-30 22:47:11 UTC (rev 806) @@ -0,0 +1,99 @@ +pfcClient.prototype.updateNickWhoisBox = function(nickid) + { + var div = document.createElement('div'); + div.setAttribute('class', 'pfc_nickwhois'); + div.setAttribute('className', 'pfc_nickwhois'); // for IE6 + + var ul = document.createElement('ul'); + div.appendChild(ul); + + // add the close button + var li = document.createElement('li'); + li.setAttribute('class', 'pfc_nickwhois_close'); + li.setAttribute('className', 'pfc_nickwhois_close'); // for IE6 + ul.appendChild(li); + var a = document.createElement('a'); + a.setAttribute('href', ''); + a.pfc_parent = div; + a.onclick = function(evt){ + this.pfc_parent.style.display = 'none'; + return false; + } + var img = document.createElement('img'); + img.setAttribute('src', this.res.getFileUrl('images/close-whoisbox.gif')); + img.alt = document.createTextNode(this.res.getLabel('Close')); + a.appendChild(img); + li.appendChild(a); + + // add the privmsg link (do not add it if this button is yourself) + if (pfc.getUserMeta(nickid,'nick') != this.nickname) + { + var li = document.createElement('li'); + li.setAttribute('class', 'pfc_nickwhois_pv'); + li.setAttribute('className', 'pfc_nickwhois_pv'); // for IE6 + ul.appendChild(li); + var a = document.createElement('a'); + a.setAttribute('href', ''); + a.pfc_nickid = nickid; + a.pfc_parent = div; + a.onclick = function(evt){ + var nick = pfc.getUserMeta(this.pfc_nickid,'nick'); + pfc.sendRequest('/privmsg', nick); + this.pfc_parent.style.display = 'none'; + return false; + } + var img = document.createElement('img'); + img.setAttribute('src', this.res.getFileUrl('images/openpv.gif')); + img.alt = document.createTextNode(this.res.getLabel('Private message')); + a.appendChild(img); + a.appendChild(document.createTextNode(this.res.getLabel('Private message'))); + li.appendChild(a); + } + + + // add the whois information table + var table = document.createElement('table'); +// table.setAttribute('cellspacing',0); +// table.setAttribute('cellpadding',0); +// table.setAttribute('border',0); + var tbody = document.createElement('tbody'); + table.appendChild(tbody); + var um = this.getAllUserMeta(nickid); + var um_keys = um.keys(); + var msg = ''; + for (var i=0; i<um_keys.length; i++) + { + var k = um_keys[i]; + var v = um[k]; + if (v && k != 'nickid' + && k != 'floodtime' + && k != 'flood_nbmsg' + && k != 'flood_nbchar' + && k != 'avatar' + ) + { + var tr = document.createElement('tr'); + var td1 = document.createElement('td'); + td1.setAttribute('class', 'pfc_nickwhois_c1'); + td1.setAttribute('className', 'pfc_nickwhois_c1'); // for IE6 + var td2 = document.createElement('td'); + td2.setAttribute('class', 'pfc_nickwhois_c2'); + td2.setAttribute('className', 'pfc_nickwhois_c2'); // for IE6 + td1.appendChild(document.createTextNode(k)); + td2.appendChild(document.createTextNode(v)); + tr.appendChild(td1); + tr.appendChild(td2); + tbody.appendChild(tr); + } + } + div.appendChild(table); + + // append the avatar image + var img = document.createElement('img'); + img.setAttribute('src',this.getUserMeta(nickid,'avatar')); + img.setAttribute('class', 'pfc_nickwhois_avatar'); + img.setAttribute('className', 'pfc_nickwhois_avatar'); // for IE6 + div.appendChild(img); + + this.nickwhoisbox[nickid] = div; + } \ No newline at end of file Added: trunk/demo/demo50_data/mytheme/style.css =================================================================== --- trunk/demo/demo50_data/mytheme/style.css (rev 0) +++ trunk/demo/demo50_data/mytheme/style.css 2006-09-30 22:47:11 UTC (rev 806) @@ -0,0 +1,3 @@ +img.pfc_nickwhois_avatar { + margin: 10px; +} \ No newline at end of file Modified: trunk/demo/index.php =================================================================== --- trunk/demo/index.php 2006-09-30 22:44:49 UTC (rev 805) +++ trunk/demo/index.php 2006-09-30 22:47:11 UTC (rev 806) @@ -74,6 +74,7 @@ <li><a href="demo35_shared_memory.php">demo35 - demo which show how to use the shared memory container</a> (not yet working)</li> <li><a href="demo43_change_the_nicknames_colors.php">demo43 - demo which show how to change the nicknames automatic colors</a></li> + <li><a href="demo50_customized_usermetadata.php">demo50 - demo which shows how to use user metadata : add avatar (images) to each connected users</a></li> </ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 01:48:38
|
Revision: 803 http://svn.sourceforge.net/phpfreechat/?rev=803&view=rev Author: kerphi Date: 2006-09-30 15:07:15 -0700 (Sat, 30 Sep 2006) Log Message: ----------- [en] User's metadata implementation : it make possible to build customized user profiles by sending your own metadata for each connected users and to display it as you want in the user's box. This release add two commands : "/whois nickname" used to query the user's metadata list and "/who channel" used internal to get the channel user list. For example: now the server admins can have customized user icon (thanks to Johnny Philavanh for his sponsoring : $400 USD). [14h] [fr] Impl?\195?\169mentation des m?\195?\169ta donn?\195?\169es utilisateur : cela rend possible les profils utilisateurs personnalis?\195?\169s, on peut associer une information ?\195?\160 un utilisateur, r?\195?\169cup?\195?\169rer cette information cot?\195?\169 client et afficher une interface en cons?\195?\169quence. Deux nouvelles commandes ont ?\195?\169t?\195?\169 ajout?\195?\169 : "/whois pseudonyme" permet de r?\195?\169cup?\195?\169rer la liste des m?\195?\169ta donn?\195?\169es de l'utilisateur identifi?\195?\169 par son pseudonyme, et "/who channel" qui permet de r?\195?\169cup?\195?\169rer la liste des utilisateurs d'un channel. Par exemple : il est maintenant possible d'afficher une image diff?\195?\169rente pour les administrateurs du chat (merci ?\195?\160 Johnny Philavanh pour sa donation de $400 USD). [14h] Modified Paths: -------------- trunk/src/client/chat.js.tpl.php trunk/src/client/pfcclient.js trunk/src/commands/connect.class.php trunk/src/commands/deop.class.php trunk/src/commands/identify.class.php trunk/src/commands/join.class.php trunk/src/commands/nick.class.php trunk/src/commands/op.class.php trunk/src/commands/privmsg.class.php trunk/src/commands/update.class.php trunk/src/pfccommand.class.php trunk/src/pfccontainer.class.php trunk/src/pfcglobalconfig.class.php trunk/src/phpfreechat.class.php trunk/themes/default/images/ch-active.gif trunk/themes/default/images/ch.gif trunk/themes/default/images/clock-on.gif trunk/themes/default/images/pv-active.gif trunk/themes/default/images/pv.gif trunk/themes/default/images/user.gif trunk/themes/default/style.css Added Paths: ----------- trunk/lib/json/ trunk/lib/json/JSON.php trunk/lib/json/LICENSE trunk/src/commands/who.class.php trunk/src/commands/who2.class.php trunk/src/commands/whois.class.php trunk/src/commands/whois2.class.php trunk/themes/default/images/close-whoisbox.gif trunk/themes/default/images/openpv.gif trunk/themes/default/images/user-admin.gif Removed Paths: ------------- trunk/src/commands/getonlinenick.class.php trunk/testcase/cmd_error.php trunk/testcase/cmd_nick.php trunk/testcase/cmd_send.php Added: trunk/lib/json/JSON.php =================================================================== --- trunk/lib/json/JSON.php (rev 0) +++ trunk/lib/json/JSON.php 2006-09-30 22:07:15 UTC (rev 803) @@ -0,0 +1,806 @@ +<?php +/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ + +/** + * Converts to and from JSON format. + * + * JSON (JavaScript Object Notation) is a lightweight data-interchange + * format. It is easy for humans to read and write. It is easy for machines + * to parse and generate. It is based on a subset of the JavaScript + * Programming Language, Standard ECMA-262 3rd Edition - December 1999. + * This feature can also be found in Python. JSON is a text format that is + * completely language independent but uses conventions that are familiar + * to programmers of the C-family of languages, including C, C++, C#, Java, + * JavaScript, Perl, TCL, and many others. These properties make JSON an + * ideal data-interchange language. + * + * This package provides a simple encoder and decoder for JSON notation. It + * is intended for use with client-side Javascript applications that make + * use of HTTPRequest to perform server communication functions - data can + * be encoded into JSON notation for use in a client-side javascript, or + * decoded from incoming Javascript requests. JSON format is native to + * Javascript, and can be directly eval()'ed with no further parsing + * overhead + * + * All strings should be in ASCII or UTF-8 format! + * + * LICENSE: Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: Redistributions of source code must retain the + * above copyright notice, this list of conditions and the following + * disclaimer. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * @category + * @package Services_JSON + * @author Michal Migurski <mik...@te...> + * @author Matt Knapp <mdknapp[at]gmail[dot]com> + * @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com> + * @copyright 2005 Michal Migurski + * @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $ + * @license http://www.opensource.org/licenses/bsd-license.php + * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198 + */ + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +define('SERVICES_JSON_SLICE', 1); + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +define('SERVICES_JSON_IN_STR', 2); + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +define('SERVICES_JSON_IN_ARR', 3); + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +define('SERVICES_JSON_IN_OBJ', 4); + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +define('SERVICES_JSON_IN_CMT', 5); + +/** + * Behavior switch for Services_JSON::decode() + */ +define('SERVICES_JSON_LOOSE_TYPE', 16); + +/** + * Behavior switch for Services_JSON::decode() + */ +define('SERVICES_JSON_SUPPRESS_ERRORS', 32); + +/** + * Converts to and from JSON format. + * + * Brief example of use: + * + * <code> + * // create a new instance of Services_JSON + * $json = new Services_JSON(); + * + * // convert a complexe value to JSON notation, and send it to the browser + * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4))); + * $output = $json->encode($value); + * + * print($output); + * // prints: ["foo","bar",[1,2,"baz"],[3,[4]]] + * + * // accept incoming POST data, assumed to be in JSON notation + * $input = file_get_contents('php://input', 1000000); + * $value = $json->decode($input); + * </code> + */ +class Services_JSON +{ + /** + * constructs a new JSON instance + * + * @param int $use object behavior flags; combine with boolean-OR + * + * possible values: + * - SERVICES_JSON_LOOSE_TYPE: loose typing. + * "{...}" syntax creates associative arrays + * instead of objects in decode(). + * - SERVICES_JSON_SUPPRESS_ERRORS: error suppression. + * Values which can't be encoded (e.g. resources) + * appear as NULL instead of throwing errors. + * By default, a deeply-nested resource will + * bubble up with an error, so all return values + * from encode() should be checked with isError() + */ + function Services_JSON($use = 0) + { + $this->use = $use; + } + + /** + * convert a string from one UTF-16 char to one UTF-8 char + * + * Normally should be handled by mb_convert_encoding, but + * provides a slower PHP-only method for installations + * that lack the multibye string extension. + * + * @param string $utf16 UTF-16 character + * @return string UTF-8 character + * @access private + */ + function utf162utf8($utf16) + { + // oh please oh please oh please oh please oh please + if(function_exists('mb_convert_encoding')) { + return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); + } + + $bytes = (ord($utf16{0}) << 8) | ord($utf16{1}); + + switch(true) { + case ((0x7F & $bytes) == $bytes): + // this case should never be reached, because we are in ASCII range + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr(0x7F & $bytes); + + case (0x07FF & $bytes) == $bytes: + // return a 2-byte UTF-8 character + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr(0xC0 | (($bytes >> 6) & 0x1F)) + . chr(0x80 | ($bytes & 0x3F)); + + case (0xFFFF & $bytes) == $bytes: + // return a 3-byte UTF-8 character + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr(0xE0 | (($bytes >> 12) & 0x0F)) + . chr(0x80 | (($bytes >> 6) & 0x3F)) + . chr(0x80 | ($bytes & 0x3F)); + } + + // ignoring UTF-32 for now, sorry + return ''; + } + + /** + * convert a string from one UTF-8 char to one UTF-16 char + * + * Normally should be handled by mb_convert_encoding, but + * provides a slower PHP-only method for installations + * that lack the multibye string extension. + * + * @param string $utf8 UTF-8 character + * @return string UTF-16 character + * @access private + */ + function utf82utf16($utf8) + { + // oh please oh please oh please oh please oh please + if(function_exists('mb_convert_encoding')) { + return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8'); + } + + switch(strlen($utf8)) { + case 1: + // this case should never be reached, because we are in ASCII range + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return $utf8; + + case 2: + // return a UTF-16 character from a 2-byte UTF-8 char + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr(0x07 & (ord($utf8{0}) >> 2)) + . chr((0xC0 & (ord($utf8{0}) << 6)) + | (0x3F & ord($utf8{1}))); + + case 3: + // return a UTF-16 character from a 3-byte UTF-8 char + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr((0xF0 & (ord($utf8{0}) << 4)) + | (0x0F & (ord($utf8{1}) >> 2))) + . chr((0xC0 & (ord($utf8{1}) << 6)) + | (0x7F & ord($utf8{2}))); + } + + // ignoring UTF-32 for now, sorry + return ''; + } + + /** + * encodes an arbitrary variable into JSON format + * + * @param mixed $var any number, boolean, string, array, or object to be encoded. + * see argument 1 to Services_JSON() above for array-parsing behavior. + * if var is a strng, note that encode() always expects it + * to be in ASCII or UTF-8 format! + * + * @return mixed JSON string representation of input var or an error if a problem occurs + * @access public + */ + function encode($var) + { + switch (gettype($var)) { + case 'boolean': + return $var ? 'true' : 'false'; + + case 'NULL': + return 'null'; + + case 'integer': + return (int) $var; + + case 'double': + case 'float': + return (float) $var; + + case 'string': + // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT + $ascii = ''; + $strlen_var = strlen($var); + + /* + * Iterate over every character in the string, + * escaping with a slash or encoding to UTF-8 where necessary + */ + for ($c = 0; $c < $strlen_var; ++$c) { + + $ord_var_c = ord($var{$c}); + + switch (true) { + case $ord_var_c == 0x08: + $ascii .= '\b'; + break; + case $ord_var_c == 0x09: + $ascii .= '\t'; + break; + case $ord_var_c == 0x0A: + $ascii .= '\n'; + break; + case $ord_var_c == 0x0C: + $ascii .= '\f'; + break; + case $ord_var_c == 0x0D: + $ascii .= '\r'; + break; + + case $ord_var_c == 0x22: + case $ord_var_c == 0x2F: + case $ord_var_c == 0x5C: + // double quote, slash, slosh + $ascii .= '\\'.$var{$c}; + break; + + case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): + // characters U-00000000 - U-0000007F (same as ASCII) + $ascii .= $var{$c}; + break; + + case (($ord_var_c & 0xE0) == 0xC0): + // characters U-00000080 - U-000007FF, mask 110XXXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, ord($var{$c + 1})); + $c += 1; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xF0) == 0xE0): + // characters U-00000800 - U-0000FFFF, mask 1110XXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, + ord($var{$c + 1}), + ord($var{$c + 2})); + $c += 2; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xF8) == 0xF0): + // characters U-00010000 - U-001FFFFF, mask 11110XXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, + ord($var{$c + 1}), + ord($var{$c + 2}), + ord($var{$c + 3})); + $c += 3; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xFC) == 0xF8): + // characters U-00200000 - U-03FFFFFF, mask 111110XX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, + ord($var{$c + 1}), + ord($var{$c + 2}), + ord($var{$c + 3}), + ord($var{$c + 4})); + $c += 4; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xFE) == 0xFC): + // characters U-04000000 - U-7FFFFFFF, mask 1111110X + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, + ord($var{$c + 1}), + ord($var{$c + 2}), + ord($var{$c + 3}), + ord($var{$c + 4}), + ord($var{$c + 5})); + $c += 5; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + } + } + + return '"'.$ascii.'"'; + + case 'array': + /* + * As per JSON spec if any array key is not an integer + * we must treat the the whole array as an object. We + * also try to catch a sparsely populated associative + * array with numeric keys here because some JS engines + * will create an array with empty indexes up to + * max_index which can cause memory issues and because + * the keys, which may be relevant, will be remapped + * otherwise. + * + * As per the ECMA and JSON specification an object may + * have any string as a property. Unfortunately due to + * a hole in the ECMA specification if the key is a + * ECMA reserved word or starts with a digit the + * parameter is only accessible using ECMAScript's + * bracket notation. + */ + + // treat as a JSON object + if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) { + $properties = array_map(array($this, 'name_value'), + array_keys($var), + array_values($var)); + + foreach($properties as $property) { + if(Services_JSON::isError($property)) { + return $property; + } + } + + return '{' . join(',', $properties) . '}'; + } + + // treat it like a regular array + $elements = array_map(array($this, 'encode'), $var); + + foreach($elements as $element) { + if(Services_JSON::isError($element)) { + return $element; + } + } + + return '[' . join(',', $elements) . ']'; + + case 'object': + $vars = get_object_vars($var); + + $properties = array_map(array($this, 'name_value'), + array_keys($vars), + array_values($vars)); + + foreach($properties as $property) { + if(Services_JSON::isError($property)) { + return $property; + } + } + + return '{' . join(',', $properties) . '}'; + + default: + return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS) + ? 'null' + : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string"); + } + } + + /** + * array-walking function for use in generating JSON-formatted name-value pairs + * + * @param string $name name of key to use + * @param mixed $value reference to an array element to be encoded + * + * @return string JSON-formatted name-value pair, like '"name":value' + * @access private + */ + function name_value($name, $value) + { + $encoded_value = $this->encode($value); + + if(Services_JSON::isError($encoded_value)) { + return $encoded_value; + } + + return $this->encode(strval($name)) . ':' . $encoded_value; + } + + /** + * reduce a string by removing leading and trailing comments and whitespace + * + * @param $str string string value to strip of comments and whitespace + * + * @return string string value stripped of comments and whitespace + * @access private + */ + function reduce_string($str) + { + $str = preg_replace(array( + + // eliminate single line comments in '// ...' form + '#^\s*//(.+)$#m', + + // eliminate multi-line comments in '/* ... */' form, at start of string + '#^\s*/\*(.+)\*/#Us', + + // eliminate multi-line comments in '/* ... */' form, at end of string + '#/\*(.+)\*/\s*$#Us' + + ), '', $str); + + // eliminate extraneous space + return trim($str); + } + + /** + * decodes a JSON string into appropriate variable + * + * @param string $str JSON-formatted string + * + * @return mixed number, boolean, string, array, or object + * corresponding to given JSON input string. + * See argument 1 to Services_JSON() above for object-output behavior. + * Note that decode() always returns strings + * in ASCII or UTF-8 format! + * @access public + */ + function decode($str) + { + $str = $this->reduce_string($str); + + switch (strtolower($str)) { + case 'true': + return true; + + case 'false': + return false; + + case 'null': + return null; + + default: + $m = array(); + + if (is_numeric($str)) { + // Lookie-loo, it's a number + + // This would work on its own, but I'm trying to be + // good about returning integers where appropriate: + // return (float)$str; + + // Return float or int, as appropriate + return ((float)$str == (integer)$str) + ? (integer)$str + : (float)$str; + + } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) { + // STRINGS RETURNED IN UTF-8 FORMAT + $delim = substr($str, 0, 1); + $chrs = substr($str, 1, -1); + $utf8 = ''; + $strlen_chrs = strlen($chrs); + + for ($c = 0; $c < $strlen_chrs; ++$c) { + + $substr_chrs_c_2 = substr($chrs, $c, 2); + $ord_chrs_c = ord($chrs{$c}); + + switch (true) { + case $substr_chrs_c_2 == '\b': + $utf8 .= chr(0x08); + ++$c; + break; + case $substr_chrs_c_2 == '\t': + $utf8 .= chr(0x09); + ++$c; + break; + case $substr_chrs_c_2 == '\n': + $utf8 .= chr(0x0A); + ++$c; + break; + case $substr_chrs_c_2 == '\f': + $utf8 .= chr(0x0C); + ++$c; + break; + case $substr_chrs_c_2 == '\r': + $utf8 .= chr(0x0D); + ++$c; + break; + + case $substr_chrs_c_2 == '\\"': + case $substr_chrs_c_2 == '\\\'': + case $substr_chrs_c_2 == '\\\\': + case $substr_chrs_c_2 == '\\/': + if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || + ($delim == "'" && $substr_chrs_c_2 != '\\"')) { + $utf8 .= $chrs{++$c}; + } + break; + + case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)): + // single, escaped unicode character + $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2))) + . chr(hexdec(substr($chrs, ($c + 4), 2))); + $utf8 .= $this->utf162utf8($utf16); + $c += 5; + break; + + case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): + $utf8 .= $chrs{$c}; + break; + + case ($ord_chrs_c & 0xE0) == 0xC0: + // characters U-00000080 - U-000007FF, mask 110XXXXX + //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 2); + ++$c; + break; + + case ($ord_chrs_c & 0xF0) == 0xE0: + // characters U-00000800 - U-0000FFFF, mask 1110XXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 3); + $c += 2; + break; + + case ($ord_chrs_c & 0xF8) == 0xF0: + // characters U-00010000 - U-001FFFFF, mask 11110XXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 4); + $c += 3; + break; + + case ($ord_chrs_c & 0xFC) == 0xF8: + // characters U-00200000 - U-03FFFFFF, mask 111110XX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 5); + $c += 4; + break; + + case ($ord_chrs_c & 0xFE) == 0xFC: + // characters U-04000000 - U-7FFFFFFF, mask 1111110X + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 6); + $c += 5; + break; + + } + + } + + return $utf8; + + } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) { + // array, or object notation + + if ($str{0} == '[') { + $stk = array(SERVICES_JSON_IN_ARR); + $arr = array(); + } else { + if ($this->use & SERVICES_JSON_LOOSE_TYPE) { + $stk = array(SERVICES_JSON_IN_OBJ); + $obj = array(); + } else { + $stk = array(SERVICES_JSON_IN_OBJ); + $obj = new stdClass(); + } + } + + array_push($stk, array('what' => SERVICES_JSON_SLICE, + 'where' => 0, + 'delim' => false)); + + $chrs = substr($str, 1, -1); + $chrs = $this->reduce_string($chrs); + + if ($chrs == '') { + if (reset($stk) == SERVICES_JSON_IN_ARR) { + return $arr; + + } else { + return $obj; + + } + } + + //print("\nparsing {$chrs}\n"); + + $strlen_chrs = strlen($chrs); + + for ($c = 0; $c <= $strlen_chrs; ++$c) { + + $top = end($stk); + $substr_chrs_c_2 = substr($chrs, $c, 2); + + if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) { + // found a comma that is not inside a string, array, etc., + // OR we've reached the end of the character list + $slice = substr($chrs, $top['where'], ($c - $top['where'])); + array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false)); + //print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); + + if (reset($stk) == SERVICES_JSON_IN_ARR) { + // we are in an array, so just push an element onto the stack + array_push($arr, $this->decode($slice)); + + } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { + // we are in an object, so figure + // out the property name and set an + // element in an associative array, + // for now + $parts = array(); + + if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { + // "name":value pair + $key = $this->decode($parts[1]); + $val = $this->decode($parts[2]); + + if ($this->use & SERVICES_JSON_LOOSE_TYPE) { + $obj[$key] = $val; + } else { + $obj->$key = $val; + } + } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { + // name:value pair, where name is unquoted + $key = $parts[1]; + $val = $this->decode($parts[2]); + + if ($this->use & SERVICES_JSON_LOOSE_TYPE) { + $obj[$key] = $val; + } else { + $obj->$key = $val; + } + } + + } + + } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) { + // found a quote, and we are not inside a string + array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c})); + //print("Found start of string at {$c}\n"); + + } elseif (($chrs{$c} == $top['delim']) && + ($top['what'] == SERVICES_JSON_IN_STR) && + ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) { + // found a quote, we're in a string, and it's not escaped + // we know that it's not escaped becase there is _not_ an + // odd number of backslashes at the end of the string so far + array_pop($stk); + //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n"); + + } elseif (($chrs{$c} == '[') && + in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { + // found a left-bracket, and we are in an array, object, or slice + array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false)); + //print("Found start of array at {$c}\n"); + + } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) { + // found a right-bracket, and we're in an array + array_pop($stk); + //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); + + } elseif (($chrs{$c} == '{') && + in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { + // found a left-brace, and we are in an array, object, or slice + array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false)); + //print("Found start of object at {$c}\n"); + + } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) { + // found a right-brace, and we're in an object + array_pop($stk); + //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); + + } elseif (($substr_chrs_c_2 == '/*') && + in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { + // found a comment start, and we are in an array, object, or slice + array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false)); + $c++; + //print("Found start of comment at {$c}\n"); + + } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) { + // found a comment end, and we're in one now + array_pop($stk); + $c++; + + for ($i = $top['where']; $i <= $c; ++$i) + $chrs = substr_replace($chrs, ' ', $i, 1); + + //print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); + + } + + } + + if (reset($stk) == SERVICES_JSON_IN_ARR) { + return $arr; + + } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { + return $obj; + + } + + } + } + } + + /** + * @todo Ultimately, this should just call PEAR::isError() + */ + function isError($data, $code = null) + { + if (class_exists('pear')) { + return PEAR::isError($data, $code); + } elseif (is_object($data) && (get_class($data) == 'services_json_error' || + is_subclass_of($data, 'services_json_error'))) { + return true; + } + + return false; + } +} + +if (class_exists('PEAR_Error')) { + + class Services_JSON_Error extends PEAR_Error + { + function Services_JSON_Error($message = 'unknown error', $code = null, + $mode = null, $options = null, $userinfo = null) + { + parent::PEAR_Error($message, $code, $mode, $options, $userinfo); + } + } + +} else { + + /** + * @todo Ultimately, this class shall be descended from PEAR_Error + */ + class Services_JSON_Error + { + function Services_JSON_Error($message = 'unknown error', $code = null, + $mode = null, $options = null, $userinfo = null) + { + + } + } + +} + +?> Added: trunk/lib/json/LICENSE =================================================================== --- trunk/lib/json/LICENSE (rev 0) +++ trunk/lib/json/LICENSE 2006-09-30 22:07:15 UTC (rev 803) @@ -0,0 +1,21 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN +NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Modified: trunk/src/client/chat.js.tpl.php =================================================================== --- trunk/src/client/chat.js.tpl.php 2006-09-30 19:39:55 UTC (rev 802) +++ trunk/src/client/chat.js.tpl.php 2006-09-30 22:07:15 UTC (rev 803) @@ -2,6 +2,7 @@ <?php $nick = $u->nick != "" ? addslashes($u->nick) : addslashes($c->nick); ?> var pfc_nickname = '<?php echo ($GLOBALS["output_encoding"]=="UTF-8" ? $nick : iconv("UTF-8", $GLOBALS["output_encoding"],$nick)); ?>'; +var pfc_nickid = '<?php echo $u->nickid; ?>'; var pfc_version = '<?php echo $version; ?>'; var pfc_clientid = '<?php echo md5(uniqid(rand(), true)); ?>'; var pfc_title = '<?php echo addslashes($title); ?>'; @@ -93,6 +94,7 @@ "Click here to send your message", // _pfc "Send", // _pfc "You are not allowed to speak to yourself", // _pfc + "Close", // _pfc ); foreach($labels_to_load as $l) { @@ -126,6 +128,9 @@ 'images/bt_mail.gif', 'images/bt_color.gif', 'images/color_transparent.gif', + 'images/close-whoisbox.gif', + 'images/openpv.gif', + 'images/user-admin.gif', ); foreach($fileurl_to_load as $f) Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-30 19:39:55 UTC (rev 802) +++ trunk/src/client/pfcclient.js 2006-09-30 22:07:15 UTC (rev 803) @@ -19,7 +19,11 @@ // load the resources manager (labels and urls) this.res = new pfcResource(); - this.nickname = pfc_nickname; + this.nickname = pfc_nickname; + this.nickid = pfc_nickid; + this.usermeta = $H(); + this.chanmeta = $H(); + this.nickwhoisbox = $H(); // this array contains all the sent command // used the up and down key to navigate in the history @@ -286,6 +290,8 @@ { this.el_handle.innerHTML = param; this.nickname = param; + this.usermeta[this.nickid]['nick'] = param; + this.updateNickBox(this.nickid); // clear the possible error box generated by the bellow displayMsg(...) function this.clearError(Array(this.el_words)); @@ -379,11 +385,100 @@ { this.displayMsg( cmd, param ); } + else if (cmd == "whois" || cmd == "whois2") + { + var nickid = param['nickid']; + if (resp == "ok") + { + this.usermeta[nickid] = $H(param); + this.updateNickBox(nickid); + this.updateNickWhoisBox(nickid); + } + if (cmd == "whois") + { + // display the whois info + var um = this.getAllUserMeta(nickid); + var um_keys = um.keys(); + var msg = ''; + for (var i=0; i<um_keys.length; i++) + { + var k = um_keys[i]; + var v = um[k]; + if (v && k != 'nickid' + && k != 'floodtime' + && k != 'flood_nbmsg' + && k != 'flood_nbchar' + ) + msg = msg + '<strong>' + k + '</strong>: ' + v + '<br/>'; + } + this.displayMsg( cmd, msg ); + } + } + else if (cmd == "who" || cmd == "who2") + { + var chan = param['chan']; + var chanid = param['chanid']; + var meta = $H(param['meta']); + + if (resp == "ok") + { + this.chanmeta[chanid] = meta; + + // send /whois commands for unknown users + for (var i=0; i<meta['users']['nickid'].length; i++) + { + var nickid = meta['users']['nickid'][i]; + var nick = meta['users']['nick'][i]; + var um = this.getAllUserMeta(nickid); + if (!um) this.sendRequest('/whois2', nick); + } + + // update the nick list display on the current channel + this.updateNickListBox(chanid); + } + + if (cmd == "who") + { + // display the whois info + var cm = this.getAllChanMeta(chanid); + var cm_keys = cm.keys(); + var msg = ''; + for (var i=0; i<cm_keys.length; i++) + { + var k = cm_keys[i]; + var v = cm[k]; + if (k != 'users') + { + msg = msg + '<strong>' + k + '</strong>: ' + v + '<br/>'; + } + } + this.displayMsg( cmd, msg ); + } + } else alert(cmd + "-"+resp+"-"+param); }, + getAllUserMeta: function(nickid) + { + return this.usermeta[nickid]; + }, + getUserMeta: function(nickid, key) + { + return this.usermeta[nickid][key]; + }, + + getAllChanMeta: function(chanid) + { + return this.chanmeta[chanid]; + }, + + getChanMeta: function(chanid, key) + { + return this.chanmeta[chanid][key]; + }, + doSendMessage: function() { var w = this.el_words; @@ -757,64 +852,33 @@ this.el_words.focus(); }, + updateNickBox: function(nickid) + { + // @todo optimize this function because it is called lot of times so it could cause CPU consuming on client side + var chanids = this.chanmeta.keys(); + for(var i = 0; chanids.length > i; i++) + { + this.updateNickListBox(chanids[i]); + } + }, + /** * fill the nickname list with connected nicknames */ - updateNickList: function(tabid,lst) + updateNickListBox: function(chanid) { - // alert('updateNickList: tabid='+tabid+"-lst="+lst.inspect()); - //var tabid = hex_md5(_to_utf8("ch_"+recipient)); - - this.nicklist[tabid] = lst; - var nicks = lst; - var nickdiv = this.gui.getOnlineContentFromTabId(tabid).firstChild; + var nickidlst = this.chanmeta[chanid]['users']['nickid']; + var nickdiv = this.gui.getOnlineContentFromTabId(chanid).firstChild; var ul = document.createElement('ul'); - for (var i=0; i<nicks.length; i++) + ul.setAttribute('class', 'pfc_nicklist'); + ul.setAttribute('className', 'pfc_nicklist'); // IE6 + for (var i=0; i<nickidlst.length; i++) { - var li = document.createElement('li'); - if (nicks[i] != this.nickname) - { - // this is someone -> create a privmsg link - var img = document.createElement('img'); - img.setAttribute('src', this.res.getFileUrl('images/user.gif')); - img.alt = this.res.getLabel('Private message'); - img.title = img.alt; - img.style.marginRight = '5px'; - var a = document.createElement('a'); - a.setAttribute('href', ''); - a.pfc_nick = nicks[i]; - a.onclick = function(){pfc.sendRequest('/privmsg', this.pfc_nick); return false;} - a.appendChild(img); - li.appendChild(a); - } - else - { - // this is myself -> do not create a privmsg link - var img = document.createElement('img'); - img.setAttribute('src', this.res.getFileUrl('images/user-me.gif')); - img.alt = ''; - img.title = img.alt; - img.style.marginRight = '5px'; - li.appendChild(img); - } - + var nickid = nickidlst[i]; - // nobr is not xhtml valid but it's a workeround - // for IE which doesn't support 'white-space: pre' css rule - var nobr = document.createElement('nobr'); - var span = document.createElement('span'); - span.pfc_nick = nicks[i]; - span.onclick = function(){pfc.insert_text(this.pfc_nick+", ","",false); return false;} - span.appendChild(document.createTextNode(nicks[i])); - span.setAttribute('class', 'pfc_nickmarker pfc_nick_'+ hex_md5(_to_utf8(nicks[i]))); - span.setAttribute('className', 'pfc_nickmarker pfc_nick_'+ hex_md5(_to_utf8(nicks[i]))); // for IE6 - - // Element.addClassName(span, 'pfc_nickmarker'); - // Element.addClassName(span, 'pfc_nick_'+ hex_md5(_to_utf8(nicks[i]))); - nobr.appendChild(span); - li.appendChild(nobr); - li.style.borderBottom = '1px solid #AAA'; - + var li = this.buildNickItem(nickid); + li.setAttribute('class', 'pfc_nickitem_'+nickid); + li.setAttribute('className', 'pfc_nickitem_'+nickid); // IE6 ul.appendChild(li); } var fc = nickdiv.firstChild; @@ -824,7 +888,151 @@ nickdiv.appendChild(ul,fc); this.colorizeNicks(nickdiv); }, + + getNickWhoisBox: function(nickid) + { + if (!this.nickwhoisbox[nickid]) + this.updateNickWhoisBox(nickid); + return this.nickwhoisbox[nickid]; + }, + + updateNickWhoisBox: function(nickid) + { + var div = document.createElement('div'); + div.setAttribute('class', 'pfc_nickwhois'); + div.setAttribute('className', 'pfc_nickwhois'); // for IE6 + + var ul = document.createElement('ul'); + div.appendChild(ul); + + // add the close button + var li = document.createElement('li'); + li.setAttribute('class', 'pfc_nickwhois_close'); + li.setAttribute('className', 'pfc_nickwhois_close'); // for IE6 + ul.appendChild(li); + var a = document.createElement('a'); + a.setAttribute('href', ''); + a.pfc_parent = div; + a.onclick = function(evt){ + this.pfc_parent.style.display = 'none'; + return false; + } + var img = document.createElement('img'); + img.setAttribute('src', this.res.getFileUrl('images/close-whoisbox.gif')); + img.alt = document.createTextNode(this.res.getLabel('Close')); + a.appendChild(img); + li.appendChild(a); + + // add the privmsg link (do not add it if this button is yourself) + if (pfc.getUserMeta(nickid,'nick') != this.nickname) + { + var li = document.createElement('li'); + li.setAttribute('class', 'pfc_nickwhois_pv'); + li.setAttribute('className', 'pfc_nickwhois_pv'); // for IE6 + ul.appendChild(li); + var a = document.createElement('a'); + a.setAttribute('href', ''); + a.pfc_nickid = nickid; + a.pfc_parent = div; + a.onclick = function(evt){ + var nick = pfc.getUserMeta(this.pfc_nickid,'nick'); + pfc.sendRequest('/privmsg', nick); + this.pfc_parent.style.display = 'none'; + return false; + } + var img = document.createElement('img'); + img.setAttribute('src', this.res.getFileUrl('images/openpv.gif')); + img.alt = document.createTextNode(this.res.getLabel('Private message')); + a.appendChild(img); + a.appendChild(document.createTextNode(this.res.getLabel('Private message'))); + li.appendChild(a); + } + + + // add the whois information table + var table = document.createElement('table'); +// table.setAttribute('cellspacing',0); +// table.setAttribute('cellpadding',0); +// table.setAttribute('border',0); + var tbody = document.createElement('tbody'); + table.appendChild(tbody); + var um = this.getAllUserMeta(nickid); + var um_keys = um.keys(); + var msg = ''; + for (var i=0; i<um_keys.length; i++) + { + var k = um_keys[i]; + var v = um[k]; + if (v && k != 'nickid' + && k != 'floodtime' + && k != 'flood_nbmsg' + && k != 'flood_nbchar' + ) + { + var tr = document.createElement('tr'); + var td1 = document.createElement('td'); + td1.setAttribute('class', 'pfc_nickwhois_c1'); + td1.setAttribute('className', 'pfc_nickwhois_c1'); // for IE6 + var td2 = document.createElement('td'); + td2.setAttribute('class', 'pfc_nickwhois_c2'); + td2.setAttribute('className', 'pfc_nickwhois_c2'); // for IE6 + td1.appendChild(document.createTextNode(k)); + td2.appendChild(document.createTextNode(v)); + tr.appendChild(td1); + tr.appendChild(td2); + tbody.appendChild(tr); + } + } + div.appendChild(table); + + this.nickwhoisbox[nickid] = div; + }, + + buildNickItem: function(nickid) + { + var nick = this.getUserMeta(nickid, 'nick'); + var isadmin = this.getUserMeta(nickid, 'isadmin'); + var li = document.createElement('li'); + + var img = document.createElement('img'); + if (isadmin) + img.setAttribute('src', this.res.getFileUrl('images/user-admin.gif')); + else + img.setAttribute('src', this.res.getFileUrl('images/user.gif')); + img.style.marginRight = '5px'; + img.setAttribute('class', 'pfc_nickbutton'); + img.setAttribute('className', 'pfc_nickbutton'); // for IE6 + img.pfc_nick = nick; + img.pfc_nickid = nickid; + img.onclick = function(evt){ + var d = pfc.getNickWhoisBox(this.pfc_nickid); + document.body.appendChild(d); + d.style.display = 'block'; + d.style.zIndex = '400'; + d.style.position = 'absolute'; + d.style.left = (evt.pageX-5)+'px'; + d.style.top = (evt.pageY-5)+'px'; + return false; + } + li.appendChild(img); + + // nobr is not xhtml valid but it's a workeround + // for IE which doesn't support 'white-space: pre' css rule + var nobr = document.createElement('nobr'); + var span = document.createElement('span'); + span.setAttribute('class', 'pfc_nickmarker pfc_nick_'+nickid); + span.setAttribute('className', 'pfc_nickmarker pfc_nick_'+nickid); // for IE6 + span.pfc_nick = nick; + span.pfc_nickid = nickid; + span.onclick = function(){pfc.insert_text(this.pfc_nick+", ","",false); return false;} + span.appendChild(document.createTextNode(nick)); + nobr.appendChild(span); + li.appendChild(nobr); + li.style.borderBottom = '1px solid #AAA'; + return li; + }, + /** * clear the nickname list */ @@ -1136,7 +1344,6 @@ var loginlogout_icon = $('pfc_loginlogout'); if (this.isconnected) { - // this.updateNickList(this.nicklist); loginlogout_icon.src = this.res.getFileUrl('images/logout.gif'); loginlogout_icon.alt = this.res.getLabel('Disconnect'); loginlogout_icon.title = loginlogout_icon.alt; Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-09-30 19:39:55 UTC (rev 802) +++ trunk/src/commands/connect.class.php 2006-09-30 22:07:15 UTC (rev 803) @@ -54,15 +54,22 @@ // setup some user meta $nickid = $u->nickid; // store the user ip - $ct->setUserMeta($nickid, 'ip', $_SERVER["REMOTE_ADDR"]); + $ip = $_SERVER["REMOTE_ADDR"]; + if ($ip == "::1") $ip = "127.0.0.1"; // fix for konqueror & localhost + $ct->setUserMeta($nickid, 'ip', $ip); // store the admin flag $ct->setUserMeta($nickid, 'isadmin', $isadmin); - + // store the customized nick metadata + foreach($c->nickmeta as $k => $v) + $ct->setUserMeta($nickid, $k, $v); + // register the user (and his metadata) in the allready joined channel foreach( $u->channels as $id => $chan ) $ct->createNick($chan["recipient"], $u->nick, $u->nickid); foreach( $u->privmsg as $id => $pv ) $ct->createNick($pv["recipient"], $u->nick, $u->nickid); + + $this->forceWhoisReload($u->nick); // connect to the server $xml_reponse->addScript("pfc.handleResponse('connect', 'ok', '');"); Modified: trunk/src/commands/deop.class.php =================================================================== --- trunk/src/commands/deop.class.php 2006-09-30 19:39:55 UTC (rev 802) +++ trunk/src/commands/deop.class.php 2006-09-30 22:07:15 UTC (rev 803) @@ -27,6 +27,8 @@ $container =& $c->getContainerInstance(); $nicktodeopid = $container->getNickId($nicktodeop); $container->setUserMeta($nicktodeopid, 'isadmin', false); + + $this->forceWhoisReload($nicktodeop); } } Deleted: trunk/src/commands/getonlinenick.class.php =================================================================== --- trunk/src/commands/getonlinenick.class.php 2006-09-30 19:39:55 UTC (rev 802) +++ trunk/src/commands/getonlinenick.class.php 2006-09-30 22:07:15 UTC (rev 803) @@ -1,54 +0,0 @@ -<?php - -require_once(dirname(__FILE__)."/../pfccommand.class.php"); - -class pfcCommand_getonlinenick extends pfcCommand -{ - function run(&$xml_reponse, $p) - { - $clientid = $p["clientid"]; - $param = $p["param"]; - $sender = $p["sender"]; - $recipient = $p["recipient"]; - $recipientid = $p["recipientid"]; - - $c =& $this->c; - $container =& $c->getContainerInstance(); - - // get the cached nickname list - $nicklist_sid = "pfc_nicklist_".$c->getId()."_".$clientid."_".$recipientid; - $oldnicklist = isset($_SESSION[$nicklist_sid]) ? $_SESSION[$nicklist_sid] : array(); - - // get the real nickname list - $users = $container->getOnlineNick($recipient); - $nicklist = array(); - if (isset($users["nick"])) - foreach($users["nick"] as $n) - $nicklist[] = $n; - sort($nicklist); - - if ($oldnicklist != $nicklist) // check if the nickname list must be updated on the client side - { - $_SESSION[$nicklist_sid] = $nicklist; - - if ($c->debug) - { - $nicklist2 = implode(",",$nicklist); - pxlog("/getonlinenick (nicklist updated - nicklist=".$nicklist2.")", "chat", $c->getId()); - } - - // build and send the nickname list - $js = ""; - foreach ($nicklist as $nick) - { - $nickname = addslashes($nick); // must escape ' charactere for javascript string - $js .= "'".$nickname."',"; - } - $js = substr($js, 0, strlen($js)-1); // remove last ',' - $xml_reponse->addScript("pfc.updateNickList('".$recipientid."',Array(".$js."));"); - } - - } -} - -?> \ No newline at end of file Modified: trunk/src/commands/identify.class.php =================================================================== --- trunk/src/commands/identify.class.php 2006-09-30 19:39:55 UTC (rev 802) +++ trunk/src/commands/identify.class.php 2006-09-30 22:07:15 UTC (rev 803) @@ -57,9 +57,10 @@ if ($isadmin) { // ok the current user is an admin, just save the isadmin flag in the metadata - $container =& $c->getContainerInstance(); - $container->setUserMeta($u->nickid, 'isadmin', $isadmin); - + $ct =& $c->getContainerInstance(); + $ct->setUserMeta($u->nickid, 'isadmin', $isadmin); + $this->forceWhoisReload($u->nick); + $msg .= _pfc("Succesfully identified"); $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', '".$msg."');"); } Modified: trunk/src/commands/join.class.php =================================================================== --- trunk/src/commands/join.class.php 2006-09-30 19:39:55 UTC (rev 802) +++ trunk/src/commands/join.class.php 2006-09-30 22:07:15 UTC (rev 803) @@ -44,10 +44,6 @@ $u->channels[$chanid]["name"] = $channame; $u->saveInCache(); - // clear the cached nicknames list for the given channel - $nicklist_sid = "pfc_nicklist_".$c->getId()."_".$clientid."_".$chanid; - $_SESSION[$nicklist_sid] = NULL; - // show a join message $cmdp = $p; $cmdp["param"] = _pfc("%s joins %s",$u->nick, $channame); Modified: trunk/src/commands/nick.class.php =================================================================== --- trunk/src/commands/nick.class.php 2006-09-30 19:39:55 UTC (rev 802) +++ trunk/src/commands/nick.class.php 2006-09-30 22:07:15 UTC (rev 803) @@ -48,6 +48,7 @@ $container->changeNick($newnick, $oldnick); $u->nick = $newnick; $u->saveInCache(); + $this->forceWhoisReload($u->nick); // notify all the joined channels/privmsg $cmdp = $p; @@ -86,6 +87,7 @@ $u->nick = $newnick; $u->active = true; $u->saveInCache(); + $this->forceWhoisReload($u->nick); $xml_reponse->addScript("pfc.handleResponse('nick', 'connected', '".addslashes($newnick)."');"); Modified: trunk/src/commands/op.class.php =================================================================== --- trunk/src/commands/op.class.php 2006-09-30 19:39:55 UTC (rev 802) +++ trunk/src/commands/op.class.php 2006-09-30 22:07:15 UTC (rev 803) @@ -33,6 +33,8 @@ $container =& $c->getContainerInstance(); $nicktoopid = $container->getNickId($nicktoop); $container->setUserMeta($nicktoopid, 'isadmin', true); + + $this->forceWhoisReload($nicktoop); } } Modified: trunk/src/commands/privmsg.class.php =================================================================== --- trunk/src/commands/privmsg.class.php 2006-09-30 19:39:55 UTC (rev 802) +++ trunk/src/commands/privmsg.class.php 2006-09-30 22:07:15 UTC (rev 803) @@ -73,10 +73,6 @@ $u->privmsg[$pvrecipientid]["pvnickid"] = $pvnickid; $u->saveInCache(); - // clear the cached nicknames list for the given channel - $nicklist_sid = "pfc_nicklist_".$c->getId()."_".$clientid."_".$pvrecipientid; - $_SESSION[$nicklist_sid] = NULL; - // reset the message id indicator // i.e. be ready to re-get all last posted messages $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$pvrecipientid; Modified: trunk/src/commands/update.class.php =================================================================== --- trunk/src/commands/update.class.php 2006-09-30 19:39:55 UTC (rev 802) +++ trunk/src/commands/update.class.php 2006-09-30 22:07:15 UTC (rev 803) @@ -37,8 +... [truncated message content] |
From: <ke...@us...> - 2006-10-04 01:48:33
|
Revision: 801 http://svn.sourceforge.net/phpfreechat/?rev=801&view=rev Author: kerphi Date: 2006-09-30 12:35:32 -0700 (Sat, 30 Sep 2006) Log Message: ----------- Create a new theme (msn) in order to use the famfamfam them as default smileys Added Paths: ----------- trunk/themes/msn/ trunk/themes/msn/smileys/ Removed Paths: ------------- trunk/themes/default/smileys/ Copied: trunk/themes/msn/smileys (from rev 800, trunk/themes/default/smileys) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 01:46:58
|
Revision: 807 http://svn.sourceforge.net/phpfreechat/?rev=807&view=rev Author: kerphi Date: 2006-09-30 16:07:38 -0700 (Sat, 30 Sep 2006) Log Message: ----------- simplify the default smileys theme Modified Paths: -------------- trunk/themes/default/smileys/theme Modified: trunk/themes/default/smileys/theme =================================================================== --- trunk/themes/default/smileys/theme 2006-09-30 22:47:11 UTC (rev 806) +++ trunk/themes/default/smileys/theme 2006-09-30 23:07:38 UTC (rev 807) @@ -6,22 +6,22 @@ # These icons are under a Creative Commons Attribution 2.5 # License http://creativecommons.org/licenses/by/2.5/ -emoticon_smile.png :-) :) ^_^ :o) -emoticon_evilgrin.png >( >:-( >:( -arrow_right.png => -> --> ==> >>> -arrow_left.png <= <- <-- <== <<< -emoticon_surprised.png :S :s :-S :-s :/ :-/ :\ :-\ :o :O :-o :-O :!?!: :?!?: O_O o_o 0.0 O.O OO 00 o.o o-o O-O 0-0 -emoticon_grin.png 8) 8-) B) B-) :-D :D 9_9 ^o) ^-) -emoticon_unhappy.png :'( :"( :( :-( :o( :-< :-{ +( +-( -exclamation.png :-@ :@ (!) [!] :!: -lightbulb.png *) 0= -emoticon_happy.png :lol: -emoticon_waii.png :{} :-{} :razz: :} :-} -emoticon_wink.png ;-) ;) ;o) *_- o_- -_o -emoticon_tongue.png :P :-P :oP :p :-p :op ;P ;p ;-P ;-p ;op ;oP -weather_rain.png /// \\\ ||| :rain: :drizzle: -weather_snow.png :***: :snow: -weather_sun.png >O< :sun: -weather_clouds.png :""": :cloud: :clouds: -weather_cloudy.png :"O": :cloudly: -weather_lightning.png :$: +emoticon_smile.png :-) ^_^ :) +emoticon_evilgrin.png >( +arrow_right.png => -> --> ==> >>> +arrow_left.png <= <- <-- <== <<< +emoticon_surprised.png :S :s :-S :-s :/ :-/ +emoticon_grin.png :-D :D +emoticon_unhappy.png :'( :-( :o( :-< :( +exclamation.png :!: +lightbulb.png *) 0= +emoticon_happy.png :lol: +emoticon_waii.png :{} :-{} :razz: :} :-} +emoticon_wink.png ;-) ;o) ;) +emoticon_tongue.png :P :-P :-p :p +weather_rain.png /// \\\ ||| :rain: :drizzle: +weather_snow.png :***: +weather_sun.png >O< +weather_clouds.png :""": :cloud: :clouds: +weather_cloudy.png :"O": :cloudly: +weather_lightning.png :$: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 01:46:04
|
Revision: 799 http://svn.sourceforge.net/phpfreechat/?rev=799&view=rev Author: kerphi Date: 2006-09-27 09:33:38 -0700 (Wed, 27 Sep 2006) Log Message: ----------- [en] Bug fix: when leaving and joining the same channel the message history was lost. [15min] [fr] Bug fix: quitter et rejoindre le meme salon provoquait la perte de l'historique des messages de ce channel. [15min] Modified Paths: -------------- trunk/src/commands/leave.class.php Modified: trunk/src/commands/leave.class.php =================================================================== --- trunk/src/commands/leave.class.php 2006-09-27 16:30:22 UTC (rev 798) +++ trunk/src/commands/leave.class.php 2006-09-27 16:33:38 UTC (rev 799) @@ -71,8 +71,19 @@ } // remove the nickname from the channel/pv - $container =& $c->getContainerInstance(); - $container->removeNick($leave_recip, $u->nickid); + $ct =& $c->getContainerInstance(); + $ct->removeNick($leave_recip, $u->nickid); + + // reset the sessions indicators + $chanrecip = $leave_recip; + $chanid = $leave_id; + // reset the fromid flag + $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$chanid; + $from_id = $ct->getLastId($chanrecip)-$c->max_msg; + $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; + // reset the oldmsg flag + $oldmsg_sid = "pfc_oldmsg_".$c->getId()."_".$clientid."_".$chanid; + $_SESSION[$oldmsg_sid] = true; // return ok to the client // then the client will remove the channel' tab This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 01:43:25
|
Revision: 798 http://svn.sourceforge.net/phpfreechat/?rev=798&view=rev Author: kerphi Date: 2006-09-27 09:30:22 -0700 (Wed, 27 Sep 2006) Log Message: ----------- code cleaning Modified Paths: -------------- trunk/src/containers/file.class.php Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-09-26 21:02:14 UTC (rev 797) +++ trunk/src/containers/file.class.php 2006-09-27 16:30:22 UTC (rev 798) @@ -49,7 +49,7 @@ { $c =& $this->c; - $cfg = array(); + $cfg = pfcContainer::getDefaultConfig(); $cfg["chat_dir"] = ''; // will be generated from the other parameters into the init step $cfg["server_dir"] = ''; // will be generated from the other parameters into the init step return $cfg; @@ -57,7 +57,7 @@ function init() { - $errors = array(); + $errors = pfcContainer::init(); $c =& $this->c; // generate the container parameters from other config parameters This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-10-04 01:42:46
|
Revision: 804 http://svn.sourceforge.net/phpfreechat/?rev=804&view=rev Author: kerphi Date: 2006-09-30 15:19:38 -0700 (Sat, 30 Sep 2006) Log Message: ----------- add the msn theme demo Modified Paths: -------------- trunk/demo/index.php trunk/index.php Added Paths: ----------- trunk/demo/demo49_msn_smiley_theme.php Removed Paths: ------------- trunk/demo/demo11_famfamfam_smiley_theme.php Deleted: trunk/demo/demo11_famfamfam_smiley_theme.php =================================================================== --- trunk/demo/demo11_famfamfam_smiley_theme.php 2006-09-30 22:07:15 UTC (rev 803) +++ trunk/demo/demo11_famfamfam_smiley_theme.php 2006-09-30 22:19:38 UTC (rev 804) @@ -1,38 +0,0 @@ -<?php - -require_once dirname(__FILE__)."/../src/phpfreechat.class.php"; - -$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat -$params["title"] = "A chat with a customized smiley theme (famfamfam theme)"; -$params["nick"] = "guest"; // setup the intitial nickname -$params["theme"] = "famfamfam"; -$chat = new phpFreeChat( $params ); - -?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html> - <head> - <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - <title>phpFreeChat demo</title> - - <?php $chat->printJavascript(); ?> - <?php $chat->printStyle(); ?> - - </head> - - <body> - <?php $chat->printChat(); ?> - -<?php - // print the current file - echo "<h2>The source code</h2>"; - $filename = __FILE__; - echo "<p><code>".$filename."</code></p>"; - echo "<pre style=\"margin: 0 50px 0 50px; padding: 10px; background-color: #DDD;\">"; - $content = file_get_contents($filename); - echo htmlentities($content); - echo "</pre>"; -?> - - </body> -</html> \ No newline at end of file Added: trunk/demo/demo49_msn_smiley_theme.php =================================================================== --- trunk/demo/demo49_msn_smiley_theme.php (rev 0) +++ trunk/demo/demo49_msn_smiley_theme.php 2006-09-30 22:19:38 UTC (rev 804) @@ -0,0 +1,38 @@ +<?php + +require_once dirname(__FILE__)."/../src/phpfreechat.class.php"; + +$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat +$params["title"] = "A chat with a customized smiley theme (famfamfam theme)"; +$params["nick"] = "guest".rand(1,1000); // setup the intitial nickname +$params["theme"] = "msn"; +$chat = new phpFreeChat( $params ); + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <title>phpFreeChat demo</title> + + <?php $chat->printJavascript(); ?> + <?php $chat->printStyle(); ?> + + </head> + + <body> + <?php $chat->printChat(); ?> + +<?php + // print the current file + echo "<h2>The source code</h2>"; + $filename = __FILE__; + echo "<p><code>".$filename."</code></p>"; + echo "<pre style=\"margin: 0 50px 0 50px; padding: 10px; background-color: #DDD;\">"; + $content = file_get_contents($filename); + echo htmlentities($content); + echo "</pre>"; +?> + + </body> +</html> \ No newline at end of file Modified: trunk/demo/index.php =================================================================== --- trunk/demo/index.php 2006-09-30 22:07:15 UTC (rev 803) +++ trunk/demo/index.php 2006-09-30 22:19:38 UTC (rev 804) @@ -80,13 +80,13 @@ <h2 id="demo-themes">Themes</h2> <ul> - <li><a href="demo11_famfamfam_smiley_theme.php">demo11 - A chat with a customized smiley theme (famfamfam theme)</a></li> <li><a href="demo12_phoenity_smiley_theme.php">demo12 - A chat with a customized smiley theme (phoenity theme)</a></li> <li><a href="demo17_cerutti_smiley_theme.php">demo17 - A chat with a customized smiley theme (cerutti theme)</a></li> <li><a href="demo18_phpbb2_smiley_theme.php">demo18 - A chat with a customized smiley theme (phpbb2 theme)</a></li> <li><a href="demo28_blune_theme.php">demo28 - use a customized theme (blune theme)</a></li> <li><a href="demo28_mini_blune_theme.php">demo28 - use a customized theme (blune theme) - mini</a></li> <li><a href="demo44_green_theme.php">demo44 - use a customized theme (green)</a></li> + <li><a href="demo49_msn_smiley_theme.php">demo49 - A chat with a customized smiley theme (msn theme)</a></li> </ul> <h2 id="demo-translations">Translations</h2> Modified: trunk/index.php =================================================================== --- trunk/index.php 2006-09-30 22:07:15 UTC (rev 803) +++ trunk/index.php 2006-09-30 22:19:38 UTC (rev 804) @@ -3,7 +3,7 @@ require_once dirname(__FILE__)."/src/phpfreechat.class.php"; $params = array(); $params["title"] = "Quick chat"; -$params["nick"] = "guest".rand(1,10); // setup the intitial nickname +$params["nick"] = "guest".rand(1,1000); // setup the intitial nickname $params["isadmin"] = true; // just for debug ;) $params["serverid"] = md5(__FILE__); // calculate a unique id for this chat $chat = new phpFreeChat( $params ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-26 21:02:54
|
Revision: 797 http://svn.sourceforge.net/phpfreechat/?rev=797&view=rev Author: kerphi Date: 2006-09-26 14:02:14 -0700 (Tue, 26 Sep 2006) Log Message: ----------- update webinstall script for the new command line generator stuff Added Paths: ----------- trunk/contrib/installer.beta-5.1/ trunk/contrib/installer.beta-5.1/CHANGELOG trunk/contrib/installer.beta-5.1/README trunk/contrib/installer.beta-5.1/TODO trunk/contrib/installer.beta-5.1/createinstaller/ trunk/contrib/installer.beta-5.1/createinstaller/data/ trunk/contrib/installer.beta-5.1/createinstaller/data/favicon.ico trunk/contrib/installer.beta-5.1/createinstaller/data/installer.css trunk/contrib/installer.beta-5.1/createinstaller/data/installer.jpg trunk/contrib/installer.beta-5.1/createinstaller/data/license.html trunk/contrib/installer.beta-5.1/createinstaller/data/license.inc trunk/contrib/installer.beta-5.1/createinstaller/data/precheck.inc trunk/contrib/installer.beta-5.1/createinstaller/data/start.inc trunk/contrib/installer.beta-5.1/createinstaller/data/unknown.gif trunk/contrib/installer.beta-5.1/createinstaller/page.appname.php trunk/contrib/installer.beta-5.1/createinstaller/page.build.php trunk/contrib/installer.beta-5.1/createinstaller/page.files1.php trunk/contrib/installer.beta-5.1/createinstaller/page.files2.php trunk/contrib/installer.beta-5.1/createinstaller/page.pages.php trunk/contrib/installer.beta-5.1/createinstaller/page.start.php trunk/contrib/installer.beta-5.1/createinstaller.php trunk/contrib/installer.beta-5.1/docs/ trunk/contrib/installer.beta-5.1/docs/classtrees_webinstall.html trunk/contrib/installer.beta-5.1/docs/elementindex.html trunk/contrib/installer.beta-5.1/docs/elementindex_webinstall.html trunk/contrib/installer.beta-5.1/docs/errors.html trunk/contrib/installer.beta-5.1/docs/index.html trunk/contrib/installer.beta-5.1/docs/li_webinstall.html trunk/contrib/installer.beta-5.1/docs/media/ trunk/contrib/installer.beta-5.1/docs/media/background.png trunk/contrib/installer.beta-5.1/docs/media/empty.png trunk/contrib/installer.beta-5.1/docs/media/logo.png trunk/contrib/installer.beta-5.1/docs/media/style.css trunk/contrib/installer.beta-5.1/docs/todolist.html trunk/contrib/installer.beta-5.1/docs/webinstall/ trunk/contrib/installer.beta-5.1/docs/webinstall/_engine_inc_php.html trunk/contrib/installer.beta-5.1/docs/webinstall/phpInstaller.html trunk/contrib/installer.beta-5.1/engine.inc.php trunk/contrib/installer.beta-5.1/engine_data/ trunk/contrib/installer.beta-5.1/engine_data/archive_tar.php trunk/contrib/installer.beta-5.1/engine_data/extract.bz.inc trunk/contrib/installer.beta-5.1/engine_data/extract.tar.inc trunk/contrib/installer.beta-5.1/engine_data/extract.tgz.inc trunk/contrib/installer.beta-5.1/engine_data/extract.zip.inc trunk/contrib/installer.beta-5.1/engine_data/installer_data.inc trunk/contrib/installer.beta-5.1/engine_data/step_aboutto.inc trunk/contrib/installer.beta-5.1/engine_data/step_finished.inc trunk/contrib/installer.beta-5.1/engine_data/step_installer.inc trunk/contrib/installer.beta-5.1/engine_data/step_path.inc trunk/contrib/installer.beta-5.1/engine_data/write.file.inc trunk/contrib/installer.beta-5.1/engine_data/write.ftp.inc trunk/contrib/installer.beta-5.1/engine_data/write.sftp.inc trunk/contrib/installer.beta-5.1/examples/ trunk/contrib/installer.beta-5.1/examples/customoutput.php trunk/contrib/installer.beta-5.1/examples/package.php trunk/contrib/installer.beta-5.1/genphpfromfile.php Removed Paths: ------------- trunk/contrib/pfcInstaller/ trunk/contrib/phpinstaller/ Added: trunk/contrib/installer.beta-5.1/CHANGELOG =================================================================== --- trunk/contrib/installer.beta-5.1/CHANGELOG (rev 0) +++ trunk/contrib/installer.beta-5.1/CHANGELOG 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,20 @@ +ISO 8601 Formatted +Newest at top + +Key + + Addition + - Removed + # Changed + +# 2006-09-24 Various bugs that threw an error of E_NOTICE +# 2006-09-24 Fixed spelling error of "engene_data" to "engine_data" (the i) ++ 2006-09-22 Added support for generating .tar.gz files +# 2006-04-18 Fixed the 'ignore' bug on generator interface ++ 2006-04-18 Per-page button settings ++ 2006-04-18 Auto-scrolling on message pane ++ 2006-03-10 function updatepb_unknown ++ 2006-03-08 Download Functionality ++ 2005-08-23 Function message ++ 2005-08-23 Function addMetaFile +# 2005-08-23 Fixed bug (sf.net 1258143) "Fatal error: Call to undefined function: updatep" ++ 2005-08-16 Installer page: 'Finished' \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/README =================================================================== --- trunk/contrib/installer.beta-5.1/README (rev 0) +++ trunk/contrib/installer.beta-5.1/README 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,21 @@ +This package will help you create your own web installer. +The PHP script installer can unpack a web-based installer +and the files to install and install it with one file. To +make a web installer you will need to open createinstaller.php +in your browser. Click next, than enter the path of the script. +Click next, next, next, than see it compile. Go open the file +install.php it created in your browser than follow than test it +in a new path-- see if it works. Distribute it, or customise it +to change the look. Than become a developer for the PHP script +installer project and help me develop a script that also +(here's my todo list) configures your newly installed script, +popluate a database, download updates from the web, or install +from a file. + + +File list Description +/createinstaller Automated installer creator interface + precheck.inc First page in installer, default pre-install check + 2.txt Next user-page in compiled installer, License page +/engine_data Installer Creator Resources, templates +/createinstaller Directory: Installer engene data \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/TODO =================================================================== --- trunk/contrib/installer.beta-5.1/TODO (rev 0) +++ trunk/contrib/installer.beta-5.1/TODO 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,5 @@ +* Install from a file +* Download from an FTP source +* Run SQL code into a database +* Post-Install Configuration capabilites +* install to FTP path Added: trunk/contrib/installer.beta-5.1/createinstaller/data/favicon.ico =================================================================== (Binary files differ) Property changes on: trunk/contrib/installer.beta-5.1/createinstaller/data/favicon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/contrib/installer.beta-5.1/createinstaller/data/installer.css =================================================================== --- trunk/contrib/installer.beta-5.1/createinstaller/data/installer.css (rev 0) +++ trunk/contrib/installer.beta-5.1/createinstaller/data/installer.css 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,313 @@ +body { + margin: 0px; + padding: 0px; + color : #333; + background-color : #FFF; + font-size : 11px; + font-family : Arial, Helvetica, sans-serif; +} + +#wrapper { + border: 0px; + margin: 0px; + margin-left: auto; + margin-right: auto; + padding: 0px; +} + +#header { + background-color: #FFF; + background-position: right top; + border-bottom: 4px solid #80B5D7; +} + +#headertext { + position: relative; + width: 100%; + background: url("?file=hb") #30569D no-repeat; + background-position: top right; + margin: 0px; + padding: 0px; + height: 35px; + color: white; + font-size: 30px; + font-family: FrancineHmk; +} + +.version { + font-size: 10px; + color: lightgray; +} + +#stepbar { + background-color: #F1F3F5; + width: 170px; + font-size: 11px; + float: left; + text-align: left; +} + +#step { + background: url("?file=logoimage") no-repeat; + font-size: 30px; + font-weight: bold; + text-align: left; + color: #666666; + padding: 10px 0px 20px 80px; + white-space: nowrap; + position: relative; + float: left; +} + +.step-on { + color: #BBDDFF; + background: #30559C; + font-weight: bold; + font-size: 13px; + padding: 10px; + border: 1px solid #cccccc; + margin-bottom: 2px; +} + +.step-off { + font-size: 13px; + color: #999999; + font-weight: bold; + padding: 10px; + border: 1px solid #cccccc; + margin-bottom: 2px; +} + +#right { + float: right; + width: 560px; + border-left: 1px solid #cccccc; + padding-left: 10px; + +} + +#break { + height: 20px; +} + +.licensetext { + text-align: left; +} + +.license { + padding: 0px; + width: 535px; + height: 325px; +} + +.description { + padding: 0px; + width: 535px; + height: 325px; +} + +.license-form { + float: left; +} + + +.install { + margin-left: auto; + margin-right: auto; + margin-top: 3em; + margin-bottom: 3em; + padding: 10px; + border: 1px solid #cccccc; + width: 750px; + background: #F1F3F5; +}/* +.install { + margin-left: auto; + margin-right: auto; + margin-top: 3em; + margin-bottom: 3em; + padding: 10px; + border: 1px solid #cccccc; + background: #F1F3F5; + overflow:auto; + position:absolute; + left:20px; + right:20px; + bottom:20px; + top:45px; +} +*/ + +.install h1 { + font-size: 18px; + font-weight: bold; + color: #30557C; + padding: 4px 0px 4px 0px; + text-align: center; + border-bottom: 1px solid #cccccc; + margin-bottom: 10px; + +} + +.install-form { + position: relative; + text-align: left; + margin-top:1em; +} + +.install-form table, .install-form input { + width: 100%; +} + +.install-text { + position: relative; + text-align: left; +} + +.form-block { + border: 1px solid #cccccc; + background: #E9ECEF; + padding-top: 5px; + padding-left: 5px; + padding-bottom: 5px; + padding-right: 5px; +} + +.left { + position: relative; + text-align: left; + float: left; + width: 50%; +} + +.right { + position: relative; + text-align: left; + float: right; + width: 70%; +} + +.far-right { + position: relative; + text-align: right; + float: right; +} + +.far-left { + position: relative; + text-align: left; + float: left; +} + +.clr { + clear:both; + } + +.ctr { + text-align: center; + vertical-align: middle; +} + +.content { + text-align: left; +} + +.button { + border : solid 1px #999; + background: #C9CcCF; + color : #666666; + font-weight : bold; + font-size : 11px; + padding: 4px; + cursor: pointer; +} + +table.content { + width: 80%; +} + +table.content td { + color : #333333; + font-size: 11px; + width: 50%; +} + + +table.content2 td { + color : #333333; + font-size: 11px; +} + +.toggle { + font-weight: bold; +} + +a { + color : #FF9900; + text-decoration : none; +} +a:hover { + color : #999999; + text-decoration : underline; +} +a:active { + color : #FF6600; + text-decoration : underline; +} + +.inputbox { + color: blue; + font-family: Arial, Helvetica, sans-serif; + z-index: -3; + font-size: 11px; +} + +.small { + color : #333; + font-size : 10px; +} + +.error { + color : #cc0000; + font-size : 12px; + font-weight : bold; + padding-top: 10px; + padding-bottom: 10px; +} + + +select.options, input.options { + font-size: 8pt; + border: 1px solid #999; +} + +form { + margin: 0px 0px 0px 0px; +} + + +.dottedline { + border-bottom: 1px solid #333; +} + +.installheader { + color : #FFF; + font-size : 24px; +} + +textarea { + color : #0000dd; + font-family : Arial; + font-size : 11px; + border: 1px; +} + +#license-tabed a{ + border: 1px solid #cccccc; + border-bottom: none; + background: #E9ECEF; + padding: 3px 3px 1px 3px; +} +#license-tabed{ + text-align: left; +} Added: trunk/contrib/installer.beta-5.1/createinstaller/data/installer.jpg =================================================================== (Binary files differ) Property changes on: trunk/contrib/installer.beta-5.1/createinstaller/data/installer.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/contrib/installer.beta-5.1/createinstaller/data/license.html =================================================================== --- trunk/contrib/installer.beta-5.1/createinstaller/data/license.html (rev 0) +++ trunk/contrib/installer.beta-5.1/createinstaller/data/license.html 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,364 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +<title>Untitled Document</title> +<style type="text/css"> +<!-- +body { + font-family: arial, helvetica, sans serif; + font-size: 11px; + background: #E9ECEF; +} + +p { + font-family: arial, helvetica, sans serif; + font-size: 11px; + text-align:justify; +} + +h2 { + font-family: arial, helvetica, sans serif; + font-size: 13px; + font-weight: bold; +} + +h3 { + font-family: arial, helvetica, sans serif; + font-size: 12px; + font-weight: bold; +} + +h4 { + font-family: arial, helvetica, sans serif; + font-size: 11px; + font-weight: bold; +} + +li { + font-family: arial, helvetica, sans serif; + font-size: 11px; + text-align:justify; +} + +pre { + font-size: 11px; + text-align:justify; +} +--> +</style> +</head> +<body> +<h2>Table of Contents</h2> +<ul> + <li><a href="#SEC1" name="TOC1" id="TOC1">GNU GENERAL PUBLIC LICENSE</a> + <ul> + <li><a href="#SEC2" name="TOC2" id="TOC2">Preamble</a> </li> + <li><a href="#SEC3" name="TOC3" id="TOC3">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a> </li> + <li><a href="#SEC4" name="TOC4" id="TOC4">How to Apply These Terms to Your New Programs</a> </li> + </ul> + </li> +</ul> +<p></p> +<hr /> +<h2><a href="#TOC1" name="SEC1" id="SEC1">GNU GENERAL PUBLIC LICENSE</a></h2> +<p> Version 2, June 1991 </p> +<pre> +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +</pre> +<h2><a href="#TOC2" name="SEC2" id="SEC2">Preamble</a></h2> +<p> The licenses for most software are designed to take away your freedom to share and change +it. By contrast, the GNU General Public License is intended to guarantee +your freedom to share and change free software--to make sure the software is free for all its +users. This General Public License applies to most of the Free Software Foundation's software +and to any other program whose authors commit to using it. (Some other Free Software +Foundation software is covered by the GNU Library General Public License instead.) You can +apply it to your programs, too. </p> +<p> When we speak of free software, we are referring to freedom, not price. Our General +Public Licenses are designed to make sure that you have the freedom to distribute copies +of free software (and charge for this service if you wish), that you receive source code +or can get it if you want it, that you can change the software or use pieces of it in new +free programs; and that you know you can do these things. </p> +<p> To protect your rights, we need to make restrictions that forbid anyone to deny you +these rights or to ask you to surrender the rights. These restrictions translate to certain +responsibilities for you if you distribute copies of the software, or if you modify it. </p> +<p> For example, if you distribute copies of such a program, whether gratis or for a fee, +you must give the recipients all the rights that you have. You must make sure that they, +too, receive or can get the source code. And you must show them these terms so they know +their rights. </p> +<p> We protect your rights with two steps: (1) copyright the software, and (2) offer you +this license which gives you legal permission to copy, distribute and/or modify the +software.</p> +<p> Also, for each author's protection and ours, we want to make certain that everyone +understands that there is no warranty for this free software. If the software is modified +by someone else and passed on, we want its recipients to know that what they have is not +the original, so that any problems introduced by others will not reflect on the original +authors' reputations. </p> +<p> Finally, any free program is threatened constantly by software patents. We wish to +avoid the danger that redistributors of a free program will individually obtain patent +licenses, in effect making the program proprietary. To prevent this, we have made it clear +that any patent must be licensed for everyone's free use or not licensed at all. </p> +<p> The precise terms and conditions for copying, distribution and modification follow. </p> +<h2><a href="#TOC3" name="SEC3" id="SEC3">TERMS AND CONDITIONS FOR COPYING, +DISTRIBUTION AND MODIFICATION</a></h2> +<p> <strong>0.</strong> This License applies to any program or other work which contains a +notice placed by the copyright holder saying it may be distributed under the terms of this +General Public License. The "Program", below, refers to any such program or work, and a +"work based on the Program" means either the Program or any derivative work under copyright +law: that is to say, a work containing the Program or a portion of it, either +verbatim or with modifications and/or translated into another language. (Hereinafter, +translation is included without limitation in the term "modification".) Each licensee is +addressed as "you".</p> +<p> Activities other than copying, distribution and modification are not covered by this +License; they are outside its scope. The act of running the Program is not restricted, and +the output from the Program is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). Whether that is true depends +on what the Program does.</p> +<p> <strong>1.</strong> You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously and appropriately +publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any warranty; and give any +other recipients of the Program a copy of this License along with the Program.</p> +<p> You may charge a fee for the physical act of transferring a copy, and you may at your +option offer warranty protection in exchange for a fee.</p> +<p> <strong>2.</strong> You may modify your copy or copies of the Program or any portion of +it, thus forming a work based on the Program, and copy and distribute such modifications or +work under the terms of Section 1 above, provided that you also meet all of these +conditions:</p> +<p></p> +<ul> + <li><strong>a)</strong> You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + <p> + </p> + </li> + <li><strong>b)</strong> You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any part thereof, to be + licensed as a whole at no charge to all third parties under the terms of this License. + <p> + </p> + </li> + <li><strong>c)</strong> If the modified program normally reads commands interactively + when run, you must cause it, when started running for such interactive use in the most + ordinary way, to print or display an announcement including an appropriate copyright + notice and a notice that there is no warranty (or else, saying that you provide a warranty) + and that users may redistribute the program under these conditions, and telling the user + how to view a copy of this License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on the Program is not + required to print an announcement.) +</li> +</ul> +<p> +These requirements apply to the modified work as a whole. If identifiable sections of that +work are not derived from the Program, and can be reasonably considered independent and +separate works in themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you distribute the same +sections as part of a whole which is a work based on the Program, the distribution of the +whole +must be on the terms of this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it.</p> +<p> Thus, it is not the intent of this section to claim rights or contest your rights to +work written entirely by you; rather, the intent is to exercise the right to control the +distribution of derivative or collective works based on the Program. +</p> +<p> In addition, mere aggregation of another work not based on the Program with the +Program (or with a work based on the Program) on a volume of a storage or distribution +medium does not bring the other work under the scope of this License. +</p> +<p> <strong>3.</strong> You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of Sections 1 and 2 +above provided that you also do one of the following: + <!-- we use this doubled UL to get the sub-sections indented, --> + <!-- while making the bullets as unobvious as possible. --> +</p> +<ul> + <li><strong>a)</strong> Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange; or, + <p> + </p> + </li> + <li><strong>b)</strong> Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your cost of physically + performing source distribution, a complete machine-readable copy of the corresponding + source code, to be distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + <p> + </p> + </li> + <li><strong>c)</strong> Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is allowed only for + noncommercial distribution and only if you received the program in object code or + executable form with such an offer, in accord with Subsection b above.) +</li> +</ul> +<p>The source code for a work means the preferred form of the work for making modifications +to it. For an executable work, complete source code means all the source code for all +modules it contains, plus any associated interface definition files, plus the scripts used +to control compilation and installation of the executable. However, as a special exception, +the source code distributed need not include anything that is normally distributed (in +either source or binary form) with the major components (compiler, kernel, and so on) of +the operating system on which the executable runs, unless that component itself accompanies +the executable.</p> +<p> If distribution of executable or object code is made by offering access to copy from a +designated place, then offering equivalent access to copy the source code from the same +place counts as distribution of the source code, even though third parties are not compelled +to copy the source along with the object code. +</p> +<p> <strong>4.</strong> You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt otherwise to copy, modify, +sublicense or distribute the Program is void, and will automatically terminate your rights +under this License. However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such parties remain in full +compliance. +</p> +<p> <strong>5.</strong> You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or distribute the Program +or its derivative works. These actions are prohibited by law if you do not accept this +License. Therefore, by modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and all its terms and +conditions for copying, distributing or modifying the Program or works based on it. +</p> +<p> <strong>6.</strong> Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original licensor to copy, +distribute or modify the Program subject to these terms and conditions. You may not impose +any further restrictions on the recipients' exercise of the rights granted herein. You are +not responsible for enforcing compliance by third parties to this License. +</p> +<p> <strong>7.</strong> If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), conditions are imposed +on you (whether by court order, agreement or otherwise) that contradict the conditions of +this License, they do not excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this License and any +other pertinent obligations, then as a consequence you may not distribute the Program at +all. For example, if a patent license would not permit royalty-free redistribution of the +Program by all those who receive copies directly or indirectly through you, then the only +way you could satisfy both it and this License would be to refrain entirely from distribution +of the Program. +</p> +<p> If any portion of this section is held invalid or unenforceable under any particular +circumstance, the balance of the section is intended to apply and the section as a whole +is intended to apply in other circumstances. +</p> +<p> It is not the purpose of this section to induce you to infringe any patents or other +property right claims or to contest validity of any such claims; this section has the sole +purpose of protecting the integrity of the free software distribution system, which is +implemented by public license practices. Many people have made generous contributions to +the wide range of software distributed through that system in reliance on consistent +application of that system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot impose that choice. +</p> +<p> This section is intended to make thoroughly clear what is believed to be a consequence +of the rest of this License. +</p> +<p> <strong>8.</strong> If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the original copyright +holder who places the Program under this License may add an explicit geographical +distribution limitation excluding those countries, so that distribution is permitted +only in or among countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. +</p> +<p> <strong>9.</strong> The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will be similar in spirit +to the present version, but may differ in detail to address new problems or concerns. +</p> +<p> Each version is given a distinguishing version number. If the Program specifies a +version number of this License which applies to it and "any later version", you have the +option of following the terms and conditions either of that version or of any later version +published by the Free Software Foundation. If the Program does not specify a version number +of this License, you may choose any version ever published by the Free Software Foundation. +</p> +<p> <strong>10.</strong> If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author to ask for +permission. For software which is copyrighted by the Free Software Foundation, write +to the Free Software Foundation; we sometimes make exceptions for this. Our decision +will be guided by the two goals of preserving the free status of all derivatives of +our free software and of promoting the sharing and reuse of software generally. +</p> +<p><strong>NO WARRANTY</strong><a id="w"> </a></p> +<p> <strong>11.</strong> BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" +WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE +RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +</p> +<p> <strong>12.</strong> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, +SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE +THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE +OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH +ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +</p> +<p> +</p> +<h2>END OF TERMS AND CONDITIONS</h2> +<h2><a href="#TOC4" name="SEC4" id="SEC4">How to Apply These Terms to Your New +Programs</a></h2> +<p> If you develop a new program, and you want it to be of the greatest possible use to +the public, the best way to achieve this is to make it free software which everyone can +redistribute and change under these terms. </p> +<p> To do so, attach the following notices to the program. It is safest to attach them +to the start of each source file to most effectively convey the exclusion of warranty; +and each file should have at least the "copyright" line and a pointer to where the full +notice is found. </p> +<pre> +<var>one line to give the program's name and an idea of what it does.</var> +Copyright (C) <var>yyyy</var> <var>name of author</var> + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +</pre> +<p> Also add information on how to contact you by electronic and paper mail. </p> +<p> If the program is interactive, make it output a short notice like this when it starts +in an interactive mode: </p> +<pre> +Gnomovision version 69, Copyright (C) <var>year</var> <var>name of author</var> +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details +type `show w'. This is free software, and you are welcome +to redistribute it under certain conditions; type `show c' +for details. +</pre> +<p> The hypothetical commands <samp>`show w'</samp> and <samp>`show c'</samp> should show +the appropriate parts of the General Public License. Of course, the commands you use may +be called something other than <samp>`show w'</samp> and <samp>`show c'</samp>; they could +even be mouse-clicks or menu items--whatever suits your program. </p> +<p> You should also get your employer (if you work as a programmer) or your school, if any, +to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the +names: </p> +<pre> +Yoyodyne, Inc., hereby disclaims all copyright +interest in the program `Gnomovision' +(which makes passes at compilers) written +by James Hacker. + +<var>signature of Ty Coon</var>, 1 April 1989 +Ty Coon, President of Vice +</pre> +<p> This General Public License does not permit incorporating your program into proprietary +programs. If your program is a subroutine library, you may consider it more useful to permit +linking proprietary applications with the library. If this is what you want to do, use the +<a href="/licenses/l">GNU Lesser General Public License</a> instead of this License. +</p> +</body> +</html> \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/createinstaller/data/license.inc =================================================================== --- trunk/contrib/installer.beta-5.1/createinstaller/data/license.inc (rev 0) +++ trunk/contrib/installer.beta-5.1/createinstaller/data/license.inc 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,27 @@ +<?php +echo <<<HTML +<h2> GNU/GPL License: </h2> +<div class="licensetext"> +<a href="about:blank">PROGRAM</a> +is Free Software released under the GNU/GPL License. +<div class="error"> *** To continue installing PROGRAM you must check the box under the license *** </div> +</div> +<div class="clr"> </div> +<div class="license-form" id="license-tabed"> +For +<a href="?file=license#w" onclick="document.getElementById('license-frame').src=this.href;return false;">End-users</a> +<a href="?file=license#SEC2" onclick="document.getElementById('license-frame').src=this.href;return false;">Developers</a> +<a href="?file=license#SEC3" onclick="document.getElementById('license-frame').src=this.href;return false;">Distributers</a> +<div class="form-block" style="padding: 0px;"> +<iframe id="license-frame" src="$HTTP_FILE?file=license" class="license" frameborder="0" scrolling="auto"></iframe> +</div> +</div> +<div class="clr"></div> +<div class="ctr"><span class="ctr"> +<input name="agreecheck" id="agreecheck" class="inputbox" onclick="agreesubmit(this)" type="checkbox" value="true" /> +<label for="agreecheck">I Accept the GPL License</label> +</span></div> +<div class="clr"></div> +</div> +HTML; +?> \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/createinstaller/data/precheck.inc =================================================================== --- trunk/contrib/installer.beta-5.1/createinstaller/data/precheck.inc (rev 0) +++ trunk/contrib/installer.beta-5.1/createinstaller/data/precheck.inc 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,54 @@ +<?php +/** Print text displaying status + * + * @param int $type + 1: Abailable/Unavailable + * + 2: Pass/Fail + * @param bool|int $value + */ +function status($value=null,$type) +{ + switch($type) + { + case null: $value=$type;break; + case 'yes': return $value?'<span style="color:green;">Yes</span>':'<span style="color:red;">No</span>'; + case 'available':return $value?'<span style="color:green;">Available</span>':'<span style="color:red;">Unavailable</span>'; + case 'writeable': return $value?'<span style="color:green;">Writeable</span>':'<span style="color:red;">Not Writeable</span>'; + case 'on': return $value?'<span style="color:green;">ON</span>':'<span style="color:red;">OFF</span>'; + case 'support': return $value?'<span style="color:green;">Supported</span>':'<span style="color:red;">Unsupported</span>'; + case 'true': return $value?'<span style="color:green;">True</span>':'<span style="color:red;">False</span>'; + default: return 'ERR'; + } +} + +//// edit this +$a = array( + 'file_get_contents'=>status(function_exists('file_get_contents'),'available'), + 'unserialize'=>status(function_exists('unserialize'),'available'), + 'GZ Compression'=>status(function_exists('gzuncompress'),'available') +); + + +$rows = ''; +foreach ($a as $n=>$v){ + $rows.="<tr><td class=\"item\">$n</td><td align=\"left\"><b>$v</b></td></tr>"; +} + +echo <<<HTML +<div class="install-text"> +These settings are recommended for PHP in order to ensure full +compatibility with PROGRAM. +<br /> +However, it may still operate if your settings do not quite match the recommended +(In this case, the program will only offer, and thus say, 'Limited Functionality'). +<div class="clr"></div> +</div> +<div class="install-form"> +<div class="form-block"> +<table class="content"> +$rows +</table> +</div> +<div class="clr"></div> +</div> +HTML; +?> \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/createinstaller/data/start.inc =================================================================== --- trunk/contrib/installer.beta-5.1/createinstaller/data/start.inc (rev 0) +++ trunk/contrib/installer.beta-5.1/createinstaller/data/start.inc 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1 @@ +Welcome to APPNAME \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/createinstaller/data/unknown.gif =================================================================== (Binary files differ) Property changes on: trunk/contrib/installer.beta-5.1/createinstaller/data/unknown.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/contrib/installer.beta-5.1/createinstaller/page.appname.php =================================================================== --- trunk/contrib/installer.beta-5.1/createinstaller/page.appname.php (rev 0) +++ trunk/contrib/installer.beta-5.1/createinstaller/page.appname.php 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,8 @@ +<?php +$uses[] = 'appname'; +?> +<div><h2>Applactation Name</h2></div> +<div>What is the name of your applactation?</div> +<div class="margin"> + <input type="text" style="width:30em;" name="appname" id="appname" value="<?php echo gpv('appname'); ?>" /> +</div> \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/createinstaller/page.build.php =================================================================== --- trunk/contrib/installer.beta-5.1/createinstaller/page.build.php (rev 0) +++ trunk/contrib/installer.beta-5.1/createinstaller/page.build.php 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,73 @@ +<?php +$phpi = new phpInstaller(); +$dataDir = realpath(dirname(__FILE__).'/../engene_data'); +$phpi->dataDir($dataDir); +$phpi->appName = gpv('appname'); +$phpi->appVersion = gpv('appver'); +$phpi->compress = true; +$phpi->ignore[] = '/installer.php'; +$phpi->ignore[] = '/phpinstaller/'; +$phpi->ignore[] = 'tests'; +$phpi->ignore[] = 'hi2'; +foreach(explode("\n",gpv('ignore')) as $v){ + if($v=trim($v)) $phpi->ignore[] = $v; +} + +$phpi->messageCallback = 'message'; +function message($message,$state=null){ + if($state==2) echo '<div style="color:grey;">'; + else echo '<div>'; + + if($state) echo htmlspecialchars(str_pad($message,74,'.')).'....'; + else echo htmlspecialchars($message); + + switch ($state) { + case 1:echo '[<span style="color:red;">failed</span>]';break; + case 2:echo '[<span style="font-weight:bold;">ignore</span>]';break; + case 3:echo '[<span style="color:green;"> file </span>]';break; + case 4:echo '[<span style="color:green;"> dir </span>]';break; + case 5:echo '[<span style="color:green;"> done </span>]';break; + } + echo '</div>'; +} + +echo '<div style="height:30em;overflow:auto;border:inset 1px grey;"><pre>'; +//template files + if(!$phpi->addMetaFile('ss','createinstaller/data/installer.css','text/css',$replace)){ + die('Could not add main.css to installer.<br />'); + } + +foreach (gpv('packages') as $v){ + var_export($v); + if(isset($v['url']) && isset($v['path'])){ + //$phpi->generatedata($v['path']); + $phpi->addPathDownload($v['url'],$v['to']); + }else if(isset($v['url'])){ + $phpi->addPathDownload($v['url'],$v['to'],$v['type']); + }else if(isset($v['path'])){ + $phpi->addPath($v['path'],$v['to']); + } +} +//$phpi->addPath(gpv('rootpath')); +$phpi->addPage('Pre-installation Check',file_get_contents('createinstaller/data/precheck.inc')); + +//license page +if(gpv('step_license')){ + if($phpi->addMetaFile('license','createinstaller/data/license.html','text/html')){ + $phpi->addPage('License',file_get_contents('createinstaller/data/license.inc'),array(),array('disabled'=>true)); + }else{ + $phpi->message('The license could not be added. Check the file '.$lPath.'.'); + } +} +if(!$phpi->addMetaFile('unknown','createinstaller/data/unknown.gif','image/gif')){ + $phpi->message('The license could not be added. Check the file '.$lPath.'.'); +} +if(!$phpi->addMetaFile('hb','createinstaller/data/installer.jpg','image/jpeg')){ + $phpi->message('The license could not be added. Check the file '.$lPath.'.'); +} + +$phpi->addInstallerPages(); +$phpi->generate(RESULTFILE); +echo '<a href="?download">download</a>'; +echo '</pre></div>'; +?> \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/createinstaller/page.files1.php =================================================================== --- trunk/contrib/installer.beta-5.1/createinstaller/page.files1.php (rev 0) +++ trunk/contrib/installer.beta-5.1/createinstaller/page.files1.php 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,81 @@ +<?php +$uses[] = 'rootpath'; +$uses[] = 'packages'; +$packages = gpv('packages'); +function genSelect($type=null){ + $compresstypes=''; + foreach(phpInstaller::$compresstypes as $v){ + if($v==$type) $compresstypes.="<option selected=\"selected\">$v</option>"; + else $compresstypes.="<option>$v</option>"; + } + return $compresstypes; +} +?> +<h2>Files to Extract</h2> +<p> +Here you can add files that will be installed. +Optional if you do not need files installed, or files are already distributed. +</p> +<div> +<select name="package_type" id="package_type"> +<option>Regluar</option> +<option>Download</option> +<option>Archive (Distributed With Installer)</option> +</select> +<input type="submit" name="package_add" id="package_add" value="Add..."></div> +<?php +if(isset($_POST['package_type']) && isset($_POST['package_add'])){ + switch ($_POST['package_type']){ + case 'Regluar': + $packages[] = array('to'=>'/','path'=>dirname(__FILE__)); + break; + case 'Download': + $packages[] = array('to'=>'/','url'=>'http://domain/file.zip ; http://domain/backup.zip','type'=>'zip'); + break; + case 'Archive (Distributed With Installer)': + $packages[] = array('to'=>'/','path'=>'archive.zip','type'=>'zip'); + break; + } +} + +$_packages = array(); +foreach($packages as $x=>$v){ + if(!isset($_POST['package_clear'][$x])) $_packages[] = $v; +} +$packages = $_packages; + +?> +<h2>Current Paths</h2> +<?php +if($packages){ +?> +<table style="width:100%;"> +<colgroup> +<col width="20%" /> +<col width="30%" /> +<col width="35%" /> +<col width="10%" /> +<col width="5%" /> +</colgroup> +<thead><th>Path To</th><th>Path From</th><th>URL (seperate with a " ; ", a space, semicolon, and another space)</th><th>Type</th><th>Remove</th></thead> +<?php + foreach($packages as $n=>$v){ + echo '<tr>'; + echo '<td>'; + echo '<input type="text" style="width:100%;" name="packages['.$n.'][to]" id="packages['.$n.'][to]" value="'.$v['to'].'" >'; + echo '</td><td>'; + echo isset($v['path'])?'<input style="width:100%;" type="text" name="packages['.$n.'][path]" id="packages['.$n.'][path]" value="'.$v['path'].'" >':'N/A'; + echo '</td><td>'; + echo isset($v['url'])?'<input style="width:100%;" type="text" name="packages['.$n.'][url]" id="packages['.$n.'][url]" value="'.$v['url'].'" >':'N/A'; + echo '</td><td>'; + echo isset($v['type'])?'<select style="width:100%;" name="packages['.$n.'][type]" id="packages['.$n.'][type]">'.genSelect($v['type']).'</select>':'N/A'; + echo '</td><td>'; + echo '<input type="submit" name="package_clear['.$n.']" id="package_clear['.$n.']" value="Remove" >'; + echo '</td>'; + echo "</tr>\n"; + } + echo '</table>'; +}else{ + echo 'You have no listings defined.'; +} +?> \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/createinstaller/page.files2.php =================================================================== --- trunk/contrib/installer.beta-5.1/createinstaller/page.files2.php (rev 0) +++ trunk/contrib/installer.beta-5.1/createinstaller/page.files2.php 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,10 @@ +<?php +$uses[] = 'ignore'; +?> +<h2>Files to Ignore</h2> +<p> +Any files containing one of the following strings will be ignored: +</p> +<div> +<textarea name="ignore" id="ignore" style="width:100%;height:10em;"><?php echo gpv('ignore'); ?></textarea> +</div> \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/createinstaller/page.pages.php =================================================================== --- trunk/contrib/installer.beta-5.1/createinstaller/page.pages.php (rev 0) +++ trunk/contrib/installer.beta-5.1/createinstaller/page.pages.php 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,11 @@ +<?php +$uses[] = 'step_license'; +?> +<div style="text-align:left;"><h1>Setup pages</h1></div> +<div><h2>Add/Remove pages</h2></div> +<div> +<label for="step_license">Include License page?</label> +<input type="checkbox" name="step_license" id="step_license" value="true"<?php + if(gpv('step_license')){echo ' checked="checked"';} ?> /><br /> +Please edit the <code>createinstaller/data/license.html</code> file to include your licence. +</div> Added: trunk/contrib/installer.beta-5.1/createinstaller/page.start.php =================================================================== --- trunk/contrib/installer.beta-5.1/createinstaller/page.start.php (rev 0) +++ trunk/contrib/installer.beta-5.1/createinstaller/page.start.php 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1 @@ +<div style="text-align:left;"><h1>Welcome to the Installer creater.</h1></div> \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/createinstaller.php =================================================================== --- trunk/contrib/installer.beta-5.1/createinstaller.php (rev 0) +++ trunk/contrib/installer.beta-5.1/createinstaller.php 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,152 @@ +<?php +if (version_compare(phpversion(), '5.0.0', '<')){ + die("PHP5 is required for this verson of the installer devkit"); +} + +define('HTTP_FILE',strtolower(strtok($_SERVER['SERVER_PROTOCOL'], '/')).'://'.$_SERVER['HTTP_HOST']. $_SERVER['PHP_SELF']); +define('VERSION','1.0-rc1'); +define('RESULTFILE','installer.php'); +include('engine.inc.php'); + +//Download the installer +if (isset($_REQUEST['download'])) { + header("HTTP/1.1 200 OK"); + header("Status: 200 OK"); + header('Content-Type: application/force-download'); + header('Content-Disposition: attachment; filename="'.RESULTFILE.'"'); + header('Content-Length: '.filesize(RESULTFILE)); + readfile(RESULTFILE); + exit(0); +} + + +function gpv($name,$default=null,$get=true){//getPostValue + if(isset($_REQUEST[$name])){ + if($get){ + if(is_array($_REQUEST[$name])){ + return antislash($_REQUEST[$name]); + }else if( ($n=unserialize(urldecode($_REQUEST[$name]))) !==false || $_REQUEST[$name]===urlencode(serialize(false))){ + return $n; + }else{ + return antislash(antislash($_REQUEST[$name])); + } + }else{ + if(is_array($_REQUEST[$name])){ + return urlencode(serialize(antislash($_REQUEST[$name]))); + }else if( ($n=unserialize(urldecode($_REQUEST[$name]))) !==false || $_REQUEST[$name]===urlencode(serialize(false))){ + return urlencode(serialize($n)); + }else{ + return urlencode(serialize($_REQUEST[$name])); + } + } + }else{ + return $get?urlencode(serialize($default)):$default; + } +} + +function antislash($var){ + if(is_string($var)) return stripslashes($var); + if(is_array($var)){ + foreach($var as $n=>$v){ + $var[$n] = antislash($v); + } + } + return $var; +} + +$pages = array( + array('title'=>'Welcome', 'file'=>'start'), + array('title'=>'Applictation Name','file'=>'pages'), + array('title'=>'Applictation Name','file'=>'appname'), + array('title'=>'Files Setup', 'file'=>'files1'), + array('title'=>'Ignore', 'file'=>'files2'), + array('title'=>'Installer Definition' , 'file'=>'build') +); + +echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>Installer Creater</title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +<link rel="shortcut icon" href="favicon.ico" /> +<style> + +body { + margin: 0px; + background-color: white; + color : black; + padding:1em; +} + +h1,h2,h3,h4,h5{ + font-weight:bold; + margin:1px; + padding:1px; +} +h1{font-size:150%;} +h2{font-size:125%;} +h3{font-size:115%;} +h4{font-size:105%;} +div.margin{margin-left:1em;} +</style> +</head> +<body> +<form name="form" id="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> + <?php + $defaults = array( + 'page'=>(isset($_REQUEST['page'])?$_REQUEST['page']:0), + 'packages'=>array(), + 'step_license'=>'', + 'rootpath'=>dirname(__FILE__), + 'exec'=>'', + 'appname'=>'', + 'appver'=>'', + 'ignore'=>'' + ); + foreach($defaults as $dname=>$dvalue){ + $hidden[] = $dname; + if(!isset($_REQUEST[$dname])){ + $_REQUEST[$dname] = gpv($dname,$dvalue,true); + } + } + $uses = array('page'); + $totalpages = 5; + $page = gpv('page'); + + if(isset($_REQUEST['page_next'])) $page++; + else if(isset($_REQUEST['page_back'])) $page--; + + $button_prev = $page!=0; + $button_next = $page!=$totalpages; + if($file=$pages[$page]['file']){ + include("createinstaller/page.$file.php"); + }else{ + echo "Not a valid page (number $page)"; + } + ?> + <div style="text-align:right;margin-top:0.5em;padding:0.5em;border-top:solid 1px black;"> + <?php if($button_next){ ?> + <input type="submit" name="page_next" id="page_next" value="Next" style="float:right;" /> + <?php } ?> + <?php if($button_prev){ ?> + <input type="submit" name="page_back" id="page_back" value="Back" style="float:left;" /> + <?php } ?> + <input type="hidden" name="page" id="page" value="<?php echo $page; ?>" /> + </div><br /> + <?php + //echo '<table>'; + foreach($hidden as $value){ + if(!in_array($value,$uses)){ + echo '<input type="hidden" name="'.$value.'" id="'.$value.'" value="'.gpv($value,null,false).'" />'; + //echo "<tr><td>$value</td><td>"; + //var_dump(gpv($value)); + //echo "</td></tr>\n"; + } + } + //echo '</table>'; + ?> +</form> +</body> +</html> \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/docs/classtrees_webinstall.html =================================================================== --- trunk/contrib/installer.beta-5.1/docs/classtrees_webinstall.html (rev 0) +++ trunk/contrib/installer.beta-5.1/docs/classtrees_webinstall.html 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>Class Trees for Package webinstall</title> + <link rel="stylesheet" type="text/css" href="media/style.css"> + <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/> +</head> +<body> + +<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%"> + <tr> + <td class="header-top-left"><img src="media/logo.png" border="0" alt="phpDocumentor " /></td> + <td class="header-top-right">webinstall<br /><div class="header-top-right-subpackage"></div></td> + </tr> + <tr><td colspan="2" class="header-line"><img src="media/empty.png" width="1" height="1" border="0" alt="" /></td></tr> + <tr> + <td colspan="2" class="header-menu"> + [ <a href="classtrees_webinstall.html" class="menu">class tree: webinstall</a> ] + [ <a href="elementindex_webinstall.html" class="menu">index: webinstall</a> ] + [ <a href="elementindex.html" class="menu">all elements</a> ] + </td> + </tr> + <tr><td colspan="2" class="header-line"><img src="media/empty.png" width="1" height="1" border="0" alt="" /></td></tr> +</table> + +<table width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="195" class="menu"> + <div class="package-title">webinstall</div> + <div class="package"> + <div id="todolist"> + <p><a href="todolist.html">Todo List</a></p> + </div> + </div> + <b>Packages:</b><br /> + <div class="package"> + <a href="li_webinstall.html">webinstall</a><br /> + </div> + <br /> + </td> + <td> + <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top"> + +<h1>Class Trees for Package webinstall</h1> +<hr class="separator" /> +<div class="classtree">Root class phpInstaller</div> +<ul> +<li><a href="webinstall/phpInstaller.html">phpInstaller</a></li></ul> + + <div class="credit"> + <hr class="separator" /> + Documentation generated on Tue, 05 Sep 2006 22:32:40 -0600 by <a href="http://www.phpdoc.org">phpDocumentor 1.3.0RC4</a> + </div> + </td></tr></table> + </td> + </tr> +</table> + +</body> +</html> \ No newline at end of file Added: trunk/contrib/installer.beta-5.1/docs/elementindex.html =================================================================== --- trunk/contrib/installer.beta-5.1/docs/elementindex.html (rev 0) +++ trunk/contrib/installer.beta-5.1/docs/elementindex.html 2006-09-26 21:02:14 UTC (rev 797) @@ -0,0 +1,281 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>Element Index</title> + <link rel="stylesheet" type="text/css" href="media/style.css"> + <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/> +</head> +<body> + +<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%"> + <tr> + <td class="header-top-left"><img src="media/logo.png" border="0" alt="phpDocumentor " /></td> + <td class="header-top-right">webinstall<br /><div class="header-top-right-subpackage"></div></td> + </tr> + <tr><td colspan="2" class="header-line"><img src="media/empty.png" width="1" height="1" border="0" alt="" /></td></tr> + <tr> + <td colspan="2" class="header-menu"> + [ <a href="classtrees_webinstall.html" class="menu">class tree: webinstall</a> ] + [ <a href="elementindex_webinstall.html" class="menu">index: webinstall</a> ] + [ <a href="elementindex.html" class="menu">all elements</a> ] + </td> + </tr> + <tr><td colspan="2" class="header-line"><img src="media/empty.png" width="1" height="1" border="0" alt="" /></td></tr> +</table> + +<table width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="195" class="menu"> + <div class="package-title">webinstall</div> + <div class="package"> + <div id="todolist"> + <p><a href="todolist.html">Todo List</a></p> + </div> + </div> + <b>Packages:</b><br /> + <div class="package"> + <a href="li_webinstall.html">webinstall</a><br /> + </div> + <br /> + </td> + <td> + <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top"> + +<a name="top"></a> +<h1>Index of All Elements</h1> +<h3>Package Indexes</h3> +<ul> + <li><a href="elementindex_webinstall.html">webinstall</a></li> +</ul> +<br /> + [ <a href="elementindex.html#a">a</a> ] + [ <a href="elementindex.html#c">c</a> ] + [ <a href="elementindex.html#d">d</a> ] + [ <a href="elementindex.html#e">e</a> ] + [ <a href="elementindex.html#f">f</a> ] + [ <a href="elementindex.html#g">g</a> ] + [ <a href="elementindex.html#i">i</a> ] + [ <a href="elementindex.html#m">m</a> ] + [ <a href="elementindex.html#p">p</a> ] + [ <a href="elementindex.html#s">s</a> ] + [ <a href="elementindex.html#v">v</a> ] + [ <a href="elementindex.html#_">_</a> ] +<br /><br /> + <a name="a"></a> + <div class="index-letter-section"> + <div style="float: left" class="index-letter-title">a</div> + <div style="float: right"><a href="#top">[Top]</a></div> + <div style="clear: both"></div> + </div> + <div> + <h2>a</h2> + <dl> + <dt><b>$appDescription</b></dt> + <dd>in file engine.inc.php, variable <a href="webinstall/phpInstaller.html#var$appDescription">phpInstaller::$appDescription</a><br> Optional Applactation Description</dd> + <dt><b>$appId</b></dt> + <dd>in file engine.inc.php, variable <a href="webinstall/phpInstaller.html#var$appId">phpInstaller::$appId</a><br> Short applactation name, with no spaces</dd> + <dt><b>$appName</b></dt> + <dd>in file engine.inc.php, variable <a href="webinstall/phpInstaller.html#var$appName">phpInstaller::$appName</a><br> Applactation Name</dd> + <dt><b>$appVersion</b></dt> + <dd>in file engine.inc.php, variable <a href="webinstall/phpInstaller.html#var$appVersion">phpInstaller::$appVersion</a><br> Optional Applactation Version</dd> + <dt><b>addCompressionMethod</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddCompressionMethod">phpInstaller::addCompressionMethod()</a><br> Add a decompression method to use</dd> + <dt><b>addInstallerPages</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddInstallerPages">phpInstaller::addInstallerPages()</a><br> Add the file-copying steps to the installer</dd> + <dt><b>addMetaFile</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddMetaFile">phpInstaller::addMetaFile()</a><br> Add a file to the installer.</dd> + <dt><b>addPage</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddPage">phpInstaller::addPage()</a><br> add a page to the installer</dd> + <dt><b>addPath</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddPath">phpInstaller::addPath()</a><br> Add a directory of files to the installer</dd> + <dt><b>addPathDownload</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddPathDownload">phpInstaller::addPathDownload()</a><br> Add a path that the user downloads</dd> + <dt><b>addWriteMethod</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddWriteMethod">phpInstaller::addWriteMethod()</a><br> Add a method of creating files for example, over FTP, ect.</dd> + </dl> + </div> + <a name="c"></a> + <div class="index-letter-section"> + <div style="float: left" class="index-letter-title">c</div> + <div style="float: right"><a href="#top">[Top]</a></div> + <div style="clear: both"></div> + </div> + <div> + <h2>c</h2> + <dl> ... [truncated message content] |
From: <ke...@us...> - 2006-09-26 19:07:44
|
Revision: 796 http://svn.sourceforge.net/phpfreechat/?rev=796&view=rev Author: kerphi Date: 2006-09-26 12:07:34 -0700 (Tue, 26 Sep 2006) Log Message: ----------- [en] The setup generator is now integrated to the command line process (many thanks to awright and his great webinstall project : http://sourceforge.net/projects/webinstall) [30min] [fr] Le generateur de setup est maintenant integr?\195?\169 directement dans le processus de generation automatique de release en ligne de commande (merci beaucoup ?\195?\160 awright et a son superbe webinstall : http://sourceforge.net/projects/webinstall) [30min] Modified Paths: -------------- trunk/misc/createwebinstaller.php Modified: trunk/misc/createwebinstaller.php =================================================================== --- trunk/misc/createwebinstaller.php 2006-09-26 16:35:31 UTC (rev 795) +++ trunk/misc/createwebinstaller.php 2006-09-26 19:07:34 UTC (rev 796) @@ -4,15 +4,16 @@ $archivename = 'phpfreechat-'.$version.'-setup.php'; $pfcpath = dirname(__FILE__).'/phpfreechat-'.$version; if (!file_exists($pfcpath)) die("Dont find the directory $pfcpath"); -$phpinstaller_path = realpath(dirname(__FILE__).'/../contrib/phpinstaller'); +$phpinstaller_path = realpath(dirname(__FILE__).'/../contrib/installer.beta-5.1'); include($phpinstaller_path.'/engine.inc.php'); $phpi = new phpInstaller(); -$phpi->dataDir($phpinstaller_path.'/engene_data'); +$phpi->dataDir($phpinstaller_path.'/engine_data'); $phpi->appName = 'phpFreeChat'; $phpi->appVersion = $version; $phpi->addMetaFile('ss',$phpinstaller_path.'/createinstaller/data/installer.css','text/css') or die('Can not find stylesheet'); $phpi->ignore[] = '.svn'; +$phpi->addPage('Pre-Install Check',file_get_contents($phpinstaller_path.'/createinstaller/data/precheck.inc')); $phpi->addInstallerPages(); $phpi->addPath($pfcpath); $phpi->generate($archivename); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-26 16:35:40
|
Revision: 795 http://svn.sourceforge.net/phpfreechat/?rev=795&view=rev Author: kerphi Date: 2006-09-26 09:35:31 -0700 (Tue, 26 Sep 2006) Log Message: ----------- [en] New 'firstisadmin' parameter : this parameter is used to give admin rights to the first connected users on the server. [fr] Nouveau param?\195?\168tre 'firstisadmin' qui permet de donner les droits administrateurs a la premiere personne connect?\195?\169e sur le serveur. 45min Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/pfcglobalconfig.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-09-24 20:56:41 UTC (rev 794) +++ trunk/src/commands/connect.class.php 2006-09-26 16:35:31 UTC (rev 795) @@ -44,7 +44,7 @@ // check if the user is alone on the server, and give it the admin status if yes $isadmin = $c->isadmin; - if (!$isadmin) + if ($c->firstisadmin && !$isadmin) { $users = $ct->getOnlineNick(NULL); if (isset($users["nickid"]) && Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-09-24 20:56:41 UTC (rev 794) +++ trunk/src/pfcglobalconfig.class.php 2006-09-26 16:35:31 UTC (rev 795) @@ -34,8 +34,10 @@ // these parameters are dynamic (not cached) var $nick = ""; // the initial nickname ("" means the user will be queried) + var $isadmin = false; var $admins = array("admin" => ""); // the key is the nickname, the value is the password + var $firstisadmin = true; // give admin rights to the first connected user on the server var $islocked = false; // set this parameter to true to lock the chat for all users var $lockurl = "http://www.phpfreechat.net"; // this is the url where the users must be redirected when the chat is locked This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-24 20:57:20
|
Revision: 794 http://svn.sourceforge.net/phpfreechat/?rev=794&view=rev Author: kerphi Date: 2006-09-24 13:56:41 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Add the new webinstaller version and try to adapte the packager script Modified Paths: -------------- trunk/misc/createwebinstaller.php trunk/version Added Paths: ----------- trunk/contrib/phpinstaller/ trunk/contrib/phpinstaller/CHANGELOG trunk/contrib/phpinstaller/README trunk/contrib/phpinstaller/TODO trunk/contrib/phpinstaller/createinstaller/ trunk/contrib/phpinstaller/createinstaller/data/ trunk/contrib/phpinstaller/createinstaller/data/favicon.ico trunk/contrib/phpinstaller/createinstaller/data/installer.css trunk/contrib/phpinstaller/createinstaller/data/installer.jpg trunk/contrib/phpinstaller/createinstaller/data/license.html trunk/contrib/phpinstaller/createinstaller/data/license.inc trunk/contrib/phpinstaller/createinstaller/data/precheck.inc trunk/contrib/phpinstaller/createinstaller/data/start.inc trunk/contrib/phpinstaller/createinstaller/data/unknown.gif trunk/contrib/phpinstaller/createinstaller/page.appname.php trunk/contrib/phpinstaller/createinstaller/page.build.php trunk/contrib/phpinstaller/createinstaller/page.files1.php trunk/contrib/phpinstaller/createinstaller/page.files2.php trunk/contrib/phpinstaller/createinstaller/page.pages.php trunk/contrib/phpinstaller/createinstaller/page.start.php trunk/contrib/phpinstaller/createinstaller.php trunk/contrib/phpinstaller/docs/ trunk/contrib/phpinstaller/docs/classtrees_webinstall.html trunk/contrib/phpinstaller/docs/elementindex.html trunk/contrib/phpinstaller/docs/elementindex_webinstall.html trunk/contrib/phpinstaller/docs/errors.html trunk/contrib/phpinstaller/docs/index.html trunk/contrib/phpinstaller/docs/li_webinstall.html trunk/contrib/phpinstaller/docs/media/ trunk/contrib/phpinstaller/docs/media/background.png trunk/contrib/phpinstaller/docs/media/empty.png trunk/contrib/phpinstaller/docs/media/logo.png trunk/contrib/phpinstaller/docs/media/style.css trunk/contrib/phpinstaller/docs/todolist.html trunk/contrib/phpinstaller/docs/webinstall/ trunk/contrib/phpinstaller/docs/webinstall/_engine_inc_php.html trunk/contrib/phpinstaller/docs/webinstall/phpInstaller.html trunk/contrib/phpinstaller/engene_data/ trunk/contrib/phpinstaller/engene_data/archive_tar.php trunk/contrib/phpinstaller/engene_data/extract.bz.inc trunk/contrib/phpinstaller/engene_data/extract.tar.inc trunk/contrib/phpinstaller/engene_data/extract.tgz.inc trunk/contrib/phpinstaller/engene_data/extract.zip.inc trunk/contrib/phpinstaller/engene_data/installer_data.inc trunk/contrib/phpinstaller/engene_data/step_aboutto.inc trunk/contrib/phpinstaller/engene_data/step_finished.inc trunk/contrib/phpinstaller/engene_data/step_installer.inc trunk/contrib/phpinstaller/engene_data/step_path.inc trunk/contrib/phpinstaller/engene_data/write.file.inc trunk/contrib/phpinstaller/engene_data/write.ftp.inc trunk/contrib/phpinstaller/engene_data/write.sftp.inc trunk/contrib/phpinstaller/engine.inc.php trunk/contrib/phpinstaller/examples/ trunk/contrib/phpinstaller/examples/customoutput.php trunk/contrib/phpinstaller/examples/package.php trunk/contrib/phpinstaller/genphpfromfile.php Added: trunk/contrib/phpinstaller/CHANGELOG =================================================================== --- trunk/contrib/phpinstaller/CHANGELOG (rev 0) +++ trunk/contrib/phpinstaller/CHANGELOG 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,18 @@ +ISO 8601 Formatted +Newest at top + +Key + + Addition + - Removed + # Changed + ++ 2006-09-22 Added support for generating .tar.gz files +# 2006-04-18 Fixed the 'ignore' bug on generator interface ++ 2006-04-18 Per-page button settings ++ 2006-04-18 Auto-scrolling on message pane ++ 2006-03-10 function updatepb_unknown ++ 2006-03-08 Download Functionality ++ 2005-08-23 Function message ++ 2005-08-23 Function addMetaFile +# 2005-08-23 Fixed bug (sf.net 1258143) "Fatal error: Call to undefined function: updatep" ++ 2005-08-16 Installer page: 'Finished' \ No newline at end of file Added: trunk/contrib/phpinstaller/README =================================================================== --- trunk/contrib/phpinstaller/README (rev 0) +++ trunk/contrib/phpinstaller/README 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,21 @@ +This package will help you create your own web installer. +The PHP script installer can unpack a web-based installer +and the files to install and install it with one file. To +make a web installer you will need to open createinstaller.php +in your browser. Click next, than enter the path of the script. +Click next, next, next, than see it compile. Go open the file +install.php it created in your browser than follow than test it +in a new path-- see if it works. Distribute it, or customise it +to change the look. Than become a developer for the PHP script +installer project and help me develop a script that also +(here's my todo list) configures your newly installed script, +popluate a database, download updates from the web, or install +from a file. + + +File list Description +/createinstaller Automated installer creator interface + precheck.inc First page in installer, default pre-install check + 2.txt Next user-page in compiled installer, License page +/engene_data Installer Creator Resources, templates +/createinstaller Directory: Installer engene data \ No newline at end of file Added: trunk/contrib/phpinstaller/TODO =================================================================== --- trunk/contrib/phpinstaller/TODO (rev 0) +++ trunk/contrib/phpinstaller/TODO 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,5 @@ +* Install from a file +* Download from an FTP source +* Run SQL code into a database +* Post-Install Configuration capabilites +* install to FTP path Added: trunk/contrib/phpinstaller/createinstaller/data/favicon.ico =================================================================== (Binary files differ) Property changes on: trunk/contrib/phpinstaller/createinstaller/data/favicon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/contrib/phpinstaller/createinstaller/data/installer.css =================================================================== --- trunk/contrib/phpinstaller/createinstaller/data/installer.css (rev 0) +++ trunk/contrib/phpinstaller/createinstaller/data/installer.css 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,313 @@ +body { + margin: 0px; + padding: 0px; + color : #333; + background-color : #FFF; + font-size : 11px; + font-family : Arial, Helvetica, sans-serif; +} + +#wrapper { + border: 0px; + margin: 0px; + margin-left: auto; + margin-right: auto; + padding: 0px; +} + +#header { + background-color: #FFF; + background-position: right top; + border-bottom: 4px solid #80B5D7; +} + +#headertext { + position: relative; + width: 100%; + background: url("?file=hb") #30569D no-repeat; + background-position: top right; + margin: 0px; + padding: 0px; + height: 35px; + color: white; + font-size: 30px; + font-family: FrancineHmk; +} + +.version { + font-size: 10px; + color: lightgray; +} + +#stepbar { + background-color: #F1F3F5; + width: 170px; + font-size: 11px; + float: left; + text-align: left; +} + +#step { + background: url("?file=logoimage") no-repeat; + font-size: 30px; + font-weight: bold; + text-align: left; + color: #666666; + padding: 10px 0px 20px 80px; + white-space: nowrap; + position: relative; + float: left; +} + +.step-on { + color: #BBDDFF; + background: #30559C; + font-weight: bold; + font-size: 13px; + padding: 10px; + border: 1px solid #cccccc; + margin-bottom: 2px; +} + +.step-off { + font-size: 13px; + color: #999999; + font-weight: bold; + padding: 10px; + border: 1px solid #cccccc; + margin-bottom: 2px; +} + +#right { + float: right; + width: 560px; + border-left: 1px solid #cccccc; + padding-left: 10px; + +} + +#break { + height: 20px; +} + +.licensetext { + text-align: left; +} + +.license { + padding: 0px; + width: 535px; + height: 325px; +} + +.description { + padding: 0px; + width: 535px; + height: 325px; +} + +.license-form { + float: left; +} + + +.install { + margin-left: auto; + margin-right: auto; + margin-top: 3em; + margin-bottom: 3em; + padding: 10px; + border: 1px solid #cccccc; + width: 750px; + background: #F1F3F5; +}/* +.install { + margin-left: auto; + margin-right: auto; + margin-top: 3em; + margin-bottom: 3em; + padding: 10px; + border: 1px solid #cccccc; + background: #F1F3F5; + overflow:auto; + position:absolute; + left:20px; + right:20px; + bottom:20px; + top:45px; +} +*/ + +.install h1 { + font-size: 18px; + font-weight: bold; + color: #30557C; + padding: 4px 0px 4px 0px; + text-align: center; + border-bottom: 1px solid #cccccc; + margin-bottom: 10px; + +} + +.install-form { + position: relative; + text-align: left; + margin-top:1em; +} + +.install-form table, .install-form input { + width: 100%; +} + +.install-text { + position: relative; + text-align: left; +} + +.form-block { + border: 1px solid #cccccc; + background: #E9ECEF; + padding-top: 5px; + padding-left: 5px; + padding-bottom: 5px; + padding-right: 5px; +} + +.left { + position: relative; + text-align: left; + float: left; + width: 50%; +} + +.right { + position: relative; + text-align: left; + float: right; + width: 70%; +} + +.far-right { + position: relative; + text-align: right; + float: right; +} + +.far-left { + position: relative; + text-align: left; + float: left; +} + +.clr { + clear:both; + } + +.ctr { + text-align: center; + vertical-align: middle; +} + +.content { + text-align: left; +} + +.button { + border : solid 1px #999; + background: #C9CcCF; + color : #666666; + font-weight : bold; + font-size : 11px; + padding: 4px; + cursor: pointer; +} + +table.content { + width: 80%; +} + +table.content td { + color : #333333; + font-size: 11px; + width: 50%; +} + + +table.content2 td { + color : #333333; + font-size: 11px; +} + +.toggle { + font-weight: bold; +} + +a { + color : #FF9900; + text-decoration : none; +} +a:hover { + color : #999999; + text-decoration : underline; +} +a:active { + color : #FF6600; + text-decoration : underline; +} + +.inputbox { + color: blue; + font-family: Arial, Helvetica, sans-serif; + z-index: -3; + font-size: 11px; +} + +.small { + color : #333; + font-size : 10px; +} + +.error { + color : #cc0000; + font-size : 12px; + font-weight : bold; + padding-top: 10px; + padding-bottom: 10px; +} + + +select.options, input.options { + font-size: 8pt; + border: 1px solid #999; +} + +form { + margin: 0px 0px 0px 0px; +} + + +.dottedline { + border-bottom: 1px solid #333; +} + +.installheader { + color : #FFF; + font-size : 24px; +} + +textarea { + color : #0000dd; + font-family : Arial; + font-size : 11px; + border: 1px; +} + +#license-tabed a{ + border: 1px solid #cccccc; + border-bottom: none; + background: #E9ECEF; + padding: 3px 3px 1px 3px; +} +#license-tabed{ + text-align: left; +} Added: trunk/contrib/phpinstaller/createinstaller/data/installer.jpg =================================================================== (Binary files differ) Property changes on: trunk/contrib/phpinstaller/createinstaller/data/installer.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/contrib/phpinstaller/createinstaller/data/license.html =================================================================== --- trunk/contrib/phpinstaller/createinstaller/data/license.html (rev 0) +++ trunk/contrib/phpinstaller/createinstaller/data/license.html 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,364 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +<title>Untitled Document</title> +<style type="text/css"> +<!-- +body { + font-family: arial, helvetica, sans serif; + font-size: 11px; + background: #E9ECEF; +} + +p { + font-family: arial, helvetica, sans serif; + font-size: 11px; + text-align:justify; +} + +h2 { + font-family: arial, helvetica, sans serif; + font-size: 13px; + font-weight: bold; +} + +h3 { + font-family: arial, helvetica, sans serif; + font-size: 12px; + font-weight: bold; +} + +h4 { + font-family: arial, helvetica, sans serif; + font-size: 11px; + font-weight: bold; +} + +li { + font-family: arial, helvetica, sans serif; + font-size: 11px; + text-align:justify; +} + +pre { + font-size: 11px; + text-align:justify; +} +--> +</style> +</head> +<body> +<h2>Table of Contents</h2> +<ul> + <li><a href="#SEC1" name="TOC1" id="TOC1">GNU GENERAL PUBLIC LICENSE</a> + <ul> + <li><a href="#SEC2" name="TOC2" id="TOC2">Preamble</a> </li> + <li><a href="#SEC3" name="TOC3" id="TOC3">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a> </li> + <li><a href="#SEC4" name="TOC4" id="TOC4">How to Apply These Terms to Your New Programs</a> </li> + </ul> + </li> +</ul> +<p></p> +<hr /> +<h2><a href="#TOC1" name="SEC1" id="SEC1">GNU GENERAL PUBLIC LICENSE</a></h2> +<p> Version 2, June 1991 </p> +<pre> +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +</pre> +<h2><a href="#TOC2" name="SEC2" id="SEC2">Preamble</a></h2> +<p> The licenses for most software are designed to take away your freedom to share and change +it. By contrast, the GNU General Public License is intended to guarantee +your freedom to share and change free software--to make sure the software is free for all its +users. This General Public License applies to most of the Free Software Foundation's software +and to any other program whose authors commit to using it. (Some other Free Software +Foundation software is covered by the GNU Library General Public License instead.) You can +apply it to your programs, too. </p> +<p> When we speak of free software, we are referring to freedom, not price. Our General +Public Licenses are designed to make sure that you have the freedom to distribute copies +of free software (and charge for this service if you wish), that you receive source code +or can get it if you want it, that you can change the software or use pieces of it in new +free programs; and that you know you can do these things. </p> +<p> To protect your rights, we need to make restrictions that forbid anyone to deny you +these rights or to ask you to surrender the rights. These restrictions translate to certain +responsibilities for you if you distribute copies of the software, or if you modify it. </p> +<p> For example, if you distribute copies of such a program, whether gratis or for a fee, +you must give the recipients all the rights that you have. You must make sure that they, +too, receive or can get the source code. And you must show them these terms so they know +their rights. </p> +<p> We protect your rights with two steps: (1) copyright the software, and (2) offer you +this license which gives you legal permission to copy, distribute and/or modify the +software.</p> +<p> Also, for each author's protection and ours, we want to make certain that everyone +understands that there is no warranty for this free software. If the software is modified +by someone else and passed on, we want its recipients to know that what they have is not +the original, so that any problems introduced by others will not reflect on the original +authors' reputations. </p> +<p> Finally, any free program is threatened constantly by software patents. We wish to +avoid the danger that redistributors of a free program will individually obtain patent +licenses, in effect making the program proprietary. To prevent this, we have made it clear +that any patent must be licensed for everyone's free use or not licensed at all. </p> +<p> The precise terms and conditions for copying, distribution and modification follow. </p> +<h2><a href="#TOC3" name="SEC3" id="SEC3">TERMS AND CONDITIONS FOR COPYING, +DISTRIBUTION AND MODIFICATION</a></h2> +<p> <strong>0.</strong> This License applies to any program or other work which contains a +notice placed by the copyright holder saying it may be distributed under the terms of this +General Public License. The "Program", below, refers to any such program or work, and a +"work based on the Program" means either the Program or any derivative work under copyright +law: that is to say, a work containing the Program or a portion of it, either +verbatim or with modifications and/or translated into another language. (Hereinafter, +translation is included without limitation in the term "modification".) Each licensee is +addressed as "you".</p> +<p> Activities other than copying, distribution and modification are not covered by this +License; they are outside its scope. The act of running the Program is not restricted, and +the output from the Program is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). Whether that is true depends +on what the Program does.</p> +<p> <strong>1.</strong> You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously and appropriately +publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any warranty; and give any +other recipients of the Program a copy of this License along with the Program.</p> +<p> You may charge a fee for the physical act of transferring a copy, and you may at your +option offer warranty protection in exchange for a fee.</p> +<p> <strong>2.</strong> You may modify your copy or copies of the Program or any portion of +it, thus forming a work based on the Program, and copy and distribute such modifications or +work under the terms of Section 1 above, provided that you also meet all of these +conditions:</p> +<p></p> +<ul> + <li><strong>a)</strong> You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + <p> + </p> + </li> + <li><strong>b)</strong> You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any part thereof, to be + licensed as a whole at no charge to all third parties under the terms of this License. + <p> + </p> + </li> + <li><strong>c)</strong> If the modified program normally reads commands interactively + when run, you must cause it, when started running for such interactive use in the most + ordinary way, to print or display an announcement including an appropriate copyright + notice and a notice that there is no warranty (or else, saying that you provide a warranty) + and that users may redistribute the program under these conditions, and telling the user + how to view a copy of this License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on the Program is not + required to print an announcement.) +</li> +</ul> +<p> +These requirements apply to the modified work as a whole. If identifiable sections of that +work are not derived from the Program, and can be reasonably considered independent and +separate works in themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you distribute the same +sections as part of a whole which is a work based on the Program, the distribution of the +whole +must be on the terms of this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it.</p> +<p> Thus, it is not the intent of this section to claim rights or contest your rights to +work written entirely by you; rather, the intent is to exercise the right to control the +distribution of derivative or collective works based on the Program. +</p> +<p> In addition, mere aggregation of another work not based on the Program with the +Program (or with a work based on the Program) on a volume of a storage or distribution +medium does not bring the other work under the scope of this License. +</p> +<p> <strong>3.</strong> You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of Sections 1 and 2 +above provided that you also do one of the following: + <!-- we use this doubled UL to get the sub-sections indented, --> + <!-- while making the bullets as unobvious as possible. --> +</p> +<ul> + <li><strong>a)</strong> Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange; or, + <p> + </p> + </li> + <li><strong>b)</strong> Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your cost of physically + performing source distribution, a complete machine-readable copy of the corresponding + source code, to be distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + <p> + </p> + </li> + <li><strong>c)</strong> Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is allowed only for + noncommercial distribution and only if you received the program in object code or + executable form with such an offer, in accord with Subsection b above.) +</li> +</ul> +<p>The source code for a work means the preferred form of the work for making modifications +to it. For an executable work, complete source code means all the source code for all +modules it contains, plus any associated interface definition files, plus the scripts used +to control compilation and installation of the executable. However, as a special exception, +the source code distributed need not include anything that is normally distributed (in +either source or binary form) with the major components (compiler, kernel, and so on) of +the operating system on which the executable runs, unless that component itself accompanies +the executable.</p> +<p> If distribution of executable or object code is made by offering access to copy from a +designated place, then offering equivalent access to copy the source code from the same +place counts as distribution of the source code, even though third parties are not compelled +to copy the source along with the object code. +</p> +<p> <strong>4.</strong> You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt otherwise to copy, modify, +sublicense or distribute the Program is void, and will automatically terminate your rights +under this License. However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such parties remain in full +compliance. +</p> +<p> <strong>5.</strong> You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or distribute the Program +or its derivative works. These actions are prohibited by law if you do not accept this +License. Therefore, by modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and all its terms and +conditions for copying, distributing or modifying the Program or works based on it. +</p> +<p> <strong>6.</strong> Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original licensor to copy, +distribute or modify the Program subject to these terms and conditions. You may not impose +any further restrictions on the recipients' exercise of the rights granted herein. You are +not responsible for enforcing compliance by third parties to this License. +</p> +<p> <strong>7.</strong> If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), conditions are imposed +on you (whether by court order, agreement or otherwise) that contradict the conditions of +this License, they do not excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this License and any +other pertinent obligations, then as a consequence you may not distribute the Program at +all. For example, if a patent license would not permit royalty-free redistribution of the +Program by all those who receive copies directly or indirectly through you, then the only +way you could satisfy both it and this License would be to refrain entirely from distribution +of the Program. +</p> +<p> If any portion of this section is held invalid or unenforceable under any particular +circumstance, the balance of the section is intended to apply and the section as a whole +is intended to apply in other circumstances. +</p> +<p> It is not the purpose of this section to induce you to infringe any patents or other +property right claims or to contest validity of any such claims; this section has the sole +purpose of protecting the integrity of the free software distribution system, which is +implemented by public license practices. Many people have made generous contributions to +the wide range of software distributed through that system in reliance on consistent +application of that system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot impose that choice. +</p> +<p> This section is intended to make thoroughly clear what is believed to be a consequence +of the rest of this License. +</p> +<p> <strong>8.</strong> If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the original copyright +holder who places the Program under this License may add an explicit geographical +distribution limitation excluding those countries, so that distribution is permitted +only in or among countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. +</p> +<p> <strong>9.</strong> The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will be similar in spirit +to the present version, but may differ in detail to address new problems or concerns. +</p> +<p> Each version is given a distinguishing version number. If the Program specifies a +version number of this License which applies to it and "any later version", you have the +option of following the terms and conditions either of that version or of any later version +published by the Free Software Foundation. If the Program does not specify a version number +of this License, you may choose any version ever published by the Free Software Foundation. +</p> +<p> <strong>10.</strong> If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author to ask for +permission. For software which is copyrighted by the Free Software Foundation, write +to the Free Software Foundation; we sometimes make exceptions for this. Our decision +will be guided by the two goals of preserving the free status of all derivatives of +our free software and of promoting the sharing and reuse of software generally. +</p> +<p><strong>NO WARRANTY</strong><a id="w"> </a></p> +<p> <strong>11.</strong> BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" +WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE +RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +</p> +<p> <strong>12.</strong> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, +SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE +THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE +OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH +ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +</p> +<p> +</p> +<h2>END OF TERMS AND CONDITIONS</h2> +<h2><a href="#TOC4" name="SEC4" id="SEC4">How to Apply These Terms to Your New +Programs</a></h2> +<p> If you develop a new program, and you want it to be of the greatest possible use to +the public, the best way to achieve this is to make it free software which everyone can +redistribute and change under these terms. </p> +<p> To do so, attach the following notices to the program. It is safest to attach them +to the start of each source file to most effectively convey the exclusion of warranty; +and each file should have at least the "copyright" line and a pointer to where the full +notice is found. </p> +<pre> +<var>one line to give the program's name and an idea of what it does.</var> +Copyright (C) <var>yyyy</var> <var>name of author</var> + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +</pre> +<p> Also add information on how to contact you by electronic and paper mail. </p> +<p> If the program is interactive, make it output a short notice like this when it starts +in an interactive mode: </p> +<pre> +Gnomovision version 69, Copyright (C) <var>year</var> <var>name of author</var> +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details +type `show w'. This is free software, and you are welcome +to redistribute it under certain conditions; type `show c' +for details. +</pre> +<p> The hypothetical commands <samp>`show w'</samp> and <samp>`show c'</samp> should show +the appropriate parts of the General Public License. Of course, the commands you use may +be called something other than <samp>`show w'</samp> and <samp>`show c'</samp>; they could +even be mouse-clicks or menu items--whatever suits your program. </p> +<p> You should also get your employer (if you work as a programmer) or your school, if any, +to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the +names: </p> +<pre> +Yoyodyne, Inc., hereby disclaims all copyright +interest in the program `Gnomovision' +(which makes passes at compilers) written +by James Hacker. + +<var>signature of Ty Coon</var>, 1 April 1989 +Ty Coon, President of Vice +</pre> +<p> This General Public License does not permit incorporating your program into proprietary +programs. If your program is a subroutine library, you may consider it more useful to permit +linking proprietary applications with the library. If this is what you want to do, use the +<a href="/licenses/l">GNU Lesser General Public License</a> instead of this License. +</p> +</body> +</html> \ No newline at end of file Added: trunk/contrib/phpinstaller/createinstaller/data/license.inc =================================================================== --- trunk/contrib/phpinstaller/createinstaller/data/license.inc (rev 0) +++ trunk/contrib/phpinstaller/createinstaller/data/license.inc 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,27 @@ +<?php +echo <<<HTML +<h2> GNU/GPL License: </h2> +<div class="licensetext"> +<a href="about:blank">PROGRAM</a> +is Free Software released under the GNU/GPL License. +<div class="error"> *** To continue installing PROGRAM you must check the box under the license *** </div> +</div> +<div class="clr"> </div> +<div class="license-form" id="license-tabed"> +For +<a href="?file=license#w" onclick="document.getElementById('license-frame').src=this.href;return false;">End-users</a> +<a href="?file=license#SEC2" onclick="document.getElementById('license-frame').src=this.href;return false;">Developers</a> +<a href="?file=license#SEC3" onclick="document.getElementById('license-frame').src=this.href;return false;">Distributers</a> +<div class="form-block" style="padding: 0px;"> +<iframe id="license-frame" src="$HTTP_FILE?file=license" class="license" frameborder="0" scrolling="auto"></iframe> +</div> +</div> +<div class="clr"></div> +<div class="ctr"><span class="ctr"> +<input name="agreecheck" id="agreecheck" class="inputbox" onclick="agreesubmit(this)" type="checkbox" value="true" /> +<label for="agreecheck">I Accept the GPL License</label> +</span></div> +<div class="clr"></div> +</div> +HTML; +?> \ No newline at end of file Added: trunk/contrib/phpinstaller/createinstaller/data/precheck.inc =================================================================== --- trunk/contrib/phpinstaller/createinstaller/data/precheck.inc (rev 0) +++ trunk/contrib/phpinstaller/createinstaller/data/precheck.inc 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,65 @@ +<?php +/** Print text displaying status + * + * @param int $type + 1: Abailable/Unavailable + * + 2: Pass/Fail + * @param bool|int $value + */ +function status($value=null,$type) +{ + switch($type) + { + case null: $value=$type;break; + case 'yes': return '<span style="color:red;">No</span>'; + case 'available':return '<span style="color:green;">Available</span>'; + case 'writeable': return '<span style="color:green;">Writeable</span>'; + case 'on': return '<span style="color:green;">ON</span>'; + case 'support': + case 'true': return '<span style="color:green;">True</span>'; + default: return 'ERR'; + } + switch($value) + { + case 'yes': return '<span style="color:green;">Yes</span>'; + case 'no': return '<span style="color:red;">No</span>'; + case 'available':return '<span style="color:green;">Available</span>'; + case 'missing': return '<span style="color:red;">Missing</span>'; + case 'writeable': return '<span style="color:green;">Writeable</span>'; + case 'unwriteable': return '<span style="color:red;">Un-writeable</span>'; + case 'on': return '<span style="color:green;">ON</span>'; + case 'off': return '<span style="color:red;">OFF</span>'; + case 'support': + case 'supported': return '<span style="color:green;">Supported</span>'; + case 'x': return '<span style="color:red;">X</span>'; + default: + case 'true': return '<span style="color:green;">True</span>'; + case 'false': return '<span style="color:red;">False</span>'; + } +} +$a = array( + status(function_exists('file_get_contents'),'available'), + status(function_exists('unserialize'),'available'), + status(function_exists('gzuncompress'),'available') +); + +echo <<<HTML +<div class="install-text"> +These settings are recommended for PHP in order to ensure full +compatibility with PROGRAM. +<br /> +However, it may still operate if your settings do not quite match the recommended +(In this case, the program will only offer, and thus say, 'Limited Functionality'). +<div class="clr"></div> +</div> +<div class="install-form"> +<div class="form-block"> +<table class="content"> +<tr><td class="item">file_get_contents</td><td align="left"><b>{$a[0]}</b></td></tr> +<tr><td class="item">unserialize</td><td align="left"><b>{$a[1]}</b></td></tr> +<tr><td class="item">GZ Compression</td><td align="left"><b>{$a[2]}</b></td></tr> +</table> +</div> +<div class="clr"></div> +</div> +HTML; +?> \ No newline at end of file Added: trunk/contrib/phpinstaller/createinstaller/data/start.inc =================================================================== --- trunk/contrib/phpinstaller/createinstaller/data/start.inc (rev 0) +++ trunk/contrib/phpinstaller/createinstaller/data/start.inc 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1 @@ +Welcome to APPNAME \ No newline at end of file Added: trunk/contrib/phpinstaller/createinstaller/data/unknown.gif =================================================================== (Binary files differ) Property changes on: trunk/contrib/phpinstaller/createinstaller/data/unknown.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/contrib/phpinstaller/createinstaller/page.appname.php =================================================================== --- trunk/contrib/phpinstaller/createinstaller/page.appname.php (rev 0) +++ trunk/contrib/phpinstaller/createinstaller/page.appname.php 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,8 @@ +<?php +$uses[] = 'appname'; +?> +<div><h2>Applactation Name</h2></div> +<div>What is the name of your applactation?</div> +<div class="margin"> + <input type="text" style="width:30em;" name="appname" id="appname" value="<?php echo gpv('appname'); ?>" /> +</div> \ No newline at end of file Added: trunk/contrib/phpinstaller/createinstaller/page.build.php =================================================================== --- trunk/contrib/phpinstaller/createinstaller/page.build.php (rev 0) +++ trunk/contrib/phpinstaller/createinstaller/page.build.php 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,73 @@ +<?php +$phpi = new phpInstaller(); +$dataDir = realpath(dirname(__FILE__).'/../engene_data'); +$phpi->dataDir($dataDir); +$phpi->appName = gpv('appname'); +$phpi->appVersion = gpv('appver'); +$phpi->compress = true; +$phpi->ignore[] = '/installer.php'; +$phpi->ignore[] = '/phpinstaller/'; +$phpi->ignore[] = 'tests'; +$phpi->ignore[] = 'hi2'; +foreach(explode("\n",gpv('ignore')) as $v){ + if($v=trim($v)) $phpi->ignore[] = $v; +} + +$phpi->messageCallback = 'message'; +function message($message,$state=null){ + if($state==2) echo '<div style="color:grey;">'; + else echo '<div>'; + + if($state) echo htmlspecialchars(str_pad($message,74,'.')).'....'; + else echo htmlspecialchars($message); + + switch ($state) { + case 1:echo '[<span style="color:red;">failed</span>]';break; + case 2:echo '[<span style="font-weight:bold;">ignore</span>]';break; + case 3:echo '[<span style="color:green;"> file </span>]';break; + case 4:echo '[<span style="color:green;"> dir </span>]';break; + case 5:echo '[<span style="color:green;"> done </span>]';break; + } + echo '</div>'; +} + +echo '<div style="height:30em;overflow:auto;border:inset 1px grey;"><pre>'; +//template files + if(!$phpi->addMetaFile('ss','createinstaller/data/installer.css','text/css',$replace)){ + die('Could not add main.css to installer.<br />'); + } + +foreach (gpv('packages') as $v){ + var_export($v); + if(isset($v['url']) && isset($v['path'])){ + //$phpi->generatedata($v['path']); + $phpi->addPathDownload($v['url'],$v['to']); + }else if(isset($v['url'])){ + $phpi->addPathDownload($v['url'],$v['to'],$v['type']); + }else if(isset($v['path'])){ + $phpi->addPath($v['path'],$v['to']); + } +} +//$phpi->addPath(gpv('rootpath')); +$phpi->addPage('Pre-installation Check',file_get_contents('createinstaller/data/precheck.inc')); + +//license page +if(gpv('step_license')){ + if($phpi->addMetaFile('license','createinstaller/data/license.html','text/html')){ + $phpi->addPage('License',file_get_contents('createinstaller/data/license.inc'),array(),array('disabled'=>true)); + }else{ + $phpi->message('The license could not be added. Check the file '.$lPath.'.'); + } +} +if(!$phpi->addMetaFile('unknown','createinstaller/data/unknown.gif','image/gif')){ + $phpi->message('The license could not be added. Check the file '.$lPath.'.'); +} +if(!$phpi->addMetaFile('hb','createinstaller/data/installer.jpg','image/jpeg')){ + $phpi->message('The license could not be added. Check the file '.$lPath.'.'); +} + +$phpi->addInstallerPages(); +$phpi->generate(RESULTFILE); +echo '<a href="?download">download</a>'; +echo '</pre></div>'; +?> \ No newline at end of file Added: trunk/contrib/phpinstaller/createinstaller/page.files1.php =================================================================== --- trunk/contrib/phpinstaller/createinstaller/page.files1.php (rev 0) +++ trunk/contrib/phpinstaller/createinstaller/page.files1.php 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,81 @@ +<?php +$uses[] = 'rootpath'; +$uses[] = 'packages'; +$packages = gpv('packages'); +function genSelect($type=null){ + $compresstypes=''; + foreach(phpInstaller::$compresstypes as $v){ + if($v==$type) $compresstypes.="<option selected=\"selected\">$v</option>"; + else $compresstypes.="<option>$v</option>"; + } + return $compresstypes; +} +?> +<h2>Files to Extract</h2> +<p> +Here you can add files that will be installed. +Optional if you do not need files installed, or files are already distributed. +</p> +<div> +<select name="package_type" id="package_type"> +<option>Regluar</option> +<option>Download</option> +<option>Archive (Distributed With Installer)</option> +</select> +<input type="submit" name="package_add" id="package_add" value="Add..."></div> +<?php +if(isset($_POST['package_type']) && isset($_POST['package_add'])){ + switch ($_POST['package_type']){ + case 'Regluar': + $packages[] = array('to'=>'/','path'=>dirname(__FILE__)); + break; + case 'Download': + $packages[] = array('to'=>'/','url'=>'http://domain/file.zip ; http://domain/backup.zip','type'=>'zip'); + break; + case 'Archive (Distributed With Installer)': + $packages[] = array('to'=>'/','path'=>'archive.zip','type'=>'zip'); + break; + } +} + +$_packages = array(); +foreach($packages as $x=>$v){ + if(!isset($_POST['package_clear'][$x])) $_packages[] = $v; +} +$packages = $_packages; + +?> +<h2>Current Paths</h2> +<?php +if($packages){ +?> +<table style="width:100%;"> +<colgroup> +<col width="20%" /> +<col width="30%" /> +<col width="35%" /> +<col width="10%" /> +<col width="5%" /> +</colgroup> +<thead><th>Path To</th><th>Path From</th><th>URL (seperate with a " ; ", a space, semicolon, and another space)</th><th>Type</th><th>Remove</th></thead> +<?php + foreach($packages as $n=>$v){ + echo '<tr>'; + echo '<td>'; + echo '<input type="text" style="width:100%;" name="packages['.$n.'][to]" id="packages['.$n.'][to]" value="'.$v['to'].'" >'; + echo '</td><td>'; + echo isset($v['path'])?'<input style="width:100%;" type="text" name="packages['.$n.'][path]" id="packages['.$n.'][path]" value="'.$v['path'].'" >':'N/A'; + echo '</td><td>'; + echo isset($v['url'])?'<input style="width:100%;" type="text" name="packages['.$n.'][url]" id="packages['.$n.'][url]" value="'.$v['url'].'" >':'N/A'; + echo '</td><td>'; + echo isset($v['type'])?'<select style="width:100%;" name="packages['.$n.'][type]" id="packages['.$n.'][type]">'.genSelect($v['type']).'</select>':'N/A'; + echo '</td><td>'; + echo '<input type="submit" name="package_clear['.$n.']" id="package_clear['.$n.']" value="Remove" >'; + echo '</td>'; + echo "</tr>\n"; + } + echo '</table>'; +}else{ + echo 'You have no listings defined.'; +} +?> \ No newline at end of file Added: trunk/contrib/phpinstaller/createinstaller/page.files2.php =================================================================== --- trunk/contrib/phpinstaller/createinstaller/page.files2.php (rev 0) +++ trunk/contrib/phpinstaller/createinstaller/page.files2.php 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,10 @@ +<?php +$uses[] = 'ignore'; +?> +<h2>Files to Ignore</h2> +<p> +Any files containing one of the following strings will be ignored: +</p> +<div> +<textarea name="ignore" id="ignore" style="width:100%;height:10em;"><?php echo gpv('ignore'); ?></textarea> +</div> \ No newline at end of file Added: trunk/contrib/phpinstaller/createinstaller/page.pages.php =================================================================== --- trunk/contrib/phpinstaller/createinstaller/page.pages.php (rev 0) +++ trunk/contrib/phpinstaller/createinstaller/page.pages.php 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,11 @@ +<?php +$uses[] = 'step_license'; +?> +<div style="text-align:left;"><h1>Setup pages</h1></div> +<div><h2>Add/Remove pages</h2></div> +<div> +<label for="step_license">Include License page?</label> +<input type="checkbox" name="step_license" id="step_license" value="true"<?php + if(gpv('step_license')){echo ' checked="checked"';} ?> /><br /> +Please edit the <code>createinstaller/data/license.html</code> file to include your licence. +</div> Added: trunk/contrib/phpinstaller/createinstaller/page.start.php =================================================================== --- trunk/contrib/phpinstaller/createinstaller/page.start.php (rev 0) +++ trunk/contrib/phpinstaller/createinstaller/page.start.php 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1 @@ +<div style="text-align:left;"><h1>Welcome to the Installer creater.</h1></div> \ No newline at end of file Added: trunk/contrib/phpinstaller/createinstaller.php =================================================================== --- trunk/contrib/phpinstaller/createinstaller.php (rev 0) +++ trunk/contrib/phpinstaller/createinstaller.php 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,152 @@ +<?php +if (version_compare(phpversion(), '5.0.0', '<')){ + die("PHP5 is required for this verson of the installer devkit"); +} + +define('HTTP_FILE',strtolower(strtok($_SERVER['SERVER_PROTOCOL'], '/')).'://'.$_SERVER['HTTP_HOST']. $_SERVER['PHP_SELF']); +define('VERSION','1.0-rc1'); +define('RESULTFILE','installer.php'); +include('engine.inc.php'); + +//Download the installer +if (isset($_REQUEST['download'])) { + header("HTTP/1.1 200 OK"); + header("Status: 200 OK"); + header('Content-Type: application/force-download'); + header('Content-Disposition: attachment; filename="'.RESULTFILE.'"'); + header('Content-Length: '.filesize(RESULTFILE)); + readfile(RESULTFILE); + exit(0); +} + + +function gpv($name,$default=null,$get=true){//getPostValue + if(isset($_REQUEST[$name])){ + if($get){ + if(is_array($_REQUEST[$name])){ + return antislash($_REQUEST[$name]); + }else if( ($n=unserialize(urldecode($_REQUEST[$name]))) !==false || $_REQUEST[$name]===urlencode(serialize(false))){ + return $n; + }else{ + return antislash(antislash($_REQUEST[$name])); + } + }else{ + if(is_array($_REQUEST[$name])){ + return urlencode(serialize(antislash($_REQUEST[$name]))); + }else if( ($n=unserialize(urldecode($_REQUEST[$name]))) !==false || $_REQUEST[$name]===urlencode(serialize(false))){ + return urlencode(serialize($n)); + }else{ + return urlencode(serialize($_REQUEST[$name])); + } + } + }else{ + return $get?urlencode(serialize($default)):$default; + } +} + +function antislash($var){ + if(is_string($var)) return stripslashes($var); + if(is_array($var)){ + foreach($var as $n=>$v){ + $var[$n] = antislash($v); + } + } + return $var; +} + +$pages = array( + array('title'=>'Welcome', 'file'=>'start'), + array('title'=>'Applictation Name','file'=>'pages'), + array('title'=>'Applictation Name','file'=>'appname'), + array('title'=>'Files Setup', 'file'=>'files1'), + array('title'=>'Ignore', 'file'=>'files2'), + array('title'=>'Installer Definition' , 'file'=>'build') +); + +echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>Installer Creater</title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +<link rel="shortcut icon" href="favicon.ico" /> +<style> + +body { + margin: 0px; + background-color: white; + color : black; + padding:1em; +} + +h1,h2,h3,h4,h5{ + font-weight:bold; + margin:1px; + padding:1px; +} +h1{font-size:150%;} +h2{font-size:125%;} +h3{font-size:115%;} +h4{font-size:105%;} +div.margin{margin-left:1em;} +</style> +</head> +<body> +<form name="form" id="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> + <?php + $defaults = array( + 'page'=>(isset($_REQUEST['page'])?$_REQUEST['page']:0), + 'packages'=>array(), + 'step_license'=>'', + 'rootpath'=>dirname(__FILE__), + 'exec'=>'', + 'appname'=>'', + 'appver'=>'', + 'ignore'=>'' + ); + foreach($defaults as $dname=>$dvalue){ + $hidden[] = $dname; + if(!isset($_REQUEST[$dname])){ + $_REQUEST[$dname] = gpv($dname,$dvalue,true); + } + } + $uses = array('page'); + $totalpages = 5; + $page = gpv('page'); + + if(isset($_REQUEST['page_next'])) $page++; + else if(isset($_REQUEST['page_back'])) $page--; + + $button_prev = $page!=0; + $button_next = $page!=$totalpages; + if($file=$pages[$page]['file']){ + include("createinstaller/page.$file.php"); + }else{ + echo "Not a valid page (number $page)"; + } + ?> + <div style="text-align:right;margin-top:0.5em;padding:0.5em;border-top:solid 1px black;"> + <?php if($button_next){ ?> + <input type="submit" name="page_next" id="page_next" value="Next" style="float:right;" /> + <?php } ?> + <?php if($button_prev){ ?> + <input type="submit" name="page_back" id="page_back" value="Back" style="float:left;" /> + <?php } ?> + <input type="hidden" name="page" id="page" value="<?php echo $page; ?>" /> + </div><br /> + <?php + //echo '<table>'; + foreach($hidden as $value){ + if(!in_array($value,$uses)){ + echo '<input type="hidden" name="'.$value.'" id="'.$value.'" value="'.gpv($value,null,false).'" />'; + //echo "<tr><td>$value</td><td>"; + //var_dump(gpv($value)); + //echo "</td></tr>\n"; + } + } + //echo '</table>'; + ?> +</form> +</body> +</html> \ No newline at end of file Added: trunk/contrib/phpinstaller/docs/classtrees_webinstall.html =================================================================== --- trunk/contrib/phpinstaller/docs/classtrees_webinstall.html (rev 0) +++ trunk/contrib/phpinstaller/docs/classtrees_webinstall.html 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>Class Trees for Package webinstall</title> + <link rel="stylesheet" type="text/css" href="media/style.css"> + <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/> +</head> +<body> + +<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%"> + <tr> + <td class="header-top-left"><img src="media/logo.png" border="0" alt="phpDocumentor " /></td> + <td class="header-top-right">webinstall<br /><div class="header-top-right-subpackage"></div></td> + </tr> + <tr><td colspan="2" class="header-line"><img src="media/empty.png" width="1" height="1" border="0" alt="" /></td></tr> + <tr> + <td colspan="2" class="header-menu"> + [ <a href="classtrees_webinstall.html" class="menu">class tree: webinstall</a> ] + [ <a href="elementindex_webinstall.html" class="menu">index: webinstall</a> ] + [ <a href="elementindex.html" class="menu">all elements</a> ] + </td> + </tr> + <tr><td colspan="2" class="header-line"><img src="media/empty.png" width="1" height="1" border="0" alt="" /></td></tr> +</table> + +<table width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="195" class="menu"> + <div class="package-title">webinstall</div> + <div class="package"> + <div id="todolist"> + <p><a href="todolist.html">Todo List</a></p> + </div> + </div> + <b>Packages:</b><br /> + <div class="package"> + <a href="li_webinstall.html">webinstall</a><br /> + </div> + <br /> + </td> + <td> + <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top"> + +<h1>Class Trees for Package webinstall</h1> +<hr class="separator" /> +<div class="classtree">Root class phpInstaller</div> +<ul> +<li><a href="webinstall/phpInstaller.html">phpInstaller</a></li></ul> + + <div class="credit"> + <hr class="separator" /> + Documentation generated on Tue, 05 Sep 2006 22:32:40 -0600 by <a href="http://www.phpdoc.org">phpDocumentor 1.3.0RC4</a> + </div> + </td></tr></table> + </td> + </tr> +</table> + +</body> +</html> \ No newline at end of file Added: trunk/contrib/phpinstaller/docs/elementindex.html =================================================================== --- trunk/contrib/phpinstaller/docs/elementindex.html (rev 0) +++ trunk/contrib/phpinstaller/docs/elementindex.html 2006-09-24 20:56:41 UTC (rev 794) @@ -0,0 +1,281 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>Element Index</title> + <link rel="stylesheet" type="text/css" href="media/style.css"> + <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/> +</head> +<body> + +<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%"> + <tr> + <td class="header-top-left"><img src="media/logo.png" border="0" alt="phpDocumentor " /></td> + <td class="header-top-right">webinstall<br /><div class="header-top-right-subpackage"></div></td> + </tr> + <tr><td colspan="2" class="header-line"><img src="media/empty.png" width="1" height="1" border="0" alt="" /></td></tr> + <tr> + <td colspan="2" class="header-menu"> + [ <a href="classtrees_webinstall.html" class="menu">class tree: webinstall</a> ] + [ <a href="elementindex_webinstall.html" class="menu">index: webinstall</a> ] + [ <a href="elementindex.html" class="menu">all elements</a> ] + </td> + </tr> + <tr><td colspan="2" class="header-line"><img src="media/empty.png" width="1" height="1" border="0" alt="" /></td></tr> +</table> + +<table width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="195" class="menu"> + <div class="package-title">webinstall</div> + <div class="package"> + <div id="todolist"> + <p><a href="todolist.html">Todo List</a></p> + </div> + </div> + <b>Packages:</b><br /> + <div class="package"> + <a href="li_webinstall.html">webinstall</a><br /> + </div> + <br /> + </td> + <td> + <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top"> + +<a name="top"></a> +<h1>Index of All Elements</h1> +<h3>Package Indexes</h3> +<ul> + <li><a href="elementindex_webinstall.html">webinstall</a></li> +</ul> +<br /> + [ <a href="elementindex.html#a">a</a> ] + [ <a href="elementindex.html#c">c</a> ] + [ <a href="elementindex.html#d">d</a> ] + [ <a href="elementindex.html#e">e</a> ] + [ <a href="elementindex.html#f">f</a> ] + [ <a href="elementindex.html#g">g</a> ] + [ <a href="elementindex.html#i">i</a> ] + [ <a href="elementindex.html#m">m</a> ] + [ <a href="elementindex.html#p">p</a> ] + [ <a href="elementindex.html#s">s</a> ] + [ <a href="elementindex.html#v">v</a> ] + [ <a href="elementindex.html#_">_</a> ] +<br /><br /> + <a name="a"></a> + <div class="index-letter-section"> + <div style="float: left" class="index-letter-title">a</div> + <div style="float: right"><a href="#top">[Top]</a></div> + <div style="clear: both"></div> + </div> + <div> + <h2>a</h2> + <dl> + <dt><b>$appDescription</b></dt> + <dd>in file engine.inc.php, variable <a href="webinstall/phpInstaller.html#var$appDescription">phpInstaller::$appDescription</a><br> Optional Applactation Description</dd> + <dt><b>$appId</b></dt> + <dd>in file engine.inc.php, variable <a href="webinstall/phpInstaller.html#var$appId">phpInstaller::$appId</a><br> Short applactation name, with no spaces</dd> + <dt><b>$appName</b></dt> + <dd>in file engine.inc.php, variable <a href="webinstall/phpInstaller.html#var$appName">phpInstaller::$appName</a><br> Applactation Name</dd> + <dt><b>$appVersion</b></dt> + <dd>in file engine.inc.php, variable <a href="webinstall/phpInstaller.html#var$appVersion">phpInstaller::$appVersion</a><br> Optional Applactation Version</dd> + <dt><b>addCompressionMethod</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddCompressionMethod">phpInstaller::addCompressionMethod()</a><br> Add a decompression method to use</dd> + <dt><b>addInstallerPages</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddInstallerPages">phpInstaller::addInstallerPages()</a><br> Add the file-copying steps to the installer</dd> + <dt><b>addMetaFile</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddMetaFile">phpInstaller::addMetaFile()</a><br> Add a file to the installer.</dd> + <dt><b>addPage</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddPage">phpInstaller::addPage()</a><br> add a page to the installer</dd> + <dt><b>addPath</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddPath">phpInstaller::addPath()</a><br> Add a directory of files to the installer</dd> + <dt><b>addPathDownload</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddPathDownload">phpInstaller::addPathDownload()</a><br> Add a path that the user downloads</dd> + <dt><b>addWriteMethod</b></dt> + <dd>in file engine.inc.php, method <a href="webinstall/phpInstaller.html#methodaddWriteMethod">phpInstaller::addWriteMethod()</a><br> Add a method of creating files for example, over FTP, ect.</dd> + </dl> + </div> + <a name="c"></a> + <div class="index-letter-section"> + <div style="float: left" class="index-letter-title">c</div> + <div style="float: right"><a href="#top">[Top]</a></div> + <div style="clear: both"></div> + </div> + <div> + <h2>c</h2> + <dl> + <dt><b>$compress</b></dt> + <dd>in file engine.inc.php, variable <a href="webinstall/phpInstaller.html#var$compress">phpInstaller::$compress</a><br> Compress the installer</dd> + <dt><b>$compresstypes</b></dt> + <dd>in file ... [truncated message content] |
From: <ke...@us...> - 2006-09-24 20:08:57
|
Revision: 793 http://svn.sourceforge.net/phpfreechat/?rev=793&view=rev Author: kerphi Date: 2006-09-24 13:08:47 -0700 (Sun, 24 Sep 2006) Log Message: ----------- [en] New 'privmsg' parameter: this is an array of nicknames that you want to speak to (in a private chat) at first chat loading (thanks to Johnny Philavanh for his sponsoring : $130 USD) [3h00] [fr] Nouveau param?\195?\168tre 'privmsg' : c'est un tableau destin?\195?\169 ?\195?\160 contenir une liste de pseudonyme avec lesquels on souhaite ouvrir une fen?\195?\170tre de discussion au premier demarrage du chat (merci ?\195?\160 Johnny Philavanh pour sa donation de $130 USD). [3h00] Modified Paths: -------------- trunk/src/client/chat.js.tpl.php trunk/src/client/pfcclient.js trunk/src/commands/privmsg.class.php trunk/src/pfcglobalconfig.class.php Modified: trunk/src/client/chat.js.tpl.php =================================================================== --- trunk/src/client/chat.js.tpl.php 2006-09-23 15:49:00 UTC (rev 792) +++ trunk/src/client/chat.js.tpl.php 2006-09-24 20:08:47 UTC (rev 793) @@ -1,4 +1,6 @@ +<?php function quoteandescape($v) { return "'".addslashes($v)."'"; } ?> <?php $nick = $u->nick != "" ? addslashes($u->nick) : addslashes($c->nick); ?> + var pfc_nickname = '<?php echo ($GLOBALS["output_encoding"]=="UTF-8" ? $nick : iconv("UTF-8", $GLOBALS["output_encoding"],$nick)); ?>'; var pfc_version = '<?php echo $version; ?>'; var pfc_clientid = '<?php echo md5(uniqid(rand(), true)); ?>'; @@ -18,18 +20,22 @@ var pfc_connect_at_startup = <?php echo $connect_at_startup ? "true" : "false"; ?>; var pfc_notify_window = <?php echo $notify_window ? "true" : "false"; ?>; var pfc_defaultchan = Array(<?php - function quoteandescape($v) { return "'".addslashes($v)."'"; } - $list = array(); foreach($c->channels as $ch) {$list[] = $ch; } + $list = array(); foreach($c->channels as $item) {$list[] = $item; } $list = array_map("quoteandescape",$list); echo implode(",", $list); ?>); var pfc_userchan = Array(<?php - $list = array(); foreach($u->channels as $ch) {$list[] = $ch["name"];} + $list = array(); foreach($u->channels as $item) {$list[] = $item["name"];} $list = array_map("quoteandescape",$list); echo implode(",", $list); ?>); -var pfc_privmsg = Array(<?php - $list = array(); foreach($u->privmsg as $pv) {$list[] = $pv["name"];} +var pfc_defaultprivmsg = Array(<?php + $list = array(); foreach($c->privmsg as $item) {$list[] = $item; } + $list = array_map("quoteandescape",$list); + echo implode(",", $list); + ?>); +var pfc_userprivmsg = Array(<?php + $list = array(); foreach($u->privmsg as $item) {$list[] = $item["name"];} $list = array_map("quoteandescape",$list); echo implode(",", $list); ?>); @@ -86,6 +92,7 @@ "Maximum number of private chat has been reached", // _pfc "Click here to send your message", // _pfc "Send", // _pfc + "You are not allowed to speak to yourself", // _pfc ); foreach($labels_to_load as $l) { Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-23 15:49:00 UTC (rev 792) +++ trunk/src/client/pfcclient.js 2006-09-24 20:08:47 UTC (rev 793) @@ -234,6 +234,10 @@ { // speak to unknown user } + else if (resp == "speak_to_myself") + { + this.displayMsg( cmd, this.res.getLabel('You are not allowed to speak to yourself') ); + } else alert(cmd + "-"+resp+"-"+param); } @@ -241,20 +245,18 @@ { if (resp == "connected" || resp == "notchanged") { - // now join channels comming from sessions - // or the default one cmd = ''; - if (pfc_userchan.length == 0) + + // join the default channels comming from the parameter list + for (var i=0; i<pfc_defaultchan.length; i++) { - for (var i=0; i<pfc_defaultchan.length; i++) - { - if (i<pfc_defaultchan.length-1) - cmd = "/join2"; - else - cmd = "/join"; - this.sendRequest(cmd, pfc_defaultchan[i]); - } + if (i<pfc_defaultchan.length-1) + cmd = "/join2"; + else + cmd = "/join"; + this.sendRequest(cmd, pfc_defaultchan[i]); } + // now join channels comming from sessions for (var i=0; i<pfc_userchan.length; i++) { if (i<pfc_userchan.length-1) @@ -263,10 +265,21 @@ cmd = "/join"; this.sendRequest(cmd, pfc_userchan[i]); } - for (var i=0; i<pfc_privmsg.length; i++) + + // join the default privmsg comming from the parameter list + for (var i=0; i<pfc_defaultprivmsg.length; i++) { - this.sendRequest("/privmsg", pfc_privmsg[i]); + if (i<pfc_defaultprivmsg.length-1) + cmd = "/privmsg2"; + else + cmd = "/privmsg"; + this.sendRequest(cmd, pfc_defaultprivmsg[i]); } + // now join privmsg comming from the sessions + for (var i=0; i<pfc_userprivmsg.length; i++) + { + this.sendRequest("/privmsg", pfc_userprivmsg[i]); + } } if (resp == "ok" || resp == "notchanged" || resp == "changed" || resp == "connected") Modified: trunk/src/commands/privmsg.class.php =================================================================== --- trunk/src/commands/privmsg.class.php 2006-09-23 15:49:00 UTC (rev 792) +++ trunk/src/commands/privmsg.class.php 2006-09-24 20:08:47 UTC (rev 793) @@ -25,7 +25,7 @@ // error: can't speak to myself if ($pvnickid == $nickid) { - $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ko', Array('".addslashes($pvname)."','speak to myself'));"); + $xml_reponse->addScript("pfc.handleResponse('".$this->name."','speak_to_myself');"); return; } Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-09-23 15:49:00 UTC (rev 792) +++ trunk/src/pfcglobalconfig.class.php 2006-09-24 20:08:47 UTC (rev 793) @@ -54,8 +54,9 @@ 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; + 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) @@ -111,7 +112,7 @@ // private parameters var $_sys_proxies = array("lock", "checktimeout", "checknickchange", "auth", "noflood", "censor", "log"); var $_proxies = array(); // will contains proxies to execute on each command (filled in the init step) - var $_dyn_params = array("nick","isadmin","islocked","admins","frozen_channels"); + var $_dyn_params = array("nick","isadmin","islocked","admins","frozen_channels", "channels", "privmsg"); var $_params_type = array(); function pfcGlobalConfig( $params = array() ) @@ -184,6 +185,12 @@ if (isset($params[$dp])) $this->$dp = $params[$dp]; + // 'channels' is now a dynamic parameter, just check if I need to initialize it or not + if (is_array($this->channels) && + count($this->channels) == 0 && + !isset($params['channels'])) + $this->channels = array(_pfc("My room")); + // now load or save the configuration in the cache $this->synchronizeWithCache(); } @@ -274,7 +281,6 @@ if ($this->title == "") $this->title = _pfc("My Chat"); if ($this->xajaxpath == "") $this->xajaxpath = dirname(__FILE__)."/../lib/xajax_0.2.3"; if ($this->jspath == "") $this->jspath = dirname(__FILE__)."/../lib/javascript"; - if (is_array($this->channels) && count($this->channels) == 0) $this->channels = array(_pfc("My room")); // first of all, check the used functions $f_list["file_get_contents"] = _pfc("You need %s", "PHP 4 >= 4.3.0 or PHP 5"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |