You are viewing the PKP Support Forum | PKP Home Wiki

I found two bugs in search.php

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

I found two bugs in search.php

Postby panthergirl » Thu Apr 21, 2005 3:36 pm

The first bug was that the search query string that gets passed to search.php when it is re-invoked was being displayed on the page. Not fatal, but sloppy looking -- there's no reason the user needs to see that. This code corrects the problem:

Code: Select all
   // show next and prev page links, if applicable
   if($page>1) {
      $prev_page = $page-1;
      $prev_url = "search.php?$string&page=$prev_page";
      if($sort) {
         $prev_url .= "&sort=$sort";
      $prev_link = "<a href=\"".print_url($prev_url)."\">&lt;&lt; Previous Results</a>";
   if($num_records>($page*$max_records)) {
      $next_page = $page+1;
      $next_url = "search.php?$string&page=$next_page";
      if($sort) {
         $next_url .= "&sort=$sort";
      $next_link .= "<a href=\"".print_url($next_url)."\">Next Results &gt;&gt;</a>";
   if($next_link || $prev_link) {
      echo "<p>";
      echo $prev_link;
      if($prev_link && $next_link) {
         echo " | ";
      echo $next_link;
      echo "</p>";

(Where I have $next_url and $prev_url, the original code had $next_link and $prev_link, respectively. But there needs to be a different string variable for the URLs or we get the display problem).

The second bug is that db->data_seek is called by search.php, but data_seek is not defined in any of the files in ocs/include/db (i.e., the files that are named db.*.inc.php). So, for example, db.mysql.inc.php needs to have the following code added to it:
Code: Select all
   // move internal result pointer to the specified row number
   function data_seek($result, $row_number) {
      return mysql_data_seek($result, $row_number);

Sorry if I've used odd words to explain these bugs -- I'm not as familiar with PHP as I should be.

Now if someone can help me with my room_id problem, that would be great! (see my previous post).

Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest