MyBB Community Forums

Full Version: variable help pls (important)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
"WDZ"
I use this in my php:

$session->ipaddress
print "Your ip is <b>$session</b><br>";

when I saw this code isn't work than I am delete...
than I add this one:

print "your ip: $_SERVER['REMOTE_ADDR']";

it isn't work. I don't understand what am I do Sad

"Michael83"
could you explain what WDZ sad? or how can I do another way

"Michael83"
I am quickly understanding you Big Grin
(now Michael83 said that alep is my nuisance Big Grin )
Try something like this...
print "Your ip is <b>".$_SERVER['REMOTE_ADDR']."</b><br>";
Or
print "Your ip is <b>".$session->ipaddress."</b><br>";
Hey, I've got a fan. Toungue

He said that you do not need to get the information using a query. The following line does the same (thanks WDZ):
echo "... and you are ".$mybb->user['fid3'];
thank you very much for your answer...
I like mybb (don't cross me and I like youSmile )
Sad Sad Sad Sad
I have got ony one problem Smile


...... 
....
switch ($mybb->user['usergroup']) {
case "1":
   $usergroup = "0";
   break;
case "2":
   $usergroup = "0";
   break;
case "3":
   $usergroup = "2"; 
   break;
case "4":
	$usergroup = "1"; //admin
	
	break;
case "5":
	$usergroup = "0";
	break;

case "6":
	$usergroup = "3"; // mod
	break;
......
....
..
<param name="userIcon" value="<?php if($usergruop == "3"){echo "8";} 

elseif(
$query = $db->query("SELECT fid3 FROM ".TABLE_PREFIX."userfields WHERE ufid = '".$mybb->user['uid']."'");
$sex = $db->fetch_array($query);
.$sex['fid3']=="Male" ) { echo "4";} else {echo "3";} ?>">

4 is male photo 3 is female photo. (and 8 is the other photo)
this line have got problem: $query = $db->query("SELECT fid3 FROM ".TABLE_PREFIX."userfields


I don't understand what am I do Rolleyes
could you tell me how can I do right?
yes yes I know I am problem Sad
pls pls only one error my code Sad
Try this instead:

<param name="userIcon" value="<?php
if($usergroup == "3"){ echo "8";} 

$query = $db->query("SELECT fid3 FROM ".TABLE_PREFIX."userfields WHERE ufid = '".$mybb->user['uid']."'");
$sex = $db->fetch_array($query);
if($sex['fid3']=="Male" ) { echo "4";}
else {echo "3";} ?>">

Or this:


<param name="userIcon" value="<?php
if($usergroup == "3"){ echo "8";} 

if($mybb->user['fid3']=="Male" ) { echo "4";}
else {echo "3";} ?>">

I can't believe but it isn't work in my php... Allways write 3 value Sad and male see female photo. because 3 is female photo Sad

<param name="userIcon" value="<?php
if($mybb->user['fid3']=="Male" ) { echo "4";}
else {echo "3";} ?>">

I am solved with your helps:
== this one change = and erase near of the male "" than it is ok Smile
(like this =Male)
(but somtimes male change female or female change male !!! interesting)
thank you for your answer
you are very helpfull
I am very grateful:

"Michael83" Big Grin
"DennisTT" Cool
"WDZ" Shy
"Ryan Ashbrook" Smile
Pages: 1 2