M
maxiplay
Прохожие
- Автор темы
- #1
В стандартной поставке CMS SmallNuke 2.02(03)
поиск в публикациях не реализован
вот моя доработка может кому пригодиться
pages.php (../modules/search/)
<?php
######################################################################
# SmallNuke v2 Sites Build System
# ============================================
# Copyright (c) 2005 by Sergey Vipolzov (info@smallnuke.com)
# Для просмотра ссылки Войдиили Зарегистрируйся
#
============================================
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License.
######################################################################
if (!defined('SN_SiteSystem')) {
Header("Location: ../../../index.php");
exit;
}
$num = $db->sql_fetchrow($db->sql_query("SELECT COUNT(*) FROM ".$conf['prefix']."_mod_pages WHERE (title LIKE '%$query%' OR home_text LIKE '%$query%' OR body_text LIKE '%$query%') ".select_lang('AND').""));
if($num[0] > 0) {
if($modname != "") {
$sql = "SELECT * FROM ".$conf['prefix']."_mod_pages WHERE (title LIKE '%$query%' OR home_text LIKE '%$query%' OR body_text LIKE '%$query%') ".select_lang('AND')." ORDER BY id DESC LIMIT $page,$per_page";
} else {
$sql = "SELECT * FROM ".$conf['prefix']."_mod_pages WHERE (title LIKE '%$query%' OR home_text LIKE '%$query%' OR body_text LIKE '%$query%') ".select_lang('AND')." ORDER BY id DESC LIMIT $first_page_res";
}
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$title[] = $row['title'];
$text[] = "$row[home_text] $row[body_text]";
$url[] = 'in=view&id='.$row['id'].''; // Значение после index.php?go=ИмяМодуля&
}
}
$num_page = $num[0];
?>
поиск в публикациях не реализован
вот моя доработка может кому пригодиться
pages.php (../modules/search/)
<?php
######################################################################
# SmallNuke v2 Sites Build System
# ============================================
# Copyright (c) 2005 by Sergey Vipolzov (info@smallnuke.com)
# Для просмотра ссылки Войди
#
============================================
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License.
######################################################################
if (!defined('SN_SiteSystem')) {
Header("Location: ../../../index.php");
exit;
}
$num = $db->sql_fetchrow($db->sql_query("SELECT COUNT(*) FROM ".$conf['prefix']."_mod_pages WHERE (title LIKE '%$query%' OR home_text LIKE '%$query%' OR body_text LIKE '%$query%') ".select_lang('AND').""));
if($num[0] > 0) {
if($modname != "") {
$sql = "SELECT * FROM ".$conf['prefix']."_mod_pages WHERE (title LIKE '%$query%' OR home_text LIKE '%$query%' OR body_text LIKE '%$query%') ".select_lang('AND')." ORDER BY id DESC LIMIT $page,$per_page";
} else {
$sql = "SELECT * FROM ".$conf['prefix']."_mod_pages WHERE (title LIKE '%$query%' OR home_text LIKE '%$query%' OR body_text LIKE '%$query%') ".select_lang('AND')." ORDER BY id DESC LIMIT $first_page_res";
}
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$title[] = $row['title'];
$text[] = "$row[home_text] $row[body_text]";
$url[] = 'in=view&id='.$row['id'].''; // Значение после index.php?go=ИмяМодуля&
}
}
$num_page = $num[0];
?>