News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Pretty URLs

Started by SMFHacks.com Team, January 31, 2007, 10:56:43 AM

Previous topic - Next topic

Dannii

Can you give a link to one of the pages that breaks?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

viulian

128 pages and counting - Last time i followed was around page 115 :)

I would like to upgrade to version 0.8.5 - I don't know what version I have currently - I guess 8.0 by the text in PrettyUrls.php headers.

What steps do I have to follow for the upgrade ? Shall I also clear the cache tables ?

Dannii

Uninstall the existing package, download and install the new package. You don't need to touch the database.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

viulian

It works :)

However, I had some minor issues which I'll describe here:
a) by default, because the package works for apache rewrite rules only, it is assumed that turning on the actions urls, it will still work. But for me, which I'm on nginx (and I haven't configured the rewrite rules for actions too), this ment I was not able to access any admin page. So I had to come up with a way to remove the module without accessing the admin, but by directly feeding the URL into the forum (the subaction=uninstall2 which is the equivalent of pressing "Yes, I confirm" package deletion button). I then disabled the "enabled => 1" for actions, and tried to reinstall.
b) It seems that uninstall did not clean up (I am using the 0.8.5 version) all the files, so I had to clean up manually before install.

However, Danii, don't know if you remember, but I asked a while ago about the chr(18) issue inside the pretty_url column because I do want to use my own sitemap.xml generation module;
Basically I was using the 'pretty_url' column value to generate the google sitemap <loc> tag for each topic;
However, for the topics which had an ' in their name, the computed pretty_url value contains chr(18) which is not UTF-8 and if used 'as is' produces a strange character which is this one:  (and thus .xml does not validate).
However, by carefully tracking what the code does, I noticed that there are some str_replace methods involving the chr(18) and "'" , so now, after reading the pretty_url value from the db, I also do a replacement for chr(18) value back to "'".

Don't know why you did not want to escape the character directly or use some standard escaping mechanisms :)
Maybe chr(18) value was not intended to reach the database, but in my case it did - so I had to revert it back to "'" before using the value in the pretty_url column.


Dannii

Quotea) by default, because the package works for apache rewrite rules only, it is assumed that turning on the actions urls, it will still work. But for me, which I'm on nginx (and I haven't configured the rewrite rules for actions too), this ment I was not able to access any admin page. So I had to come up with a way to remove the module without accessing the admin, but by directly feeding the URL into the forum (the subaction=uninstall2 which is the equivalent of pressing "Yes, I confirm" package deletion button). I then disabled the "enabled => 1" for actions, and tried to reinstall.
Hmm that is unfortunate. Perhaps I should have suggested disabling the mod before uninstall it. You can always use the file on the trouble shooting page too ;)

QuoteDon't know why you did not want to escape the character directly or use some standard escaping mechanisms :)
Oh I tried! It was a nightmare! Perhaps next year after I've finished 1.0 and have some time to work on the mod during holidays I'll try again. But with the number of times things were getting escape and unescaped I found it easier to do it myself at times I know will work.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

viulian

:) Great Job anyway!

If it's working, it's OK.
And love PHP anyway, I wonder what it would have been to code this in what... LISP :D and then track down the chr(18) replacement! (I'm afraid of LISP / Haskell / etc).

mark7144


Dannii

It's only when you reply isn't it? Can you suply a temp account for me to test it?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

mark7144

Sure,

User: test
Password: test

If you could delete your test posts after it would be great :)

Dannii

I can't find anything wrong, and can't test with Opera Mobile. Are there any errors in the SMF or Apache error logs?
Does the problem happen in the default theme?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

mark7144

Quote from: Dannii on October 20, 2008, 03:16:03 AM
I can't find anything wrong, and can't test with Opera Mobile. Are there any errors in the SMF or Apache error logs?
Does the problem happen in the default theme?
The problem does happen with the default theme and here is the error:

http://www.murraysworld.com/talk/index.php?pretty;board=chit-chat.0&amp;action=post2;start=690

2: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument
File: /var/www/vhosts/murraysworld.com/httpdocs/talk/Sources/Post.php
Line: 1296

Dannii

Can you post lines 1290-1300?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

mark7144

Quote from: Dannii on October 20, 2008, 07:12:36 AM
Can you post lines 1290-1300?
Here is lines 1290 - 1304...

// Now make sure this email address is not banned from posting.
isBannedEmail($_POST['email'], 'cannot_post', sprintf($txt['you_are_post_banned'], $txt[28]));
}
}
// Check the subject and message.
if (!isset($_POST['subject']) || $func['htmltrim']($_POST['subject']) === '')
$post_errors[] = 'no_subject';
if (!in_array(20, $board))
{
if (!isset($_POST['message']) || $func['htmltrim']($_POST['message']) === '')
$post_errors[] = 'no_message';
}
elseif (!empty($modSettings['max_messageLength']) && $func['strlen']($_POST['message']) > $modSettings['max_messageLength'])
$post_errors[] = 'long_message';
else
{

Daymon

I have this mod set up on my forum, and it works with the main forum menu, but in the boards and topics it keeps showing an old sub domain that's no longer in use. Must be left over from when I tried this mod out on the sub domain. I can't figure out where to change this so it shows the actual path to the forum instead of the old sub domain.

Dannii

mark7144, are you using 0.9?

Daymon, check that the value of pretty_root_url in the smf_settings table is correct.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Daymon

Quote from: Dannii on October 20, 2008, 11:14:27 AM

Daymon, check that the value of pretty_root_url in the smf_settings table is correct.

How do I do this?

glennk

Hi Eldacar,

Could you advise on thiserrors please ?

http://www.whitbyseaanglers.co.uk/forum/index.php?pretty;action=admin&amp;area=pretty

Unable to load the 'PrettyUrls.english-utf8' language file

Dannii

QuoteHow do I do this?
Use phpMyAdmin, or follow these instructions: http://code.google.com/p/prettyurls/wiki/TroubleShooting

QuoteUnable to load the 'PrettyUrls.english-utf8' language file
Try copying the PrettyUrls.english.php file to PrettyUrls.english-utf8.php
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Frozt

I have a problem with the accents in boards categories in spanish
in the rest of the forum work really good

but in categories like "Discusión General"

instead:

..com/discusion-general/

appear:

discusiandoacuten-general/

this happen in some boards categories



I try change the accents of that cagetories to display without accent

and I empty the tables:

smf_pretty_topic_urls
smf_pretty_urls_cache

but when I again active Pretty URLs happen the same, appear:

discusiandoacuten-general/


I have to empty other database table?

a3des

Hello!
I am using SMF 2.0 beta 4 with Pretty URLs 0.8.5.
After installing without problem or error, I have now this message when I try to acces Admin/Themes section:

An Error Has Occurred!
Unable to load the 'Themes' template.

Any ideea where to look for a solution to this error?

Advertisement: