View Full Version : Pulling age from Vbulletin Profiles
Jaime82
02-04-2006, 01:57 AM
I have Vbulletin and RealChat integrated. I have the profile information from Vbulletin displayed for the chat room. There is one problem though. I can't get the age from Vbulletin to display in the chat room. Can anyone tell me how to do that? Here is the code I am using to display the information. Everything works good, except the age.
<param name="nick" value="<?php echo $vbulletin->userinfo[username];?>">
<param name="embedded" value="yes">
<param name="channel" value="room name">
<param name="pLabel1" value="Gender:">
<param name="pValue1" value="<?php echo $vbulletin->userinfo[field14];?>">
<param name="pLabel2" value="Age:">
<param name="pValue2" value="<?php echo $vbulletin->userinfo[age];?>">
<param name="pLabel3" value="Location:">
<param name="pValue3" value="<?php echo $vbulletin->userinfo[field2];?>">
<param name="pLabel4" value="">
<param name="pValue4" value="">
<param name="pLabel5" value="">
<param name="pValue5" value="">
<param name="pLabel6" value="">
<param name="pValue6" value="">
<param name="pLabel7" value="">
<param name="pValue7" value="">
<param name="pLabel8" value="">
<param name="pValue8" value="">
Thanks!
Jaime
deathemperor
02-04-2006, 02:56 AM
the age of a user is not a stored value in db, it is caculated depending on user's age, of course. Here is what vb staffs calculate in the file member.php:
// BIRTHDAY
// Set birthday fields right here!
if ($userinfo['birthday'] AND $userinfo['showbirthday'] > 0)
{
$bday = explode('-', $userinfo['birthday']);
$year = vbdate('Y', TIMENOW, false, false);
$month = vbdate('n', TIMENOW, false, false);
$day = vbdate('j', TIMENOW, false, false);
if ($year > $bday[2] AND $bday[2] != '0000')
{
$userinfo['age'] = $year - $bday[2];
if ($month < $bday[0] OR ($month == $bday[0] AND $day < $bday[1]))
{
$userinfo['age']--;
}
if ($userinfo['age'] > 101)
{ // why can't we have 102 year old forum users?
$show['age'] = false;
}
else
{
$show['age'] = true;
$show['extrainfo'] = true;
}
}
if ($userinfo['showbirthday'] == 2)
{
if ($year > $bday[2] AND $bday[2] > 1901 AND $bday[2] != '0000')
{
require_once(DIR . '/includes/functions_misc.php');
$vbulletin->options['calformat1'] = mktimefix($vbulletin->options['calformat1'], $bday[2]);
if ($bday[2] >= 1970)
{
$yearpass = $bday[2];
}
else
{
// day of the week patterns repeat every 28 years, so
// find the first year >= 1970 that has this pattern
$yearpass = $bday[2] + 28 * ceil((1970 - $bday[2]) / 28);
}
$userinfo['birthday'] = vbdate($vbulletin->options['calformat1'], mktime(0, 0, 0, $bday[0], $bday[1], $yearpass), false, true, false);
}
else
{
// lets send a valid year as some PHP3 don't like year to be 0
$userinfo['birthday'] = vbdate($vbulletin->options['calformat2'], mktime(0, 0, 0, $bday[0], $bday[1], 1992), false, true, false);
}
if ($userinfo['birthday'] == '')
{
if ($bday[2] == '0000')
{
$userinfo['birthday'] = "$bday[0]-$bday[1]";
}
else
{
$userinfo['birthday'] = "$bday[0]-$bday[1]-$bday[2]";
}
}
$show['extrainfo'] = true;
$show['birthday'] = true;
}
else
{
$show['birthday'] = false;
}
}
use that for your reference. the line is 467 in file member.php of vb3.5.3.
Jaime82
02-04-2006, 03:25 AM
the age of a user is not a stored value in db, it is caculated depending on user's age, of course. Here is what vb staffs calculate in the file member.php:
// BIRTHDAY
// Set birthday fields right here!
if ($userinfo['birthday'] AND $userinfo['showbirthday'] > 0)
{
$bday = explode('-', $userinfo['birthday']);
$year = vbdate('Y', TIMENOW, false, false);
$month = vbdate('n', TIMENOW, false, false);
$day = vbdate('j', TIMENOW, false, false);
if ($year > $bday[2] AND $bday[2] != '0000')
{
$userinfo['age'] = $year - $bday[2];
if ($month < $bday[0] OR ($month == $bday[0] AND $day < $bday[1]))
{
$userinfo['age']--;
}
if ($userinfo['age'] > 101)
{ // why can't we have 102 year old forum users?
$show['age'] = false;
}
else
{
$show['age'] = true;
$show['extrainfo'] = true;
}
}
if ($userinfo['showbirthday'] == 2)
{
if ($year > $bday[2] AND $bday[2] > 1901 AND $bday[2] != '0000')
{
require_once(DIR . '/includes/functions_misc.php');
$vbulletin->options['calformat1'] = mktimefix($vbulletin->options['calformat1'], $bday[2]);
if ($bday[2] >= 1970)
{
$yearpass = $bday[2];
}
else
{
// day of the week patterns repeat every 28 years, so
// find the first year >= 1970 that has this pattern
$yearpass = $bday[2] + 28 * ceil((1970 - $bday[2]) / 28);
}
$userinfo['birthday'] = vbdate($vbulletin->options['calformat1'], mktime(0, 0, 0, $bday[0], $bday[1], $yearpass), false, true, false);
}
else
{
// lets send a valid year as some PHP3 don't like year to be 0
$userinfo['birthday'] = vbdate($vbulletin->options['calformat2'], mktime(0, 0, 0, $bday[0], $bday[1], 1992), false, true, false);
}
if ($userinfo['birthday'] == '')
{
if ($bday[2] == '0000')
{
$userinfo['birthday'] = "$bday[0]-$bday[1]";
}
else
{
$userinfo['birthday'] = "$bday[0]-$bday[1]-$bday[2]";
}
}
$show['extrainfo'] = true;
$show['birthday'] = true;
}
else
{
$show['birthday'] = false;
}
}
use that for your reference. the line is 467 in file member.php of vb3.5.3.
Would that code work putting it on a php page? How would you put it on the page?
deathemperor
02-04-2006, 03:35 AM
I thought you know PHP, that code is php so you can put in a php page. if you can use the $vbulletin->userinfo[username] then I belive that code will work and give you $userinfo['age'], then use that for the member age. try this code:
$userinfo['birthday'] = $vbulletin->userinfo['birthday'];
$userinfo['showbirthday'] = $vbulletin->userinfo['showbirthday'];
// BIRTHDAY
// Set birthday fields right here!
if ($userinfo['birthday'] AND $userinfo['showbirthday'] > 0)
{
$bday = explode('-', $userinfo['birthday']);
$year = vbdate('Y', TIMENOW, false, false);
$month = vbdate('n', TIMENOW, false, false);
$day = vbdate('j', TIMENOW, false, false);
if ($year > $bday[2] AND $bday[2] != '0000')
{
$userinfo['age'] = $year - $bday[2];
if ($month < $bday[0] OR ($month == $bday[0] AND $day < $bday[1]))
{
$userinfo['age']--;
}
if ($userinfo['age'] > 101)
{ // why can't we have 102 year old forum users?
$show['age'] = false;
}
else
{
$show['age'] = true;
$show['extrainfo'] = true;
}
}
if ($userinfo['showbirthday'] == 2)
{
if ($year > $bday[2] AND $bday[2] > 1901 AND $bday[2] != '0000')
{
require_once(DIR . '/includes/functions_misc.php');
$vbulletin->options['calformat1'] = mktimefix($vbulletin->options['calformat1'], $bday[2]);
if ($bday[2] >= 1970)
{
$yearpass = $bday[2];
}
else
{
// day of the week patterns repeat every 28 years, so
// find the first year >= 1970 that has this pattern
$yearpass = $bday[2] + 28 * ceil((1970 - $bday[2]) / 28);
}
$userinfo['birthday'] = vbdate($vbulletin->options['calformat1'], mktime(0, 0, 0, $bday[0], $bday[1], $yearpass), false, true, false);
}
else
{
// lets send a valid year as some PHP3 don't like year to be 0
$userinfo['birthday'] = vbdate($vbulletin->options['calformat2'], mktime(0, 0, 0, $bday[0], $bday[1], 1992), false, true, false);
}
if ($userinfo['birthday'] == '')
{
if ($bday[2] == '0000')
{
$userinfo['birthday'] = "$bday[0]-$bday[1]";
}
else
{
$userinfo['birthday'] = "$bday[0]-$bday[1]-$bday[2]";
}
}
$show['extrainfo'] = true;
$show['birthday'] = true;
}
else
{
$show['birthday'] = false;
}
}
then you can use $userinfo['birthday'].
Jaime82
02-04-2006, 03:59 AM
I thought you know PHP, that code is php so you can put in a php page. if you can use the $vbulletin->userinfo[username] then I belive that code will work and give you $userinfo['age'], then use that for the member age. try this code:
$userinfo['birthday'] = $vbulletin->userinfo['birthday'];
$userinfo['showbirthday'] = $vbulletin->userinfo['showbirthday'];
// BIRTHDAY
// Set birthday fields right here!
if ($userinfo['birthday'] AND $userinfo['showbirthday'] > 0)
{
$bday = explode('-', $userinfo['birthday']);
$year = vbdate('Y', TIMENOW, false, false);
$month = vbdate('n', TIMENOW, false, false);
$day = vbdate('j', TIMENOW, false, false);
if ($year > $bday[2] AND $bday[2] != '0000')
{
$userinfo['age'] = $year - $bday[2];
if ($month < $bday[0] OR ($month == $bday[0] AND $day < $bday[1]))
{
$userinfo['age']--;
}
if ($userinfo['age'] > 101)
{ // why can't we have 102 year old forum users?
$show['age'] = false;
}
else
{
$show['age'] = true;
$show['extrainfo'] = true;
}
}
if ($userinfo['showbirthday'] == 2)
{
if ($year > $bday[2] AND $bday[2] > 1901 AND $bday[2] != '0000')
{
require_once(DIR . '/includes/functions_misc.php');
$vbulletin->options['calformat1'] = mktimefix($vbulletin->options['calformat1'], $bday[2]);
if ($bday[2] >= 1970)
{
$yearpass = $bday[2];
}
else
{
// day of the week patterns repeat every 28 years, so
// find the first year >= 1970 that has this pattern
$yearpass = $bday[2] + 28 * ceil((1970 - $bday[2]) / 28);
}
$userinfo['birthday'] = vbdate($vbulletin->options['calformat1'], mktime(0, 0, 0, $bday[0], $bday[1], $yearpass), false, true, false);
}
else
{
// lets send a valid year as some PHP3 don't like year to be 0
$userinfo['birthday'] = vbdate($vbulletin->options['calformat2'], mktime(0, 0, 0, $bday[0], $bday[1], 1992), false, true, false);
}
if ($userinfo['birthday'] == '')
{
if ($bday[2] == '0000')
{
$userinfo['birthday'] = "$bday[0]-$bday[1]";
}
else
{
$userinfo['birthday'] = "$bday[0]-$bday[1]-$bday[2]";
}
}
$show['extrainfo'] = true;
$show['birthday'] = true;
}
else
{
$show['birthday'] = false;
}
}
then you can use $userinfo['birthday'].
It still just post the persons birthday when I add that code. Below is the code of the page I'm using.
<?php
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
chdir('/home/httpd/vhosts/url.com/httpdocs/bbs');
require('/home/httpd/vhosts/url.com/httpdocs/bbs/global.php');
include('/home/httpd/vhosts/url.com/httpdocs/bbs/global.php');
chdir('/home/httpd/vhosts/url.com/httpdocs');
$userinfo['birthday'] = $vbulletin->userinfo['birthday'];
$userinfo['showbirthday'] = $vbulletin->userinfo['showbirthday'];
// BIRTHDAY
// Set birthday fields right here!
if ($userinfo['birthday'] AND $userinfo['showbirthday'] > 0)
{
$bday = explode('-', $userinfo['birthday']);
$year = vbdate('Y', TIMENOW, false, false);
$month = vbdate('n', TIMENOW, false, false);
$day = vbdate('j', TIMENOW, false, false);
if ($year > $bday[2] AND $bday[2] != '0000')
{
$userinfo['age'] = $year - $bday[2];
if ($month < $bday[0] OR ($month == $bday[0] AND $day < $bday[1]))
{
$userinfo['age']--;
}
if ($userinfo['age'] > 101)
{ // why can't we have 102 year old forum users?
$show['age'] = false;
}
else
{
$show['age'] = true;
$show['extrainfo'] = true;
}
}
if ($userinfo['showbirthday'] == 2)
{
if ($year > $bday[2] AND $bday[2] > 1901 AND $bday[2] != '0000')
{
require_once(DIR . '/includes/functions_misc.php');
$vbulletin->options['calformat1'] = mktimefix($vbulletin->options['calformat1'], $bday[2]);
if ($bday[2] >= 1970)
{
$yearpass = $bday[2];
}
else
{
// day of the week patterns repeat every 28 years, so
// find the first year >= 1970 that has this pattern
$yearpass = $bday[2] + 28 * ceil((1970 - $bday[2]) / 28);
}
$userinfo['birthday'] = vbdate($vbulletin->options['calformat1'], mktime(0, 0, 0, $bday[0], $bday[1], $yearpass), false, true, false);
}
else
{
// lets send a valid year as some PHP3 don't like year to be 0
$userinfo['birthday'] = vbdate($vbulletin->options['calformat2'], mktime(0, 0, 0, $bday[0], $bday[1], 1992), false, true, false);
}
if ($userinfo['birthday'] == '')
{
if ($bday[2] == '0000')
{
$userinfo['birthday'] = "$bday[0]-$bday[1]";
}
else
{
$userinfo['birthday'] = "$bday[0]-$bday[1]-$bday[2]";
}
}
$show['extrainfo'] = true;
$show['birthday'] = true;
}
else
{
$show['birthday'] = false;
}
}
if (!in_array($vbulletin->userinfo['usergroupid'], array(5,6,7,9,10))){
?>
<!-- CSS Stylesheet -->
<link rel="stylesheet" type="text/css" href="../bbs/clientscript/vbulletin_css/chatlogin.css" id="vbulletin_css" />
<br>
<table class="tborder" cellpadding="3" cellspacing="1" border="0" width="70%" align="center">
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div align="left">
<script type="text/javascript" src="../bbs/clientscript/vbulletin_md5.js"></script>
<form action="../bbs/login.php" target="_top" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)">
<input type="hidden" name="do" value="login" />
<input type="hidden" name="url" value="../chat/chat.html" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
<input type="hidden" name="s" value="" />
<!-- permission error message - user not logged in -->
<div align="center" class="mediumfont"><b>To Enter the Chat Room</b></div>
<br>
<br>
<div align="center" class="mediumfont">You must have a registered chat name to enter our chat rooms. If you have<br>
not yet registered your chat name and would like to do so, please <a href="../bbs/register.php?do=signup" target="_top">click here.</a></div>
<br>
<br>
<fieldset class="fieldset">
<legend>Log in</legend>
<table cellpadding="0" cellspacing="2" border="0" align="center">
<tr>
<td>Chat Name:<br /><input type="text" class="bginput" name="vb_login_username" size="50" accesskey="u" tabindex="1" /></td>
</tr>
<tr>
<td>Password:<br /><input type="password" class="bginput" name="vb_login_password" size="50" accesskey="p" tabindex="1" /></td>
</tr>
<tr>
<td>
<span style="float:right"><a href="../bbs/login.php?do=lostpw" target="_top">Forgotten Your Password?</a></span>
<label for="cb_cookieuser"><input type="checkbox" name="cookieuser" value="1" id="cb_cookieuser" tabindex="1" />Remember Me?</label>
</td>
</tr>
<tr>
<td align="right">
<input type="submit" class="button" value="Log in" accesskey="s" tabindex="1" />
<input type="reset" class="button" value="Reset Fields" accesskey="r" tabindex="1" />
</td>
</tr>
</table>
</fieldset>
</form>
<!-- / permission error message - user not logged in -->
</div>
</div>
</td>
</tr>
</table>
<?
}else {
?>
<html>
<head>
<title>Chat Login Page</title>
<link rel="stylesheet" href="styles.css" type="text/css">
</HEAD>
<BODY LEFTMARGIN=0 RIGHTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0>
<center>
<!-- Begin: RealChat Client code -->
<applet
archive = "RealChat.jar"
codebase = "."
code = "rcs.client.RealChatClient.class"
name = "ChatClient"
width = "100%"
height = "100%"
align = "top"
alt = "RealChat Client applet"
MAYSCRIPT>
<param name="nick" value="<?php echo $vbulletin->userinfo[username];?>">
<param name="embedded" value="yes">
<param name="channel" value="Room">
<param name="pLabel1" value="Gender:">
<param name="pValue1" value="<?php echo $vbulletin->userinfo[field14];?>">
<param name="pLabel2" value="Age:">
<param name="pValue2" value="<?php echo $vbulletin->userinfo[birthday];?>">
<param name="pLabel3" value="Location:">
<param name="pValue3" value="<?php echo $vbulletin->userinfo[field2];?>">
<param name="pLabel4" value="">
<param name="pValue4" value="">
<param name="pLabel5" value="">
<param name="pValue5" value="">
<param name="pLabel6" value="">
<param name="pValue6" value="">
<param name="pLabel7" value="">
<param name="pValue7" value="">
<param name="pLabel8" value="">
<param name="pValue8" value="">
<param name="onCloseURL" value="http://www.url.com/index.php">
<!-- no java or java disabled -->
RealChat client requires Java compatible web browser<br>For more information visit our <a target="_blank" href="http://www.realchat.com/">java chat software</a> support page<br><br><a target="_blank" href="http://www.java.com/"><img src="getjava.gif" alt="Java - Get it now!" width="88" height="31" border="0"></a><br><br>Please click the button above to get the Java plug-in now
</applet>
<!-- End: RealChat Client code -->
<br><br>
<small>
Please wait for applet to load.
</small>
</center>
</body>
</html>
<? } ?>
deathemperor
02-04-2006, 04:09 AM
I told you to use $userinfo['age'], not $vbulletin->userinfo[birthday]
Jaime82
02-04-2006, 04:20 AM
The Age profile field is blank when I go into the chat room. I will post the code below so you can see exactly what I put instead of $vbulletin->userinfo[birthday]
<?php
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
chdir('/home/httpd/vhosts/url.com/httpdocs/bbs');
require('/home/httpd/vhosts/url.com/httpdocs/bbs/global.php');
include('/home/httpd/vhosts/url.com/httpdocs/bbs/global.php');
chdir('/home/httpd/vhosts/url.com/httpdocs');
$userinfo['birthday'] = $vbulletin->userinfo['birthday'];
$userinfo['showbirthday'] = $vbulletin->userinfo['showbirthday'];
// BIRTHDAY
// Set birthday fields right here!
if ($userinfo['birthday'] AND $userinfo['showbirthday'] > 0)
{
$bday = explode('-', $userinfo['birthday']);
$year = vbdate('Y', TIMENOW, false, false);
$month = vbdate('n', TIMENOW, false, false);
$day = vbdate('j', TIMENOW, false, false);
if ($year > $bday[2] AND $bday[2] != '0000')
{
$userinfo['age'] = $year - $bday[2];
if ($month < $bday[0] OR ($month == $bday[0] AND $day < $bday[1]))
{
$userinfo['age']--;
}
if ($userinfo['age'] > 101)
{ // why can't we have 102 year old forum users?
$show['age'] = false;
}
else
{
$show['age'] = true;
$show['extrainfo'] = true;
}
}
if ($userinfo['showbirthday'] == 2)
{
if ($year > $bday[2] AND $bday[2] > 1901 AND $bday[2] != '0000')
{
require_once(DIR . '/includes/functions_misc.php');
$vbulletin->options['calformat1'] = mktimefix($vbulletin->options['calformat1'], $bday[2]);
if ($bday[2] >= 1970)
{
$yearpass = $bday[2];
}
else
{
// day of the week patterns repeat every 28 years, so
// find the first year >= 1970 that has this pattern
$yearpass = $bday[2] + 28 * ceil((1970 - $bday[2]) / 28);
}
$userinfo['birthday'] = vbdate($vbulletin->options['calformat1'], mktime(0, 0, 0, $bday[0], $bday[1], $yearpass), false, true, false);
}
else
{
// lets send a valid year as some PHP3 don't like year to be 0
$userinfo['birthday'] = vbdate($vbulletin->options['calformat2'], mktime(0, 0, 0, $bday[0], $bday[1], 1992), false, true, false);
}
if ($userinfo['birthday'] == '')
{
if ($bday[2] == '0000')
{
$userinfo['birthday'] = "$bday[0]-$bday[1]";
}
else
{
$userinfo['birthday'] = "$bday[0]-$bday[1]-$bday[2]";
}
}
$show['extrainfo'] = true;
$show['birthday'] = true;
}
else
{
$show['birthday'] = false;
}
}
if (!in_array($vbulletin->userinfo['usergroupid'], array(5,6,7,9,10))){
?>
<!-- CSS Stylesheet -->
<link rel="stylesheet" type="text/css" href="../bbs/clientscript/vbulletin_css/chatlogin.css" id="vbulletin_css" />
<br>
<table class="tborder" cellpadding="3" cellspacing="1" border="0" width="70%" align="center">
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div align="left">
<script type="text/javascript" src="../bbs/clientscript/vbulletin_md5.js"></script>
<form action="../bbs/login.php" target="_top" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)">
<input type="hidden" name="do" value="login" />
<input type="hidden" name="url" value="../chat/chat.html" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
<input type="hidden" name="s" value="" />
<!-- permission error message - user not logged in -->
<div align="center" class="mediumfont"><b>To Enter the Chat Room</b></div>
<br>
<br>
<div align="center" class="mediumfont">You must have a registered chat name to enter our chat rooms. If you have<br>
not yet registered your chat name and would like to do so, please <a href="../bbs/register.php?do=signup" target="_top">click here.</a></div>
<br>
<br>
<fieldset class="fieldset">
<legend>Log in</legend>
<table cellpadding="0" cellspacing="2" border="0" align="center">
<tr>
<td>Chat Name:<br /><input type="text" class="bginput" name="vb_login_username" size="50" accesskey="u" tabindex="1" /></td>
</tr>
<tr>
<td>Password:<br /><input type="password" class="bginput" name="vb_login_password" size="50" accesskey="p" tabindex="1" /></td>
</tr>
<tr>
<td>
<span style="float:right"><a href="../bbs/login.php?do=lostpw" target="_top">Forgotten Your Password?</a></span>
<label for="cb_cookieuser"><input type="checkbox" name="cookieuser" value="1" id="cb_cookieuser" tabindex="1" />Remember Me?</label>
</td>
</tr>
<tr>
<td align="right">
<input type="submit" class="button" value="Log in" accesskey="s" tabindex="1" />
<input type="reset" class="button" value="Reset Fields" accesskey="r" tabindex="1" />
</td>
</tr>
</table>
</fieldset>
</form>
<!-- / permission error message - user not logged in -->
</div>
</div>
</td>
</tr>
</table>
<?
}else {
?>
<html>
<head>
<title>Chat Login Page</title>
<link rel="stylesheet" href="styles.css" type="text/css">
</HEAD>
<BODY LEFTMARGIN=0 RIGHTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0>
<center>
<!-- Begin: RealChat Client code -->
<applet
archive = "RealChat.jar"
codebase = "."
code = "rcs.client.RealChatClient.class"
name = "ChatClient"
width = "100%"
height = "100%"
align = "top"
alt = "RealChat Client applet"
MAYSCRIPT>
<param name="nick" value="<?php echo $vbulletin->userinfo[username];?>">
<param name="embedded" value="yes">
<param name="channel" value="Room">
<param name="pLabel1" value="Gender:">
<param name="pValue1" value="<?php echo $vbulletin->userinfo[field14];?>">
<param name="pLabel2" value="Age:">
<param name="pValue2" value="<?php echo $vbulletin->userinfo[age];?>">
<param name="pLabel3" value="Location:">
<param name="pValue3" value="<?php echo $vbulletin->userinfo[field2];?>">
<param name="pLabel4" value="">
<param name="pValue4" value="">
<param name="pLabel5" value="">
<param name="pValue5" value="">
<param name="pLabel6" value="">
<param name="pValue6" value="">
<param name="pLabel7" value="">
<param name="pValue7" value="">
<param name="pLabel8" value="">
<param name="pValue8" value="">
<param name="onCloseURL" value="http://www.url.com/index.php">
<!-- no java or java disabled -->
RealChat client requires Java compatible web browser<br>For more information visit our <a target="_blank" href="http://www.realchat.com/">java chat software</a> support page<br><br><a target="_blank" href="http://www.java.com/"><img src="getjava.gif" alt="Java - Get it now!" width="88" height="31" border="0"></a><br><br>Please click the button above to get the Java plug-in now
</applet>
<!-- End: RealChat Client code -->
<br><br>
<small>
Please wait for applet to load.
</small>
</center>
</body>
</html>
<? } ?>
deathemperor
02-04-2006, 04:28 AM
T______T
dude, use $userinfo[age], and do not use $vbulletin->userinfo[age]
$userifo and $vbulletin->userinfo is different.
Jaime82
02-04-2006, 04:37 AM
Thank you so much. That worked.
BTW, I'm not a dude...I'm a girl :-)
Thanks again...knew someone on here had to know how to do what I was trying to do.
Jaime
deathemperor
02-04-2006, 05:58 AM
glad that helped (finally ^^), girl. :D
Jaime82
02-07-2006, 07:07 PM
glad that helped (finally ^^), girl. :D
Have one more question. I want the chat room to display the word "minor" for the age field if the member is under 18. Is there an easy way to do that?
Thanks
Jaime
deathemperor
02-10-2006, 05:01 AM
use this
<param name="pValue2" value="<?php if($userinfo['age'] < 18) echo "minor"; echo $vbulletin->userinfo[age];?>">
Jaime82
02-14-2006, 07:08 AM
use this
<param name="pValue2" value="<?php if($userinfo['age'] < 18) echo "minor"; echo $vbulletin->userinfo[age];?>">
Thanks for the help in figuring that out. Got it on the page, but had to make a few little changes. Just in case anyone else wants to know how to do this. Here is what I had to put in to work right.
<param name="pValue2" value="<?php if($userinfo['age'] < 18) echo "minor"; else echo $userinfo[age];?>">
Jaime
deathemperor
02-14-2006, 01:48 PM
I thought you want to echo the word "minor" along with the age if age is less than 18, so I wrote that.
anyways glad to see it's done.
Jaime82
02-15-2006, 05:38 AM
This works great except for one thing. If someone has it set to Hide Age and Date of Birth in their profile on the message board, it says minor in the age profile field when they enter the chat room, even if their not a minor. Help in fixing this would be greatly appreciated.
Thank you!
Jaime
deathemperor
02-15-2006, 05:59 AM
then
<param name="pValue2" value="<?php if($userinfo['age']){ if($userinfo['age'] < 18) echo "minor"; else echo $userinfo[age]; }?>">
would work
Jaime82
02-15-2006, 06:20 AM
then
<param name="pValue2" value="<?php if($userinfo['age']){ if($userinfo['age'] < 18) echo "minor"; else echo $userinfo[age]; }?>">
would work
That worked....Thank you so much!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.