Connecting Tech Pros Worldwide Help | Site Map

php/mysql variable passing in Javascript

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 04:18 AM
Eric Wagar
Guest
 
Posts: n/a
Default php/mysql variable passing in Javascript

I have a phpnuke website, and I use DigiChat chat. Since I have users who
register, I'd like to be able to pass there username and email (at a
minimum) into the chat system, so they do not have to enter in their
information multiple times.

I am attempting to use the below file (which was obtained from a website
using DigiChat and something called IBForums), but I am not able to get any
output on the page when using it. Any help?

Thanks
Eric

<?php

//--------------------------------
// Basic DigiChat Integration v1.0 hack by InvisionHacks(tm)
// Copyright 2004 Chris Griego [cgriego]
// http://www.invisionhacks.com/

//class module extends module_loader
{
// var $output = "";

function module()
{
global $fg_phpnuke,
$print,
$std;

$ibforums->lang['digichat_guest'] = "You must register with
our forums to use our chat feature.";

if (!$fg_phpnuke->nuke_users['user_id'])
{
// If a guest, error.
$std->Error(array('LEVEL' => 1, 'MSG' =>
'digichat_guest'));
} else {
$this->output = <<<EOF

<head>
<title>Chat Entry</title>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red"
leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
<div align="left">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" height="100%">
<tr>
<td align="center" valign="top" width="100%" background="block.title.png"
height="20">&nbsp;</td>
</tr>
<tr>
<TD HEIGHT="100%" ALIGN="left" VALIGN="top" style="margin:0;
padding-top:0pt; padding-right:0pt; padding-bottom:0pt; padding-left:10pt;">
<p align="left"><font face="Verdana">Be patient while
chat<br>loads.</font></p>
<p align="left">&nbsp;</p>
</td>
</tr>
</table>
</div>
</body>
</html>

<script language="JavaScript" type="text/javascript">

isMac = (navigator.appVersion.indexOf("Mac")!=-1) ?
true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IEwin =
((document.all)&&(navigator.appVersion.indexOf("MS IE")!=-1) && !isMac) ?
true : false;
NS = (navigator.appName.indexOf("Netscape")!=-1) ?
true : false;

document.writeln("<APPLET NAME='DigiChat'
CODEBASE='http://www.flyguylive.com/DigiChat/DigiClasses/' ");

document.writeln("CODE='com.diginet.digichat.clien t.DigiChatApplet' ");
if (isMac)
document.writeln("ARCHIVE=Client_Mac.jar
MAYSCRIPT>");
else if (!isMac)
{
if (IEwin)
{

document.writeln("ARCHIVE=Client_Plugin.jar MAYSCRIPT>");
document.write(" <PARAM NAME=cabbase
value=Client_IE.cab>");
document.write(" <PARAM
NAME=useslibrary value=DigiChat Applet>");
document.write(" <PARAM
NAME=namespace value=Digi-Net>");
document.write(" <PARAM
NAME=useslibrarycodebase value=Client_IE.cab>");
document.write(" <PARAM
NAME=useslibraryversion value=4,0,1,0>");
}
else if (NS)

document.writeln("ARCHIVE='Client_NS.jar' MAYSCRIPT>");
}

document.write(" <PARAM NAME=MenuItem1
VALUE=GrownUpsMeet.com>");
document.write(" <PARAM NAME=MenuLocation1
VALUE=http://www.GrownUpsMeet.com>");
document.write(" <PARAM NAME=MenuItem2
VALUE='GrownUps.info'>");
document.write(" <PARAM NAME=MenuLocation2
VALUE=http://www.GrownUps.info>");
document.write(" <PARAM NAME=siteID VALUE=1000>");
document.write(" <PARAM NAME=background
VALUE=FFFFFF>");
document.write(" <PARAM NAME=signed VALUE=true>");
document.write(" <PARAM NAME=textcolor
VALUE=000000>");

// Integration Here
document.write(" <param name=nickname
value=$_POST['name'][arrayindex]>");
# document.write(" <param name=nickname
value='{$ibforums->member['name']}'>");
# document.write(" <param name=email
value='{$ibforums->member['email']}'>");

document.write(" GrownUpsChat requires a Java
Compatible web browser to run. ");
document.write(" </APPLET>");

</script>
EOF;

print($this->output);
exit();

}
}
}

// End Basic DigiChat Integration v1.0 hack
//--------------------------------
?>

  #2  
Old July 17th, 2005, 04:19 AM
kogger
Guest
 
Posts: n/a
Default Re: php/mysql variable passing in Javascript

Hey Eric,

how are you using this file? Are you actually instantiating it in some
way? Viewing it directly won't produce anything. It needs to be called
from somewhere. Maybe you missed a step in the instructions?

Eric Wagar wrote:[color=blue]
> I have a phpnuke website, and I use DigiChat chat. Since I have
> users who register, I'd like to be able to pass there username and
> email (at a minimum) into the chat system, so they do not have to
> enter in their information multiple times.
>
> I am attempting to use the below file (which was obtained from a
> website using DigiChat and something called IBForums), but I am not
> able to get any output on the page when using it. Any help?
>
> Thanks
> Eric
>
> <?php
>
> //--------------------------------
> // Basic DigiChat Integration v1.0 hack by InvisionHacks(tm)
> // Copyright 2004 Chris Griego [cgriego]
> // http://www.invisionhacks.com/
>
> //class module extends module_loader
> {
> // var $output = "";
>
> function module()
> {
> global $fg_phpnuke,
> $print,
> $std;
>
> $ibforums->lang['digichat_guest'] = "You must
> register with our forums to use our chat feature.";
>
> if (!$fg_phpnuke->nuke_users['user_id'])
> {
> // If a guest, error.
> $std->Error(array('LEVEL' => 1, 'MSG' =>
> 'digichat_guest'));
> } else {
> $this->output = <<<EOF
>
> <head>
> <title>Chat Entry</title>
> </head>
> <body bgcolor="white" text="black" link="blue" vlink="purple"
> alink="red" leftmargin="0" marginwidth="0" topmargin="0"
> marginheight="0"> <div align="left">
> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%"
> height="100%"> <tr>
> <td align="center" valign="top" width="100%"
> background="block.title.png" height="20">&nbsp;</td>
> </tr>
> <tr>
> <TD HEIGHT="100%" ALIGN="left" VALIGN="top" style="margin:0;
> padding-top:0pt; padding-right:0pt; padding-bottom:0pt;
> padding-left:10pt;"> <p align="left"><font face="Verdana">Be patient
> while chat<br>loads.</font></p>
> <p align="left">&nbsp;</p>
> </td>
> </tr>
> </table>
> </div>
> </body>
> </html>
>
> <script language="JavaScript" type="text/javascript">
>
> isMac =
> (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
> IEmac = ((document.all)&&(isMac)) ? true :
> false; IEwin =
> ((document.all)&&(navigator.appVersion.indexOf("MS IE")!=-1) &&
> !isMac) ? true : false;
> NS =
> (navigator.appName.indexOf("Netscape")!=-1) ? true : false;
>
> document.writeln("<APPLET NAME='DigiChat'
> CODEBASE='http://www.flyguylive.com/DigiChat/DigiClasses/' ");
>
> document.writeln("CODE='com.diginet.digichat.clien t.DigiChatApplet'
> "); if (isMac)
>
> document.writeln("ARCHIVE=Client_Mac.jar MAYSCRIPT>");
> else if (!isMac)
> {
> if (IEwin)
> {
>
> document.writeln("ARCHIVE=Client_Plugin.jar MAYSCRIPT>");
> document.write(" <PARAM
> NAME=cabbase value=Client_IE.cab>");
> document.write(" <PARAM
> NAME=useslibrary value=DigiChat Applet>");
> document.write(" <PARAM
> NAME=namespace value=Digi-Net>");
> document.write(" <PARAM
> NAME=useslibrarycodebase value=Client_IE.cab>");
> document.write(" <PARAM
> NAME=useslibraryversion value=4,0,1,0>");
> }
> else if (NS)
>
> document.writeln("ARCHIVE='Client_NS.jar' MAYSCRIPT>");
> }
>
> document.write(" <PARAM NAME=MenuItem1
> VALUE=GrownUpsMeet.com>");
> document.write(" <PARAM NAME=MenuLocation1
> VALUE=http://www.GrownUpsMeet.com>");
> document.write(" <PARAM NAME=MenuItem2
> VALUE='GrownUps.info'>");
> document.write(" <PARAM NAME=MenuLocation2
> VALUE=http://www.GrownUps.info>");
> document.write(" <PARAM NAME=siteID
> VALUE=1000>"); document.write(" <PARAM
> NAME=background
> VALUE=FFFFFF>");
> document.write(" <PARAM NAME=signed
> VALUE=true>"); document.write(" <PARAM
> NAME=textcolor
> VALUE=000000>");
>
> // Integration Here
> document.write(" <param name=nickname
> value=$_POST['name'][arrayindex]>");
> # document.write(" <param name=nickname
> value='{$ibforums->member['name']}'>");
> # document.write(" <param name=email
> value='{$ibforums->member['email']}'>");
>
> document.write(" GrownUpsChat requires a Java
> Compatible web browser to run. ");
> document.write(" </APPLET>");
>
> </script>
> EOF;
>
> print($this->output);
> exit();
>
> }
> }
> }
>
> // End Basic DigiChat Integration v1.0 hack
> //--------------------------------[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.