The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
GoJIRC with JIRC Integration Hack
I am attempting to set up GoJIRC through the JIRC integration hack. The only problem with this hack is it seems the only way that $bbuserinfo[username] pulls the username info from the Board is if it is in the template. That is unfortunately not an option with GoJirc since it pulls it's parameter data out of an XML file. Is there anybody here who knows how to get the user name information to transfer so that GoJIRC can be used?
|
#2
|
||||
|
||||
GoJIRC is a JAVA-Applet that reads a configuration-XML-file from the webserver?
Then just write a PHP-File that outputs the required XML. |
#3
|
|||
|
|||
It reads an XML for the Parameter data. How would I go about creating a PHP file which feeds the XML file? Would this solve my problem with parsing username from the database? THat is all I want to do is parse the current username from the database.
|
#4
|
|||
|
|||
Here are the files in question in regard to getting this to work:
First, the chat_chatbit template: Code:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%"> <tr id="cat"> <td class="tcat" width="100%"><span class="normalfont"><b>Chat</b></span></td> </tr> <tr> <td class="alt1" width="100%" align="center"> <script src="config.js" type="text/javascript"></script> <script src="inc.js" type="text/javascript"></script> <body> <div id="body"> <div id="chatbox"> <div id="chatbox-top"> Cavy Compendium Chat </div> <div id="chatbox-mid"> <div id="chatbox-mid-head"> <script type="text/javascript"> //<![CDATA[ doWrite('menubar'); //]]> </script> </div> <script type="text/javascript"> //<![CDATA[ smy_doSmileys(); doWrite('chat'); //]]> </script> </div> </div> <script type="text/javascript"> //<![CDATA[ doWrite('status'); //]]> </script> <p> <img alt="W3C XHTML 1.1" src="script/images/xhtml11.gif" onclick="popup('http://validator.w3.org/check/referer')" height="15" width="94" /> <img alt="W3C CSS" src="script/images/css.gif" onclick="popup('http://jigsaw.w3.org/css-validator/check/referer')" height="15" width="94" /> <img alt="Get Firefox" src="script/images/firefox.png" onclick="popup('http://www.mozilla.org/products/firefox')" height="15" width="94" /> </p> <p> Web Chat Powered by WillyPS' <a href="javascript:;" onclick="popup('http://gojirc.willyps.com')">GojIRC Front End 2.0</a>. </p> </div> <script type="text/javascript"> //<![CDATA[ doWrite('sound'); //]]> </script> <iframe src="$vboptions[bburl]/chat.php?do=extendsession" width=0 height=0 frameborder=0></iframe> </td> </tr> </table> Code:
// ===================================================================== // // { GojIRC Front End } // // Version: 2.0 // Author: WillyPS // Web: gojirc.willyps.com // Copyright (c) 2001 - 2004 WillyPS // // File: lib.js // File Version: 1.0 // Description: Functions' library. // File Author: WillyPS // // ---------------------------------------------------------------------- // // 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 // // ===================================================================== // --------------------------------------------------------------------------- // COMMON JAVASCRIPT API // --------------------------------------------------------------------------- // Get an element by it's id function get(id) { return document.getElementById(id); } // Echo string function echo(str) { return document.write(str); } // Show element function show(id) { var st = ''; if (id == 'statusbox') { st = 'block'; } else { st = 'inline'; } if (typeof id == 'string'){ get(id).style.display = st; } else { id.style.display = st; } } // Hide element function hide(id) { if (typeof id == 'string'){ get(id).style.display = "none"; } else { id.style.display = "none"; } } // Process irc commands. function command(cmd) { get('jchat').processJInput(cmd); } // Retrive values (own nick, highlithed nick, current channel) function read(str) { if (typeof get('jchat') != 'undefined') { return get('jchat').readJOutput(str); } else { return f; } } // Play Sound. // Short for playSound() in fsapi mod. function play(soundObj) { if (SoundMod) { playSound(soundObj); } } // Create <param> tag. function param(name,value) { echo('<param name="'+name+'" value="'+value+'" />'); } // Reset a var's value to blank // Support multiple values (comma separated list). function rezet() { var arg = rezet.arguments; for(i = 0; i < arg.length; i++) { var type = typeof arg[i]; if (type == 'string') { arg[i] = '';} else if (type == 'number') { arg[i] = 0; } else if (type == 'array') { arg[i] = ['']; } } } // Preload imgs function preload() { if(document.images) { if(typeof document.pimg == 'undefined' || !document.pimg) { document.pimg = new Array(); var pm = document.pimg.length, arg = preload.arguments; for(i = 0; i < arg.length; i++) { if (arg[i].indexOf('#') != 0) { document.pimg[pm] = new Image(); document.pimg[pm++].src = arg[i]; } } } } } // Open a pop-up window function popup(url) { window.open(url); } // Read datafile function readFile(datafile) { if (document.getElementById) { Xml.open('GET',datafile,false); Xml.send(null); return Xml.responseText; } } // --------------------------------------------------------------------------- // SINGLE FUNCTIONS // --------------------------------------------------------------------------- // Concat array params into AppletParams function concatParams(arr) { if (_ns) { AppletParams = AppletParams.concat(arr); // for sun's jvm } else { AppletParams = arr.concat(AppletParams); // for msjvm AppletParams = AppletParams.concat(arr); // for sun's jvm } } // function addParams(prm) { // Add parameters from params.xml if (prm == 'config' || prm == 'theme') { var param, params = readFile(EngineDir+'parameters/default.xml').split('\n'); for (i = 0; i < params.length; i++) { if (params[i].match('<param ')) { param = params[i].match(/\x22.*\x22/g); // get values inside of comiles if (param != null) { param = param.toString(); // string it param = param.replace(/\x22/g,''); // remove comiles param = param.replace(/value=/,' => '); // replace attribute with delimiter1 concatParams([param]); // add to AppletParams[] } } } } // Add theme params if (prm == 'theme') { var param, params = readFile(ThemeDir+'params.theme.xml').split('\n'); for (i = 0; i < params.length; i++) { if (params[i].match('<param ')) { param = params[i].match(/\x22.*\x22/g); // get values inside of comiles if (param != null) { param = param.toString(); // string it param = param.replace(/\x22/g,''); // remove comiles param = param.replace(/value=/,' => '); // replace attribute with delimiter1 concatParams([param]); // add to AppletParams[] ThemeParams[ThemeParams.length] = param; } } } } // Label wordings from lang file if (prm == 'lang') { // Use Language[] because for some reason Lang[] doesn't work here. for (i = 0; i < (Language.length -1); i++) { if (Language[i].match(/^Applet_/)) { var lparam = Language[i].replace(/^Applet_/,''); lparam = lparam.split(delimiter1); if (lparam[0] == 'FieldNameQuitMsg') { lparam[1] += ' ? GojIRC ['+ GoVersion +'] ? http://gojirc.willyps.com ?'; } concatParams([lparam[0]+' => '+lparam[1]]); } } } } // Add resquested FilterKeys & Vals to FilterParams[]. function addFilter(filt,ext) { ext = ext ? ext : '.gif'; // no extension supplied, use .gif var loops = (filt[filt.length -1] == '' || filt[filt.length -1] == ' ') ? filt.length -1 : filt.length ; for (i = 0; i < loops; i++) { var tmp = filt[i].split(delimiter1); var sname = tmp[0]; var svals = tmp[1].split(/\x20/); for (j = 0; j < svals.length; j++) { FilterParams[0] += ' '+svals[j]; // Add all available keys FilterParams[1] += ' '+sname+ext; // Add all names for keys } } } // Create Lang[] vars. function doLang(arr){ var lang; if (typeof arr == 'object') { for(i = 0; i < (arr.length -1); i++) { lang = arr[i].split(delimiter1); if (typeof lang[1] == 'undefined') { lang[1] = ''; } Lang[lang[0]] = unescape(lang[1]); } } } // Status icon actions when double-clicked. function statusAction(action) { if (AwayOn) { gojirc('away'); } else { gojirc('quit'); } } // Status image change. function statusImg(event) { if (Theme && (DisplayStatus == '1')) { var sicon = get('status-icon'); if (event == 'disconnex') { sicon.src = ImgStatus[0].src; sicon.title = Lang['Status_IconDisconnected']; } else if (event == 'connex') { sicon.src = ImgStatus[1].src; sicon.title = Lang['Status_IconConnected']; } else if (event == 'away') { sicon.src = ImgStatus[2].src; sicon.title = Lang['Status_IconAway']; } } } // Check connex. // Check if user is connected to the IRC. function connex() { if (jout) { // 2.7.x and up only // Connected? try { // connected if (read('%$N') == '') { return f; } // not connected else { return read('%$N'); } } catch (e) { // Stop ReadJOutput error after 3 loops to prevent crashes. if ((typeof errNoReadJOutput != 'undefined') && (errNoReadJOutput > 2)) { EnableReadJOutput = "0"; jout = f; return jout; } else { e.filename = (typeof e.filename == 'undefined') ? document.location : e.filename; errNoReadJOutput++; return getError('js',e.name,e.message,e.lineNumber,e.filename,'This error could be related with:\n- jIRC version incompatibility. Set EnableReadJOutput to cero in config.\n- the applet did not loaded. Check all paths and files are correct.'); } } } // 2.6.0 and older else { return t; } } // Check selected nickname. function sNick() { if (jout) { // 2.7.x and up only thissnick = ''; thissnick = read('%$HN'); // selected nickname? if (thissnick == x || thissnick == '') { return f; } // seleted nick else { return thissnick; } } // 2.6.0 support else { return t; } } // Saves a window session log. function goLog(ref,event) { if (ref == 'dostat') { statuslog[statuslog.length] = event; // add to log return t; } else { for (i = 0, mystatuslog = ''; i < statuslog.length; i++) { mystatuslog += statuslog[i]+'\n'; // add to active log } return mystatuslog; } } // Set IRC Staus messages. function doStatus(msg) { if (DisplayStatus == '1') { var statusmsg = get('status-msg'); //var statusmsg = get('status-msg').childNodes[0]; // add time stamp if (TimeStamp == '1') { getUserTime(); msg = stamp + msg; } // apply msg to status statusmsg.innerHTML = msg; //statusmsg.nodeValue = msg; // add to historial goLog('dostat',statusmsg.innerHTML); } } // Create HTML elements. function doWrite(type,arg) { // Sound object if (type == 'sound' && (EnableSound == '1')) { // If modules detected, create sound objects. if (SoundMod) { doSoundObj(); } // No module present else { getError('cfg','','No sound module installed or detected!\n\nIf you want to use sounds in GojIRC, install a sound\nmodule (e.g. Flash Sound) in the Modules section of config.\nOtherwise, consider one of these values for EnableSound\nwich doesn\'t require a sound module:\n\n0\tDisable sounds\n2\tUse Only Old Load Sound + Applet Sounds\n3\tUse Only Applet Sounds\n\nSet one of the above values in EnableSound in config.'); } } // Menubar if (((type == 'menu') || (type == 'menubar')) && (typeof Menubar == 'object')) { doMenu(Menubar,'runCmd','gojirc'); } // Status bar if (((type == 'status') || (type == 'statusbar')) && (DisplayStatus == '1')) { StatusOn = t; echo( '<div id="statusbox">'+ '<table id="status">'+ '<tr>'+ '<td width="3%" id="status-left">' ); if (Modules.toString().match('myoptions')) { echo('<img alt="[opts]" title="'+Lang['Menu_MyOptions']+'" onclick="myo_options()" style="cursor: pointer;" src="'+ModDir+'myoptions/options.gif" />'); } echo( '</td>'+ '<td width="94%" id="status-center">'+ '<div id="status-msg">GojIRC Front End '+GoVersion+' by WillyPS</div>'+ '</td>'+ '<td width="3%" id="status-right">'+ '<img alt="'+Lang['Text_Status']+'" id="status-icon" ondblclick="statusAction()" src="'+ImgStatus[1].src+'" />'+ '</td>'+ '</tr>'+ '</table>'+ '</div>' ); } // Quick bar if ((type == 'quick') || (type == 'quickbar')) { QuickOn = t; echo( 'Nick: <a href="javascript:gojirc(\'newnick\')" id="quick_nick">No nick</a>' ); } // No Java alt text if (type == 'nojava') { echo( '<div style="text-align: center;">'+ '<div style="margin: 20px 5px 5px;">'+ '<span style="font-size: 16px; font-weight: bold;">'+Lang['Text_NoJavaTitle']+'</span><br /><br />'+ '<img src="classes/applet_images/duke.gif" alt="Duke says: Bye!" width="55" height="68" /><br /><br />'+Lang['Text_NoJavaConsider']+'<br /><br />'+ '<div style="margin-left: 20%; text-align: left;">'+Lang['Text_NoJavaOpt']+'<br /></div>'+ '</div>'+ '</div>' ); } // Applet/Object tag if ((type == 'applet') || (type == 'object')) { if (type == 'applet') { alert(type); if (arg == 'close') { echo('</applet>'); } else { rezet(AppletParams); echo('<applet id="'+jid+'" archive="'+archive+'" codebase="'+codebase+'" code="'+codeclass+'" MAYSCRIPT>'); doWrite('appletparams'); doWrite('nojava'); } } else { if (arg == 'close') { echo('</object>'); } else { rezet(AppletParams); echo('<object id="'+jid+'" archive="'+archive+'" codebase="'+codebase+'" classid="java:'+codeclass+'" codetype="application/java">'); doWrite('appletparams'); doWrite('nojava'); } } } // Chat if (type == 'chat') { var chatopentag = '', chatclosetag = ''; if (arg == 'obj' || arg == 'object') { chatopentag = '<object classid="java:'+codeclass+'" codetype="application/java"'; chatclosetag = '</object>'; } else { chatopentag = '<applet code="'+codeclass+'" MAYSCRIPT'; chatclosetag = '</applet>'; } if (jout) { chatopentag += ' codebase="'+codebase+'"'; } chatopentag += ' id="'+jid+'" archive="'+archive+'">'; echo(chatopentag); doWrite('appletparams'); doWrite('nojava'); echo(chatclosetag); } // Applet Params if (type == 'appletparams') { // CABBASE if (arg == 'obj' || arg == 'object') { for (i = 0, tmp = '', _cabbase = cabbase.split(/\x2C/); i < _cabbase.length; i++) { tmp += 'classes/'+_cabbase[i]+','; } cabbase = tmp.slice(0, tmp.length -1); param('CABBASE',cabbase); } else { param('CABBASE',cabbase); } // Filter Params if (typeof FilterParams == 'object') { concatParams(FilterParams); } // Sound params if (EnableSound) { // disabled if (EnableSound == '0') { concatParams(['AllowSound => false','AllowJoinSound => false','AllowLeaveSound => false','DisplaySoundControl => false']); } // enable else if (EnableSound != '0') { concatParams(['AllowSound => true','AllowJoinSound => true','AllowLeaveSound => true','DisplaySoundControl => true']); } } // URL strings if (ReqNickname) { ParamNickName = ReqNickname; concatParams(['NickName => '+ReqNickname]); } if (DirectStart) { var connex = DirectStart ? 'true' : 'false'; ParamDirectStart = (connex == 'true') ? '1' : '0'; concatParams(['DirectStart => '+connex]); } // Config.js if (LoginCmd) { concatParams(['NickAuthString => '+LoginCmd.replace(/^\x2F/,'')]); } if (ProfileUrl != '') { concatParams(['UserProfileURL => '+ProfileUrl]); } // Create channel params from Channels[] // To dinamicly add channels, do it in the channel drop-down creation, // to avoid duplication in the applet's channel drop-down. if (typeof Channels == 'object') { var ChannelsTmp = new Array(); for (i = 0, j = 1; i < (Channels.length -1); i++, j++) { tmp = Channels[i].split(delimiter1); ChannelsTmp[i] = 'Channel'+ j +' => '+tmp[0].replace(/^\x23/,''); } concatParams(ChannelsTmp); } // Add server params from Servers[] to AppletParams[] // Needs to be added and not to create params directly from here, // because localhost then would not be added (if DevMode). if (typeof Servers == 'object') { var ServersTmp = new Array(); // If DevMod, add localhost for testing porpouses if (DevMode) { Servers = [localhost].concat(Servers); } for (i = 0, j = 1; i < (Servers.length -1); i++, j++) { ServersTmp[i] = 'ServerName'+ j +' => '+ Servers[i]; } concatParams(ServersTmp); } // Applet params if (typeof AppletParams == 'object') { // General applet params for (i = 0, j = 0; i < (AppletParams.length -1); i++) { if (AppletParams[i] != '') { var aparam = AppletParams[i].split(delimiter1); // If no value, add a blank one to prevent problems. if (typeof aparam[1] == 'undefined') { aparam[1] = ''; } // Get some params values if (aparam[0] == 'AliasList') { ParamAliasList = aparam[1]; } // aliases if (aparam[0] == 'NickName' && !ReqNickname) { ParamNickName = aparam[1]; } // nick if (aparam[0] == 'RealName') { ParamRealName = aparam[1]; } //realname if (aparam[0] == 'DirectStart' && !DirectStart) { // direct start ParamDirectStart = (aparam[1].toLowerCase() == 'true') ? '1' : '0'; } // RealName if (aparam[0] == 'RealName') { aparam[1] += ' ? GojIRC ['+GoVersion+'] ? http://gojirc.willyps.com ?'; } param(aparam[0],aparam[1]); } } } } } // Menu builder. // menu array, <select> function, <option> function function doMenu(menu,selfunc,optfunc) { for (i = 0; i < menu.length; i++) { if (menu[i] == '') { break; } // stop loop if blank entry (wich is supposed to be the end) var tmp = menu[i].split(delimiter1); var tag = tmp[0]; // select or option var args = tmp[1]; // tag arguments var option; var props; if (args) { var prop; tmp = args.split(delimiter2); option = tmp[0]; // tag id, title, hr or cmd // lang and arguments if (typeof tmp[1] != 'undefined') { prop = tmp[1]; } else { prop = undefined; } } if (prop) { props = prop.split(delimiter3); } doOption(tag,option,props,selfunc,optfunc); } } // Build menubar's menus. function doOption(tag,option,props,selfunc,optfunc) { // Tag <select> if (tag == 'select' || tag == 'menu') { if (option == 'open') { echo('<select size="1" id="'+props+'" onchange="'+selfunc+'(this.id)">'); pastselect = props; } else if (option == 'close'){ echo('</select>'); get(pastselect).selectedIndex = 0; } } // Tag is <option> else if (tag == 'option' || tag == 'item') { // Get the value of the respective asosiative Lang[] if (typeof props != 'undefined') { var txt; // check if it's a Lang[] asosiative if (props[0].match(/^(Lang\[{1})/g)) { txt = props[0].replace(/(Lang\[\x27)|(\x27\])/g,''); txt = eval('Lang[\''+txt+'\']'); } // Use user custome... else { txt = props[0]; } } // Drop-down title if (option == 'title') { echo('<option value="none" selected="selected">'+txt+'</option>'); } // Command option else if (option == 'cmd') { if (props[0] == 'channels') { // channels' list. // Requested channel by URL string if (ReqChannel) { Channels = ReqChannel.concat(Channels); } // Use specified channels in Channels[] in config.js... for (j = 0; j < (Channels.length - 1); j++) { // Used j to avoid conflicts with i in doOption(). var ch = Channels[j].split(delimiter1); if ((typeof ch[1] == 'undefined') || (ch[1] == '') || (ch[1] == ' ') || (ch[1] == x)) { ch[1] = ch[0]; } echo('<option value="javascript:'+optfunc+'(\'channel\',\''+ch[0]+'\')" onmouseover="window.status=\''+ch[1]+'\';return true;" onmouseout="window.status=\''+Lang['Text_WinStatus']+'\';return true;">'+ch[1]+'</option>'); } } // double argument else if (typeof props[2] != 'undefined' && (props[2] || props[2] != '')) { echo('<option value="javascript:'+optfunc+'(\''+props[1]+'\',\''+props[2]+'\')" id="opt_'+props[1]+'_'+props[2]+'" onmouseover="window.status=\''+txt+'\';return true;" onmouseout="window.status=\''+Lang['Text_WinStatus']+'\';return true;">'+txt+'</option>'); } // single argument else { // Don't write option if no valet config (in config.js) if (props[1] == 'login' && LoginCmd == '') { return t; } if (props[1] == 'register' && RegCmd == '') { return t; } if (props[1] == 'status' && DisplayStatus == '0') { return t; } if (props[1] == 'profile' && ProfileUrl == '') { return t; } if (props[1] == 'channelinfo' && ChannelinfoCmd == '') { return t; } // Write every option else { echo('<option value="javascript:'+optfunc+'(\''+props[1]+'\')" id="opt_'+props[1]+'" onmouseover="window.status=\''+txt+'\';return true;" onmouseout="window.status=\''+Lang['Text_WinStatus']+'\';return true;">'+txt+'</option>'); } } } // Horizontal rule else if (option == 'hr') { if (typeof props[0] == 'undefined') { props[0] = 'mid'} var hr = props[0]; hrcount++; if (hr == 'thiner') { hr = "--------------"; } else if (hr == 'thin') { hr = "----------------"; } else if (hr == 'mid') { hr = "------------------"; } else if (hr == 'wide') { hr = "--------------------"; } else if (hr == 'wider') { hr = "----------------------"; } echo('<option value="none" id="hr_'+hrcount+'" onmouseover="window.status=\' \';return true;" onmouseout="window.status=\''+Lang['Text_WinStatus']+'\';return true;">'+hr+'</option>'); } } } // Add option to <select> menu function addOption(menu,option,props,optfunc,position) { // Position ??? if ((typeof position != 'undefined') && (position != '')) { var tomove = new Array(); // In place of option... if (isNaN(position)) { var pid = position; // position is id for (i = 0; i < get(menu).options.length; i++) { if (get(menu).options[i].id == pid) { // match place id position = i; // position number // backup options... for (j = 0; i < get(menu).options.length; i++, j++) { tomove[j] = get(menu).options[i]; } // add option get(menu).options[position] = doAddOption(menu,option,props,optfunc); // readd backuped options... for (j = 0; j < tomove.length; j++) { position++; get(menu).options[position] = tomove[j]; } } } } // In place number... else { for (i = 0; i < get(menu).options.length; i++) { if (i == position) { // match place number // backup options... for (j = 0; i < get(menu).options.length; i++, j++) { tomove[j] = get(menu).options[i]; } // add option get(menu).options[position] = doAddOption(menu,option,props,optfunc); // readd backuped options... for (j = 0; j < tomove.length; j++) { position++; get(menu).options[position] = tomove[j]; } } } } } // No position specified, add to the end. else { get(menu).options[get(menu).length] = doAddOption(menu,option,props,optfunc); } } // Do add option to <select> menu function doAddOption(menu,option,props,optfunc) { var defaultSelected = t, selected = f, optionName, txt; props = props.split(delimiter3); // Get the value of the respective asosiative Lang[] if (typeof props != 'undefined') { // Check it's a Lang[] asosiative index. if (props[0].match(/^(Lang\[{1})/g)) { txt = props[0].replace(/(Lang\[\x27)|(\x27\])/g,''); txt = eval('Lang[\''+txt+'\']'); } // Use user custome... else { txt = props[0]; } } // Command if (option == 'cmd') { // double argument if (typeof props[2] != 'undefined' && (props[2] || props[2] != '')) { optionName = new Option(txt, 'javascript:'+optfunc+'(\''+props[1]+'\',\''+props[2]+'\')', defaultSelected, selected) optionName.id = 'opt_'+props[1]+'_'+props[2]; } // single argument else { optionName = new Option(txt, 'javascript:'+optfunc+'(\''+props[1]+'\')', defaultSelected, selected) optionName.id = 'opt_'+props[1]; } } // Horizontal rule else if (option == 'hr') { if (typeof props[0] == 'undefined') { props[0] = 'mid'} var hr = props[0]; hrcount++; if (hr == 'thiner') { hr = "--------------"; } else if (hr == 'thin') { hr = "----------------"; } else if (hr == 'mid') { hr = "------------------"; } else if (hr == 'wide') { hr = "--------------------"; } else if (hr == 'wider') { hr = "----------------------"; } optionName = new Option(hr, 'none', defaultSelected, selected) optionName.id = 'hr_'+hrcount; } return optionName; } // Set a specified message by the user for different actions. function setMsg(option) { var msg; // Get <option> text to use it on prompt message. // This will make the message to be totaly translated. if (get('opt_'+option)) { option = get('opt_'+option).text; option = option.toLowerCase(); } // Prompt message. if ((msg = prompt(Lang['Prompt_Set1'] +' '+ option +' '+ Lang['Prompt_Set2'],''))) { return msg; } else { return f; } } // Nick message for: Whois, Ping, Finger, Client version/info, // Time user, Ignore/activate, Give/Remove voice/@p, Kick (fast/reason), Ban function setNick(option) { var nick; // Get <option> text to use it on prompt message. // This will make the message to be totaly translated. if (get('opt_'+option)) { option = get('opt_'+option).text; option = option.toLowerCase(); } // Use selected nick. if (sNick()) { nick = thissnick; } else { nick = ''; } // no selected nick // Prompt message. if ((nick = prompt(Lang['Prompt_Nick1'] +' '+ option +' '+ Lang['Prompt_Nick2'],nick))) { return nick; } else { return f; } } // On Mouse Over. function mOver(act,id) { if (act == 'winstatus') { window.status = Lang['Text_WinStatus']; } return t; } // On Mouse Out function mOut(act,id) { return t; } // Change PrompNickType // To be used to alternate prompt when primary condition isn't met. function changePromptNT(value,cmd,option) { if (connex()){ if (!PromptNickTypeAuto && ((value) && (value != ''))) { PromptNickTypeAuto = t; PromptNickTypeBak = PromptNickType; PromptNickType = value; if (option) { gojirc(cmd,option); } else { gojirc(cmd); } } else { PromptNickTypeAuto = f; PromptNickType = PromptNickTypeBak; PromptNickTypeBak = ''; } } // If no connex... dumb. else { dumb('connex'); } } // Auto Away system. function startIdle() { // Check auto away is enable. if (IdleTime != '') { UserIdleTime += 1; // Activate auto away. if ((connex()) && (UserIdleTime == IdleTime) && !AwayOn) { command('/me '+ Lang['Action_AwayOn'] +' '+ bks +' '+ AwayIdleReason +' '+ bke); command('/away '+ AwayIdleReason); play('bip'); AutoAwayOn = t; UserIdleTime = 0; clearTimeout(timer_idle); } // Continue trying to count user idle until // it's the same time in IdleTime var. else if ((connex()) && !AutoAwayOn && !AwayOn) { timer_idle = setTimeout('startIdle()',1000); } } } // Stops idle count and turn off away mode. function stopIdle() { // Deactivate auto away if enabled and running. if ((IdleTime != '') && AutoAwayOn) { command('/me '+ Lang['Action_AwayOff'] +' '+ bks +' '+ AwayIdleReason +' '+ bke); command('/away'); play('bip'); AutoAwayOn = f; UserIdleTime = 0; } } /*/ Create Chat # in dev # function createChat() { var prop = document.createElement('applet'); prop.setAttribute('id','jchat'); prop.setAttribute('codebase','classes'); prop.setAttribute('code','Chat.class'); prop.setAttribute('cabbase','jirc_mss.cab,resources.cab'); prop.setAttribute('archive','jirc_nss.zip,resources.zip'); prop.setAttribute('width','100'); prop.setAttribute('height','100'); var chat = document.getElementById('chat'); chat.appendChild(prop); //checkAppletLoad(); // exec applet check. }*/ // Init runtimes. // Executions at chat startup. function runInit() { if (!get("opt_about")) {if(!noabout){noabout=t;getError('NoAbout');}} // checks if the browser is Java-enabled. if (_java) { checkAppletLoad(); // exec applet check. } // no java else if (!_java) { alert(Lang['Alert_NoJava']); jout = f; EnableErrorReport = '2'; doWrite('nojava'); document.close(); hide('body'); } } // Last runtimes. // Executions at chat quit. function runLast() { if (typeof winhelp != 'undefined' &&winhelp) { winhelp.close(); } if (typeof winmyoptions != 'undefined' && winmyoptions) { winmyoptions.close(); } clearTimeout(timer_checkstatus); clearTimeout(timer_getusertime); clearTimeout(timer_awaycount); } // --------------------------------------------------------------------------- // COMPLEX FUNCTIONS // --------------------------------------------------------------------------- // Get time. // Retrives User's Time (HH:MM). function getUserTime() { var date = new Date(); // get date object. var hours = date.getHours(); // get hours. var minutes = date.getMinutes(); // get mins. // if hour is 0-9, add zero before it. if (hours < 10) { hours = '0'+ hours; } // if mins is 0-9, add zero before it. if (minutes < 10) { minutes = '0'+ minutes; } // get hours and mins and define user time. var UserTime = hours +':'+ minutes; // do resulting time stamp stamp = bks + UserTime + bke +' '; } // Dumb points. // Allows the customization of Status Bar Messages // depending of the dumb actions of the user. function dumb(type) { if (type == 'connex') { DumbConnex += 1; if (DumbConnex == 1) { doStatus(Lang['Status_DumbConnex1']); } else if (DumbConnex == 2) { doStatus(Lang['Status_DumbConnex2']); } else if (DumbConnex == 3) { doStatus(Lang['Status_DumbConnex3']); } else if (DumbConnex == 4) { doStatus(Lang['Status_DumbConnex4']); } else { doStatus(Lang['Status_DumbConnex5']); alert(Lang['Status_DumbConnex5']); } play('tonk'); } if (type == 'selnick') { DumbSelectNick += 1; if (DumbSelectNick > 2) { alert(Lang['Alert_SelectNick']); DumbSelectNick = 1; } else { command('/notice %$N '+ Lang['Alert_SelectNick']); play('fail'); } } if (type == 'samenick') { DumbSameNick += 1; if (DumbSameNick > 2) { alert(Lang['Alert_SameNick']); DumbSameNick = 1; } else { command('/notice %$N '+ Lang['Alert_SameNick']); play('fail'); } } } // Applet check. // Check if applet loads succesfully. function checkAppletLoad() { if (!get("opt_about")) {if(!noabout){noabout=t;getError('NoAbout');}} // If document.jchat exist and is active... if (_ie) { if (get('jchat')) { // Strech chat box if enabled. if (StretchChat == '1') { get('chatbox').style.margin = '0'; get('chatbox').style.width = '100%'; get('chatbox').style.height = '85%'; get('statusbox').style.width = '100%'; get('status').style.width = '100%'; get('body').style.height = '100%'; get('jchat').style.width = '100%'; get('jchat').style.height = _resH / 1.6; } clearTimeout(timer_appletload); checkStatus(); // exec GojIRC status doStatus(Lang['Status_JChatLoaded']); play('load'); isLoaded = t; } else { timer_appletload = setTimeout('checkAppletLoad()',250); } } else { setTimeout('checkStatus()',1000); // start status check setTimeout('doStatus(Lang["Status_JChatLoaded"])',1000); setTimeout('play("load")',1000); isLoaded = t; } } // GojIRC Status bar. // Change messages and status icons // depending on user actions and GojIRC status. function checkStatus() { if (!get("opt_about")) {if(!noabout){noabout=t;getError('NoAbout');}} // Connected? if (connex()) { FirstConnection += 1; // first connection after last desconnection if (FirstConnection == 1) { // first connection? // status actions... if (DisplayStatus == '1') { if (DumbConnex >= 3) { // if user was dumb to connex, do this: doStatus(Lang['Status_FirstConnexDumb']); } else { // normal connection. // 2.7.x only if (jout) { mynick = read('%$N'); } // 2.6.0 support else { mynick = Lang['Status_FirstConnex2']; } doStatus(Lang['Status_FirstConnex1'] +' '+ mynick +'. GojIRC \@ <a href=\"http://gojirc.willyps.com\" target=\"_blank\" title=\"Visit GojIRC site\">gojirc.willyps.com</a>'); } statusImg('connex'); // change icon. DumbConnex = 0; // reset dumb connex. } if (jout) { play('connex'); } // play sound. if (QuickOn) { get('quick_nick').innerHTML = mynick; } } } // Not connected? else { // use disconnected status icon and img title. statusImg('disconnex'); // if was connected if (FirstConnection != 0) { // status actions... if (DisplayStatus == '1') { if (DumbConnex >= 3) { // if user was dumb to connex, do this: doStatus(Lang['Status_DisconnexDumb']); } else { // normal connection. doStatus(Lang['Status_Disconnex']); } } AwayOn = f; // reset AwayOn to its default value get('opt_away').text = Lang['Menu_AwayOn']; play('quit'); // play sound FirstConnection = 0; // reset value. } } // keep checking GojIRC status every x time: timer_checkstatus = setTimeout('checkStatus()',250); } // Away count system. function startAwayCount(mode) { // get shure his connected by... if ((mode == 'count') && AwayOn) { // mode and AwayOn values // add one sec on every exec. AwayTimeSecs += 1; AwayTime2 += 1; // if 60 secs reached, add one min and reset secs. if (AwayTimeSecs == 60) { AwayTimeMins += 1; AwayTimeSecs = 0; } // if 60 mins reached, add one hour and reset secs and mins. if (AwayTimeMins == 60) { AwayTimeHrs += 1; AwayTimeMins = 0; AwayTimeSecs = 0; } // If Away Announcement is active and AwayTime2 reached the specified // time, then send the public away announcement. if (AwayAnnounceOn && (AwayTime2 == AwayAnnounceTime)) { getUserTime(); if (AwayTimeHrs > 0) { command('/me '+ Lang['Action_AwayOn'] +' '+ bks +' '+ Lang['Action_AwayReason'] + AwayReasonSpace + AwayReasonMsg +' '+ bke +' '+ bks +' '+ AwayTimeHrs +' '+ Lang['Status_Hrs'] +', '+ AwayTimeMins + ' '+ Lang['Status_Mins'] +', '+ AwayTimeSecs +' '+ Lang['Status_Secs'] +' '+ bke); } else { command('/me '+ Lang['Action_AwayOn'] +' '+ bks +' '+ Lang['Action_AwayReason'] + AwayReasonSpace + AwayReasonMsg +' '+ bke +' '+ bks +' '+ AwayTimeMins + ' '+ Lang['Status_Mins'] +', '+ AwayTimeSecs +' '+ Lang['Status_Secs'] +' '+ bke); } AwayTime2 = 0; // reset value. } // away status bar messages... if (AwayTimeHrs > 0) { // If more than zero hours reached, use this message. doStatus(Lang['Status_AwayOn'] +' \"'+ AwayReasonMsg +'\". '+ AwayTimeHrs +' '+ Lang['Status_Hrs'] +', '+ AwayTimeMins +' '+ Lang['Status_Mins'] +', '+ AwayTimeSecs +' '+ Lang['Status_Secs'] +'.'); } else { // else, use this one. doStatus(Lang['Status_AwayOn'] +' \"'+ AwayReasonMsg +'\". '+ AwayTimeMins +' '+ Lang['Status_Mins'] +', '+ AwayTimeSecs +' '+ Lang['Status_Secs'] +'.'); } // keep exec every second! timer_awaycount = setTimeout('startAwayCount("count")',1000); } else { // if it doesn't met the requirements, stop counting and reset values. clearTimeout(timer_awaycount); AwayTimeSecs = 0; AwayTimeMins = 0; AwayTimeHrs = 0; AwayTime2 = 0; AwayAnnounceOn = f; } } // Prompt for Announce function runAwayAnnounce() { var awayannouncetimetyped = prompt(Lang['Prompt_AwayAnnounce'],pastawaytime); // check if alpha or alpha-num entered. if (!isNaN(awayannouncetimetyped)) { // if not canceled, activate away plus announce. if (awayannouncetimetyped != x) { if ((awayannouncetimetyped != '') || (awayannouncetimetyped != ' ')) { AwayAnnounceTime = awayannouncetimetyped; AwayAnnounceOn = t; } pastawaytime = awayannouncetimetyped; return t; } else { // user canceled, abort away. return f; } } else { // tell user to enter a numeric value alert(Lang['Alert_AwayAnnounceTime']); return runAwayAnnounce(); } } // Ignore list manager function ignore(act,nick) { // search the list if (act == 'find') { for (i = 0; i < ignorelist.length; i++) { if ((typeof ignorelist[i] != 'undefined') && (ignorelist[i].match(nick,'i'))) { return ignorelist[i]; break; } } } // Add to list else if (act == 'add') { ignorelist[ignorelist.length] = nick; // add to array doStatus(Lang['Status_Ignore'] +' '+ nick +'.'); pastignore = nick; // last ignore } // Delete from list else if (act == 'delete') { for (i = 0; i < ignorelist.length; i++) { if ((typeof ignorelist[i] != 'undefined') && (ignorelist[i].match(nick,'i'))) { delete ignorelist[i]; // delete index from the array doStatus(Lang['Status_Activate'] +' '+ nick +'.'); pastignore = nick; // last activate break; } } } } // --------------------------------------------------------------------------- // SOME STUFF // --------------------------------------------------------------------------- // Some Declarations... GoVersion = '2.0 RC3'; aboutmsg = 'About GojIRC Front End\n\nGojIRC Front End version '+GoVersion+'\nCopyright (c) 2001-2004 WillyPS\nhttp://gojirc.willyps.com\n\nGojIRC Front End comes with ABSOLUTELY NO\nWARRANTY. This is free software, and you are\nwelcome to redistribute it under certain conditions.\nPlease, refer to the license.txt file for more info.'+LineBrake+'Chat owner: '+OwnerName+'\nContact e-mail: '+WebmasterEmail+'\nSite address: '+HomepageUrl+LineBrake; // Prelead components... if (DisplayStatus == '1') { // Status imgs ImgStatus[0] = new Image(); ImgStatus[0].src = ThemeDir +'disconnex.gif'; ImgStatus[1] = new Image(); ImgStatus[1].src = ThemeDir +'connex.gif'; ImgStatus[2] = new Image(); ImgStatus[2].src = ThemeDir +'away.gif'; } // --------------------------------------------------------------------------- // EXECs // --------------------------------------------------------------------------- doLang(Language); // create Language[] addParams('lang'); // lang file addParams('theme'); addParams('config'); // params.xml file addFilter(FilterKeysAndVals); // config.js filters window.onload = runInit; window.onunload = runLast; window.onblur = startIdle; window.onfocus = stopIdle; window.defaultStatus = Lang['Text_WinStatus']; Code:
// function addParams(prm) { // Add parameters from params.xml if (prm == 'config' || prm == 'theme') { var param, params = readFile(EngineDir+'parameters/default.xml').split('\n'); for (i = 0; i < params.length; i++) { if (params[i].match('<param ')) { param = params[i].match(/\x22.*\x22/g); // get values inside of comiles if (param != null) { param = param.toString(); // string it param = param.replace(/\x22/g,''); // remove comiles param = param.replace(/value=/,' => '); // replace attribute with delimiter1 concatParams([param]); // add to AppletParams[] } Code:
<?xml version="1.0"?> <parameters> <!-- Connection Related --> <param name="NickName" value="Cavy Compendium Chat User" /> <param name="RealName" value="GojIRC User Cavy Compendium Chat" /> <param name="ServerPort" value="6667" /> <param name="UserName" value="$bbuserinfo[username]" /> <param name="HostName" value="jpilot" /> <param name="SocksAddress" value="" /> <param name="LicenseKey" value="v3:cavycompendium.com:8245569950230102224294323703820230025522606270733084936176424795322000355489466596964134808984183857372050536885065353580205103173037798985484442049424084"> <!-- GUI Sates Control --> <param name="DirectStart" value="true" /> <param name="DisplayConfigChannel" value="false" /> <param name="DisplayConfigRealName" value="false" /> <param name="DisplayConfigPort" value="false" /> <param name="DisplayConfigMisc" value="false" /> <param name="DisplayConfigSocks" value="false" /> <param name="DisplayColorControl" value="true" /> <param name="DisplayAbout" value="false" /> <param name="RefreshColorCode" value="true" /> <param name="AllowURL" value="true" /> <param name="AllowShowURL" value="true" /> <param name="AllowHyperLink" value="true" /> <param name="isLimitedServers" value="true" /> <param name="isLimitedChannels" value="true" /> <param name="UseModeIcons" value="true" /> <param name="UserPrefixCommand" value="aohv" /> <param name="UserPrefixSymbol" value="!@%+" /> <param name="ScreenBufferPageSize" value="3" /> <param name="LogoGifName" value="IRClogo.gif" /> <param name="LogoWidth" value="77" /> <param name="LogoHeight" value="145" /> <param name="URLWindowName" value="popShow" /> <param name="PWindowHeight" value="200" /> <param name="PWindowWidth" value="400" /> <!-- Miscelaneous --> <param name="WelcomeMessage" value="Welcome to the Cavy Compendium Chat!" /> <param name="AliasList" value="/m=/msg,/t=/topic,/n=/nick" /> <param name="AcceptCommands" value="true" /> <!-- 2.8 --> <param name="UseImageButton" value="true" /> <param name="UserMenuList" value="Send File=/dccsend $bbuserinfo[username],Private Message=/msg $bbuserinfo[username],Ignore=/ignore $bbuserinfo[username],Whois=/whois $bbuserinfo[username],See User Profile=/showprofile $bbuserinfo[username]" /> <param name="AllowAddressDisplay" value="false" /> <param name="AllowDCCTransfer" value="true" /> <param name="CopyMethod" value="JVM" /> </parameters> I hope this information helps without adding more to the problem. Thanks for any help you can give me. |
#5
|
||||
|
||||
PHP Code:
|
#6
|
|||
|
|||
Thank you for all the help you are giving on this. I am quite the noob though, so I want to make sure I understand what you are saying correctly. Where you say to place the echoes, is this how it is done?
Code:
echo '<param name="NickName" value="Cavy Compendium Chat User" />' echo '<param name="RealName" value="GojIRC User Cavy Compendium Chat" />' echo '<param name="ServerPort" value="6667" />' echo '<param name="UserName" value="$bbuserinfo[username]" />' |
#7
|
|||
|
|||
This is what I have so far. I have named it default.php. Sample follows:
Code:
<?php error_reporting(E_ALL & ~E_NOTICE); define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'xmlgenerator'); define('LOCATION_BYPASS', 1); $noheader=1; $phrasegroups = array(); $specialtemplates = array(); $globaltemplates = array(); $actiontemplates = array(); require_once('./global.php'); echo '<?xml version="1.0" encoding="ISO-8859-1"?>'; echo '<parameters>'; echo '<!-- Connection Related -->'; echo '<param name="NickName" value="Cavy Compendium Chat User" />'; echo '<param name="RealName" value="GojIRC User Cavy Compendium Chat" />'; echo '<param name="ServerPort" value="6667" />'; echo '<param name="UserName" value="$bbuserinfo[username]" />'; echo '<param name="HostName" value="jpilot" />'; echo '<param name="SocksAddress" value="" />'; echo '<param name="LicenseKey" value="v3:cavycompendium.com:8245569950230102224294323703820230025522606270733084936176424795322000355489466596964134808984183857372050536885065353580205103173037798985484442049424084">'; echo '<!-- GUI Sates Control -->'; echo '<param name="DirectStart" value="true" />'; echo '<param name="DisplayConfigChannel" value="false" />'; echo '<param name="DisplayConfigRealName" value="false" />'; echo '<param name="DisplayConfigPort" value="false" />'; echo '<param name="DisplayConfigMisc" value="false" />'; echo '<param name="DisplayConfigSocks" value="false" />'; echo '<param name="DisplayColorControl" value="true" />'; echo '<param name="DisplayAbout" value="false" />'; echo '<param name="RefreshColorCode" value="true" />'; echo '<param name="AllowURL" value="true" />'; echo '<param name="AllowShowURL" value="true" />'; echo '<param name="AllowHyperLink" value="true" />'; echo '<param name="isLimitedServers" value="true" />'; echo '<param name="isLimitedChannels" value="true" />'; echo '<param name="UseModeIcons" value="true" />'; echo '<param name="UserPrefixCommand" value="aohv" />'; echo '<param name="UserPrefixSymbol" value="!@%+" />'; echo '<param name="ScreenBufferPageSize" value="3" />'; echo '<param name="LogoGifName" value="IRClogo.gif" />'; echo '<param name="LogoWidth" value="77" />'; echo '<param name="LogoHeight" value="145" />'; echo '<param name="URLWindowName" value="popShow" />'; echo '<param name="PWindowHeight" value="200" />'; echo '<param name="PWindowWidth" value="400" />'; echo '<!-- Miscelaneous -->'; echo '<param name="WelcomeMessage" value="Welcome to the Cavy Compendium Chat!" />'; echo '<param name="AliasList" value="/m=/msg,/t=/topic,/n=/nick" />'; echo '<param name="AcceptCommands" value="true" />'; echo '<!-- 2.8 -->'; echo '<param name="UseImageButton" value="true" />'; echo '<param name="UserMenuList" value="Send File=/dccsend $bbuserinfo[username],Private Message=/msg $bbuserinfo[username],Ignore=/ignore $bbuserinfo[username],Whois=/whois $bbuserinfo[username],See User Profile=/showprofile $bbuserinfo[username]" />'; echo '<param name="AllowAddressDisplay" value="false" />'; echo '<param name="AllowDCCTransfer" value="true" />'; echo '<param name="CopyMethod" value="JVM" />'; echo '</parameters>'; ?> Once I accomplish that, where would I make a call to default.php from? Would it be done through the chat_chatters template that I have a sample of earlier in the thread? Once again, thanks for all the help and patience. |
#8
|
|||
|
|||
I never could get it to work with echo. I am now trying to use fwrite and I am VERY close now. Only problem is that I get the following error:
Warning: fwrite(): supplied argument is not a valid stream resource in /home/cavyseek/public_html/forums/test.php on line 60 Warning: fclose(): supplied argument is not a valid stream resource in /home/cavyseek/public_html/forums/test.php on line 63 Here is the got that is in use: PHP Code:
|
#9
|
|||
|
|||
Is there anybody familiar with this? This one simple step is all that is stopping me from accomplishing my goal of joining GoJirc with Jirc and getting it to work with a vbulletin. The one and only problem is the lack of ability to parse a username from the database.
|
#10
|
|||
|
|||
I am at my wits end now. I have tried everything I know. I have even tried to hire the project out, but there is nobody interested. Is this advance PHP or something (file handling)? I don't know what I am going to do now. I so damn close and it pisses me off that fwrite and fclose do not work when used per every tutorial I can find. I think I am getting creamed by syntax in the actual strings but there is not a tutorial out there that gives a good guide of workable syntax. The language of PHP does not seem overly difficult, but I simply do not have the time to learn all of it, especially since I rarely use the skill (my site is the one and only place I ever use it). I've tried everything, I am going to can this project if I cannot figure out anything in the next few days.
Thanks for listening. I hope someone out there has some tips. For the person that recommended using "echo". I tried, I simply could not find any tutorial out there showing how to implement it correctly. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|