roadway napisał(a):
CFC to chyba coś źle zrobiłes :/ Sprawdz lepiej dokladnie
Wydaje mi się, że wszystko jest jak wyżej:
posting.php
Kod:
/* TT */
if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) )
{
$sql='SELECT * FROM '.TT_TABLE.' WHERE forum_id='.$forum_id.' ORDER BY tt_title ASC';
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't obtain TT data", "", __LINE__, __FILE__, $sql);
}
$ttcount=$db->sql_numfields($result);
if ($ttcount>0)
{
$template->assign_block_vars('switch_ttypes',array());
$sel='';
if ( $mode == 'newtopic' || ( $mode == 'editpost' && ($post_data['topic_ttype']==0) ) )
$sel=' selected="selected"';
$tt_listbox='<option value="0"'.$sel.'>[ --- ]</option>';
while ($ttrow=$db->sql_fetchrow($result))
{
$sel='';
if ( $mode == 'editpost' && ($post_data['topic_ttype']==$ttrow['tt_id']) )
$sel=' selected="selected"';
$tt_listbox.='<option value="'.$ttrow['tt_id'].'"'.$sel.'>[ '.$ttrow['tt_title'].' ]</option>';
}
$tt_list = '<select name="ttype" class="post" size="1">';
$tt_list .= $tt_listbox;
$tt_list .= '</select>';
$tt_hidden = '<input type="hidden" name="ttype" value="0">';
$template->assign_vars(array(
'TTYPES'=> ( $ttcount != 0 ) ? $tt_list : $tt_hidden
));
}
}
/* TT */
posting_body.tplKod:
<tr>
<td class="row1" width="22%"><span class="gen"><b>{L_SUBJECT}</b></span></td>
<td class="row2" width="78%"> <span class="gen">
<!-- BEGIN switch_ttypes -->
{TTYPES}
<!-- END switch_ttypes -->
<input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" />
</span> </td>
</tr>
:roll:
-.-
shake your boom boom