View Single Post
  #7  
Old 02-04-2006, 04:20 AM
Jaime82 Jaime82 is offline
 
Join Date: Oct 2005
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
<? } ?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01218 seconds
  • Memory Usage 1,801KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete