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

karlbenson

Dannii,

While dealing with this post
I've discovered an issue with your mod related to indexing/noindexing (tested on default RC1).

With your mod installed ALL topics and ALL boards have <meta> noindex set (where we would actually like them to be indexed).

I'm guessing this probably related to this code in Display.php (and properly similarly in other source files)

// Let's do some work on what to search index.
if (count($_GET) > 2)
foreach ($_GET as $k => $v)
{
if (!in_array($k, array('topic', 'board', 'start', session_name())))
$context['robot_no_index'] = true;
}
if (!empty($_REQUEST['start']) && (!is_numeric($_REQUEST['start']) || $_REQUEST['start'] % $context['messages_per_page'] != 0))
$context['robot_no_index'] = true;

inny

Quote from: Dannii on April 26, 2009, 08:53:27 AM
Quote from: inny on April 25, 2009, 08:22:01 PM
Is it possible to have in future pretty urls for SMF Media Gallery?
Yes. Want to write a filter for it?

Im not sure if you mean that you want me to write a filter, but if this is the case, i dont know how to do it  :-X

If you have time to give us the filter for SMF media gallery im pretty sure many people will be glad.

Best Regards,
Inny



Dannii

Quote from: Özgür´ on April 26, 2009, 09:07:07 AM
But profile filters different work.
Pretty profile filter make this.
RewriteRule http://www.simplemachines.org/community/sixfeetunder2 to http://www.simplemachines.org/community/index.php?action=profile;user=sixfeetunder2.
But I don't know make /category/catname to mgallery;sa=album;id=catid.

Can you explain a bit more?

Ask the gallery author if you can already access albums by their title, maybe by something like action=mgallery;sa=album;albumid=title

You probably can't though. If so then you would need to modify the gallery a lot in order to be able to do that. If the gallery doesn't ensure that titles are unique this will be really hard.

Quote from: regularexpression on April 26, 2009, 10:05:47 AM
Dannii,

While dealing with this post
I've discovered an issue with your mod related to indexing/noindexing (tested on default RC1).

With your mod installed ALL topics and ALL boards have <meta> noindex set (where we would actually like them to be indexed).

I'm guessing this probably related to this code in Display.php (and properly similarly in other source files)

// Let's do some work on what to search index.
if (count($_GET) > 2)
foreach ($_GET as $k => $v)
{
if (!in_array($k, array('topic', 'board', 'start', session_name())))
$context['robot_no_index'] = true;
}
if (!empty($_REQUEST['start']) && (!is_numeric($_REQUEST['start']) || $_REQUEST['start'] % $context['messages_per_page'] != 0))
$context['robot_no_index'] = true;

I had thought I had already accounted for this. Has the algorithm changed since the code was first introduced? It's also possible I never actually had it working...

Quote from: inny on April 26, 2009, 11:28:45 AM
Quote from: Dannii on April 26, 2009, 08:53:27 AM
Quote from: inny on April 25, 2009, 08:22:01 PM
Is it possible to have in future pretty urls for SMF Media Gallery?
Yes. Want to write a filter for it?

Im not sure if you mean that you want me to write a filter, but if this is the case, i dont know how to do it  :-X

If you have time to give us the filter for SMF media gallery im pretty sure many people will be glad.

Best Regards,
Inny



Ask Özgür´, he seems to have a limited filter 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."

islam2hamy

really nice mod , but it didn't work good with Arabic
why ??

Arabic Translator - Web Designer
My Mods / My Themes  //  GfxLand





Dannii

Cause Arabic isn't support in URLs sorry.

At least not without percent encoding. I would like to add that in the future, but it's a long way away.
"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

#3445
Just to remind you all:

0.9.2 breaks some javascript URLs. I recommend using 0.9 until this can be fixed.

On SMF 2 this mod sets every topic and board page to not be indexed! If that matters, either remove the meta tag completely or don't use this mod. If you decide to uninstall this mod, the Reverter package is essential! Get it at the downloads 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."

islam2hamy

Quote from: Dannii on April 27, 2009, 04:00:37 AM
Cause Arabic isn't support in URLs sorry.

At least not without percent encoding. I would like to add that in the future, but it's a long way away.

ok, as you wish.

Arabic Translator - Web Designer
My Mods / My Themes  //  GfxLand





master2oo8

Next problem:
When in a topic stands a username which include ü,ä,ö i receive a white page.
And when i search after member which include ü,ä,ö,., i receive too a white page.

This is since i use this mod.

How can i fix?

Quote

On SMF 2 this mod sets every topic and board page to not be indexed! If that matters, either remove the meta tag completely or don't use this mod
Where i can remove meta tag?

keiths

Quote from: Dannii on April 27, 2009, 04:05:22 AMOn SMF 2 this mod sets every topic and board page to not be indexed! If that matters, either remove the meta tag completely or don't use this mod.
Can you go into this more?  Is this a bug or is it intended to do this and why?

I do see the noindex tag in my code.  Is it easy to remove?

shaitanfr

Hi Danny, Dannii  ;D

French utf-8 Translation


//   Admin chrome
$txt['pretty_chrome_title'] = 'Administration de Pretty URLs';
$txt['pretty_chrome_menu_news'] = 'Nouvelles';
$txt['pretty_chrome_menu_settings'] = 'Param&egrave;tres';
$txt['pretty_chrome_menu_maintenance'] = 'Maintenance';

//   News page
$txt['pretty_chrome_caption_news'] = 'Dernières nouvelles et information en direct du site du Projet';
$txt['pretty_chrome_page_title_news'] = 'Pretty URLs Nouvelles &amp; Infos';
$txt['pretty_chrome_title_news'] = 'Nouvelles &amp; Info';
$txt['pretty_current_version'] = 'Version courante';
$txt['pretty_download'] = 'Télécharger';
$txt['pretty_latest_version'] = 'Dernière version';
$txt['pretty_upgrade'] = 'Mettre à jour maintenant!';
$txt['pretty_version'] = 'Info Version';

//   Settings page
$txt['pretty_chrome_caption_settings'] = 'Titre des param&egrave;tres';
$txt['pretty_chrome_page_title_settings'] = 'Param&egrave;tres de Pretty URLs';
$txt['pretty_core_settings'] = 'Param&egrave;tres principaux';
$txt['pretty_enable'] = 'Autoriser la r&eacute;&eacute;criture des URLs';
$txt['pretty_filters'] = 'Filtres de r&eacute;&eacute;criture des URLs';
$txt['pretty_save'] = 'Sauvegarder les changements';

//   Maintenance page
$txt['pretty_chrome_caption_maintenance'] = 'Effectuer diverses tâches de maintenance';
$txt['pretty_chrome_page_title_maintenance'] = 'Maintenance de Pretty URLs ';
$txt['pretty_run_maintenance'] = 'Effectuer les tâches de maintenance';

//   Edit filters page
$txt['pretty_chrome_caption_filters'] = 'Un outil pour éditer les tables de filtres. La table est formatée ici avec le format <a href="http://www.json.org/">JSON.</a>  Prenez garde, le Parser JSON est extrêmement strict.';
$txt['pretty_chrome_page_title_filters'] = 'Outils pour les filtres Pretty URLs ';
$txt['pretty_chrome_title_filters'] = 'Outils Filtres';
$txt['pretty_no_json'] = 'Les Extensions PHP JSON  sont requises pour cet outil. Envisagez la mise à jour PHP 5.2.';

?>


Second part coming soon

Dannii

Quote from: master2oo8 on April 27, 2009, 02:02:12 PM
Next problem:
When in a topic stands a username which include ü,ä,ö i receive a white page.
And when i search after member which include ü,ä,ö,., i receive too a white page.

This is since i use this mod.

How can i fix?
If you get a white page check all your error logs.

Quote
Where i can remove meta tag?
From your theme's index template.

Quote from: keiths on April 27, 2009, 03:19:46 PM
Quote from: Dannii on April 27, 2009, 04:05:22 AMOn SMF 2 this mod sets every topic and board page to not be indexed! If that matters, either remove the meta tag completely or don't use this mod.
Can you go into this more?  Is this a bug or is it intended to do this and why?

I do see the noindex tag in my code.  Is it easy to remove?
I thought I had accounted for it, but it seems I haven't. No it's no intended, and I will fix it in the future. You can remove it from your theme's index template. Search, there has been lots about it before...

Quote from: shaitanfr on April 27, 2009, 05:14:01 PM
Hi Danny, Dannii  ;D

French utf-8 Translation

Hi, please do translations here thanks: https://translations.launchpad.net/prettyurls/trunk/+pots/prettyurls
"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."

dzinerfusion

hi im getting this error and im pretty sure its from this mod

8: Undefined index: pretty_enable_filters
File: /home/vol5/byethost24.com/b24_3307563/modernopolis.byethost24.com/htdocs/forum/Sources/QueryString.php
Line: 518

Dannii

If you save the settings again does it still occur?
"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."

dzinerfusion

Quote from: Dannii on April 27, 2009, 08:48:57 PM
If you save the settings again does it still occur?

What do you mean?

Dannii

Do to the pretty URLs settings page, turn off rewriting, save etc. Does the error keep occuring?
"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."

master2oo8

Quote
If you get a white page check all your error logs.

Apply Filter: Only show the error messages of this URL  xxxx/board/index.php?action=mlist;sa=search
Apply Filter: Only show the errors with the same message
Database Error: Illegal mix of collations for operation ' IN '


SELECT url_id, replacement
FROM smf_asdfgpretty_urls_cache
WHERE url_id IN ('http://xxx/board/Themes/1/style.css?rc1', 'http://xxx/board/Themes/default/css/print.css?rc1', 'http://xxx/board/Themes/default/css/ff.css', '`Ahelp', '`Asearch', '`S', '`S?type=rss;action=.xml', 'http://xxx/board/Themes/Prof/css/index.css', 'index.php', '`Aadmin', '`Amoderate', '`Aprofile', '`Apm', '`Amlist', '`Alogout;c316ddec=ccec66261a3c7473f388891a9102b602', 'http://root.lu', 'http://server.lu', '`Amlist;sa=search', '`Amlist;sa=all', '`Apm;sa=send;u=5185', '`Aprofile;u=5185', '`Aemailuser;sa=email;uid=5185', 'http://unerschütterlich.de', 'http://www.icq.com/whitepages/about_me.php?uin=5050321', '`Amlist;sa=search;search=Mr.+Unersch%C3%BCtterlich', 'http://www.simplemachines.org/', 'http://www.simplemachines.org/about/copyright.php', 'http://validator.w3.org/check/referer', '`S?wap2', 'http://smf2.uuuq.com/', 'http://host-tracker.com/', 'http://strato.de')
Apply Filter: Only show the errors from this file
File: /home/web/xxx/board/Sources/PrettyUrls-Filters.php
Line: 48

This stands in Error log!

Dannii

Using phpMyAdmin can you check what encoding the smf_asdfgpretty_urls_cache table has? Maybe try converting it to UTF-8?
"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."

dzinerfusion


Özgür

http://code.google.com/p/prettyurls/issues/detail?id=59
Dannii i write some code and work me.. Are you interested?
I'm vazgec

Subs-Prettyurls.php
Find

// Output the file
$handle = fopen($boarddir . '/.htaccess', 'w');
fwrite($handle, $htaccess);
fclose($handle);

Replace

// open htaccess
$fh = fopen($boarddir . '/.htaccess', 'r');
// read data
$theData = fread($fh, filesize($boarddir . '/.htaccess'));
// close htaccess
fclose($fh);
// copy file line from "# Pretty URLs mod" up.
$part = explode('# Pretty URLs mod', $theData);
// open file
$handle = fopen($boarddir . '/.htaccess', 'w');
// Write pretty and other code
fwrite($handle, $part[0].$htaccess);
// close file
fclose($handle);
So Long

Özgür



Smf Articles


Callback
function pretty_articles_filter($urls)
{
    global $boardurl, $scripturl;
   
// kategoriler
    $pattern = '~' . $scripturl . '(.*)action=articles;cat=([0-9]+)(.*)~S';
    $replacement = $boardurl . '/articles/cat/$2/';
    $replacement .= (strpos($replacement, '?') === false ? '?' : ';') . (isset($PHPSESSID[0]) ? $PHPSESSID[0] : '') . ';' . (isset($sesc[0]) ? $sesc[0] : '') . (isset($fragment[0]) ? $fragment[0] : '');
    foreach ($urls as $url_id => $url)
        if (!isset($url['replacement']))
            if (preg_match($pattern, $url['url']))
                $urls[$url_id]['replacement'] = preg_replace($pattern, $replacement, $url['url']);

   
    // makaleler
    $pattern = '~' . $scripturl . '(.*)sa=view;article=([0-9]+)(.*)~S';
    $replacement = $boardurl . '/articles/article/$2/';
    $replacement .= (strpos($replacement, '?') === false ? '?' : ';') . (isset($PHPSESSID[0]) ? $PHPSESSID[0] : '') . ';' . (isset($sesc[0]) ? $sesc[0] : '') . (isset($fragment[0]) ? $fragment[0] : '');
    foreach ($urls as $url_id => $url)
        if (!isset($url['replacement']))
            if (preg_match($pattern, $url['url']))
                $urls[$url_id]['replacement'] = preg_replace($pattern, $replacement, $url['url']);
   
    return $urls;
}


Filter
,
    "articles": {
        "description": "articles",
        "enabled": 0,
        "filter": {
            "priority": 4,
            "callback": "pretty_articles_filter"
        },
        "rewrite": {
            "priority": 4,
            "rule": [
                "RewriteRule ^articles/article/([^/]+)/?$ index.php?action=articles;sa=view;article=$1 [L,QSA]",
                "RewriteRule ^articles/cat/([^/]+)/?$ index.php?action=articles;cat=$1 [L,QSA]"
            ]
        },
        "title": "Articles modu pretty desteği"
    }

   
article url : site.com/forum/articles/article/5/
cat url: site.com/forum/articles/cat/5/



Smf Downloads


Callback
function pretty_downloads_filter($urls)
{
global $boardurl, $scripturl;

$pattern = '~' . $scripturl . '(.*)action=downloads;cat=([0-9]+)(.*)~S';
$replacement = $boardurl . '/downloads/cat/$2/';
$replacement .= (strpos($replacement, '?') === false ? '?' : ';') . (isset($PHPSESSID[0]) ? $PHPSESSID[0] : '') . ';' . (isset($sesc[0]) ? $sesc[0] : '') . (isset($fragment[0]) ? $fragment[0] : '');
foreach ($urls as $url_id => $url)
if (!isset($url['replacement']))
if (preg_match($pattern, $url['url']))
$urls[$url_id]['replacement'] = preg_replace($pattern, $replacement, $url['url']);

$pattern = '~' . $scripturl . '(.*)sa=view;down=([0-9]+)(.*)~S';
$replacement = $boardurl . '/downloads/item/$2/';
$replacement .= (strpos($replacement, '?') === false ? '?' : ';') . (isset($PHPSESSID[0]) ? $PHPSESSID[0] : '') . ';' . (isset($sesc[0]) ? $sesc[0] : '') . (isset($fragment[0]) ? $fragment[0] : '');
foreach ($urls as $url_id => $url)
if (!isset($url['replacement']))
if (preg_match($pattern, $url['url']))
$urls[$url_id]['replacement'] = preg_replace($pattern, $replacement, $url['url']);

return $urls;
}


Filter

,
"downloads": {
        "description": "downloads",
        "enabled": 0,
        "filter": {
            "priority": 5,
            "callback": "pretty_downloads_filter"
        },
        "rewrite": {
            "priority": 5,
            "rule": [
                "RewriteRule ^downloads/item/([^/]+)/?$ index.php?action=downloads;sa=view;down=$1 [L,QSA]",
                "RewriteRule ^downloads/cat/([^/]+)/?$ index.php?action=downloads;cat=$1 [L,QSA]"
            ]
        },
        "title": "downloads modu pretty url"
    }

   
item url : site.com/forum/downloads/item/5/
cat url: site.com/forum/downloads/cat/5/



Simple Tags



Callback


function pretty_tags_filter($urls)
{
global $boardurl, $scripturl;
// Tags
$pattern = '~' . $scripturl . '(.*)action=tags;name=([^;]+)~S';
$replacement = $boardurl . '/tags/$2';
$replacement .= (strpos($replacement, '?') === false ? '?' : ';') . (isset($PHPSESSID[0]) ? $PHPSESSID[0] : '') . ';' . (isset($sesc[0]) ? $sesc[0] : '') . (isset($fragment[0]) ? $fragment[0] : '');
foreach ($urls as $url_id => $url)
if (!isset($url['replacement']))
if (preg_match($pattern, $url['url']))
$urls[$url_id]['replacement'] = preg_replace($pattern, $replacement, $url['url']);


// Tagcloud
$pattern = '~' . $scripturl . '(.*)action=tags;cloud(.*)~S';
$replacement = $boardurl . '/tagscloud/';
$replacement .= (strpos($replacement, '?') === false ? '?' : ';') . (isset($PHPSESSID[0]) ? $PHPSESSID[0] : '') . ';' . (isset($sesc[0]) ? $sesc[0] : '') . (isset($fragment[0]) ? $fragment[0] : '');
foreach ($urls as $url_id => $url)
if (!isset($url['replacement']))
if (preg_match($pattern, $url['url']))
$urls[$url_id]['replacement'] = preg_replace($pattern, $replacement, $url['url']);
return $urls;
}


Filter
Filter =>
,
"tags": {
        "description": "Rewrite Tags URLs",
        "enabled": 0,
        "filter": {
            "priority": 5,
            "callback": "pretty_tags_filter"
        },
        "rewrite": {
            "priority": 5,
            "rule": [
                "RewriteRule ^tags/([^/]+)/?$ index.php?action=tags;name=$1 [L,QSA]",
                "RewriteRule ^tagscloud/?$ index.php?action=tags;cloud [L,QSA]"
            ]
        },
        "title": "Tags Mod Pretty Support"
    }


tag url : site.com/forum/tags/tagsname/
cloud url: site.com/forum/tagscloud/
So Long

Advertisement: