Contact Page

Автор Xvost, 10 августа 2011, 06:51:00

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

Xvost

Посмотрите на скриншот, и подскажите, как выровнять надпись "Контакты" по центру? Код прилагаю. Сам никак в толк не возьму...

<?php
/*
Contact Page
Version 2.0
by:vbgamer45
http://www.smfhacks.com
*/
function template_main()
{
global $scripturl, $txt, $context;

echo
'

<form method="post" action="'
, $scripturl, '?action=contact;sa=save">
<table class="table_list" align="center" width="60%">
        <tbody class="header">

<tr  class="catbg">
<td align="center"  colspan="2" class="catbg"><span class="left"></span>'
,$txt['smfcontact_contact'],'</td>
 </tr>
 </tbody>
 <tr>
   <td width="28%"  class="windowbg2"><span class="gen"><b>'
,$txt['smfcontact_name'],'</b></span></td>
   <td width="72%"  class="windowbg2"><input type="text" name="from" size="64" /></td>
 </tr>
 <tr>
   <td width="28%"" class="windowbg2"><span class="gen"><b>'
,$txt['smfcontact_subject'],'</b></span></td>
   <td width="72%"" class="windowbg2"><input type="text" name="subject" size="64" /></td>
 </tr>
 <tr>
   <td width="28%"  valign="top" class="windowbg2"><span class="gen"><b>'
,$txt['smfcontact_body'],'</b></span></td>
   <td width="72%"  class="windowbg2"><textarea rows="6" name="message" cols="54"></textarea></td>
 </tr>'
;
// Is visual verification enabled?
if ($context['require_verification'])
{



echo '
<tr class="windowbg2">
<td align="right" valign="top"'
, !empty($context['post_error']['need_qr_verification']) ? ' style="color: red;"' : '', '>
<b>'
, $txt['verification'], ':</b>
</td>
<td>
'
, template_control_verification($context['visual_verification_id'], 'all'), '
</td>
</tr>'
;
}


echo
'
 <tr>
   <td width="28%"" class="windowbg2"><span class="gen"><b>'
,$txt['smfcontact_emailaddress'],'</b></span></td>
   <td width="72%"" class="windowbg2"><input type="text" name="email" size="64" /></td>
 </tr>
 <tr>
   <td width="28%" colspan="2" height="26" align="center" class="windowbg2">
   <input type="submit" value="'
,$txt['smfcontact_sendemail'],'" name="submit" /></td>

 </tr>
</table>
</form>
'
;

// Copyright link requird unless removal purchase is made
echo '<br /><div align="center"><span class="smalltext">Powered by <a href="http://www.smfhacks.com" target="blank">Contact Page</a></span></div>';
}

function
template_send()
{
global $scripturl, $txt;
echo
'
<div>
<table border="0" width="80%" cellspacing="0" align="center" cellpadding="4" class="tborder">
<tr class="titlebg">
<td>'
,$txt['smfcontact_messagesent'],'</td>
</tr>

<tr class="windowbg">
<td style="padding: 3ex;">
'
,$txt['smfcontact_messagesent_click'],'<a href="', $scripturl, '">',$txt['smfcontact_messagesent_return'] ,'
</td>
</tr>
</table>
</div>'
;

// Copyright link requird unless removal purchase is made
echo '<br /><div align="center"><span class="smalltext">Powered by <a href="http://www.smfhacks.com" target="blank">Contact Page</a> by <a href="http://www.createaforum.com" title="Forum Hosting">CreateAForum.com</a></span> </div>';
}
?>

Grek

Заменить span class="left" на span class="center"

Xvost

Не годиться. В таком случае уменьшается ширина подложки до размера высоты текста.

BIOHAZARD

ссылку на рабочий вариант (форум) дайте
// надо играться с css: line-height, padding, etc.
Мои моды:
  • RedirectPage
  • Counters
  • CustomSearch
  • SypexDumper
   адаптирую темы    1.1.хx<=>2.0задавая вопросы, старайтесь сразу указывать конечную цель, предполагаемый Вами путь не обязательно окажется самым коротким

Любые моды на заказ

Xvost

На рабочем мод не стоит. Такая картина только с надписью мода, аналогичные надписи форума в порядке.

BIOHAZARD

на своём форуме ставить лень
пробуйте играться с указанными мною параметрами
тема вам в помощь: http://www.simplemachines.ru/index.php?topic=7551.0
Мои моды:
  • RedirectPage
  • Counters
  • CustomSearch
  • SypexDumper
   адаптирую темы    1.1.хx<=>2.0задавая вопросы, старайтесь сразу указывать конечную цель, предполагаемый Вами путь не обязательно окажется самым коротким

Любые моды на заказ

Xvost

Наверное я тупой, но ничего я не могу понять, как исправить проблему. Кто-то может мне подсказать, глядя на код в первом топике темы?

0daliska

Исправить ошибки в верстке шаблона формы...
Замените код Contact2.template.php на этот:
<?php
/*
Contact Page
Version 2.0
by:vbgamer45
http://www.smfhacks.com
html fixed by 0daliska
http://www.0daliska.ru
*/
function template_main()
{
global $scripturl, $txt, $context;

echo
'

<form method="post" action="'
, $scripturl, '?action=contact;sa=save">
<table class="table_list" align="center" width="60%">
<tbody class="header">
<tr class="cat_bar">
<td align="center"  colspan="2" class="catbg"><span class="left"></span><h3 class="catbg"> '
,$txt['smfcontact_contact'],'</h3></td>
 </tr>
</tbody>
<tbody>
 <tr>
   <td width="28%"  class="windowbg2"><span class="gen"><b>'
,$txt['smfcontact_name'],'</b></span></td>
   <td width="72%"  class="windowbg2"><input type="text" name="from" size="64" /></td>
 </tr>
 <tr>
   <td width="28%" class="windowbg2"><span class="gen"><b>'
,$txt['smfcontact_subject'],'</b></span></td>
   <td width="72%" class="windowbg2"><input type="text" name="subject" size="64" /></td>
 </tr>
 <tr>
   <td width="28%"  valign="top" class="windowbg2"><span class="gen"><b>'
,$txt['smfcontact_body'],'</b></span></td>
   <td width="72%"  class="windowbg2"><textarea rows="6" name="message" cols="54"></textarea></td>
 </tr>'
;
// Is visual verification enabled?
if ($context['require_verification'])
{



echo '
<tr class="windowbg2">
<td align="right" valign="top"'
, !empty($context['post_error']['need_qr_verification']) ? ' style="color: red;"' : '', '>
<b>'
, $txt['verification'], ':</b>
</td>
<td>
'
, template_control_verification($context['visual_verification_id'], 'all'), '
</td>
</tr>'
;
}


echo
'
 <tr>
   <td width="28%" class="windowbg2"><span class="gen"><b>'
,$txt['smfcontact_emailaddress'],'</b></span></td>
   <td width="72%" class="windowbg2"><input type="text" name="email" size="64" /></td>
 </tr>
 <tr>
   <td width="28%" colspan="2" height="26" align="center" class="windowbg2">
   <input type="submit" value="'
,$txt['smfcontact_sendemail'],'" name="submit" /></td>

 </tr>
 </tbody>
</table>
</form>
'
;

// Copyright link requird unless removal purchase is made
echo '<br /><div align="center"><span class="smalltext">Powered by <a href="http://www.smfhacks.com" target="blank">Contact Page</a></span></div>';
}

function
template_send()
{
global $scripturl, $txt;
echo
'
<div>
<table border="0" width="80%" cellspacing="0" align="center" cellpadding="4" class="tborder">
<tr class="titlebg">
<td>'
,$txt['smfcontact_messagesent'],'</td>
</tr>

<tr class="windowbg">
<td style="padding: 3ex;">
'
,$txt['smfcontact_messagesent_click'],'<a href="', $scripturl, '">',$txt['smfcontact_messagesent_return'] ,'
</td>
</tr>
</table>
</div>'
;

// Copyright link requird unless removal purchase is made
echo '<br /><div align="center"><span class="smalltext">Powered by <a href="http://www.smfhacks.com" target="blank">Contact Page</a> by <a href="http://www.createaforum.com" title="Forum Hosting">CreateAForum.com</a></span> </div>';
}
?>
Уехала отдыхать. Сейчас без интернета до 1 августа. Приеду - выполню все обещания
® For members of Russian community (simplemachines.ru) only

Xvost

Большое спасибо!

Xvost

0daliska, переустановил форум, обновив до версии 2.0.2, ставлю мод с Вашим кодом, вылазит некорректность (см. аттач). Уж помогите ещё раз, чего и где надо поправить?