Author Topic: I have 2 errors with in search.pjp with another publishing mod  (Read 1999 times)

0 Members and 1 Guest are viewing this topic.

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
I have 2 errors with in search.pjp with another publishing mod
« on: February 12, 2007, 10:29:49 AM »
I don't know php very well so I don't know how to solve this error:
Code: [Select]
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

The lines 278 and 279 are :
Code: [Select]
     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:
Code: [Select]
//-----------------------------------------------------
//--- 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? my version is 1.7.3

:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more