<?
function user_rules() { ?>
<table class="innertable" cellspacing=1><tr><td class="tablehead"><?=MSG_forum_rules;?></td></tr>
<tr class="basictable"><td>
<? $fh=fopen($GLOBALS['opt_dir']."/langs/".$GLOBALS['inuser']['ln_file']."/rules.txt","r"); 
while ($buffer=fgets($fh)) echo $buffer."<br>"; 
fclose($fh);
?>
</td></tr><tr><td class="tablehead">
<? if ($GLOBALS['opt_noquickreq']!=1) { ?>
<form action="index.php" method=GET><input type=hidden name=m value=profile>
<input type=hidden name=a value=register><input type=hidden name=q value=1>
<input type=hidden name=refpage value="<?=$_SERVER['HTTP_REFERER'];?>">
<input type=submit value="<?=MSG_forum_quickreg;?>" style="width : 90%"></form>
<? } ?>
<form action="index.php" method=GET><input type=hidden name=m value=profile>
<input type=hidden name=a value=register><input type=hidden name=q value=0>
<input type=hidden name=refpage value="<?=$_SERVER['HTTP_REFERER'];?>">
<input type=submit value="<?=MSG_forum_fullreg;?>" style="width : 90%"></form>
<form action="index.php" method=GET><input type=submit value="<?=MSG_forum_disagree;?>" style="width : 90%"></form>
<? if ($GLOBALS['opt_activate']==1) { ?>
<form action="index.php" method=GET><input type=hidden name=m value=profile>
<input type=hidden name=a value=resend><input type=submit value="<?=MSG_resend;?>" style="width : 90%"></form><? } ?>
</td></tr></table>
<? }

function user_profile($newaction,$newmodule,&$udata,$styleselect,$langselect,$avatarselect,$newmodule="profile") { ?>
<form action=index.php method=POST name=profile_form enctype="multipart/form-data">
<table class="innertable" cellspacing=1><tr>
<td colspan=2 class="tablehead"><?=MSG_user_params;?>:</td></tr>
<tr class="basictable"><td width=50%><?=MSG_user_name;?>:<br><div class="descr"><?
if ($GLOBALS['opt_cyrillic']) { ?><?=MSG_user_cyr;?><? }
else { ?><?=MSG_user_lat;?><? } ?></div>
</td><td>
<input type=text name=u__name size=20 maxlength=32 value="<?=$udata['u__name'];?>">
</td></tr><tr class="basictable"><td>
<? if ($newaction=="do_edit") { ?>
<?=MSG_user_oldpass;?>:<br><div class="descr"><?=MSG_user_change;?></div>
</td><td>
<input type=password name=oldpassword size=32 maxlength=32>
</td></tr><tr class="basictable"><td>
<? } ?>
<?=MSG_user_newpass;?>:<?
if ($newaction=="do_update") { ?><br><div class="descr"><?=MSG_user_emptypass;?></div><? } ?>
</td><td>
<input type=password name=password1 size=32 maxlength=32>
</td></tr><tr class="basictable"><td>
<?=MSG_user_passconfirm;?>:
</td><td>
<input type=password name=password2 size=32 maxlength=32>
</td></tr><tr class="basictable"><td>
<? if ($GLOBALS['opt_encrypted']==2) { ?><?=MSG_user_encrypted;?>
</td><td>
<input type=radio name=u_encrypted value=0 <? check($udata['u_encrypted']==0);?>><?=MSG_no;?> &nbsp;
<input type=radio name=u_encrypted value=1 <? check($udata['u_encrypted']==1);?>><?=MSG_yes;?>
</td></tr><tr class="basictable"><td>
<? } ?>
<?=MSG_user_email;?>:<?
if ($newaction=="do_update") { ?><br><div class="descr"><?=MSG_user_emptyemail;?></div><? } ?>
</td><td>
<input type=text name=u__email size=32 maxlength=32 value="<?=$udata['u__email'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_showmail;?>?
</td><td>
<input type=radio name=u_showmail value=0 <? check($udata['u_showmail']==0);?>><?=MSG_no;?> &nbsp;
<input type=radio name=u_showmail value=1 <? check($udata['u_showmail']==1);?>><?=MSG_yes;?> &nbsp;
<input type=radio name=u_showmail value=2 <? check($udata['u_showmail']==2);?>><?=MSG_user_javascript;?> &nbsp;
<input type=radio name=u_showmail value=3 <? check($udata['u_showmail']==3);?>><?=MSG_user_picture;?>
</td></tr><tr class="basictable"><td>
<? if ($newaction=="u_save") { ?>
<?=MSG_user_active;?>?
</td><td>
<input type=radio name=u__active value=1 <? check($udata['u__active']==1);?>><?=MSG_yes;?> &nbsp;
<input type=radio name=u__active value=0 <? check($udata['u__active']==0);?>><?=MSG_no;?>
</td></tr><tr class="basictable"><td>
<? } ?>
<?=MSG_user_lang;?>:
</td><td><select name=u_lnid><?=$langselect;?></select>
</td></tr><tr class="basictable"><td>
<?=MSG_user_style;?>:
</td><td><select name=u_stid><?=$styleselect;?></select>
</td></tr><tr class="basictable"><td>
<?=MSG_user_signature;?>:<br><div class="descr"><?=MSG_user_whatissign;?></div>
</td><td>
<textarea name=u_signature rows=3 cols=40><?=$udata['u_signature'];?></textarea>
</td></tr><tr class="basictable"><td>
<?=MSG_user_usesign;?><br><div class="descr"><?=MSG_user_usesigndescr;?></div>
</td><td>
<input type=radio name=u_usesignature value=0 <? check($udata['u_usesignature']==0);?>><?=MSG_no;?> &nbsp;
<input type=radio name=u_usesignature value=1 <? check($udata['u_usesignature']==1);?>><?=MSG_yes;?> &nbsp;
</td></tr><tr class="basictable"><td>
<?=MSG_user_detrans;?>?
</td><td>
<input type=radio name=u_detrans value=0 <? check($udata['u_detrans']==0);?>><?=MSG_no;?> &nbsp;
<input type=radio name=u_detrans value=1 <? check($udata['u_detrans']==1);?>><?=MSG_yes;?>
</td></tr><tr class="basictable"><td>
<?=MSG_user_multilang;?>?<br><div class="descr"><?=MSG_user_multilang_descr;?></div>
</td><td>
<input type=radio name=u_multilang value=0 <? check($udata['u_multilang']==0);?>><?=MSG_no;?> &nbsp;
<input type=radio name=u_multilang value=1 <? check($udata['u_multilang']==1);?>><?=MSG_yes;?>
</td></tr><tr class="basictable"><td>
<?=MSG_user_extform;?>?<br><div class="descr"><?=MSG_user_extform_descr;?></div>
</td><td>
<input type=radio name=u_extform value=0 <? check($udata['u_extform']==0);?>><?=MSG_no;?> &nbsp;
<input type=radio name=u_extform value=1 <? check($udata['u_extform']==1);?>><?=MSG_yes;?>
<? if (!$_GET['q']) { ?>
</td></tr><tr class="basictable"><td>
<?=MSG_user_mails;?>?</td><td>
<input type=radio name=u_nomails value=0 <? check($udata['u_nomails']==0);?>><?=MSG_yes;?> &nbsp;
<input type=radio name=u_nomails value=1 <? check($udata['u_nomails']==1);?>><?=MSG_no;?>
</td></tr><tr class="basictable"><td>
<?=MSG_user_pmnotify;?>?</td><td>
<input type=radio name=u_pmnotify value=0 <? check($udata['u_pmnotify']==0);?>><?=MSG_no;?> &nbsp;
<input type=radio name=u_pmnotify value=1 <? check($udata['u_pmnotify']==1);?>><?=MSG_yes;?>
</td></tr><tr class="basictable"><td>
<?=MSG_user_sortposts;?>:</td><td>
<input type=radio name=u_sortposts value=0 <? check($udata['u_sortposts']==0);?>><?=MSG_user_sortdefault;?><br>
<input type=radio name=u_sortposts value=1 <? check($udata['u_sortposts']==1);?>><?=MSG_user_sortreverse;?>
</td></tr><tr class="basictable"><td>
<?=MSG_user_smiles;?><br><div class="descr"><?=MSG_user_smilesdescr;?></div>
</td><td>
<input type=radio name=u_usesmiles value=0 <? check($udata['u_usesmiles']==0);?>><?=MSG_no;?> &nbsp;
<input type=radio name=u_usesmiles value=1 <? check($udata['u_usesmiles']==1);?>><?=MSG_yes;?> &nbsp;
</td></tr><tr class="basictable"><td>
<?=MSG_user_showavatars;?><br><div class="descr"><?=MSG_user_showavatars_descr;?></div>
</td><td>
<input type=radio name=u_showavatars value=0 <? check($udata['u_showavatars']==0);?>><?=MSG_no;?> &nbsp;
<input type=radio name=u_showavatars value=1 <? check($udata['u_showavatars']==1);?>><?=MSG_yes;?> &nbsp;
</td></tr><tr class="basictable"><td>
<?=MSG_user_hidden;?>
</td><td>
<input type=radio name=u_hidden value=0 <? check($udata['u_hidden']==0);?>><?=MSG_no;?> &nbsp;
<input type=radio name=u_hidden value=1 <? check($udata['u_hidden']==1);?>><?=MSG_yes;?> &nbsp;
</td></tr><tr class="basictable"><td>
<?=MSG_user_tperpage;?>:
</td><td>
<input type=text name=u_tperpage size=5 maxlength=5 value="<?=$udata['u_tperpage'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_mperpage;?>:
</td><td>
<input type=text name=u_mperpage size=5 maxlength=5 value="<?=$udata['u_mperpage'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_aperpage;?>:
</td><td>
<input type=text name=u_aperpage size=5 maxlength=5 value="<?=$udata['u_aperpage'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_shortdate;?>:<br><div class="descr"><?=MSG_user_datedescr;?></div>
</td><td>
<input type=text name=u_sformat size=20 maxlength=20 value="<?=$udata['u_sformat'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_longdate;?>:
</td><td>
<input type=text name=u_lformat size=20 maxlength=20 value="<?=$udata['u_lformat'];?>">
</td></tr>
</td></tr><tr class="basictable"><td>
<?=MSG_user_timezonesel;?>:
</td><td>
<select name=u_timeregion><?=set_select(MSG_user_timezone,$udata['u_timeregion']);?></select>
</td></tr>
</td></tr><tr class="basictable"><td>
<?=MSG_user_timelimit;?>
</td><td>
<? timelimiter($udata['u_timelimit'],"u_timelimit");?></td></tr>
<tr><td colspan=2 class="tablehead"><?=MSG_user_personalinfo;?></td></tr>
<tr class="basictable"><td>
<?=MSG_user_realname;?>:
</td><td>
<input type=text name=u_realname value="<?=$udata['u_realname'];?>" size=40 maxlength=255>
</td></tr><tr class="basictable"><td>
<?=MSG_user_gender;?>:
</td><td>
<input type=radio name=u_gender value=0 <? check($udata['u_gender']==0);?>><?=MSG_user_female;?> &nbsp;
<input type=radio name=u_gender value=1 <? check($udata['u_gender']==1);?>><?=MSG_user_male;?> &nbsp;
<input type=radio name=u_gender value=2 <? check($udata['u_gender']==2);?>><?=MSG_user_nogender;?>
</td></tr><tr class="basictable"><td>
<?=MSG_user_icq;?>:
</td><td>
<input type=text name=u_icq size=10 maxlength=10 value="<?=$udata['u_icq'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_aol;?>:
</td><td>
<input type=text name=u_aol size=20 maxlength=32 value="<?=$udata['u_aol'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_yahoo;?>:
</td><td>
<input type=text name=u_yahoo size=20 maxlength=32 value="<?=$udata['u_yahoo'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_msn;?>:
</td><td>
<input type=text name=u_msn size=20 maxlength=64 value="<?=$udata['u_msn'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_jabber;?>:
</td><td>
<input type=text name=u_jabber size=20 maxlength=64 value="<?=$udata['u_jabber'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_diary;?>:<br>
<span class="descr"><?=MSG_user_diary_comment;?></span>
</td><td>
<input type=text name=u_diary size=40 maxlength=128 value="<?=$udata['u_diary'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_homepage;?>:
</td><td>
<input type=text name=u_homepage size=40 maxlength=128 value="<?=$udata['u_homepage'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_location;?>:
</td><td>
<input type=text name=u_location size=40 maxlength=40 value="<?=$udata['u_location'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_interests;?>:
</td><td>
<textarea name=u_interests rows=5 cols=40><?=textarea($udata['u_interests']);?></textarea>
</td></tr><tr class="basictable"><td>
<?=MSG_user_birthdate;?><br>
<span class="descr"><?=MSG_user_birthdate_desc;?></span></td><td>
<input type=text size=2 maxlength=2 name=u_bday value="<?=$udata['u_bday'];?>"> <select name=u_bmonth><?=set_select(
"<option value=\"1\">".MSG_January.
"<option value=\"2\">".MSG_February.
"<option value=\"3\">".MSG_March.
"<option value=\"4\">".MSG_April.
"<option value=\"5\">".MSG_May.
"<option value=\"6\">".MSG_June.
"<option value=\"7\">".MSG_July.
"<option value=\"8\">".MSG_August.
"<option value=\"9\">".MSG_September.
"<option value=\"10\">".MSG_October.
"<option value=\"11\">".MSG_November.
"<option value=\"12\">".MSG_December,
$udata['u_bmonth']);?></select>
<input type=text name=u_byear size=4 maxlength=4 value="<?=$udata['u_byear'];?>">
</td></tr><tr class="basictable"><td>
<?=MSG_user_birthmode;?></td><td>
<input type=radio name=u_bmode value=0 <? check($udata['u_bmode']==0);?>><?=MSG_user_bnone;?><br>
<input type=radio name=u_bmode value=1 <? check($udata['u_bmode']==1);?>><?=MSG_user_bdate;?><br>
<input type=radio name=u_bmode value=2 <? check($udata['u_bmode']==2);?>><?=MSG_user_byear;?><br>
<input type=radio name=u_bmode value=3 <? check($udata['u_bmode']==3);?>><?=MSG_user_ball;?>
</td></tr>
<tr><td class="tablehead" colspan=2><?=MSG_user_personalisation;?></td></tr>
<? if ($GLOBALS['inuserlevel']>=$GLOBALS['opt_ltitle'] || $newaction=="u_save" || $newaction=="u_docreate") { ?>
<tr class="basictable"><td><?=MSG_user_customtitle;?>
</td><td><input type=text name=u__title size=40 maxlength=48 value="<?=$udata['u__title'];?>">
</td></tr>
<? }
if ($newaction!="u_save" && $newaction!="u_docreate") { ?>
<tr class="basictable"><td><?=MSG_user_avatartype;?>:</td>
<td><script><!--
function preview() {
var f=document.profile_form; 
if (document.getElementById('at0').checked) { f.a_preview.src="avatars/noavatar.gif"; }
if (document.getElementById('at1').checked) { f.a_preview.src="avatars/"+f.avatar1.value; }
if (document.getElementById('at2').checked) { f.a_preview.src=f.avatar2.value; }
if (document.getElementById('at3').checked) { f.a_preview.src="file://"+f.avatar3.value; }
}
function set_sel(num) {
document.getElementById('at'+num).checked=true;
if (num<=1) { preview(); }
}
//--></script>
<input type=radio id=at0 name=u_avatartype value=0 <? check($udata['u_avatartype']==0);?> onClick="preview()"><?=MSG_none;?> &nbsp;
<input type=radio id=at1 name=u_avatartype value=1 <? check($udata['u_avatartype']==1);?> onClick="preview()"><?=MSG_user_avatarstd;?> &nbsp;
<input type=radio id=at2 name=u_avatartype value=2 <? check($udata['u_avatartype']==2);?>><?=MSG_user_avatarext;?> &nbsp;
<? if ($GLOBALS['opt_maxavatarsize']) { ?>
<input type=radio id=at3 name=u_avatartype value=3 <? check($udata['u_avatartype']==3);?>><?=MSG_user_avatarupload;?></td></tr>
<? } ?>
<tr class="basictable"><td><?=MSG_user_avselect;?></td>
<td><table width=100% class="basictable"><tr><td width=50%>
<select name=avatar1 size=5 onChange="set_sel(1)"><?
if ($udata['u_avatartype']==1) echo set_select($avatarselect,$udata['u__avatar']);
else echo $avatarselect; ?></select></td><td>
<img name="a_preview" <? if ($GLOBALS['opt_avatarx']) { ?>width=<?=$GLOBALS['opt_avatarx']; }
if ($GLOBALS['opt_avatary']) { ?> height=<?=$GLOBALS['opt_avatary']; } ?> alt="<?=MSG_user_avpreview;?>">
</td></tr></table></td></tr>
<? if ($GLOBALS['opt_maxavatarsize']) { ?>
<tr class="basictable"><td><?=MSG_user_avurl;?></td>
<td><input type=text name=avatar2 size=30 maxlength=80 onClick="set_sel(2)" onBlur="preview()"
value="<? if ($udata['u_avatartype']==2) echo $udata['u__avatar'];?>"> &nbsp; <input type=button onClick="preview()" value="<?=MSG_preview;?>"></td></tr>
<? } ?>
<tr class="basictable"><td><?=MSG_user_avupload;?>:</td>
<td><input type=file name=avatar3 size=30 maxlength=255 onClick="set_sel(3)" onBlur="preview()"> 
Max: <?=$GLOBALS['opt_maxavatarx'];?>x<?=$GLOBALS['opt_maxavatary'];?>, <?=ceil($GLOBALS['opt_maxavatarsize']/1024);?> Kb
<input type="hidden" name="MAX_FILE_SIZE" value="<?=max($GLOBALS['opt_maxavatarsize'],$GLOBALS['opt_maxphoto']);?>"></td></tr>
<script><!--
preview();
//--></script>
<? if ($GLOBALS['opt_maxphoto']) { ?>
<tr class="basictable"><td><?=MSG_user_photoupload;?>:<br>
<? if ($newaction=="do_edit") {
?><?=MSG_user_photodescr;?><? } ?>
</td><td><input type=file name=photo1 size=30 maxlength=255> 
Max: <?=$GLOBALS['opt_maxphotox'];?>x<?=$GLOBALS['opt_maxphotoy'];?>, <?=ceil($GLOBALS['opt_maxphoto']/1024);?> Kb</td></tr>
<? if ($newaction=="do_edit") {
?><tr class="basictable"><td><?=MSG_user_photodel;?>
</td><td><input type=checkbox name=photo_del value=1></td></tr>
<? }
  }
 }
 elseif ($newaction=="u_save") { ?>
<tr class="basictable"><td><?=MSG_user_photodel;?>
</td><td><input type=checkbox name=photo_del value=1></td></tr>
<tr class="basictable"><td><?=MSG_user_avatardel;?>
</td><td><input type=checkbox name=avatar_del value=1></td></tr>
 <? }
}
else { ?>
<tr class="basictable"><td><?=MSG_user_claimyours;?></td>
<td><input type=radio name=claim value=1 checked><?=MSG_yes;?> &nbsp;
<input type=radio name=claim value=0><?=MSG_no;?></td></tr>
<? }
if ($newaction=="do_register") {
  if ($GLOBALS['opt_ddos']==1) { ?>
<tr class="basictable"><td><?=MSG_user_ddoscode;?></td>
<td><input type=text name=code size=8 maxlength=8> <img src="agent.php?a=code&sid=<?=session_id();?>" alt="<?=MSG_user_nocode;?>"></td></tr>
<? } ?>
<tr class="basictable"><td colspan=2 align=center><?=MSG_user_afterreg;?></td></tr>
<? } ?>
<tr><td colspan=2 class="tablehead">
<? if (getvar("refpage")) { ?><input type=hidden name=refpage value="<?=getvar("refpage");?>"><input type=hidden name=u value=<?=$udata['u_id'];?>><? }
else { ?><input type=hidden name=refpage value="<?=$_SERVER['HTTP_REFERER'];?>"><input type=hidden name=u value=<?=$udata['u_id'];?>><? } ?>
<input type=hidden name=m value=<?=$newmodule;?>><input type=hidden name=a value="<?=$newaction;?>">
<input type=submit value="<?=MSG_save;?>">
</td></tr></table></form>
<? }

function user_big_login() { ?>
<form action="index.php" method=POST>
<table class="innertable" cellspacing=1 width=100%><tr><td class="tablehead" colspan=2><?=MSG_login;?></td></tr>
<tr class="basictable"><td>
<?=MSG_input_login;?>:
</td><td>
<input type=text name=inusername size=32 maxlength=32>
</td></tr><tr class="basictable"><td>
<?=MSG_input_password;?>:
</td><td>
<input type=password name="inpassword" size=32 maxlength=32>
</td></tr><tr class="basictable"><td><?=MSG_login_mode;?></td>
<td><input type=radio name=login_mode value=0 checked><?=MSG_login_normal;?> &nbsp;
<input type=radio name=login_mode value=1><?=MSG_login_secure;?> &nbsp;
<input type=radio name=login_mode value=2><?=MSG_login_keep;?>
</td></tr><tr class="basictable"><td colspan=2 align=center>
<a href="index.php?a=password&m=profile"><?=MSG_input_forgot;?>?</a>
<tr><td class="tablehead" colspan=2>
<input type=hidden name=m value=profile>
<input type=hidden name=a value=do_login>
<input type=hidden name=refpage value="<?=$_SERVER['HTTP_REFERER'];?>">
<input type=submit value="<?=MSG_dologin;?>">
</td></tr></table></form>
<? }

function user_list_start($pages) { ?>
<div class="descr" style="text-align: left"><form action="index.php" method=GET>
<?=MSG_u_orderby;?>: <select name="o"><?=set_select("<option value=\"u__regdate\">".MSG_u_regdate.
"<option value=\"u__name\">".MSG_u_name."<option value=\"u__title\">".MSG_u_title.
"<option value=\"u__level\">".MSG_u_level."<option value=\"urating\">".MSG_u_urating.
"<option value=\"u_gender\">".MSG_u_gender."<option value=\"u_location\">".MSG_u_location."<option value=\"u_icq\">".MSG_u_icq."<option value=\"u_homepage\">".MSG_u_homepage."<option value=\"lastvisit\">".MSG_u_lastvisit,getvar("o"));?></select>
<?=MSG_u_order;?> <select name=desc>
<?=set_select("<option value=\"\">".MSG_asc."<option value=\"desc\">".MSG_desc."",getvar("desc"));?></select>
<input type=hidden name=m value="profile"><input type=hidden name=a value="listusers">
<input type=submit value=<?=MSG_show;?>>
</form></div>
<table class="innertable" cellspacing=1 width=100%><tr><td colspan=12 class="tablehead">
<table width=100% class="tablehead" cellspacing=0><tr><td width=30%>&nbsp;</td>
<td width=40%><?=MSG_user_list;?></td>
<td width=30% align=right><?=$pages;?></td></tr></table>
</td></tr><tr class="tablehead">
<td><?=MSG_name;?></td>
<td><?=MSG_title;?></td>
<td><?=MSG_level;?></td>
<td><?=MSG_p_count;?></td>
<td><?=MSG_rating;?></td>
<td><?=MSG_gender;?></td>
<td><?=MSG_location;?></td>
<td><?=MSG_email;?></td>
<td><?=MSG_homepage;?></td>
<td>ICQ</td>
<td><?=MSG_regdate;?></td>
<td><?=MSG_lastvisit;?></td></tr>
<? }

function user_list_entry(&$udata) { ?>
<tr class="basictable" style="text-align: center">
<td><a href="index.php?m=profile&u=<?=$udata['u_id'];?>"><?=$udata['u__name'];?></a></td>
<td><?=$udata['u__title'];?></td>
<td><?=$udata['l_title'];?></td>
<td><?=intval($udata['pcount']);?></td>
<td><?=intval($udata['urating']);?></td>
<td><? if ($udata['u_gender']==1) { ?><?=MSG_user_male;?><? }
elseif ($udata['u_gender']==0) { ?><?=MSG_user_female;?><? }
else { ?><?=MSG_user_nogender;?><? } ?></td>
<td><?=$udata['u_location'];?></td>
<td><?=show_email_q($udata['u__email'],$udata['u_showmail'],$udata['u_id']);?></td>
<td> <? if ($udata['u_homepage'] && $udata['u_homepage']!="http://") { ?><a href="<?=$udata['u_homepage'];?>" target=_blank><?=MSG_have;?></a><? }
else { ?><?=MSG_none;?><? } ?></td>
<td><? if ($udata['u_icq']) { ?><img src="http://wwp.icq.com/scripts/online.dll?icq=<?=$udata['u_icq'];?>&img=5" alt="<?=MSG_have;?>"><? }
else { ?><?=MSG_none;?><? } ?></td>
<td><?=short_date_out($udata['u__regdate']);?></td>
<td><?=short_date_out($udata['lastvisit']);?></td></tr>
<? }

function user_list_end() { ?>
<tr><td colspan=12 class="tablehead"><a href="index.php?a=user_search&m=profile"><?=MSG_us_search;?></a></td></tr>  
</table>
<? }

function user_profile_start(&$udata,$lmsg,$allowrate) { ?>
<table class="innertable" cellspacing=1 width=100%><tr>
<td colspan=2 class="tablehead"><?=MSG_user_profile;?> <div class="username"><?=$udata['u__name'];?></div></td></tr>
<tr class="basictable"><td width=50%><?=MSG_user_name;?>:</td>
<td><?=$udata['u__name'];?></td></tr>
<tr class="basictable"><td>
<?=MSG_user_realname;?>:
</td><td>
<?=$udata['u_realname'];?></td></tr>
<? if ($udata['u_avatartype']>0) { ?>
<tr class="basictable"><td width=50%><?=MSG_user_avatar;?>:</td>
<td><?=show_avatar($udata);?></td></tr>
<? }
if ($udata['u__photo_id']) { ?>
<tr class="basictable"><td width=50%><?=MSG_user_photo;?>:</td>
<td><img src="file.php?fid=<?=$udata['u__photo_id'];?>"></td></tr>
<? } ?>
<tr class="basictable"><td><?=MSG_user_customtitle;?>:</td>
<td><?=$udata['u__title'];?></td></tr>
<tr class="basictable"><td><?=MSG_user_basiclevel;?>:</td>
<td><?=$udata['l_title'];?></td></tr>
<tr class="basictable"><td><?=MSG_user_gender;?>:</td>
<td><? if ($udata['u_gender']==1) { ?><?=MSG_user_male;?><? }
elseif ($udata['u_gender']==0) { ?><?=MSG_user_female;?><? }
else { ?><?=MSG_user_nogender;?><? } ?></td></tr>
<? if ($udata['u_bmode'] && $udata['u_bday'] && $udata['u_bmonth'] && $udata['u_byear']) { ?>
<tr class="basictable"><td>
<? if ($udata['u_bmode']==1 || $udata['u_bmode']==3) { ?><?=MSG_user_birthdate;?><? }
else { ?><?=MSG_user_age;?><? } ?></td><td><?
if ($udata['u_bmode']==1 && $udata['u_bday'] && $udata['u_bmonth']) { ?><?=$udata['u_bday'];?> <?=month_replace(date("F",mktime(0,0,0,$udata['u_bmonth'],$udata['u_bday'],1980)));?><? }
elseif ($udata['u_bmode']==2 && $udata['u_byear']) { ?><?=date("Y",$GLOBALS['curtime'])-$udata['u_byear']-1;?>
<?=MSG_or;?> <?=format_word(date("Y",$GLOBALS['curtime'])-$udata['u_byear'],MSG_user_age1,MSG_user_age2,MSG_user_age3);?><? }
elseif ($udata['u_bmode']==3) { ?><?=month_replace(date("d F",mktime(0,0,0,$udata['u_bmonth'],$udata['u_bday'],1980)));?> <?=$udata['u_byear'];?><? } ?>
</td></tr>
<? } ?>
<tr class="basictable"><td><?=MSG_user_location;?>:</td>
<td><?=$udata['u_location'];?></td></tr>
</td></tr><tr class="basictable"><td>
<?=MSG_user_interests;?>:</td>
<td><?=$udata['u_interests'];?></td></tr>
<tr class="basictable"><td><?=MSG_user_email;?>:</td>
<td><? show_email_f($udata['u__email'],$udata['u_showmail'],$udata['u_id']);?></td></tr>
<tr class="basictable"><td><?=MSG_user_homepage;?>:</td>
<td> <? if ($udata['u_homepage'] && $udata['u_homepage']!="http://") { ?><a href="<?=$udata['u_homepage'];?>" target=_blank><?=$udata['u_homepage'];?></a><? }
else { ?><?=MSG_no;?><? } ?></td></tr>
<tr class="basictable"><td>ICQ:</td>
<td><? if ($udata['u_icq']) { ?><img src="http://wwp.icq.com/scripts/online.dll?icq=<?=$udata['u_icq'];?>&img=5" border=0 alt=""><?=$udata['u_icq'];?> <? }
else { ?><?=MSG_no;?><? } ?></td></tr>
<tr class="basictable"><td><?=MSG_user_aol;?>:</td>
<td><? if ($udata['u_aol']) { ?><?=$udata['u_aol'];?> <? }
else { ?><?=MSG_no;?><? } ?></td></tr>
<tr class="basictable"><td><?=MSG_user_yahoo;?>:</td>
<td><? if ($udata['u_yahoo']) { ?><?=$udata['u_yahoo'];?> <? }
else { ?><?=MSG_no;?><? } ?></td></tr>
<tr class="basictable"><td><?=MSG_user_msn;?>:</td>
<td><? if ($udata['u_msn']) { ?><?=$udata['u_msn'];?> <? }
else { ?><?=MSG_no;?><? } ?></td></tr>
<tr class="basictable"><td><?=MSG_user_jabber;?>:</td>
<td><? if ($udata['u_jabber']) { ?><?=$udata['u_jabber'];?> <? }
else { ?><?=MSG_no;?><? } ?></td></tr>
<tr class="basictable"><td><?=MSG_user_diary;?>:</td>
<td><? if ($udata['u_diary']) { ?><a href="<?=$udata['u_diary'];?>" target=_blank><?=$udata['u_diary'];?></a><? }
else { ?><?=MSG_no;?><? } ?></td></tr>
<? if ($GLOBALS['opt_rating']==0) { ?>
<tr class="basictable"><td><?=MSG_user_rating;?>:</td>
<td><?=intval($udata['u_rating']) ?><? if ($GLOBALS['inuserid']>3 && $GLOBALS['inuserid']!=$udata['u_id'] && $allowrate) { ?>
&nbsp; <a href="index.php?a=do_user_rate&m=profile&dir=pro&u=<?=$udata['u_id'];?>"><?=MSG_user_ratepro;?></a> &nbsp;
<a href="index.php?a=do_user_rate&m=profile&dir=contra&u=<?=$udata['u_id'];?>"><?=MSG_user_ratecontra;?></a>
<? } ?></td></tr>
<? }
if ($GLOBALS['opt_reputation']==0 || $GLOBALS['inuserbasic']>=1000) { ?>
<tr class="basictable"><td><a href="index.php?m=profile&a=list_warn&u=<?=$udata['u_id'];?>"><?=MSG_user_reputation;?></a>:</td>
<td><?=intval($udata['uw_count']);?></td></tr>
<tr class="basictable"><td><?=MSG_user_onforum;?></td>
<td><? if ($GLOBALS['opt_topiccount']!=1) { ?><?=MSG_user_created;?> <?=format_word($udata['u_tcount'],MSG_t1,MSG_t2,MSG_t3);?><br><? } ?>
<?=MSG_user_posted;?> <?=format_word($udata['u_pcount'],MSG_p1,MSG_p2,MSG_p3);?><br>
<? if ($GLOBALS['opt_topiccount']!=1) { ?><?=MSG_user_polled;?> <?=format_word($udata['u_plcount'],MSG_pl1,MSG_pl2,MSG_pl3);?><br><? } ?>
<?=MSG_user_voted;?> <?=format_word($udata['u_vcount'],MSG_v1,MSG_v2,MSG_v3);?></td></tr>
<? } ?>
<tr class="basictable"><td><?=MSG_user_regdate;?>:</td>
<td><?=long_date_out($udata['u__regdate']);?></td></tr>
<tr class="basictable"><td><?=MSG_user_lastprofile;?>:</td>
<td><?=long_date_out($udata['u__profileupdate']);?></td></tr>
<tr class="basictable"><td><?=MSG_user_lastvisit;?>:</td>
<td><?=long_date_out($udata['u_lastvisit']);?></td></tr>
<? if ($GLOBALS['opt_topiccount']!=1) { ?>
<tr class="basictable"><td><?=MSG_user_lastpost;?>:</td>
<td><? if (!$lmsg) { ?><?=MSG_none;?><? }
elseif ($lmsg['f_lview']<=$GLOBALS['inuserlevel']) { long_date_out($lmsg['p__time']);?> <?=MSG_intopic;?> "<a href="index.php?t=<?=$lmsg['t_id'];?>"><?=$lmsg['t_title'];?></a>"
<?=MSG_inforum;?> "<a href="index.php?f=<?=$lmsg['f_id'];?>"><?=$lmsg['f_title'];?></a>" <? } ?>
</td></tr>
<? }
}

function user_profile_list() { ?>
<tr><td class="tablehead" colspan=2><?=MSG_user_perforum;?>:</td></tr>
<tr><td colspan=2 style="padding: 0px">
<table cellpadding=0 cellspacing=1 width=100%>
<tr><td class="tablehead" width=50%><?=MSG_f;?></td><td class="tablehead" width=20%><?=MSG_f_speclevel;?></td>
<td class="tablehead" width=20%><?=MSG_f_lastvisit;?></td><td class="tablehead" width=10%><?=MSG_f_msgcount;?></td></tr>
<? }

function user_profile_entry(&$fdata,$total) { ?>
<tr class="basictable"><td><a href="index.php?ct=<?=$fdata['ct_id'];?>"><?=$fdata['ct_name'];?></a> &raquo; <a href="index.php?f=<?=$fdata['f_id'];?>"><?=$fdata['f_title'];?></a>
</td><td align=center><?=$fdata['l_title'];?></td><td align=center>
<?=long_date_out($fdata['lv_time']); ?></td>
<td align=center><?=$fdata['f_count'];?> <?
if ($fdata['f_nostats']==0) { ?>(<?=sprintf("%.2f",$fdata['f_count']*100/$total);?>%)<? } ?>
</td></tr>
<? }

function user_profile_finish() { ?>
</table></td></tr>
<? }

function user_profile_end(&$udata,$flist) { ?>
<tr><td colspan=2 class="tablehead"><?=MSG_user_connect;?></td></tr>
<? if ($GLOBALS['inuserid']>3) { ?>
<tr class="basictable"><td colspan=2><a href="index.php?m=messages&a=newmsg&u=<?=$udata['u_id'];?>"><?=MSG_user_pm;?></a></td>
<? } ?>
<tr class="basictable"><td colspan=2><a href="index.php?m=misc&a=sendmail&u=<?=$udata['u_id'];?>"><?=MSG_user_sendmail;?></a></td>
<tr class="basictable"><td colspan=2><noindex><a href="index.php?m=search&a=do_usertopic&fs=all&res=topic&text=<?=$udata['u__name'];?>"><?=MSG_user_searchtopic;?></a></noindex></td>
<tr class="basictable"><td colspan=2><noindex><a href="index.php?m=search&a=do_user&fs=all&res=post&text=<?=$udata['u__name'];?>"><?=MSG_user_searchposts;?></a></noindex></td>
</tr></table>
<? }

function online_start() { ?>
<table cellspacing=1 class="innertable" width=100%><tr><td class="tablehead" colspan=2>
<?=MSG_present;?></td></tr>
<? }

function online_entry(&$udata,$comment) { ?>
<tr class="basictable"><td width=30%><?=user_out($udata['u__name'],$udata['u_id']);?><br>
<?=long_date_out($udata['uo_time']);?></td>
<td><?=$comment;?></td></tr>
<? }

function online_end() { ?>
</table>
<? }

function get_password_form() { ?>
<form action=index.php method=POST>
<table cellspacing=1 class="innertable" width=100%><tr><td class="tablehead" colspan=2>
<?=MSG_pass_restore;?>
</td></tr><tr class="basictable"><td colspan=2 align=center>
<?=MSG_pass_data;?>
</td></tr><tr class="basictable"><td width=50%><?=MSG_pass_name;?>:
</td><td><input type=text name=login size=32 maxlength=32></td></tr>
<tr class="basictable"><td><?=MSG_pass_email;?>:
</td><td><input type=text name=email size=32 maxlength=48></td></tr>
<tr class="basictable"><td><?=MSG_pass_uid;?>:
</td><td><input type=text name=number size=10 maxlength=10></td></tr>
<tr><td class="tablehead" colspan=2>
<input type=hidden name=a value=do_password>
<input type=hidden name=m value=profile>
<input type=submit value="<?=MSG_pass_dosend;?>">
</td></tr></table></form>
<? }

function resend_form() { ?>
<form action=index.php method=POST>
<table cellspacing=1 class="innertable" width=100%><tr><td class="tablehead" colspan=2>
<?=MSG_resend_done;?>
</td></tr><tr class="basictable"><td colspan=2 align=center>
<?=MSG_resend_text;?>
</td></tr><tr class="basictable"><td width=50%><?=MSG_resend_name;?>:
</td><td><input type=text name=uname size=32 maxlength=32></td></tr>
<tr class="basictable"><td><?=MSG_resend_pass;?>:
</td><td><input type=password name=password1 size=32 maxlength=32></td></tr>
<tr class="basictable"><td><?=MSG_resend_newmail;?>:
</td><td><input type=text name=newmail size=32 maxlength=48></td></tr>
<?  if ($GLOBALS['opt_ddos']==1) { ?>
<tr class="basictable"><td><?=MSG_user_ddoscode;?></td>
<td><input type=text name=code size=8 maxlength=8> <img src="agent.php?a=code&sid=<?=session_id();?>" alt="<?=MSG_user_nocode;?>"></td></tr>
<? } ?>
<tr><td class="tablehead" colspan=2>
<input type=hidden name=a value=do_resend>
<input type=hidden name=m value=profile>
<input type=submit value="<?=MSG_send;?>">
</td></tr></table></form>
<? }


function warn_form_start(&$pdata,$count) { ?>
<form action=index.php method=POST>
<table cellspacing=1 class="innertable" width=100%><tr><td class="tablehead" colspan=2>
<?=MSG_u_warnlist;?> <?=user_out($pdata['u__name'],$pdata['u_id']);?>
<? }

function warn_form_entry(&$warndata) { ?>
</td></tr><tr class="basictable"><td colspan=2><b><? if ($warndata['uw_value']==-1) { ?><?=MSG_warn_warning;?><? }
else { ?><?=MSG_warn_award;?><? } ?> <?=MSG_warn_from;?> <?=user_out($warndata['u__name'],$warndata['u_id']);?>:</b><br>
<?=nl2br($warndata['uw_comment']);?>
<? }

function warn_form_noentries() { ?>
<tr class="basictable"><td colspan=2><?=MSG_warn_none;?>.</td></tr>
<? }

function warn_form_end() { ?>
</td></tr></table>
<? }

function warn_form_input() { ?>
<br>
<form action=index.php method=POST>
<table cellspacing=1 class="innertable" width=100%><tr><td class="tablehead" colspan=2>
<?=MSG_warn;?> <?=MSG_intopic;?> "<a href="index.php?t=<?=$GLOBALS['intopic']['t_id'];?>">
<?=$GLOBALS['intopic']['t_title'];?></a>" <?=MSG_inforum;?> "<a href="index.php?f=<?=$GLOBALS['inforum']['f_id'];?>"><?=$GLOBALS['inforum']['f_title'];?></a>".</td></tr>
<tr class="basictable"><td width=50%>
<?=MSG_warndo;?>:</td><td>
<input type=radio name=mode value=warn checked><?=MSG_warn_warning;?><br>
<? if ($GLOBALS['inuserlevel']>=1000) { ?><input type=radio name=mode value=ban><?=MSG_warn_ban;?><br><? } ?>
<input type=radio name=mode value=award><?=MSG_warn_award;?>
</td></tr><tr class="basictable"><td>
<?=MSG_warn_validtill;?>:</td><td>
<input type=radio name=valid value=endless><?=MSG_warn_endless;?> &nbsp; <input type=radio name=valid value=enddate checked><?=MSG_warn_tilldate;?>
</td></tr><tr class="basictable"><td>
<?=MSG_warn_enddate;?>:</td><td>
<?=build_date_field("enddate",$GLOBALS['curtime']+30*24*60*60);?>
</td></tr><tr class="basictable"><td>
<?=MSG_warn_comment;?>:<br>
<?=MSG_warn_commentdescr;?></td><td>
<textarea name="comment" rows=4 cols=40></textarea></td></tr>
<tr><td class="tablehead" colspan=2><input type=hidden name=m value=profile>
<input type=hidden name=a value=do_warn><input type=hidden name=t value="<?=$GLOBALS['topic'];?>">
<input type=hidden name=u value="<?=getvar("u");?>"><input type=submit value="<?=MSG_warndo;?>">
</td></tr></table></form>
<? } 

function user_search_form($levels) { ?>
<form action=index.php method=GET>
<table cellspacing=1 class="innertable" width=100%><tr><td class="tablehead" colspan=2>
<?=MSG_us_extsearch;?></td></tr>
<tr class="basictable"><td>
<?=MSG_user_name;?>:</td><td><input type=text name=name value="<?=getvar('name');?>" size=32 maxlength=32>
</td></tr><tr class="basictable"><td>
<?=MSG_us_mode;?>:</td><td>
<input type=radio name=mode value="" <?=check(!getvar('mode'));?>> <?=MSG_us_exact;?> &nbsp; 
<input type=radio name=mode value="1" <?=check(getvar('mode')==1);?>> <?=MSG_us_begins;?> &nbsp;
<input type=radio name=mode value="2" <?=check(getvar('mode')==2);?>> <?=MSG_us_contains;?>
</td></tr><tr class="basictable"><td>
<?=MSG_us_email;?>:</td><td>
<input type=checkbox name=email value=1 <?=check(getvar('email'));?>>
</td></tr><tr class="basictable"><td>
<?=MSG_us_ICQ;?>:</td><td>
<input type=checkbox name=icq value=1 <?=check(getvar('icq'));?>>
</td></tr><tr class="basictable"><td>
<?=MSG_us_photo;?>:</td><td>
<input type=checkbox name=photo value=1 <?=check(getvar('photo'));?>>
</td></tr><tr class="basictable"><td>
<?=MSG_us_minlevel;?>:</td><td>
<select name=level><?=set_select($levels,getvar('level'));?></select>
</td></tr><tr class="basictable"><td>
<?=MSG_user_interests;?></td><td>
<input type=text size=40 maxlength=255 name=interests value="<?=getvar('interests');?>">
</td></tr>
<tr><td colspan=2 class="tablehead"><input type=hidden name=m value=profile>
<input type=hidden name=a value=user_search_result><input type=submit value="<?=MSG_us_search;?>">
</td></tr></table></form>
<? }

function user_result_start($pages) { ?>
<table class="innertable" cellspacing=1 width=100%><tr class="tablehead"><td colspan=12>
<table width=100% class="tablehead" cellspacing=0><tr><td width=30%>&nbsp;</td>
<td width=40%><?=MSG_us_result;?></td>
<td width=30% align=right><?=$pages;?></td></tr></table>
</td></tr><tr class="tablehead">
<td><?=MSG_name;?></td>
<td><?=MSG_title;?></td>
<td><?=MSG_level;?></td>
<td><?=MSG_p_count;?></td>
<td><?=MSG_rating;?></td>
<td><?=MSG_gender;?></td>
<td><?=MSG_location;?></td>
<td><?=MSG_email;?></td>
<td><?=MSG_homepage;?></td>
<td>ICQ</td>
<td><?=MSG_regdate;?></td>
<td><?=MSG_lastvisit;?></td></tr>
<? }

function user_result_end() { ?>
</table><br>
<? }
