
<script language="JavaScript">
<!--
function checkAll(form){
  for (var i = 0; i < form.elements.length; i++){
    eval("form.elements[" + i + "].checked = form.elements[0].checked");
  }
}
-->
</script>
</head>
<body>


<script language="javascript">
function AjaxReply()
{

	var AjaxState = {ajaxSend : $("#status").html("<div class='info_bar'> <img border='0' src='{$image_path}/loading.gif'></div>")};

	var data = {};
	data['text']	=	$("#box_text").val();
	data['code_confirm']	=	$("#code_confirm").val();
	data['ajax']	=	1;

	$.post("index.php?page=visitormessage&add_visitor_message=1&id={$MemberInfo['id']}",data,function Success(xml) { $("#status").html(xml); });
}

function Wait()
{
	$("#status").html("{$lang['Ongoing_process']}");
}

function Ready()
{
	$("#visitor_messag_id").click(AjaxReply);
}

$(document).ready(Ready);

-->
</script>

{if !{$No_VisitorMessageList}}
<form action="index.php?page=visitormessage&amp;del=1&amp;id={$MemberInfo['id']}" name="form1" method="post">

<table width="100%" border="0" class="border" cellpadding="0" style="border-collapse: collapse" align="center">
  <tr>
    <td width="60%" class="tcat" colspan="1">
{if {$show}}
<div class="l-left">
<input type="checkbox" name="check_all" onClick="checkAll(this.form)"/>
  </div>
{else}
{if {$_CONF['rows']['group_info']['admincp_allow']}}
{if !{$show}}
<div class="l-left">
<input type="checkbox" name="check_all" onClick="checkAll(this.form)"/>
 </div>
{/if}
{/if}
{/if}
{$lang['Showing_Visitor_Messages']}
   </td>
  </tr>
      {Des::while}{VisitorMessageList}
   <tr id="visitor_messag">
    <td class="row1" width="60%" valign="top">
<table border="0" width="100%" cellpadding="1" class="border">
	<tr>
<td class="row1" valign="top">
{if {$VisitorMessageList['postusername']}}
<?php

      	$userid = $PowerBB->_CONF['template']['while']['VisitorMessageList'][$this->x_loop]['postuserid'];
        $GetAvatar = $PowerBB->DB->sql_query("SELECT * FROM " . $PowerBB->table['member'] . " WHERE id = '$userid'");
        $Avatar = @mysql_fetch_array($GetAvatar);
        $avater_path = $Avatar['avater_path'];
?>
<?php if ($avater_path){ ?>
<a class="UserPhotoLink" href="index.php?page=profile&amp;show=1&amp;id={$VisitorMessageList['postuserid']}">
<img src='<?php echo $avater_path; ?>' alt="Photo" class="UserPhoto UserPhoto_mini" />
</a>
{/if}
<?php if ($avater_path ==''){ ?>
<a class="UserPhotoLink" href="index.php?page=profile&amp;show=1&amp;id={$VisitorMessageList['postuserid']}">
	<img src="{$image_path}/
	{$_CONF['info_row']['default_avatar']}" border="0" alt="Photo" class="UserPhoto UserPhoto_mini" />
	</a>
{/if}

{else}
<a class="UserPhotoLink" href="index.php?page=profile&amp;show=1&amp;id={$VisitorMessageList['postuserid']}">
	<img src="{$image_path}/
	{$_CONF['info_row']['default_avatar']}" border="0" class="UserPhoto UserPhoto_mini" />
	</a>
{/if}
		</td>
		<td class="row1" width="100%" valign="top">
<table border="0" width="100%" cellpadding="0" style="border-collapse: collapse">
	<tr>
		<td class="row2">
  <div class="r-right">
{if {$VisitorMessageList['postusername']}}
<a href="index.php?page=profile&amp;show=1&amp;id={$VisitorMessageList['postuserid']}">{$VisitorMessageList['postusername']}</a>
{else}
{$lang['Guest_']}
{/if}
</div>
  <div class="l-left">
<font class="smallfont">{$VisitorMessageList['dateline']} </font>
{if {$show}}
  <input type="checkbox" name="check[]" value="{$VisitorMessageList['id']}" />
  {else}
{if {$_CONF['rows']['group_info']['admincp_allow']}}
{if !{$show}}
  <input type="checkbox" name="check[]" value="{$VisitorMessageList['id']}" />
{/if}
{/if}
{/if}
</div>
</td>
	</tr>
</table>

<br />
<?php $PowerBB->_CONF['template']['while']['VisitorMessageList'][$this->x_loop]['pagetext'] = $PowerBB->functions->CleanVariable($PowerBB->_CONF['template']['while']['VisitorMessageList'][$this->x_loop]['pagetext'],'html'); ?>
<?php $PowerBB->_CONF['template']['while']['VisitorMessageList'][$this->x_loop]['pagetext'] = $PowerBB->Powerparse->replace($PowerBB->_CONF['template']['while']['VisitorMessageList'][$this->x_loop]['pagetext']); ?>
<?php $PowerBB->_CONF['template']['while']['VisitorMessageList'][$this->x_loop]['pagetext'] = $PowerBB->Powerparse->censor_words($PowerBB->_CONF['template']['while']['VisitorMessageList'][$this->x_loop]['pagetext']); ?>
<?php echo $PowerBB->_CONF['template']['while']['VisitorMessageList'][$this->x_loop]['pagetext']; ?>

<br />
<?php if ($PowerBB->_CONF['template']['_CONF']['rows']['member_row']['usergroup'] == '1') {  ?>
<div class="l-left">
&nbsp;&nbsp;
<img title="{$lang['user_IP']}:
{$VisitorMessageList['ipaddress']}" border="0" src="{$image_path}/ip.gif" width="25" height="15">
&nbsp;&nbsp;
</div>
{/if}

 {if {$_CONF['member_permission']}}
{if {$VisitorMessageList['postusername']} == {$_CONF['rows']['member_row']['username']}}
<div class="l-left">
<a id="pagetext" href="index.php?page=visitormessage&amp;edit=1&amp;id={$VisitorMessageList['id']}">
{$lang['Edit_Message']}</a>
</div>
{else}
{if {$_CONF['rows']['group_info']['admincp_allow']}}
<div class="l-left">
<a id="pagetext" href="index.php?page=visitormessage&amp;edit=1&amp;id={$VisitorMessageList['id']}">
{$lang['Edit_Message']}</a>
</div>
{/if}
{/if}
{/if}

		</td>
	</tr>
	</table>
</td>
  </tr>
     {/Des::while}
{if {$show}}
     <tr>
    <td width="60%" class="row1" align="center">
<input class="button" name="delet" type="submit" value="{$lang['delet_Visitor_Messages']}" />
</td>
  </tr>
{else}
{if {$_CONF['rows']['group_info']['admincp_allow']}}
{if !{$show}}
     <tr>
    <td width="60%" class="row1" align="center">
<input class="button" name="delet" type="submit" value="{$lang['delet_Visitor_Messages']}" />
</td>
  </tr>
{/if}
{/if}
{/if}
     <tr>
    <td width="60%" class="row2" align="left">
{$pager}</td>
  </tr>
  </table>

</form>

<br />
{else}
<table width="100%" border="0" cellspacing="1" class="border" align="center">
  <tr>
    <td width="60%" class="tcat" colspan="1">
{$lang['Showing_Visitor_Messages']}
    </td>
  </tr>
       <tr>
    <td width="60%" class="row1" align="center">
{$lang['No_VisitorMessageList']}
        </td>
  </tr>
  </table>
{/if}
<br />
{if {$_CONF['info_row']['active_visitor_message']} == '1'}
{if {$_CONF['group_info']['visitormessage']} == 1}
<?php if (!$PowerBB->_CONF['template']['MemberInfo']['visitormessage'] == '0'
OR !$PowerBB->_CONF['template']['group_info_visitormessage'] == '0'
and $PowerBB->_CONF['template']['_CONF']['rows']['member_row']['id'] == $PowerBB->_CONF['template']['MemberInfo']['id']) {  ?>

<form name="topic" method="post" action="index.php?page=visitormessage&amp;add_visitor_message=1&amp;id={$MemberInfo['id']}">
<div id="status"></div>
<table align="center" class="border" border="0" cellspacing="1" width="100%">
  <tr>
    <td width="60%" class="tcat" colspan="1">
{$lang['Write_a_new_message']}
    </td>
  </tr>
   <tr>
    <td width="60%" class="row1">
{template}visitor_message_js{/template}
<textarea name="text" id="box_text" style="display:block;" class="editoriframemini" tabindex="3"></textarea>
   <script type="text/javascript">
    comm._toggle();
</script>
{if {$_CONF['info_row']['smiles_show']} == 1}
<fieldset>
<legend>{$lang['smiles']}</legend>
			{Des::while}{SmileRows}
				<img src="{$SmileRows['smile_path']}" OnClick="AddSmileyIcon('{$SmileRows['smile_path']}');" alt="{$SmileRows['smile_path']}" border="0" cellspacing="1" />
			{/Des::while}
</fieldset>
{/if}
    </td>
  </tr>
  {if !{$_CONF['member_permission']}}
<tr>
    <td width="60%" class="row1" align="center">
<font class="smallfont">{$lang['Verification']}</font>
<br />
<img id="turing" src="includes/captcha.php" />
 <input name="code_confirm" id="code_confirm" type="text" size="4" maxlength="5" dir="ltr"/>
<br />
<script language="javascript">

     var clicks = 0;

     function updateImg()
     {
      clicks++
     var doc = document.getElementById("turing");
     doc.src = "includes/captcha.php" + "?act=" + clicks;
     }
-->
</script>
<a onclick="updateImg();"><font class="smallfont">{$lang['Image_replacement']}</font></a>
    </td>
  </tr>
  {/if}

    <tr>
    <td width="60%" class="row1" align="center">
<input name="insert" type="button" id="visitor_messag_id" value="{$lang['send']}" onclick="comm._submit();" />
    </td>
  </tr>
</table>
</form>
{/if}
{/if}
{/if}


