News:

Wondering if this will always be free?  See why free is better.

Main Menu

Pretty URLs

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

Previous topic - Next topic

Naveeddil

Thanks Dannii
It were all from "smf_settings" table  where the URL of pretty_url were to old address
As i edit it to new one and run the Maintenance everything got Solved :)

asmith

Thanks dannii it worked :)

Just one thing. I had this files to download that the user had uploaded them before
for example:
€uro.ext

when I try to download it by the site, It can't find the file.  But when I enter this url:
site.com/€uro.ext

Browser finds the file on the site.

I removed that character from the database (Where the file name is stored) and made the file name:

uro.ext

Then the download worked.
What's the problem with these characters and how can I make them work for download?

Dannii

asmith, well the euro character can't actually be used in URLs... I don't really understand your problem though. This mod won't change any URLs to download files, unless they are accessed by SMF URLs.
"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."

asmith

The mentence solved my problem. That was only a problem I just wanted to ask.

When users upload files, I used their username as the file name. Since this user had euro character in his name, so the file that was saved had euro characters in it.

The download function on the site is not accepting the euro character,  But I can access the file by typing  site.com/€uro.ext in the address bar.

thought maybe you had such experience in this thing.

gregh

Quote from: Dannii on September 08, 2009, 11:50:10 AM
gregh, that seems rather strange... new topics shouldn't be given the same ID as deleted topics. Perhaps your database doesn't have the auto-increment working? In any case, if you delete those URLs from the smf_pretty_topic_urls table, and then run maintenance, new pretty URLs will be generated for them.

Hi Dannii,

Thanks for the prompt reply, the manual deletion and running maintenance has worked.

I think auto increment is working, everything in the dbase was sequential, however the last two topics had no ID and no entry in the smf_pretty_topic_urls table.

Is there a way to have Pretty URLS delete a link when that link is deleted from the forum?

Regards,

Greg

malcolm_x

I managed to make it work under lighttpd by just adding those lines to lighty's config:


url.rewrite = (
  "^/forum/([-_!~*'()$a-zA-Z0-9]+)(/(\?(.*)))?/?$" => "/forum/index.php?pretty;board=$1.0&$4",
  "^/forum/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)(/(\?(.*)))?/?$" => "/forum/index.php?pretty;board=$1.$2&$5",
  "^/forum/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)(/(\?(.*)))?/?$" => "/forum/index.php?pretty;board=$1;topic=$2.0&$5",
  "^/forum/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)(/(\?(.*)))?/?$" => "/forum/index.php?pretty;board=$1;topic=$2.$3&$6",
  "^/forum/?$" => "/forum/index.php",
)


But I also disabled actions and profiles in pretty urls admin panel.

You can see it workin' here: www.akwarium.net.pl/forum/ [nofollow]

Quote from: sipiatti on July 14, 2009, 02:36:58 AM
Hi,

I need a help of a lighttpd rewriting master :)
I've installed pretty url on a lighttpd driven smf.

here are the rules I've created:
url.rewrite = (
"^/(.*)\.(.+)$" => "$0",
"^/forums/([-_!~*'()$a-zA-Z0-9]+)(\?(.*))?/?$" => "/forums/index.php?pretty;board=$1.0$2",
"^/forums/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)(\?(.*))?/?$" => "/forums/index.php?pretty;board=$1.$2$3",
"^/forums/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)(\?(.*))?/?$" => "/forums/index.php?pretty;board=$1;topic=$2.0$3",
"^/forums/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)(\?(.*))?/?$" => "/forums/index.php?pretty;board=$1;topic=$2.$3$4",

"^/forums/?$" => "/forums/index.php",
"^/links/(.*)/?$" => "/links/index.php/$1",
"^/mint/(.*)/?$" => "/mint/index.php/$1",
"^/(.*)/?$" => "/index.php/$1"
)

the very last backreferences are for appending the original querystring (if my logic works well)

However, there are some links what do not work. Most of the board and topic urls work, but e.g. if there is an apostroph in it, it fails. Also the "New Topic" "Reply" "Mark as read" links do not work.
Is there anybody out there who managed to work pretty with lighttpd?

Thanks in advance
sipiatti

Özgür

I have this log in my errorlog.
/forum/index.php?

2: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: invalid UTF-8 string at offset 1851
File: /home/xxx/public_html/forum/Sources/Subs.php
Line: 2596


Why this is happening? And what is the "Compilation failed: invalid UTF-8 string at offset 1851" :|
So Long

Dannii

Weird... can you post lines 2590-2600 here please?

Was it just a once-off error, or does it keep happening?
"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."

Özgür

#4288
2579 ~ 2597
// This smiley regex makes sure it doesn't parse smileys within code tags (so [url=mailto:[email protected]] doesn't parse the :D smiley)
$smileyPregReplacements = array();
$searchParts = array();
for ($i = 0, $n = count($smileysfrom); $i < $n; $i++)
{
$smileyCode = '<img src="' . $modSettings['smileys_url'] . '/' . $user_info['smiley_set'] . '/' . $smileysto[$i] . '" alt="' . strtr(htmlspecialchars($smileysfrom[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')). '" title="' . strtr(htmlspecialchars($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" border="0" class="smiley" />';

$smileyPregReplacements[$smileysfrom[$i]] = $smileyCode;
$smileyPregReplacements[htmlspecialchars($smileysfrom[$i], ENT_QUOTES)] = $smileyCode;
$searchParts[] = preg_quote($smileysfrom[$i], '~');
$searchParts[] = preg_quote(htmlspecialchars($smileysfrom[$i], ENT_QUOTES), '~');
}

$smileyPregSearch = '~(?<=[>:\?\.\s' . $non_breaking_space . '[\]()*\\\;]|^)(' . implode('|', $searchParts) . ')(?=[^[:alpha:]0-9]|$)~e' . ($context['utf8'] ? 'u' : '');
}

// Replace away!
$message = preg_replace($smileyPregSearch, 'isset($smileyPregReplacements[\'$1\']) ? $smileyPregReplacements[\'$1\'] : \'\'', $message);
}


2596 is
$message = preg_replace($smileyPregSearch, 'isset($smileyPregReplacements[\'$1\']) ? $smileyPregReplacements[\'$1\'] : \'\'', $message);

I don't know whats happening after or before this error. Because i didn't see it anytime but before.
So Long

Dannii

Hmm... I don't think your error has anything to do with this mod. That code will be finished long before Pretty URLs starts working.
"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."

coendeurloo

Hi Danni, first of all, wonderfull plugin! It makes my board so much better.

I just have one small problem. Pretty URLS can't seem to work with a topic named: "Foto's en Filmpjes". I presume it has something to do with the ' in it. However, renaming the board title to "Fotos en Filmpjes", clearing the pretty urls cache in phpmyadmin etc. and then re-enabling it doesn't seem to work, it still wants to name it "Foto's en Filmpjes". When I click the link, firefox keeps on loading and then gives an error.

Is there a solution to this problem? Because of this small thing I can't enable it...which is a waste ;)

malcolm_x

coendeurloo, you can find a simple solution I find out to this problem on the bottom of this issue site.
I hope it will work for you too.

http://code.google.com/p/prettyurls/issues/detail?id=102 [nofollow]

viethungs

it can't install in SMF 2.0 RC1.2.

How to make it work in this ?

distante

Quote from: viethungs on September 11, 2009, 08:29:45 PM
it can't install in SMF 2.0 RC1.2.

How to make it work in this ?
Quote from: distante on July 24, 2009, 08:34:39 PM
A tip, If you want to Install PU in a SMF 2RC1.2 you need to put the forum in SMF 2RC1 in "advance" inside the packages tap

Take a look (is a spanish forum)
www.lanuevacuadra.com

:P

viethungs

Quote from: distante on September 11, 2009, 09:01:18 PM
Quote from: viethungs on September 11, 2009, 08:29:45 PM
it can't install in SMF 2.0 RC1.2.

How to make it work in this ?
Quote from: distante on July 24, 2009, 08:34:39 PM
A tip, If you want to Install PU in a SMF 2RC1.2 you need to put the forum in SMF 2RC1 in "advance" inside the packages tap

Take a look (is a spanish forum)
www.lanuevacuadra.com [nofollow]

:P

Wow, I'm forgot to search, but when put SMF 2RC1 in to advance, the PU still can't installed.

And I try with put SMF 1.1, I can [ Apply Mod ]  but have many error to install.

What can i do now ?
Pls!

Dannii

What does it say for SMF 2 RC1? Did you have the space? Basically just remove the ".2"
"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."

viethungs

Quote from: Dannii on September 12, 2009, 03:40:08 AM
What does it say for SMF 2 RC1? Did you have the space? Basically just remove the ".2"

I using SMF 2RC 1.2

I've try remove .2, It can Apply Mod and have no error, but still can't install.

it say

QuoteYou cannot download or install new packages because the Packages directory or one of the files in it are not writable!

I had chmod Sources, Themes folder to 777 and I have many space.

Some thing wrong ?

thank for help  :P

Dannii

That's not a problem with this mod and I don't have the time to help you with general SMF problems sorry. Please ask for help on the SMF support boards.
"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."

coendeurloo

Quote from: malcolm_x on September 11, 2009, 04:21:42 AM
coendeurloo, you can find a simple solution I find out to this problem on the bottom of this issue site.
I hope it will work for you too.

http://code.google.com/p/prettyurls/issues/detail?id=102

Unfortunatly that does not work. I've disabled pretty urls, updated the Subs-PrettyUrls.php, emptied the pretty urls cache tables, ran maintenance tasks and enabled it again, still doesn't work...

Your modifications only seems to work for " though, not the ' in "Foto's" for instance?

Dannii

After you've done that, also delete the row from smf_pretty_topic_url for that problematic topic.

I might just remove quotes. They have caused SO many troubles over the years!

Anyone strongly want them to remain?
"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."

Advertisement: