Page 2 of 3

Posted: Tue 17. Feb 2004, 23:32
by Moozie
Yes the url is OK in the menu. But if you enter in the content (ARTICLE) a link like:

Code: Select all

[id kontakt]click for page kontakt[/id]
Then the fronmtend does not show a lionk to kontakt.html, does it?

Posted: Wed 18. Feb 2004, 11:41
by Jan212
didn't test it - one moment...

Posted: Sat 21. Feb 2004, 16:21
by Repute
I hope comes an change soon coase it's just an great feature the search engines love it ;)... But the html editors in phpwcms don't :S

Greets,

Repute

Alias

Posted: Mon 23. Feb 2004, 13:40
by Inets
I have problem with links like [ID link] goto [/ID]

When I change rewrite url_search func in front.func.inc with:

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

Its really works.

.htaccess file likes this

php_flag magic_quotes_gpc Off
php_flag register_globals Off

RewriteEngine on
RewriteRule ^(.*).html$ ./index.php?id=$1
RewriteRule ^index.html$ ./index.php

Posted: Mon 23. Feb 2004, 22:40
by Moozie
I tried your suggestion, but the same problems are there.

For your information:
1. I make a page in admin and give it the alias "page_7"
2. In article I say: [ID page_7] goto page 7[/ID]

What happens is that tje link goes to "page_7.html", but when I click it it goed toe the homepage, so this is the index page. Only the links in the nav-table works correct, but there the links are typed as "0.33.0.0.1.html" instead of "page_7.html".

Can you confirm that when you write: problem with links like [ID link] goto [/ID],you mean that "link" means ALIAS?

Posted: Mon 22. Mar 2004, 15:28
by gent
Moozie wrote: 2. In article I say: [ID page_7] goto page 7[/ID]

i use [INT page_7.html]goto page 7[/INT]

or is there a other solution?
or is the bug fixed?

Posted: Mon 22. Mar 2004, 15:44
by Jan212
[ID alias]Link[/ID]

Posted: Mon 22. Mar 2004, 17:21
by gent
Jan212 wrote:[ID alias]Link[/ID]
this link will be */as.html , cause the first 3 chars will be lost.

Posted: Mon 22. Mar 2004, 17:27
by ionrock
I had the same issue and have not had time to mess with it. But if someone else is having trouble I also would like to know a solution. :)

Posted: Mon 22. Mar 2004, 22:01
by Jan212
it works if you install pixelpeters mods... i've tested it 2 minutes ago.

front.func.inc.php

Code: Select all

//Rewrite functions / modded 02.03.04
function url_search($query)    
{ 
   if ( subStr($query,0,4) == "?id=") 
   { 
      // this is for id=0,0,0,0,0 
      $noid = substr($query, 4); 
      $file = str_replace(",", ".", $noid).".html"; //further use 
   } 
   else 
   { 
      // this is for mypage.html 
      $noid = substr($query,1); 
      $file = str_replace(",", ".", $noid).".html"; //further use 
   } 
   $link = "<a href=\"".$file."\""; 
   return($link); 
} 

here goes the .htaccess code

Code: Select all

php_flag magic_quotes_gpc Off
php_flag register_globals Off
DirectoryIndex index.php
RewriteEngine on 
RewriteBase /phpwcms/
# This will rewrite 0.0.0.0.0.html => index.php?id=0.0.0.0.0 
RewriteRule ^([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)\.html$ /phpwcms/index.php?id=$1.$2.$3.$4.$5.$6
# This will rewrite mypage.html => index.php?mypage 
RewriteRule ^([a-zA-Z0-9_]*)\.html$ /phpwcms/index.php?$1

Posted: Mon 22. Mar 2004, 22:22
by gent
sorry but again, i tested it again and again by copy/pasting ur code and pixelpeters code .. and sorry it dont work.

the error i get is posted here: http://www.phpwcms.de/forum/viewtopic.php?p=7189#7189

Posted: Mon 22. Mar 2004, 22:59
by Jan212
Ok- everything works now... or am i wrong?

Posted: Mon 22. Mar 2004, 23:04
by gent
all is working well ... thx

ganz lieben dank nochmal :)

Posted: Mon 22. Mar 2004, 23:33
by Jan212
kein problem :wink: zum zwoten...

check out the newest movie i had in my brain

http://www.magentaliebe.de

Posted: Fri 23. Apr 2004, 11:34
by Florian
Hello guys!

After upgrading to RC-3 I've got several problems with the mod_rewrite function.

At first by default the mod_rewrite is set to *.shtml endings. Thats for some of us quite a problem, because the Apaches are set by default to .htm, .html and so one, but NOT to .shtml. So you have to access the front.func.inc.php and comment / uncomment the affected lines within the REWRITE function of Jan212.
On the other hand I have the problem, that the rewrite does not the whole job. The function doesn't rewrite "?flag" given links to "flag.html". For example: http://www.inokoo.de/0.1.0.0.1.0.html?kontakt is the result.

So here's my .htaccess config

Code: Select all

php_flag magic_quotes_gpc Off
php_flag register_globals Off




# Rewrite functionality for phpwcms
# optimized by Jan212
# 18-04-2004

#DirectoryIndex index.html index.php 
RewriteEngine On


# IF PHPWCMS IS INSTALLED IN YOUR WEB ROOT

# This will rewrite 0.0.0.0.0.0.shtml => index.php?id=0.0.0.0.0.0
RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.html$ index.php?id=$1.$2.$3.$4.$5.$6

# This will rewrite mypage.html => index.php?mypage
RewriteRule ^(.+)\.html$ index.php?$1


# If phpwcms is installed in a subdirectory,
# sample: "phpwcms" then use this (remove #)
# ===============================================
#RewriteBase /inoko

# This will rewrite 0.0.0.0.0.0.shtml => index.php?id=0.0.0.0.0.0
#RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.shtml$ /inoko/index.php?id=$1.$2.$3.$4.$5.$6

# This will rewrite index-mypage.shtml => index.php?mypage 
#RewriteRule ^(.+)\.shtml$ /inoko/index.php?$1 



#THIS IS FOR REWRITE LOGGING 
#RewriteLog "/absolute/path/to/the/rewrite.log" 
# 0 = Logging disabled, 9 = highest level of logging, only for debugging 
#RewriteLogLevel 3


And this is the function in front.func.inc.php

Code: Select all

// REWRITE - PATCHED FOR 04/04 // jan212
function url_search($query) { 
	if ( substr($query,0,4) == '?id=') { 
		$noid = substr($query, 4); 
		$file = str_replace(',', '.', $noid).'.html'; 
		//$file = str_replace(',', '.', $noid).'.shtml'; 
	} else { 
		$noid = substr($query,1); 
		$file = str_replace(',', '.', $noid).'.html'; 
		//$file = str_replace(',', '.', $noid).'.shtml';
		/*
		//get category name
		$s = $GLOBALS['content']['struct'][ $GLOBALS['content']['cat_id'] ]['acat_name'];
		if($s) {
			$s = str_replace(' ', '-', $s);
			$s = str_replace('_', '-', $s);
			$s = remove_accents($s);
			$file = $s.'_'.$file;
		}
		*/
	} 
	$link = '<a href="'.$file.'"'; 
	return($link); 
} 

function js_url_search($query) { 
	if ( substr($query,0,4) == '?id=') { 
		$noid = substr($query, 4);
		$file = str_replace(',', '.', $noid).'.html'; 
		//$file = str_replace(',', '.', $noid).'.shtml'; 
	} else { 
		$noid = substr($query,1); 
		$file = str_replace(',', '.', $noid).'.html';
		//$file = str_replace(',', '.', $noid).'.shtml';
		/*
		//get category name
		$s = $GLOBALS['content']['struct'][ $GLOBALS['content']['cat_id'] ]['acat_name'];
		if($s) {
			$s = str_replace(' ', '-', $s);
			$s = str_replace('_', '-', $s);
			$s = remove_accents($s);
			$file = $s.'_'.$file;
		}
		*/
	} 
	$link = "onClick=\"location.href='".$file."'"; 
	return($link); 
} 

// -------------------------------------------------------------
Any suggestions to me, please :D .

Cheers,
Florian