hi all i have got this bit of code i want to bring smf usernames into lightirc but it is not working so i was after some help please
<?php
require_once('../ccn/SSI.php');
global $context;
if ($context['user']['is_guest']) {
$userchatname = 'chatz-Guest_' . rand(1,10000);
} else {
$userchatname = $context['user']['name'];
}
$userchatname = str_replace(" ","_",$userchatname);
$userchatname = str_replace(".","_",$userchatname);
?>
params.nick = "<?php echo($userchatname); ?>";
echo? that doesn't seem right.
Thanx kindred what would you use to pull the usernames?
Not sure... But including the whole file would be a help...
this is whole file Kindred and thanx
ok.... I am confused as all heck now...
this is a .php file... You open with the <?php and include/require SSI... but then you close the php with the ?> and go on to the rest of the file and settings and functions. huh? ???
Please attach the ORIGINAL file from your lightirc installation, before you added the SSI code.
here is the file
This is solved thanx Kindred for your help i went back thru the code and found my mistakes ::)
glad you were able to fix it. Mind stating how, for future references?
Also, sorry I didn't respond faster; I was going to take a look at it tomorrow, when I got some free time with a real computer rather than an iDevice.
Sure i can do that if it will help others with lightirc
<?php
require_once('../ccn/SSI.php');
global $context;
/*if ($context['user']['is_guest']) {*/
if ($context["user"]["id"]<1) {
$userchatname = 'chatz-Guest_' . rand(1,10000);
} else {
$userchatname = $context['user']['name'];
}
$userchatname = str_replace(" ","_",$userchatname);
$userchatname = str_replace(".","_",$userchatname);
?>
params.nick = "<?php echo $userchatname; ?>";
hmmm.... that should not have made a difference.
$context["user"]["id"]<1 should return the same thing as $context['user']['is_guest']
well that is what i thought but it does work