Sland
ПротNв те4ениR
- Регистрация
- 15 Дек 2006
- Сообщения
- 194
- Реакции
- 159
- Автор темы
- #1
Для просмотра ссылки Войди или Зарегистрируйся
открыть engine/modules/show.full.php
найти и удалить
найти
заменить на
создать 2 файла шаблона
comments1.tpl - для нечетных комментариев
comments2.tpl - для четных
Автор : storm aka unstandart
открыть engine/modules/show.full.php
найти и удалить
PHP:
if ($config['comm_msort'] == "ASC")
$tpl->set('{comment-id}', $cstart+$i);
else
$tpl->set('{comment-id}', $comments_num-$cstart-$i+1);
найти
PHP:
$tpl->load_template('comments.tpl');
if (strpos ($tpl->copy_template, "[xfvalue_") !== false) $xfound = true; else $xfound = false;
if ($xfound) $xfields = xfieldsload(true);
$tpl->copy_template = "<a name="comment"></a>".$tpl->copy_template;
if ($config['allow_cmod']) $where_approve = " AND " . PREFIX . "_comments.approve='1'"; else $where_approve = "";
$sql_result = $db->query("SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . USERPREFIX . "_users.email, news_num, comm_num, user_group, reg_date, signature, foto, fullname, land, icq, xfields FROM " . PREFIX . "_comments LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$news_id'".$where_approve." ORDER BY date ".$config['comm_msort']." LIMIT ".$cstart.",".$config['comm_nummers']);
while($row = $db->get_row($sql_result)){ $i++;
$row['date'] = strtotime($row['date']);
$row['gast_name'] = stripslashes($row['gast_name']);
$row['gast_email'] = stripslashes($row['gast_email']);
$row['name'] = stripslashes($row['name']);
заменить на
PHP:
$sql_result = $db->query("SELECT " . PREFIX . "_comments.id, post_id, " . PREFIX . "_comments.user_id, date, autor as gast_name, " . PREFIX . "_comments.email as gast_email, text, ip, is_register, name, " . USERPREFIX . "_users.email, news_num, comm_num, user_group, reg_date, signature, foto, fullname, land, icq, xfields FROM " . PREFIX . "_comments LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id WHERE " . PREFIX . "_comments.post_id = '$news_id'".$where_approve." ORDER BY date ".$config['comm_msort']." LIMIT ".$cstart.",".$config['comm_nummers']);
while($row = $db->get_row($sql_result)){ $i++;
if ($config['comm_msort'] == "ASC") {
$tpl->set('{comment-id}', $cstart+$i);
$a_comment_id = $cstart+$i;
} else {
$tpl->set('{comment-id}', $comments_num-$cstart-$i+1);
$a_comment_id = $comments_num-$cstart-$i+1;
}
if ($a_comment_id & 1)
$tpl->load_template('comments1.tpl');
else
$tpl->load_template('comments2.tpl');
if (strpos ($tpl->copy_template, "[xfvalue_") !== false) $xfound = true; else $xfound = false;
if ($xfound) $xfields = xfieldsload(true);
$tpl->copy_template = "<a name="comment"></a>".$tpl->copy_template;
if ($config['allow_cmod']) $where_approve = " AND " . PREFIX . "_comments.approve='1'"; else $where_approve = "";
$row['date'] = strtotime($row['date']);
$row['gast_name'] = stripslashes($row['gast_name']);
$row['gast_email'] = stripslashes($row['gast_email']);
$row['name'] = stripslashes($row['name']);
создать 2 файла шаблона
comments1.tpl - для нечетных комментариев
comments2.tpl - для четных
Автор : storm aka unstandart