View Full Version : "clean" URLs, no ? in links
03-22-2007, 02:33 AM
Is there anyway to not have the "www.domainname.com/index.php?x=nameofpage" extension in a URL and instead just have "www.domainname.com/nameofpage"? I'd ike to have something like that for about, archives, gallery, etc. Also for categories, like "www.nameofdomain.com/categories/landscapes". Is this something that PP can do or do I have to go through my admin/server? Thanks!
03-22-2007, 03:41 AM
This can be done with the post_slug addon.
You can find out more about it here:
03-22-2007, 07:47 AM
I've downloaded the "PostSlug_1.0.1_beta_modrewrite Folder" but am having issues; is that the latest one? Do I need to use the simple template that you provided in that folder or could I still use my own template?
Also, the instructions asked me to replace the index.php file. I currently have the fader.js (fades images in when I load them) on the main page but had to modify the index.php before such that when I click on the comment pop-up box link, the page DOESN'T reload. Do you know where in the index.php I could prevent the page from reloading when I click on the comment pop-up?
Lastly, I see the following warning signs on the Admin >> New Images of PP:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/pictures/public_html/addons/admin_PostSlug.php on line 308
Warning: sort() expects parameter 1 to be array, null given in /home/pictures/public_html/addons/admin_PostSlug.php on line 312
Warning: implode() [function.implode]: Bad arguments. in /home/pictures/public_html/addons/admin_PostSlug.php on line 208
Any suggestions? Thanks!
03-22-2007, 01:37 PM
You need to first make sure that Post Slug is installed properly.
Go to the addons page, and make sure the status looks like this:
You can use any template you wish, but in order to use the "Clean URLs" you have to replace the next/previous links with the Post Slug equivalents.
You may want to examine the Post Slug template and copy the code for the image/links.
03-22-2007, 08:00 PM
Before I install it, do you know where/what I need to change such that the main image window won't reload when I click on the comment pop-up window? I have the fader.js enabled but when I click the comment pop-up link, the main window reloads; it's evident since I have the fader. I recalled someone telling me it's in the /index.php file but am not sure where and what I need to change.
Reason is your instruction for post slug asks me to replace the index.php file. Thanks. Btw, my link is www.picturesforfaith.com if you want to see what I mean.
Edit: I've just installed the addon and works great but would now like to fix that reload issue on the main page when I click the comment pop-up. Also, would this addon work for other template pages? i.e. I'd like /index.php?x=about to be just /about. Thanks!
03-22-2007, 08:37 PM
Go to your image template and use this code instead of the <COMMENT_POPUP> tag:
<a href='#' onclick="window.open('index.php?popup=comment&showimage=<IMAGE_ID>','Comments','width=480,height=540,scrollbars=yes, resizable=yes');">Info/Comment</a>
Also, you may want to modify your image link with this code:
For the about page, just edit your about link, so it is "about" rather than "index.php?x=about".
You can edit the .htaccess file if you want to add more pages.
03-22-2007, 09:42 PM
I think everything is working...except in the comment pop-up window, I'm trying to put a link on the title of the image such that when I click on it, that image loads in the main window. I posted that question elsewhere and you've answered it. It was working until I incorporated the SLUG addon. Before, I used the <IMAGE_PERMALINK> tag as the link inside the comment pop-up box. Now, that tag doesn't seem to work.
I currently have:
<a href="index.php?popup=comment&showimage=<IMAGE_PREVIOUS_ID>" title="<IMAGE_PREVIOUS_TITLE>">Previous</a> | <a href="<IMAGE_PERMALINK>" target="main"><IMAGE_TITLE></a> | <IMAGE_DATE> | <a href="index.php?popup=comment&showimage=<IMAGE_NEXT_ID>" title="<IMAGE_NEXT_TITLE>">Next</a>
Is there something I'm missing/not doing correctly?
03-23-2007, 12:22 AM
Don't use the <IMAGE_PERMALINK> tag.
Use this instead:
<a href="./index.php?showimage=<IMAGE_ID>" target="main"><IMAGE_TITLE></a>
03-23-2007, 01:19 AM
Thanks again Jay! Really appreciate the quick response and help.
Edit: Jay, I just noticed that some of the drop-down category menu links have broken. If you go here: http://www.picturesforfaith.com/browse and try filtering by "Abstract", everything is fine. But when you try to filter by another category like "Struture", you get the error message: "Coming Soon! Nothing to show. No image to show here!" I'm using the <BROWSE_CATEGORIES> tag. I notice that the link URL changes too, even when I go to the /index.php?x=browse page.
The weird thing is the drop-down menu by months/page is just fine <BROWSE_MONTHLY_ARCHIVE_PAGED>.
Any idea? Thanks as always.
03-23-2007, 03:41 AM
Actually, It appears that there is a bug in the .htaccess code.
This code should work correctly:
RewriteRule ^(rss|atom)\.xml$ index.php?x=$1
# About/Browse Page
RewriteRule ^(about|browse|top20|contact)$ index.php?x=$1
#Browse (Archives) Page
RewriteRule ^archives$ index.php?x=browse&pagenum=1
# Browse (Archives) Selection
RewriteRule ^archives-([0-9]+)$ index.php?x=browse&category=$1
# Browse (Archives) Selection
RewriteRule ^archives-([0-9]+-[0-9]+)-(.*)$ index.php?x=browse&archivedate=$1&monthname=$2&pagenum=1
# Post Slug Addon
RewriteRule ^([a-z0-9-]+)$ index.php?photoslug=$1
Let me know how it turns out.
03-23-2007, 04:36 AM
Sorry, it didn't change anything I think. I'm using the <BROWSE_CATEGORIES> tag in the browse page along with the <BROWSE_MONTHLY_ARCHIVE_PAGED> tag. It's here: http://www.picturesforfaith.com/index.php?x=browse&category=13&pagenum=1. The months one is fine, am I using the wrong tag for the category one?
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.