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

Black_Paolo

Thank you Dannii, I think I found out how it works ;)
Just a question: is there a way to set that the child boards should have the prefix of the mother board?
I'm an Italian boy, so I don't speak English very well.
If there are any errors in my post, please let me know, so I (hopefully) won't do it again :D

glennk

Quote from: Dannii on August 26, 2009, 07:47:07 AM
Sorry... how is it incompatible? Did you try emulating?

Sorry I meant will you be making a version that installs on 2rc1 without need to emulate as I struggle with technical things ?

Dannii

Quote from: Black_Paolo on August 26, 2009, 02:04:41 PM
Thank you Dannii, I think I found out how it works ;)
Just a question: is there a way to set that the child boards should have the prefix of the mother board?
No sorry.

Quote from: glennk on August 26, 2009, 04:12:00 PM
Sorry I meant will you be making a version that installs on 2rc1 without need to emulate as I struggle with technical things ?
Probably not sorry, I'm very busy. Clicking the little box at the bottom of the package manager is hardly technical!
"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."

unformatted_

Hi!

thanks for this very nice mod. It works with tinyportal for dowloads, articles, links...?

Dannii

It will work but the URLs won't be especially pretty. The extras package has a filter for TP articles though.
"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."


Dannii

Yes! I have always wanted to also do subactions. Do you want to edit the actions filter to do that?
"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."

Arkangel

Quote from: Dannii on August 28, 2009, 09:03:03 PM
Yes! I have always wanted to also do subactions. Do you want to edit the actions filter to do that?

   
if you please

Smitten

Hello. GREAT MOD! congratulations.

I have a question. How can i change domain.com/forum to domain.com/foro?

Thanks. Best regards.

Dannii

Move the forum like you normally would, following these instructions:

How do I move my SMF board to a different host?

Then also follow the trouble shooting page.
"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."

shua

Quote from: Dannii on August 02, 2009, 05:57:25 AM
Quote from: shua on July 30, 2009, 03:11:24 PM
Yep, you're right.  I checked with godaddy and the stats directory is reserved.  I'd like to keep the pretty action URLS.  Any suggestions?  Thanks!
Try making this change to Subs-PrettyUrls.php:
Code (find) Select
$context['pretty']['action_array'] = $actionArray[1];
Code (add before) Select
unset($actionArray[1][array_search('stats', $actionArray[1])]);

Sweet, this totally worked. At first it didn't occur to me to run the maintenance, but then I figured out that this needs to be done to flush the old entries.

I do, however, have a new question. I just installed the Tinypic mod http://custom.simplemachines.org/mods/index.php?mod=1862 which allows a user to upload an image (or video) file to http://www.tinypic.com [nofollow] right from the posting form and then returns the BBCode and updates the posting dynamically.

It does this by calling an html file "callback.html" located in $boarddir, which contains the following:

<script type="text/javascript">
   window.onload = function() {
       parent.parent.replaceText(getParameter(document.location.href, "code"), parent.parent.document.forms.postmodify.message);
   }

   function getParameter(queryString, parameterName) {
        var parameterName = parameterName + "=";
        if(queryString.length > 0) {
            begin = queryString.indexOf(parameterName);
            if(begin != -1) {
                begin += parameterName.length;
                end = queryString.indexOf("&", begin);
                if(end == -1) {
                    end = queryString.length;
                }
                return unescape(queryString.substring(begin, end));
            }
            return "";
        }
   }
</script>


The problem appears to be this line:
parent.parent.replaceText(getParameter(document.location.href, "code"), parent.parent.document.forms.postmodify.message);

As this results in a pretty version of the url that does not seem to properly identify the new post for updating. Is there a way to set a flag so Pretty URL can be turned on or off for certain sections of code?

Hope that makes sense, thanks!

Dannii

I think it's more likely to be this line in Post.template.php:
                    tinypic_callback_url = document.location.href.substr(0,document.location.href.lastIndexOf("/"))+"/callback.html";
Try replacing it with a hardcoded URL.
"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."


Dannii

I don't have the time sorry.
"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."

FeDe.RuLeZ

Hi i have a problem with this mod. I have some problem with the Package manager so i tryed to install the mod manually. I have a problem when i try to run the install.php file. I upload it in the same directory where it placed ssi.php (the main directory of the forum) but if i try to run the file by browser, my Mozilla Firefox 3.5.2 say me that the page doesn't redirect correctly.. Please help me!

~ Forum Support  ~ News  ~ Download Center  ~ Media Center  ~ Link Directory  ~ Arcade  ~ Anche Supporto SMF!

Samuikon

Alright, I haven't seen this issue posted for v1.0rc so I'll post it.

My error log is filled with

Quote
8: Undefined index: board
File: /home/www-data/forums_kitsuneparadise_com/Sources/Display.php
Line: 100

and

Quote
8: Undefined index: 34
File: /home/www-data/forums_kitsuneparadise_com/Sources/Display.php
Line: 100

Line 100 has this:


if ((isset($context['pretty']['oldschoolquery']) || $context['pretty']['query_string']['board'] != $context['pretty']['board_urls'][$board]) && $modSettings['pretty_enable_filters'])


My version of SMF is v1.1.10. Any idea what's going on? This is quite mind boggling.

« Kitsuria Network ¤ ParaBound ¤ Glacia Server »

dreams are as portals, flat visions of misty places, fragments bound below my surface.
but i can write dreams, they flow from me, inscribed yet now unbound. i touch them, and they are real....and they are real.

- Catherine: realMYST Trailer -

Scott S

Hi, have an interesting problem...

When I visit any board/topic on the forum with pretty urls installed/active, it doesn't show me as logged in.
When I return to the home page, it shows me as logged in, and with access to the admin/pm/profile sections etc...

As I say, this only occurs when Pretty URLS is active..

Any ideas?

Dannii

Quote from: Samuikon on September 04, 2009, 02:08:49 PM
Alright, I haven't seen this issue posted for v1.0rc so I'll post it.

My error log is filled with

Quote
8: Undefined index: board
File: /home/www-data/forums_kitsuneparadise_com/Sources/Display.php
Line: 100

and

Quote
8: Undefined index: 34
File: /home/www-data/forums_kitsuneparadise_com/Sources/Display.php
Line: 100

Line 100 has this:


if ((isset($context['pretty']['oldschoolquery']) || $context['pretty']['query_string']['board'] != $context['pretty']['board_urls'][$board]) && $modSettings['pretty_enable_filters'])


My version of SMF is v1.1.10. Any idea what's going on? This is quite mind boggling.
Maybe you didn't have a clean upgrade to 1.0RC? This code should be in QueryString.php:
                // Now make absolutely sure it's a number.
                // Check for pretty board URLs too, and possibly redirect if oldschool queries were used.
                $context['pretty']['query_string']['board'] = $_REQUEST['board'];


Quote from: Scott S on September 04, 2009, 05:42:41 PM
Hi, have an interesting problem...

When I visit any board/topic on the forum with pretty urls installed/active, it doesn't show me as logged in.
When I return to the home page, it shows me as logged in, and with access to the admin/pm/profile sections etc...

As I say, this only occurs when Pretty URLS is active..

Any ideas?
Can you check your cookies and subdomains settings?
"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."

Samuikon

#4238
Quote from: Dannii on September 04, 2009, 10:55:58 PM
Maybe you didn't have a clean upgrade to 1.0RC? This code should be in QueryString.php:
                // Now make absolutely sure it's a number.
                // Check for pretty board URLs too, and possibly redirect if oldschool queries were used.
                $context['pretty']['query_string']['board'] = $_REQUEST['board'];


The code is in there. o.O

Also, I'd like to note it only happens when the query string is this: ?pretty;topic=X (where X is a topic ID)

Edit Again:

Actually, now that I look at it, the problem is my fault. It lies in my .htaccess configuration. I have Rewrite rules set in place to redirect IPB-style queries to SMF-style (I've recently converted, never been happier), so that old links would still direct visitors to the correct topic, instead of the board index. I'm not sure how I can fix this.


rewritecond %{REQUEST_URI} /index.php$
rewritecond %{query_string} ^showtopic=([0-9]+)
RewriteRule ^.*$ /index.php?pretty;topic=%1 [R=301,L]


rewritecond %{REQUEST_URI} /index.php$
rewritecond %{query_string} ^showforum=([0-9]+)
RewriteRule ^.*$ /index.php?pretty;board=%1 [R=301,L]


rewritecond %{REQUEST_URI} /index.php$
rewritecond %{query_string} ^showuser=([0-9]+)
RewriteRule ^.*$ /profile/?u=%1 [R=301,L]


I'm thinking, what I'd have to do is some kind of coding to work around it?

« Kitsuria Network ¤ ParaBound ¤ Glacia Server »

dreams are as portals, flat visions of misty places, fragments bound below my surface.
but i can write dreams, they flow from me, inscribed yet now unbound. i touch them, and they are real....and they are real.

- Catherine: realMYST Trailer -

Dannii

Just cut out the pretty; from those URLs... that might 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."

Advertisement: