Hi! I have the
same error but my error is in search.php and my version is
1.7.3 my website is:
http://www.myart.es/search.htmI don't know php very well so I don't know how to solve this error:
Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 278
Warning: strpos() [function.strpos]: Empty delimiter. in /home/yosoyfri/public_html/myart/search.php on line 279
i searched the function strpos and this function find position of first occurrence of a string : int strpos ( string $haystack, mixed $needle [, int $offset] )
The lines 278 and 279 are :
if ((strpos( $founding_title, $search_str ) != 0) ||
(strpos( $founding_text, $search_str ) != 0)){
$count_news++;
}
$site_db->free_result($news_row);
this code is from another publishing mod but nobody reply me for months.. please could anyone help me??
here is all the code from search.php from the mod:
//-----------------------------------------------------
//--- Search in news /MTsv DN/ ------------------
//-----------------------------------------------------
$founding_title = '';
$founding_text = '';
$founded_title = '';
$founded_text = '';
$search_str = $search_keywords;
$count_newses = 0;
$num_rows_news = 0;
$sql = "SELECT COUNT(*) AS num_rows_news
FROM ".NEWS_TABLE." n";
$row = $site_db->query_firstrow($sql);
$num_newses = $row['num_rows_news'];
for ($i = 1; $i < $num_newses + 1; $i++) {
$sql = "SELECT n.news_title, n.news_text
FROM ".NEWS_TABLE." n
WHERE n.news_id = $i";
$result = $site_db->query($sql);
$news_row = array();
while ($row = $site_db->fetch_array($result)) {
$news_row[] = $row;
}
$site_db->free_result($result);
$num_news = sizeof($news_row);
$row = $site_db->query_firstrow($sql);
$founding_title = '_';
$founding_title .= $news_row[0]['news_title'];
$founding_text = '_';
$founding_text .= $news_row[0]['news_text'];
$founded_title = $news_row[0]['news_title'];
$founded_text = $news_row[0]['news_text'];
if ((strpos( $founding_title, $search_str ) != 0) ||
(strpos( $founding_text, $search_str ) != 0)){
$count_news++;
}
$site_db->free_result($news_row);
}
//-----------------------------------------------------
//--- Search in news /MTsv DN/ ------------------
//-----------------------------------------------------
if (!$num_rows_all && $show_result == 1) {
if (!$count_news && $show_result == 1) {
$msg = preg_replace("/".$site_template->start."search_keywords".$site_template->end."/", $search_keywords, $lang['search_no_results']);
}
}
Is anything wrong? please.. i need help..