Witam.
Skopiowałęm w bazie danych fusion_articles i fusion_articles_cats na usion_articles2 i fusion_articles_cats2
W php-files/articles.php skopiowałęm na porady.php oraz readarticles.php na readporady.php
W php-files/administration/articles.php i articles_cats.php skopiowałęm na porady.php i porady_cats.php
W php-files/locale/polish/articles.php skopiowałem na porady.php oraz w pliku news_cats dodałem odpowiednie wpisy np: zamiast dodaj artykuł to dodaj poradę itd.
W php-files/locale/polish/admin/news-articles.php skopiowałem na news_porady.php
W każdym bądź razie porady działają prawidłowo.
Dodatkowo chciałęm aby użytkownik mógł dodawać poradę tak samo jak artykuł.
Odpowiednio zmodyfikowałęm plik php-file/submit.php oraz php-file/administration/submissions.php
Napewno to zrobiłęm dobrze bo nie ma problemu w dodawaniu porady przez użytkownika.
Mój problem polega na tym że:
Chciałem dodać w pliku php-files/search.php wpis który by szukał w poradach czyli w skopiowanych tabelach w bazie danych fusion_articles2 oraz fusion_articles_cats2
Skopiowałęm
<input type='radio' name='stype' value='a'".($stype == "a" ? " checked" : "")."> ".$locale['402']."
zamieniając na
<input type='radio' name='stype' value='p'".($stype == "p" ? " checked" : "")."> ".$locale['402']."
oraz
if ($stype == "a") {
$result = dbquery(
"SELECT ta.*,tac.* FROM ".$db_prefix."articles ta
INNER JOIN ".$db_prefix."article_cats tac ON ta.article_cat=tac.article_cat_id
WHERE ".groupaccess('article_cat_access')." AND (article_subject LIKE '%$stext%' || article_article LIKE '%$stext%')"
);
$rows = dbrows($result);
if ($rows != 0) {
echo $rows." ".($rows == 1 ? $locale['410'] : $locale['411']).$locale['422'].":<br><br>\n";
$result = dbquery(
"SELECT ta.*,tac.*, tu.user_id,user_name FROM ".$db_prefix."articles ta
INNER JOIN ".$db_prefix."article_cats tac ON ta.article_cat=tac.article_cat_id
LEFT JOIN ".$db_prefix."users tu ON ta.article_name=tu.user_id
WHERE ".groupaccess('article_cat_access')." AND (article_subject LIKE '%$stext%' || article_article LIKE '%$stext%')
ORDER BY article_datestamp DESC LIMIT $rowstart,10"
);
while ($data = dbarray($result)) {
if (eregi($stext, $data['article_subject']) && eregi($stext, $data['article_article'])) {
$subj_c = substr_count(strtolower($data['article_subject']), strtolower($stext));
$text_c = substr_count(strtolower($data['article_article']), strtolower($stext));
echo "<a href='readarticle.php?article_id=".$data['article_id']."'>".$data['article_subject']."</a><br>\n";
echo "<span class='small2'>".$locale['040']."<a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>\n";
echo $locale['041'].showdate("longdate", $data['article_datestamp'])."</span><br>\n";
echo "<span class='small'>".$subj_c." ".($subj_c == 1 ? "Match" : "Matches").$locale['432'].$locale['433'].", ";
echo $text_c." ".($text_c == 1 ? "Match" : "Matches").$locale['432'].$locale['434']."</span><br><br>";
} elseif (eregi($stext, $data['article_article'])) {
$text_c = substr_count(strtolower($data['article_article']), strtolower($stext));
echo "<a href='readarticle.php?article_id=".$data['article_id']."'>".$data['article_subject']."</a><br>\n";
echo "<span class='small2'>".$locale['040']."<a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>\n";
echo $locale['041'].showdate("longdate", $data['article_datestamp'])."</span><br>\n";
echo "<span class='small'>".$text_c." ".($text_c == 1 ? "Match" : "Matches").$locale['432'].$locale['434']."</span><br><br>";
} elseif (eregi($stext, $data['article_subject'])) {
$subj_c = substr_count(strtolower($data['article_subject']), strtolower($stext));
echo "<a href='readarticle.php?article_id=".$data['article_id']."'>".$data['article_subject']."</a><br>\n";
echo "<span class='small2'>".$locale['040']."<a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>\n";
echo $locale['041'].showdate("longdate", $data['article_datestamp'])."</span><br>\n";
echo "<span class='small'>".$subj_c." ".($subj_c == 1 ? "Match" : "Matches").$locale['432'].$locale['433']."</span><br>";
}
zamieniając na
if ($stype == "p") {
$result = dbquery(
"SELECT ta.*,tac.* FROM ".$db_prefix."articles2 ta
INNER JOIN ".$db_prefix."article_cats2 tac ON ta.article_cat=tac.article_cat_id
WHERE ".groupaccess('article_cat_access')." AND (article_subject LIKE '%$stext%' || article_article LIKE '%$stext%')"
);
$rows = dbrows($result);
if ($rows != 0) {
echo $rows." ".($rows == 1 ? $locale['410'] : $locale['411']).$locale['422'].":<br><br>\n";
$result = dbquery(
"SELECT ta.*,tac.*, tu.user_id,user_name FROM ".$db_prefix."articles2 ta
INNER JOIN ".$db_prefix."article_cats2 tac ON ta.article_cat=tac.article_cat_id
LEFT JOIN ".$db_prefix."users tu ON ta.article_name=tu.user_id
WHERE ".groupaccess('article_cat_access')." AND (article_subject LIKE '%$stext%' || article_article LIKE '%$stext%')
ORDER BY article_datestamp DESC LIMIT $rowstart,10"
);
while ($data = dbarray($result)) {
if (eregi($stext, $data['article_subject']) && eregi($stext, $data['article_article'])) {
$subj_c = substr_count(strtolower($data['article_subject']), strtolower($stext));
$text_c = substr_count(strtolower($data['article_article']), strtolower($stext));
echo "<a href='readarticle.php?article_id=".$data['article_id']."'>".$data['article_subject']."</a><br>\n";
echo "<span class='small2'>".$locale['040']."<a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>\n";
echo $locale['041'].showdate("longdate", $data['article_datestamp'])."</span><br>\n";
echo "<span class='small'>".$subj_c." ".($subj_c == 1 ? "Match" : "Matches").$locale['432'].$locale['433'].", ";
echo $text_c." ".($text_c == 1 ? "Match" : "Matches").$locale['432'].$locale['434']."</span><br><br>";
} elseif (eregi($stext, $data['article_article'])) {
$text_c = substr_count(strtolower($data['article_article']), strtolower($stext));
echo "<a href='readarticle.php?article_id=".$data['article_id']."'>".$data['article_subject']."</a><br>\n";
echo "<span class='small2'>".$locale['040']."<a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>\n";
echo $locale['041'].showdate("longdate", $data['article_datestamp'])."</span><br>\n";
echo "<span class='small'>".$text_c." ".($text_c == 1 ? "Match" : "Matches").$locale['432'].$locale['434']."</span><br><br>";
} elseif (eregi($stext, $data['article_subject'])) {
$subj_c = substr_count(strtolower($data['article_subject']), strtolower($stext));
echo "<a href='readarticle.php?article_id=".$data['article_id']."'>".$data['article_subject']."</a><br>\n";
echo "<span class='small2'>".$locale['040']."<a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a>\n";
echo $locale['041'].showdate("longdate", $data['article_datestamp'])."</span><br>\n";
echo "<span class='small'>".$subj_c." ".($subj_c == 1 ? "Match" : "Matches").$locale['432'].$locale['433']."</span><br>";
}
Mój problem polega na tym że opcja szukaj nie działa nie znajduje żadnych wyników a w dodatku zmienia się rozmiar modułu search i stopka idzie do góry.
Sami zobaczcie szukająć w poradach http://www.ko-mp....
Co jest nie tak w pliku search.php z góry dziękuje za pomoc
Zapraszam na moją stronę http://ko-mp.eu
|