Page 1 of 1

Problem with rewrite

Posted: Thu 8. Apr 2004, 21:03
by Adamski
my site is pretty much how I wanted it, with one minor problem.

The links in the navigation menu are working fine, but if you click on the box the link is in rather than the link itself, the first three letters of the link are missing. Is is possible to stop the box itself working as a link?

http://www.allaboutpanic.com

Adam

Posted: Thu 8. Apr 2004, 21:30
by Jan212
as i wrote in an article before this depends on the update of the function get_struct_data, nav_table_struct and build_levels in the front.func.inc - the bug wasn#t there at the version from 20.02.

the solution is to update the rewrite function js_url_search in the same way like the url_search

Posted: Fri 9. Apr 2004, 18:50
by Jan212

Code: Select all

function js_url_search($query) { 
   if ( subStr($query,0,4) == "?id=") { 
      $noid = substr($query, 4); 
      $file = str_replace(",", ".", $noid).".html"; 
   } else { 
      $noid = substr($query,1); 
      $file = str_replace(",", ".", $noid).".html"; 
   } 
   $link = "onClick=\"location.href='".$file."'"; 
   return($link); 
} 
:wink:

Posted: Fri 9. Apr 2004, 19:38
by Adamski
Worked like a charm, thanks jan :)

Posted: Fri 9. Apr 2004, 19:41
by Jan212
no problemo

Posted: Sat 10. Apr 2004, 14:49
by iflash
I try it, but doesn't work with the Navigation {NAV_LIST_TOP:Home: }

I change the Rewrite function in inc_front/front.func.inc

Code: Select all

//Rewrite functions
function url_search($query)    
{ 
   $noid = substr($query, 4); 
   $file = str_replace(",", ".", $noid).".html"; //further use 
   //$file = $noid.".html"; 
   $link = "<a href=\"".$file."\""; 
   return($link); 
   //unset($link); 
} 
function js_url_search($query) { 
   if ( subStr($query,0,4) == "?id=") { 
      $noid = substr($query, 4); 
      $file = str_replace(",", ".", $noid).".html"; 
   } else { 
      $noid = substr($query,1); 
      $file = str_replace(",", ".", $noid).".html"; 
   } 
   $link = "onClick=\"location.href='".$file."'"; 
   return($link); 
} 

And in inc_conf/conf.inc

Code: Select all

$phpwcms["rewrite_url"]       = 1;  //whether URL should be rewritable
Can you help me about this......

Thank's a lot

Posted: Sat 10. Apr 2004, 17:31
by Jan212
at the momemt it's only working with the nav_column. you have to hold the alias in an array from the nav_list_top (the function is in include/inc_front/front.func.inc), you can do this with a small mod in the function, like pixelpeter did it with the nav_column...