lightirc

Started by -Dave, September 10, 2012, 03:46:32 AM

Previous topic - Next topic

-Dave

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); ?>";

Kindred

echo?   that doesn't seem right.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

-Dave

Thanx kindred  what would you use  to pull the usernames?

Kindred

Not sure... But including the whole file would be a help...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

-Dave

this is whole file Kindred and thanx

Kindred

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.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

-Dave


-Dave

This is solved  thanx  Kindred for your help i went back thru the code and found my mistakes  ::)

Kindred

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.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

-Dave

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?>";

Kindred

hmmm.... that should not have made a difference.

$context["user"]["id"]<1 should return the same thing as $context['user']['is_guest']
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

-Dave

well that is what i thought but it does work 

Advertisement: