Location: PHPKode > projects > Quick Guestbook > quicktalk/qtg_form_msg.php
<?php

// QuickTalk Guestbook 2.5 build:20100731

echo '
<script type="text/javascript" src="bin/qtg_bbc.js"></script>
';

echo '
<script type="text/javascript">
<!--
function ValidateForm(theForm)
{
  if (theForm.name.value.length==0) { alert(qtHtmldecode("',$L['E_mandatory'],': ',$L['Name'],'")); return false; }
  if (theForm.code.value.length==0) { alert(qtHtmldecode("',$L['E_mandatory'],': ',$L['HSecurity'],'")); return false; }
  if (theForm.msg.value.length==0) { alert(qtHtmldecode("',$L['E_mandatory'],': ',$L['Message'],'")); return false; }
  if (theForm.msg.value.length>',$qtg_max_size,') { alert(qtHtmldecode("',$L['E_size'],'")); return false; }
  return null;
}
-->
</script>
';

echo '
<!-- form -->
<a name="addmsg"></a>

<div class="reply">
<form method="post" action="',$formaction,'" onsubmit="return ValidateForm(this);">
<table class="reply">
<tr class="reply">
<td class="reply"><label for="name">',$L['Name'],'*</label></td>
<td class="reply"><input type="text" id="name" name="name" value="',QTconv($oPost->name,'I'),'" size="40" maxlength="50" tabindex="1"/>';

if ( $qtg_use_age )
{
echo '&nbsp;<label for="age">',$L['Age'],'</label>&nbsp;<input type="text" id="age" name="age" value="',($oPost->userage<1 ? '' : $oPost->userage),'" size="2" maxlength="3" tabindex="2"/>';
}

echo '</td>
</tr>
';

if ($qtg_use_email)
{
echo '<tr class="reply">
<td class="reply"><label for="mail">',$L['Email'],'</label></td>
<td class="reply"><input type="text" id="mail" name="mail" value="',$oPost->useremail,'" size="35" maxlength="50" tabindex="3"/></td>
</tr>
';
}

if ($qtg_use_from)
{
echo '<tr class="reply">
<td class="reply"><label for="from">',$L['From'],'</label></td>
<td class="reply">';
if ($qtg_use_from_type==0) echo '<input type="text" id="form" name="from" value="',$oPost->postfrom,'" size="35" maxlength="50" tabindex="4"/>';
if ($qtg_use_from_type==1)
{
include(GetLang().'qtg_cntry.php');
echo '<select id="from" name="from" tabindex="4">';
foreach($country as $key=>$val)
{
  if ($key=='--')
  {
    echo '<option value="" ',($val==$oPost->postfrom ? QSEL : ''),'>',$val,'</option>';
  }
  else
  {
    echo '<option value="',$val,'" '.($val==$oPost->postfrom ? QSEL : '').'>',$val,'</option>';
  }
}
echo '</select>';
}
echo '</td>
</tr>
';
}

echo '<tr class="reply">
<td class="reply"><label for="msg">',$L['Message'],'*</label><br/><br/>';
if ($qtg_bbc_bold)      echo '<a href="#addmsg" onclick="storeCaret(\'b\')"><img class="bbc bbc_bold" alt="b" src="',$qtg_skin,'/img_trans.gif" width="1" height="1" title="',$L['Ico_bold'],'"/></a>';
if ($qtg_bbc_italic)    echo '<a href="#addmsg" onclick="storeCaret(\'i\')"><img class="bbc bbc_italic" alt="i" src="',$qtg_skin,'/img_trans.gif" width="1" height="1" title="',$L['Ico_italic'],'"/></a>';
if ($qtg_bbc_underline) echo '<a href="#addmsg" onclick="storeCaret(\'u\')"><img class="bbc bbc_under" alt="u" src="',$qtg_skin,'/img_trans.gif" width="1" height="1" title="',$L['Ico_under'],'"/></a>';
if ($qtg_bbc_url)       echo '<a href="#addmsg" onclick="storeCaret(\'url\')"><img class="bbc bbc_url" alt="_" src="',$qtg_skin,'/img_trans.gif" width="1" height="1" title="',$L['Ico_url'],'"/></a>';

if ($qtg_bbc_smiley)
{
  echo '<br/>';
  echo '<a href="#addmsg" onclick="smilie(',"'[:)]'",'); return false;"><img class="smile" id="smile01" src="',$qtg_skin,'/ico_smile_01.gif" width="14" height="14" title="',$L['Ico_smile01'],'" alt=":)" style="border-width:0px; vertical-align:middle; margin:4px;"/></a>';
  echo '<a href="#addmsg" onclick="smilie(',"'[:(]'",'); return false;"><img class="smile" id="smile02" src="',$qtg_skin,'/ico_smile_02.gif" width="14" height="14" title="',$L['Ico_smile02'],'" alt=":(" style="border-width:0px; vertical-align:middle; margin:4px;"/></a>';
  echo '<a href="#addmsg" onclick="smilie(',"'[:|]'",'); return false;"><img class="smile" id="smile03" src="',$qtg_skin,'/ico_smile_03.gif" width="14" height="14" title="',$L['Ico_smile03'],'" alt=":|" style="border-width:0px; vertical-align:middle; margin:4px;"/></a><br/>';
  echo '<a href="#addmsg" onclick="smilie(',"'[;)]'",'); return false;"><img class="smile" id="smile04" src="',$qtg_skin,'/ico_smile_04.gif" width="14" height="14" title="',$L['Ico_smile04'],'" alt=";)" style="border-width:0px; vertical-align:middle; margin:4px;"/></a>';
  echo '<a href="#addmsg" onclick="smilie(',"'[:t]'",'); return false;"><img class="smile" id="smile05" src="',$qtg_skin,'/ico_smile_05.gif" width="14" height="14" title="',$L['Ico_smile05'],'" alt=":t" style="border-width:0px; vertical-align:middle; margin:4px;"/></a>';
  echo '<a href="#addmsg" onclick="smilie(',"'[:o]'",'); return false;"><img class="smile" id="smile06" src="',$qtg_skin,'/ico_smile_06.gif" width="14" height="14" title="',$L['Ico_smile06'],'" alt=":o" style="border-width:0px; vertical-align:middle; margin:4px;"/></a><br/>';
  echo '<a href="#addmsg" onclick="smilie(',"'[:?]'",'); return false;"><img class="smile" id="smile07" src="',$qtg_skin,'/ico_smile_07.gif" width="14" height="14" title="',$L['Ico_smile07'],'" alt="?" style="border-width:0px; vertical-align:middle; margin:4px;"/></a>';
  echo '<a href="#addmsg" onclick="smilie(',"'[:!]'",'); return false;"><img class="smile" id="smile08" src="',$qtg_skin,'/ico_smile_08.gif" width="14" height="14" title="',$L['Ico_smile08'],'" alt="!" style="border-width:0px; vertical-align:middle; margin:4px;"/></a>';
  echo '<a href="#addmsg" onclick="smilie(',"'[:*]'",'); return false;"><img class="smile" id="smile09" src="',$qtg_skin,'/ico_smile_09.gif" width="14" height="14" title="',$L['Ico_smile09'],'" alt="*" style="border-width:0px; vertical-align:middle; margin:4px;"/></a>';
}
echo '</td>';
echo '<td class="reply">
<textarea id="msg" name="msg" ',(strlen($oPost->message)>250 ? 'rows="10" cols="55"' : 'rows="7" cols="50"'),' tabindex="5">',QTconv($oPost->message,'I'),'</textarea></td>';
echo '</tr>
';

if ( !empty($qtg_gkey) )
{
  $strPosition  = '<p class="small" style="margin:2px 0 4px 2px;text-align:right">'.$L['map']['cancreate'];
  $strPosition .= ' | <a class="small" href="javascript:void(0)" onclick="createMarker(); return false;" title="'.$L['map']['H_pntadd'].'">'.$L['map']['pntadd'].'</a>';
  $strPosition .= ' | <a class="small" href="javascript:void(0)" onclick="deleteMarker(); return false;">'.$L['map']['pntdelete'].'</a>';
  if ( isset($oPost) ) {
  if ( !empty($oPost->x) || !empty($oPost->y) ) {
    $strPosition  = '<p class="small" style="margin:2px 0 4px 2px;text-align:right">'.$L['map']['canmove'];
    $strPosition .= ' | <a class="small" href="javascript:void(0)" onclick="deleteMarker(); return false;">'.$L['map']['pntdelete'].'</a>';
    $strPosition .= ' | <a class="small" href="javascript:void(0)" onclick="undoChanges(); return false;">'.$L['map']['undo'].'</a>';
  }}
  $strPosition .= '</p>'.N;
  $strPosition .= '<div id="map_canvas" style="width:100%; height:345px;"></div>'.N;
  $strPosition .= '<input type="hidden" id="m_map_gcenter" name="m_map_gcenter" value="'.( $oPost->y==0 && $oPost->x==0 ? '' : $oPost->y.','.$oPost->x ).'"/>'.N;
  $strPosition .= '<p class="small" style="margin:4px 0 2px 2px;text-align:right">'.$L['map']['addrlatlng'].' <input type="text" size="24" id="find" name="find" class="small" value="'.$qtg_gfind.'" onkeyup="handle_keypress(event,\'findit\')" title="'.$L['map']['H_addrlatlng'].'"/> <input type="submit" id="findit" class="small" onclick="showLocation(document.getElementById(\'find\').value); return false;" value="'.$L['Search'].'"/></p>'.N;
  
  echo '<tr class="reply">
  <td class="mapedit" colspan="2">',$strPosition,'</td>
  </tr>
  ';
}

echo '<tr class="reply">
<td class="reply" colspan="2">&nbsp;</td>
</tr>
';
echo '<tr class="reply">
<td class="reply">';

$strCode=''; if ( $bAdm ) $strCode='0000';
unset($_SESSION['textcolor']);
if ( !isset($bAdm) ) $bAdm=false;

if ( !$bAdm ) {
if ( $qtg_antispam!=0 ) {

  if ( $qtg_antispam==1 )
  {
    $keycode = rand(0,9).rand(0,9).rand(0,9).rand(0,9);
    $_SESSION['textcolor']=sha1($keycode);
    echo '<p class="code"><label for="code">',$keycode,'</label></p>';
  }
  if ( $qtg_antispam==2 )
  {
    echo '<img width="75" height="28" src="admin/qtg_icode.php" alt="no GD lib." style="border-width:0px; vertical-align:middle;" title="security code"/>';
  }

}}
echo '</td>';
echo '<td class="reply">';
if ( $qtg_antispam!=0 && !$bAdm )
{
echo '<input type="text" id="code" name="code" value="',$strCode,'" size="5" maxlength="5" tabindex="6"/>&nbsp;<span class="small">',$L['HSecurity'],'*</span>&nbsp;&nbsp;';
}
else
{
echo '<input type="hidden" id="code" name="code" value="0000"/>';
}
if ( isset($p) ) echo '<input type="hidden" name="p" value="',$p,'"/>';
if ( $bAdm ) echo '<input type="hidden" name="adm" value="1"/>';
echo '<input type="hidden" name="id" value="',$id,'"/><input type="submit" name="ok" value="',$L['Send'],'" tabindex="7"/></td>';
echo '</tr>
';
echo '</table>
</form>
</div>
<p class="formfooter">*',$L['Mandatory_fields'],'</p>
';
echo '
<script type="text/javascript">
<!--
document.getElementById("name").focus();
-->
</script>
';

echo '
<!-- end form -->
';
?>
Return current item: Quick Guestbook