View Full Version : Beta Addon: Post Slug
jaywilliams
08-21-2006, 04:16 AM
What does this addon do? It's Simple.
Instead of referencing photos using an ID number like this:
index.php?showimage=24
You can reference images using a "post slug":
index.php?photoslug=post-slug-title
You can either let the script automatically generate a post slug based off your image title. Or you enter your own post slug.
I attempted to make the install as easy as possible, so as long as you have PHP 5+ and are running Pixelpost 1.5+ you should have no issues whatsoever.
Here are some screen shots displaying how it looks in the admin interface:
http://img237.imageshack.us/img237/1113/newimagenp9.th.gif (http://img237.imageshack.us/my.php?image=newimagenp9.gif)http://img82.imageshack.us/img82/211/editimageqs1.th.gif (http://img82.imageshack.us/my.php?image=editimageqs1.gif)http://img82.imageshack.us/img82/7261/addonspagexa4.th.gif (http://img82.imageshack.us/my.php?image=addonspagexa4.gif)
As this only a beta, I haven't uploaded it to the actual pixelpost addons site yet. You can download it however from one of my servers, http://members.atlantic.net/~john1957/admin_PostSlug_1_beta.zip
This is my first ever publicly released addon, so any input would be greatly appreciated. And with a little mod_rewrite, you can do even more with this addon. Hum maybe something like "/photo/photo-slug" maybe? ;-)
Oh and if you didn't notice above, this is a beta, and it does modify your database, so as always, proceed with caution if you have a database full of photos.
UPDATE:
If you want to use PostSlug with mod_rewrite, you can now download a special mod_rewire version that is ready to go right out of the box.
PostSlug_1.0.1_beta_modrewrite.zip (http://labs.dview.us/other_files/files/PostSlug_1.0.1_beta_modrewrite.zip)
NOTE: Currently, this addon/hack only works with Pixelpost v1.5
I will however port it to v1.6 in the near future.
se.nsuo.us
08-21-2006, 04:35 AM
nice addon - may be you can add a line in the description of the addon with the mod_rewrite rule and how to make it useful
jaywilliams
08-21-2006, 04:47 AM
nice addon - may be you can add a line in the description of the addon with the mod_rewrite rule and how to make it useful
Well, you can easily create a .htaccess file with the following text to do that.
RewriteEngine On
RewriteRule ^photo/(.*)$ index.php?photoslug=$1
But you will need to modify the script and your template so all the links reference the photos that way. So it would take a little effort on the users end. And as you noticed, this is a beta, so better integration with mod_rewrite will probably be something that will be added in the future.
And thanks for your comment!
Very nice idea.
I was thinking about some new stuff for linking system for about a year. Maybe at september Ill do something bigger.
Your addon is first big step forward in good direction.
jaywilliams
08-21-2006, 01:45 PM
Very nice idea.
I was thinking about some new stuff for linking system for about a year. Maybe at september Ill do something bigger.
Your addon is first big step forward in good direction.
Yes, I too have thought about doing something like this for a while.
And since the final release of Pixelpost 1.5, I've been working on a new version of my photoblog. And one of my goals for my photoblog was to have a post slug, similar to WordPress. (My other goals include having a tagging system for the photos and as well as page caching)
So this addon is a direct result of my work on the next version of my photoblog. Which as of now, it still very much under development. And hopefully, soon I will be able to release the tags addon that I am currently working on.
SnowScan
08-21-2006, 05:45 PM
Nice idea, but the link is broken...
jaywilliams
08-21-2006, 05:53 PM
Nice idea, but the link is broken...
Sorry about that, the link is now fixed.
jaywilliams
09-07-2006, 03:39 PM
Well, I've just finished redesigning my site, A Different View (http://photoblog.dview.us/), using the Post Slug addon.
The ugly image ID in the URL is gone for good, and in it's place is a nice simple "post slug". :-D
And with a little help from mod_rewrite and php, I was able to keep all the old links to my site completely functional as well.
If anyone wants any of my mod_rewrite/php scrips, feel free to contact me.
SnowScan
09-07-2006, 04:19 PM
Hi Jay,
I really like your design, very neat :)
Only probs are that not all images will do well with a reflection under them IMO and it is not logival to click the image to read the description and comment.
Apart from that it is awesome
Peter
jaywilliams
09-07-2006, 05:17 PM
Only probs are that not all images will do well with a reflection under them IMO and it is not logival to click the image to read the description and comment.
Apart from that it is awesome
Thanks for the comment!
And yes, I have to admit, that clicking on the photos to view the description/comments may not be the best solution, but it was the only way I could come up with to get the minimalistic look that I was striving to achieve.
And the reflections, yes I have to agree, some photos don't look that great with them, but I feel a majority of the shots do look good with the reflections, so I decided to add them. And instead of using the standard "Reflection.js" script to accomplish this, I made a little addon for PixelPost that uses PHP to create a "reflection image" that can be included in the template. (reflect_IMGNAME.jpg) That way the site loads faster, and has it works on any browser, even if JavaScript is turned off.
SnowScan
09-08-2006, 10:33 AM
Hi Jay,
I have one question before I installe your postslug addon
in the readme you write:
To load a image via a Post Slug, you can use the following link:
index.php?photoslug=post-slug-title
but... can I still access the images via the original image ID both for images previously uploaded and uploaded af the installed addon.
I dont want to loose references and link :)
dakwegmo
09-08-2006, 02:23 PM
I can't seem to get this addon to patch the index.php file like it's supposed to. When I run the install, it says that it's INSTALLING DATABASE and INSTALLING FILE PATCH, but no changes get made to the index.php file. When I reload the addons page, it tells me the Database is Ok, but the patch is not installed. I have tried this multiple times and ensured my index.php was writeable, but can't seem to get it patched.
Since this is beta, you may want to consider putting some error handling in the addon, so we can get an idea of where the patch is failing.
jaywilliams
09-08-2006, 03:12 PM
in the readme you write:
To load a image via a Post Slug, you can use the following link:
index.php?photoslug=post-slug-title
but... can I still access the images via the original image ID both for images previously uploaded and uploaded af the installed addon.
I dont want to loose references and link :)
Yes, you can still access your images using the traditional ?showimage=123 method. All this addon does is add an additional means of loading an image, it doesn't remove any of the current functionality.
Once you have uploaded that addon to Pixelpost, make sure you press the "Install Post Slug" button located on the addons page.
Then once it says:
Post Slug Patch: OK
Post Slug Database: OK
You are setup.
You can then go into each image individually, to specify a post slug for that image, or if you want to do it the quick way, you can click on the link "Auto Generate Post Slug". This will create a post slug for each image based off the image title.
Then it's just a matter of modifying your template to use Post slugs instead of image IDs for a reference. But remember, this step is optional, and the image IDs will still work.
jaywilliams
09-08-2006, 03:17 PM
When I run the install, it says that it's INSTALLING DATABASE and INSTALLING FILE PATCH, but no changes get made to the index.php file. When I reload the addons page, it tells me the Database is Ok, but the patch is not installed. I have tried this multiple times and ensured my index.php was writeable, but can't seem to get it patched.
Well, I figured something would happen like this, as everyone's server is different.
So, I have compiled two alternative methods to patch the index.php file.
You can download it from here:
http://members.atlantic.net/~john1957/admin_PostSlug_1_beta_PATCH.zip
Basically, the easiest way to get it up and running is to upload the included pre-patched index.php file. And the alternate way is to manually copy-paste the changed lines of code to edit the index.php file.
I hope one of the two methods work out for you. :-)
Let me know if you experience any other issues, as you stated, this is beta, and I DO want to work out any bugs that people encounter.
dakwegmo
09-08-2006, 04:45 PM
When I checked the addon code to see that there was a lot of find and replace in there, I suspected you might have a copy of the modified index.php. I will try that this weekend and let you know if it works.
Thanks.
Giuseppe
09-27-2006, 05:45 PM
Post Slug Patch: NOT INSTALLED
Post Slug Database: OK
error on line 541
more i don't Know.
When post slug work google_sitemap - version 1.0 built sitemap with Post Slug url
thx
bye
jaywilliams
09-27-2006, 05:53 PM
Post Slug Patch: NOT INSTALLED
Post Slug Database: OK
error on line 541
You may want to try uploading my already patched index.php file.
That should fix the problem.
You can get it here: admin_PostSlug_1_beta_PATCH.zip (http://members.atlantic.net/~john1957/admin_PostSlug_1_beta_PATCH.zip)
If you need any other help, feel free to contact me.
Giuseppe
09-27-2006, 09:04 PM
Thxs for quick response.
patch installed an addons work fine.
add <IMAGE_NEXT_LINK_SLUG> in image_template.php and the url of the page is:
.../fotoblog/index.php?photoslug=liberty intead of:
/fotoblog/liberty
where is my mestake?:confused:
Dennis
09-28-2006, 05:27 AM
Guiseppe,
You need to add a .htaccess file with rewrite rules in them. The url .../fotoblog/liberty will have to be rewritten to .../fotoblog/index.php?photoslug=liberty
Well, you can easily create a .htaccess file with the following text to do that.
RewriteEngine On
RewriteRule ^photo/(.*)$ index.php?photoslug=$1
But you will need to modify the script and your template so all the links reference the photos that way. So it would take a little effort on the users end. And as you noticed, this is a beta, so better integration with mod_rewrite will probably be something that will be added in the future.
And thanks for your comment!
Giuseppe
09-28-2006, 10:30 AM
I try, but don't work.
this is all i tried:
RewriteEngine On
RewriteRule ^/home//fotoblog/(.*)$ index.php?photoslug=$1
RewriteEngine On
RewriteRule ^/fotoblog/(.*)$ index.php?photoslug=$1
RewriteEngine On
RewriteRule ^home//fotoblog/(.*)$ index.php?photoslug=$1
RewriteEngine On
RewriteRule ^fotoblog/(.*)$ index.php?photoslug=$1
.htaccess in the root of my space
the server:
PHP-version 4.4.1 (Requisiti minimi di Pixelpost: versione PHP: 4.3.0 )
Session save path /tmp
MySQL version 5.0.24-standard-log (Requisiti minimi di Pixelpost: MySQL: 3.23.58 )
GD-lib bundled (2.0.28 compatible) con supporto JPEG
Gli Upload al sito Pixelpost sono possible.
Server Software Apache/2.0
Thanks schonhose & jaywilliams
Dennis
09-28-2006, 10:37 AM
Ok, I'm just wondering: how did you setup your Pixelpost? Is it located in the root or in a subdirectory?
example: http:\\www.mydomain.com\ <- root
http:\\www.mydomain.com\pixelpost\ <- subfolder
Giuseppe
09-28-2006, 11:59 AM
The second: subfolder.
know that is wrong but i put (to try) .htaccess in subfolder:shock: to see if it work:rolleyes:
thxs
jaywilliams
09-28-2006, 01:14 PM
This .htaccess code might work better for you:
RewriteEngine On
# Post Slug Addon
RewriteRule ^([a-z0-9-]+)$ index.php?photoslug=$1
Just create a .htaccess file and upload it to the same directory as Pixelpost.
Giuseppe
09-28-2006, 01:32 PM
.htaccess with new code uploaded, but link don't change.
There is a possibility rewrite engine is off? :confused:
thxs
jaywilliams
09-28-2006, 01:38 PM
The htaccess code seems to be working for me.
Example:
http://www.soveratonews.com/fotoblog/liberty
What you need to do now is edit your Pixelpost template and add this code for the next/previous links.
<span class="image-previous"><a href='/fotoblog/<IMAGE_PREVIOUS_SLUG>'>Precedente</a></span>
<span class="image-next"><a href='/fotoblog/<IMAGE_NEXT_SLUG>'>Successiva</a></span>
Giuseppe
09-28-2006, 01:52 PM
Perfect now work. THANKS
But i have three more question about:
1) How do do the same for browse_category.html like your gallery that use always the friendly link?
2) Disable or work as photoslug the click on image?
3) google_sitemap - version 1.0 built sitemap with Post Slug url?
thank you
jaywilliams
09-28-2006, 02:16 PM
1) How do do the same for browse_category.html like your gallery that use always the friendly link?
This requires some modification of the Pixelpost code.
Open up your modified index.php file.
Go to line 724.
you should see this code:
$lookingfor = 1;
$query = mysql_query("SELECT 1,id,headline,image,datetime FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime<='$cdate') ORDER BY datetime desc");
}
while(list($count,$id,$title,$name,$datetime) = mysql_fetch_row($query))
{
if( $count != $lookingfor ) continue; // Major hack for the browse filters.
$title = pullout($title);
$title = htmlspecialchars($title,ENT_QUOTES);
$thumbnail = "thumbnails/thumb_$name";
$thumb_output .= "<a href=\"$showprefix$id\"><img src=\"$thumbnail\" alt=\"$title\" title=\"$title\" class=\"thumbnails\" /></a>";
}
now copy-paste this "modified" code over that code.
$lookingfor = 1;
$query = mysql_query("SELECT 1,id,headline,image,datetime,slug FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime<='$cdate') ORDER BY datetime desc");
}
while(list($count,$id,$title,$name,$datetime,$slug ) = mysql_fetch_row($query))
{
if( $count != $lookingfor ) continue; // Major hack for the browse filters.
$title = pullout($title);
$title = htmlspecialchars($title,ENT_QUOTES);
$thumbnail = "thumbnails/thumb_$name";
$thumb_output .= "<a href=\"/fotoblog/$slug\"><img src=\"$thumbnail\" alt=\"$title\" title=\"$title\" class=\"thumbnails\" /></a>";
}
See if that fixes it for you.
2) Disable or work as photoslug the click on image?
That's easy to do.
Simply open up your template and edit the image link.
<a href="/fotoblog/<IMAGE_PREVIOUS_SLUG>">
[...IMAGE_CODE...]
</a>
3) google_sitemap - version 1.0 built sitemap with Post Slug url?
I haven't used that addon, so I am not sure how it is built. Maybe the author of that addon could assist you?
Giuseppe
09-28-2006, 02:34 PM
Thank you very much jaywilliams :-)
First is ok.
For the second option that work fine with your suggestion i prefer to disable link on image.
... and now go b---ak balls with the sitemap the third.:rolleyes:
Giuseppe
09-29-2006, 08:54 AM
Little problem:
now when i go in specific category all thumb point to last image.
There is somthing to do.
thxs
jaywilliams
09-29-2006, 01:01 PM
Little problem:
now when i go in specific category all thumb point to last image.
There is somthing to do.
thxs
I'll have to investigate it further, but at the moment I'm a bit to busy.
You can revert to the original code in the meantime. (or you can just re-upload my PostSlug index.php)
Giuseppe
09-29-2006, 07:14 PM
Thanks for the time you spent for me:) , now don't use your addons, but i subscribe to this TD when somthing go on i will be back.
bye
Hi
Just wondering
I am getting
Post Slug Patch: NOT INSTALLED
Post Slug Database: OK
The primary addon install went ok. I can create slug title names. I manually patched my index.php. But I can not use the <addon tag>.
From reading the post, it seems like i need to create a .htaccess file. Does anyone have an example. The ones I found on the web, I am not sure they are correct.
Thanks for any all help,
Yvonne
jaywilliams
10-21-2006, 03:04 PM
I am getting
Post Slug Patch: NOT INSTALLED
Post Slug Database: OK
The primary addon install went ok. I can create slug title names. I manually patched my index.php. But I can not use the <addon tag>.
Have you tried my pre-patched index.php file yet?
http://members.atlantic.net/~john1957/admin_PostSlug_1_beta_PATCH.zip
(Make a backup of your current index.php file, and then upload my modified one to take its place.)
If the patch was installed properly, you should then be able to access you photos via this url:
index.php?photoslug=[your_photoslug_name]
From reading the post, it seems like i need to create a .htaccess file.
Creating a .htaccess file is not necessary for the addon to work.
Let me know if you have any other questions. :-)
Hi Jay,
The pre-made index.php worked!! Thank you. Just a quick question. If I wanted to create a permalink for the current page how would that be done?
Thanks,
Yvonne
jaywilliams
10-21-2006, 10:07 PM
If I wanted to create a permalink for the current page how would that be done?
I used the post slug URL as my permalink (example (http://photoblog.dview.us/fall-is-coming))
By using .htaccess you can make permalinks just about anything you want.
If you have a specific way you would like to do the permalinks, just post it and I'll see if I can help you.
Hi Jay,
When looking at your website the slug titles show up at load. This is not happening on my site.
on opening it shows (I tried looking at your source code to see what you are doing that I am doing, but it did not jump out at me.
http://auntyvonne.com/
Permalink Clicked. It shows:
http://auntyvonne.com/index.php?showimage=79
Permalink Code:
<a href="index.php?showimage=<IMAGE_ID>">Permalink</a>
created this line because current image does not show up
pervious
http://auntyvonne.com/index.php?photoslug=yellow-beak
permalink clicked it shows:
http://auntyvonne.com/index.php?showimage=78
Next
works the same way
Current
If the future I will be adding a current link. I am thinking of using this
<a href="index.php" title="Current">Current</a>
Is there a better way of doing this using slug?
Side Note:
I just installed the google-site map addon.
It creates a site map with just the id. Do you think I could blend it with id and slug? Here is the code from that addon
$query = mysql_query("SELECT id,datetime FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime<='$cdate') ORDER BY datetime desc ");
while(list($id,$datetime) = mysql_fetch_row($query))
{
$datetime = strtotime($datetime);
$datetime =date("Y-m-d",$datetime);
$output .= "
<url>
<loc>".$cfgrow['siteurl']."index.php?showimage=$id</loc> <---- this is where I am thinking I could add the slug? What do you think.
Thanks You,
Yvonne
jaywilliams
10-22-2006, 04:07 PM
When looking at your website the slug titles show up at load. This is not happening on my site.
First off, I am using a .htaccess file to make the post slugs load without showing index.php
Creating a .htaccess file in your pixelpost directory with this code should do the trick.
RewriteEngine On
# Post Slug Addon
RewriteRule ^([a-z0-9-]+)$ index.php?photoslug=$1
Secondly, I have my previous next links setup like this:
<span class="image-previous"><a href='<IMAGE_PREVIOUS_SLUG>'>Previous</a></span> <span class="image-next"><a href='<IMAGE_NEXT_SLUG>'>Next</a></span>
You can also use that previous link for the image link as well.
If you want to do a post slug permalink, use code similar to this:
Permalink Code:
<a href="index.php?photoslug=<IMAGE_SLUG>">Permalink</a>
or this if you are useing the .htaccess code:
Permalink Code:
<a href="<IMAGE_SLUG>">Permalink</a>
If the future I will be adding a current link. I am thinking of using this
<a href="index.php" title="Current">Current</a>
Is there a better way of doing this using slug?
That way works, but this way is even cleaner:
<a href="/" title="Current">Current</a>
Maybe it's just me, but I prefer all my links to be as simple as possible. :-)
I'm not currently using the Google maps addon, but this should work...
$query = mysql_query("SELECT id,datetime,slug FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime<='$cdate') ORDER BY datetime desc ");
while(list($id,$datetime,$slug) = mysql_fetch_row($query))
{
$datetime = strtotime($datetime);
$datetime =date("Y-m-d",$datetime);
$output .= "
<url>
<loc>".$cfgrow['siteurl']."index.php?photoslug=$slug</loc>"
You could also modify that url if you are using .htaccess
Hopefully that answers you questions.
Feel free to post again if you need more assistance.
Hi Jay,
Thanks I will give a whirl.
Y
Hi Jay,
Sorry for the dumb basic questions which will follow. I am new to all this an well, making beginners mistakes.
I created the .htaccess file and loaded but still seeing the index.php insted of the slug. What I learned so far from the web and have done...
a) use notepad note wordpad
b) confirmed chmod is 644
c) used ascii to upload
d) placed in my root directory same spot as index.php
Thinks not sure of...
a) web said it will work only on apache. I am on a linux hosting.
b) to i have to enable it or turn it on?
Thanks for any and all help,
Y
Dennis
10-28-2006, 09:58 PM
Hi Jay,
a) web said it will work only on apache. I am on a linux hosting.
b) to i have to enable it or turn it on?
a) Linux hosting is equivalent to Apache webserver, so it will work.
b) no, when the Apache finds the .htaccess code it will use it.
Hope this helps.
boffers
11-01-2006, 03:26 PM
I really love this addon. I am using it on my website: www.offersphoto.com. The thing I am currently also interested in, is integrating this in the thumbnails below the page. Please take a look at the frontpage of my website what thumbnails I mean.
Now I am having trouble with my stats program, to see the amount of visits of the photo: there is a difference between id=# and photoslug in the url because it is not everywhere integrated. This is the same as for the browse page (x=browse). I also tried the the solution jaywilliams offered to Giuseppe (http://forum.pixelpost.org/showpost.php?p=37250&postcount=29) but I get the same problem. Is there a way the post slug can be used everywhere in the website; a full integration? Thanks! :)
jaywilliams
11-01-2006, 03:46 PM
Is there a way the post slug can be used everywhere in the website; a full integration?
Simple answer: Yes.
Long answer:
It's possible alright. If you look at my site (http://photoblog.dview.us/) you will never find a link that uses an id or x. As a matter of fact, you won't even find a .php link on my site.
But to get to this point requires some hacking of the core Pixelpost files as well as the various add-ons that you are using. For a PHP programmer, such as myself, it isn't that difficult to do. But if you've never used PHP it can be a daunting task.
I'll try to help any way I can, time permitting. So if you could, list the add-ons that are currently using the 'incorrect' ID links and I will download them and attempt to patch them myself.
Oh and btw, I've noticed from my site that search engines love the post-slug URLs. They come up MUCH higher in the search results. :-)
boffers
11-01-2006, 04:51 PM
Sounds great Jay :)
For me it is important to have the postslug integrated in:
- www.offersphoto.com - the 9 thumbnails
- http://www.offersphoto.com/index.php?x=browse - all thumnails in the browse sections, with the categories still working (that is wat I reffered to in my posting above, when changing the code like you stated in this topics, the selection of categories won't work anymore)
Do you agree that this are no add-ons, but just the latest version of PixelPost? In this case, I think the integration would be pretty easy, won't it?
The only addon, I think, which also uses the ID in links is the JBGmap: http://www.offersphoto.com/index.php?x=jbgmap.
If I am using more addons then I know, please let me know so I can list all the files of my admin folder. Thank you so much!
Edit: one more place: the RSS feed :)
hi!
can somebody help me with this problem please?
i installed the post slug addon, no error occurs.
Status is:
Post Slug Patch: OK
Post Slug Database: OK
i uploaded the .htaccess file and i tried tu put in for example
"http://www.andreas-huber.at/fotoblog/pseudofliege" which is the same as "http://www.andreas-huber.at/fotoblog/index.php?showimage=71";
The .htacess-File works as it should.
My problem is to get the prev- and next-links working.
I tried all 4 post-slug tags, but it doesn´t work. The last thing i tried is to put the following code into the template:
<a href='/fotoblog/<IMAGE_PREVIOUS_SLUG>'>Precedente</a>
<a href='/fotoblog/<IMAGE_NEXT_SLUG>'>Successiva</a>
But i always get the base-url of my photoblog (http://www.andreas-huber.at/fotoblog/).
Has anybody an idea what i did wrong?
Thanks and best regards,
andreas
Hi A,
I am not sure if this will help, but listed below is how I have used the slug. Good luck.
Y
<a href='<IMAGE_PREVIOUS_SLUG>'>Precedente</a>
<a href='<IMAGE_NEXT_SLUG>'>Successiva</a>
hi!
i tried this yesterday too, i think.
and i tried it now again, maybe today it works :-). but it doesn´t work. :-(
nevertheless thanks
andreas
Hi S,
The links I listed were working prior. I just checked and they are not working for me now. If I figuire it out I will post. I love the image #75. The red eyes are great.
Y
hi!
yvonne:
ok, please let me know if you figure out something new.
yep, 1000s of red eyes are staring at you :-). thanks.
the only thing i have to do in my template is put in these two tags?
does jaywilliams may have an idea? :-)
andreas
Hi S,
I had turned my .htaccess off. I have decided not use the post slug until I can play with it more. I can't seem to get the current concept to work. The code I send you was from Jay. If you read this thread he answered some questions for me. Good luck.
I am using the slug tag with the google site map generated add on and it is working like a charm.
Y
May anyone has an idea what is going wrong with the postslug plugin on my pixelpost installation?
the only links i get are:
http://www.andreas-huber.at/fotoblog/index.php?photoslug=
(you can see them on the bottom of the image_template).
what do i have to do that the postslug names are in the links? the postslug names are in the admin-area and i can reach them when i click on the post-slug link in the backend of pp.
andreas
Giuseppe
11-15-2006, 09:36 PM
Don't know if this can help you:
http://forum.pixelpost.org/showpost.php?p=37193&postcount=17
bye
hi!
now it works. i dont know what the problem was. i removed and installed the plugin a few times and now it works correctly.
thanks everybody in this thread for helping and thanks to jaywilliams for this cool plugin :-)
andreas
Have you tried my pre-patched index.php file yet?
http://members.atlantic.net/~john1957/admin_PostSlug_1_beta_PATCH.zip
(Make a backup of your current index.php file, and then upload my modified one to take its place.)
If the patch was installed properly, you should then be able to access you photos via this url:
index.php?photoslug=[your_photoslug_name]
Great! The patched index.php made it work for me. Thanks for the addon!
Now let me start modifying my brand spankin' new pixelpost site... ;-)
(Edit: corrected my quoting...)
Errrwin
12-05-2006, 09:37 AM
It's all working fine, but I was wondering one thing: would it be possible to generate the clean url's in the (RSS/Atom) feed too? :)
Ask developer about additional tag with such RSS. From my point of view (software and PP developer) it is possible :)
jaywilliams
12-19-2006, 03:33 PM
It's all working fine, but I was wondering one thing: would it be possible to generate the clean url's in the (RSS/Atom) feed too? :)
Yes, it is possible, as a matter of fact, I did it on my photoblog. However it does take some tweaking to the index.php file. And unless you are familiar with PHP, it can be complicated.
Dkozikowski
12-21-2006, 02:52 PM
Very nice addon. Works perfect for me except for a few minor things.
For one, how do I make the wraparound images addon work with this addon? The wraparound images addon code bellow,
<?php
/*
Replaces <NEXT_IMAGE_WRAPAROUND> and <PREVIOUS_IMAGE_WRAPAROUND> with the
links to the next or the previous image repectively. If the last or the first image are reached the image number
is wrapped around.
PLEASE NOTE that for cleanness of the code this solution does not change the Texts of the various names and thumbnails that are
available but introduces it's own Versions of these which are named <TAG_NAME_WRAPAROUND>
*/
$addon_name = "Pixelpost Wraparound Images";
$addon_description = "While Browsing the images this Addon will wrap around the links to the next or previous image when you reach the last/first image, so people can browse the images in an endless loop";
$addon_version = "0.1";
//Get first and last posted (and public) photo to be able to create a wrap around for the image links if necessary
$minphoto = sql_array("select min(id) as minid from ".$pixelpost_db_prefix."pixelpost");
$pixelpost_min_photonumb = $minphoto['minid'];
$maxphoto = sql_array("select max(id) as maxid from ".$pixelpost_db_prefix."pixelpost where datetime<='$datetime'");
$pixelpost_max_photonumb = $maxphoto['maxid'];
//Determination of the photos is done as in the original Pixelpost Version.
//The only difference ist the replacement of the Image IDs when you need to wrap around
// get previous image id and name
$previous_row_wa = sql_array("select id,headline,image from ".$pixelpost_db_prefix."pixelpost where (datetime < '$image_datetime') and (datetime<='$cdate') order by datetime desc limit 0,1");
$image_previous_id_wa = $previous_row_wa['id'];
//Is previous image available? If not wrap around (JP)
if(!isset($image_previous_id_wa)){
$previous_row_wa = sql_array("select id,headline,image from ".$pixelpost_db_prefix."pixelpost where id = '".$pixelpost_max_photonumb."'");
}
$image_previous_name_wa = $previous_row_wa['image'];
$image_previous_id_wa = $previous_row_wa['id'];
$image_previous_title_wa = pullout($previous_row_wa['headline']);
$image_previous_link_wa = "<a href='$showprefix$image_previous_id_wa'>$lang_previous</a>";
$image_previous_thumbnail_wa = "<a href='$showprefix$image_previous_id_wa'><img src='thumbnails/thumb_$image_previous_name_wa' width='$local_width' height='$local_height' alt='$image_previous_title_wa' title='$image_previous_title_wa' /></a>";
// get next image id and name
$next_row_wa = sql_array("select id,headline,image from ".$pixelpost_db_prefix."pixelpost where (datetime > '$image_datetime') and (datetime<='$cdate') order by datetime asc limit 0,1");
$image_next_id_wa = $next_row_wa['id'];
//Is next image available? If not wrap around (JP)
if(!isset($image_next_id_wa)){
$next_row_wa = sql_array("select id,headline,image from ".$pixelpost_db_prefix."pixelpost where id = '".$pixelpost_min_photonumb."'");
}
$image_next_name_wa = $next_row_wa['image'];
$image_next_id_wa = $next_row_wa['id'];
$image_next_title_wa = pullout($next_row_wa['headline']);
$image_next_link_wa = "<a href='$showprefix$image_next_id_wa'>$lang_next</a>";
$image_next_thumbnail_wa = "<a href='$showprefix$image_next_id_wa'><img src='thumbnails/thumb_$image_next_name_wa' alt='$image_next_title_wa' width='$local_width_wa' height='$local_height' title='$image_next_title' /></a>";
$tpl = str_replace("<IMAGE_PREVIOUS_LINK_WRAPAROUND>",$image_previous_link_wa,$tpl);
$tpl = str_replace("<IMAGE_PREVIOUS_THUMBNAIL_WRAPAROUND>",$image_previous_thumbnail_wa,$tpl);
$tpl = str_replace("<IMAGE_PREVIOUS_ID_WRAPAROUND>",$image_previous_id_wa,$tpl);
$tpl = str_replace("<IMAGE_PREVIOUS_TITLE_WRAPAROUND>",$image_previous_title_wa,$tpl);
$tpl = str_replace("<IMAGE_NEXT_ID_WRAPAROUND>",$image_next_id_wa,$tpl);
$tpl = str_replace("<IMAGE_NEXT_TITLE_WRAPAROUND>",$image_next_title_wa,$tpl);
$tpl = str_replace("<IMAGE_NEXT_THUMBNAIL_WRAPAROUND>",$image_next_thumbnail_wa,$tpl);
$tpl = str_replace("<IMAGE_NEXT_LINK_WRAPAROUND>",$image_next_link_wa,$tpl);
?>
ALSO,
i'm using .htaccess so my next and previous links would be
<IMAGE_PREVIOUS_SLUG> and <IMAGE_NEXT_SLUG>
correct?
When I use these tags they dont make a link. Instead, they display the current slug title instead.
Thanks for your help!
jaywilliams
12-22-2006, 01:56 AM
I haven't tried the code below, but it should work without a problem.
Enjoy the Post Slug!
<?php
/*
Replaces <NEXT_IMAGE_WRAPAROUND> and <PREVIOUS_IMAGE_WRAPAROUND> with the
links to the next or the previous image repectively. If the last or the first image are reached the image number
is wrapped around.
PLEASE NOTE that for cleanness of the code this solution does not change the Texts of the various names and thumbnails that are
available but introduces it's own Versions of these which are named <TAG_NAME_WRAPAROUND>
## NOTE: This version has been edited by Jay for the PostSlug Addon ##
*/
$addon_name = "Pixelpost Wraparound Images";
$addon_description = "While Browsing the images this Addon will wrap around the links to the next or previous image when you reach the last/first image, so people can browse the images in an endless loop";
$addon_version = "0.1";
//Get first and last posted (and public) photo to be able to create a wrap around for the image links if necessary
$minphoto = sql_array("select min(id) as minid from ".$pixelpost_db_prefix."pixelpost");
$pixelpost_min_photonumb = $minphoto['minid'];
$maxphoto = sql_array("select max(id) as maxid from ".$pixelpost_db_prefix."pixelpost where datetime<='$datetime'");
$pixelpost_max_photonumb = $maxphoto['maxid'];
//Determination of the photos is done as in the original Pixelpost Version.
//The only difference ist the replacement of the Image IDs when you need to wrap around
// get previous image id and name
$previous_row_wa = sql_array("select id,headline,image,slug from ".$pixelpost_db_prefix."pixelpost where (datetime < '$image_datetime') and (datetime<='$cdate') order by datetime desc limit 0,1"); // Edited by Jay
$image_previous_id_wa = $previous_row_wa['id'];
//Is previous image available? If not wrap around (JP)
if(!isset($image_previous_id_wa)){
$previous_row_wa = sql_array("select id,headline,image,slug from ".$pixelpost_db_prefix."pixelpost where id = '".$pixelpost_max_photonumb."'"); // Edited by Jay
}
$image_previous_name_wa = $previous_row_wa['image'];
$image_previous_slug_wa = $previous_row_wa['slug']; // Added by Jay
$image_previous_id_wa = $previous_row_wa['id'];
$image_previous_title_wa = pullout($previous_row_wa['headline']);
$image_previous_link_wa = "<a href='?photoslug=$image_previous_slug_wa'>$lang_previous</a>"; // Edited by Jay
$image_previous_thumbnail_wa = "<a href='?photoslug=$image_previous_slug_wa'><img src='thumbnails/thumb_$image_previous_name_wa' width='$local_width' height='$local_height' alt='$image_previous_title_wa' title='$image_previous_title_wa' /></a>"; // Edited by Jay
// get next image id and name
$next_row_wa = sql_array("select id,headline,image,slug from ".$pixelpost_db_prefix."pixelpost where (datetime > '$image_datetime') and (datetime<='$cdate') order by datetime asc limit 0,1");
$image_next_id_wa = $next_row_wa['id'];
//Is next image available? If not wrap around (JP)
if(!isset($image_next_id_wa)){
$next_row_wa = sql_array("select id,headline,image,slug from ".$pixelpost_db_prefix."pixelpost where id = '".$pixelpost_min_photonumb."'");
}
$image_next_name_wa = $next_row_wa['image'];
$image_next_slug_wa = $next_row_wa['slug']; // Added by Jay
$image_next_id_wa = $next_row_wa['id'];
$image_next_title_wa = pullout($next_row_wa['headline']);
$image_next_link_wa = "<a href='?photoslug=$image_next_slug_wa'>$lang_next</a>"; // Edited by Jay
$image_next_thumbnail_wa = "<a href='?photoslug=$image_next_slug_wa'><img src='thumbnails/thumb_$image_next_name_wa' alt='$image_next_title_wa' width='$local_width_wa' height='$local_height' title='$image_next_title' /></a>"; // Edited by Jay
$tpl = str_replace("<IMAGE_PREVIOUS_LINK_WRAPAROUND>",$image_previous_link_wa,$tpl);
$tpl = str_replace("<IMAGE_PREVIOUS_THUMBNAIL_WRAPAROUND>",$image_previous_thumbnail_wa,$tpl);
$tpl = str_replace("<IMAGE_PREVIOUS_ID_WRAPAROUND>",$image_previous_id_wa,$tpl);
$tpl = str_replace("<IMAGE_PREVIOUS_TITLE_WRAPAROUND>",$image_previous_title_wa,$tpl);
$tpl = str_replace("<IMAGE_NEXT_ID_WRAPAROUND>",$image_next_id_wa,$tpl);
$tpl = str_replace("<IMAGE_NEXT_TITLE_WRAPAROUND>",$image_next_title_wa,$tpl);
$tpl = str_replace("<IMAGE_NEXT_THUMBNAIL_WRAPAROUND>",$image_next_thumbnail_wa,$tpl);
$tpl = str_replace("<IMAGE_NEXT_LINK_WRAPAROUND>",$image_next_link_wa,$tpl);
?>
Dkozikowski
12-22-2006, 03:19 AM
Thank you for taking your time to do this but I cant seem to get it to work. What tags should i use? I'm using a .htaccess file if that makes a difference.
Dkozikowski
12-23-2006, 02:32 AM
[QUOTE=jaywilliams;37225]This requires some modification of the Pixelpost code.
Open up your modified index.php file.
Go to line 724.
you should see this code:
$lookingfor = 1;
$query = mysql_query("SELECT 1,id,headline,image,datetime FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime<='$cdate') ORDER BY datetime desc");
}
while(list($count,$id,$title,$name,$datetime) = mysql_fetch_row($query))
{
if( $count != $lookingfor ) continue; // Major hack for the browse filters.
$title = pullout($title);
$title = htmlspecialchars($title,ENT_QUOTES);
$thumbnail = "thumbnails/thumb_$name";
$thumb_output .= "<a href=\"$showprefix$id\"><img src=\"$thumbnail\" alt=\"$title\" title=\"$title\" class=\"thumbnails\" /></a>";
}
now copy-paste this "modified" code over that code.
$lookingfor = 1;
$query = mysql_query("SELECT 1,id,headline,image,datetime,slug FROM ".$pixelpost_db_prefix."pixelpost WHERE (datetime<='$cdate') ORDER BY datetime desc");
}
while(list($count,$id,$title,$name,$datetime,$slug ) = mysql_fetch_row($query))
{
if( $count != $lookingfor ) continue; // Major hack for the browse filters.
$title = pullout($title);
$title = htmlspecialchars($title,ENT_QUOTES);
$thumbnail = "thumbnails/thumb_$name";
$thumb_output .= "<a href=\"/fotoblog/$slug\"><img src=\"$thumbnail\" alt=\"$title\" title=\"$title\" class=\"thumbnails\" /></a>";
}
I have done this and it works great when you are viewing the main browse page. Once you select a category it no longer works! It pulls the images and displays them from the category you chose but the links are no longer valid. They do not dislay the post slug and they do not display the ugly url code for that specific image. Instead, every image points to the page that that image's category belongs to.
I can't really explain it but goto my site and choose a category and check your status bar to see what URLs are being produced.
http://www.dwilkinsjr.com/browse
jaywilliams
01-26-2007, 05:54 PM
Due to the large number of people requesting mod_rewrite support for the Post Slug addon, I have now released a special version designed especially for that.
Go here to get the link to the mod_rewrite version:
http://forum.pixelpost.org/showthread.php?t=4915 (http://forum.pixelpost.org/showthread.php?t=4915#1)
splutter
07-06-2007, 09:01 PM
I'm just building a Pixelpost site [ test at http://david-hall.net ] and am using the mod_rewrite - seems to be going well thanks - however... (there is always, just one thing!)
I am using the Pixelgrain addon to show three navigation thumbs and these still use the "index.php?showimage=" linking. I've had a fumble around to try and alter this, but my knowledge is very limited and I can't do it.
It doesn't really effect the operation of the site, as the two links are working alongside each other - just would be nice to have it all running on clean urls - I've put in a Google Search in forlorn hope that this method may work. (I got it working on tumblr.)
Thanks.
Hi there,
Is there a mod-rewrite for 1.7? I noted this is only suitable for 1.5.
Thanks
Karl
jaywilliams
12-11-2007, 10:30 PM
Right now, it's 1.5 only....
But once the final version of Pixelpost v1.7 comes out and I upgrade my photoblog, I will be releasing a new version of Post Slug that is compatible.
FunkyKingston
01-29-2008, 03:40 PM
Hi !
Excuse my english and forgive me if I've missed something but is this addon now available for the 1.7.1 version ?
Cheers !
jaywilliams
01-29-2008, 04:10 PM
I haven't updated it just yet, I've been working on another Pixelpost related project. (Such as a Lightroom plugin to export your photos straight to Pixelpost) But don't worry, I will update it in due time. :)
FunkyKingston
01-30-2008, 07:07 PM
Hi.
Nice ! I just can't wait ! :)
Thank you for your great job, PP was not exactly what I was looking for but it's for me the sexiest photo script I've ever used.
Thx again.
EarlThorfinn
02-03-2008, 10:18 PM
Jay - Love the clean urls on your site, and the photos. Can't wait for the 1.7.1 addon! For me, clean urls will make PP perfect. I've found it's a big factor in SEO.
I really hope the addon gets bundled with the official release, to make installation and future updates as easy as possible.
My thanks again to Team Pixelpost for making this great software!
aquila
02-10-2008, 03:31 PM
I would love to install this addon on a new site I'm building, it just makes things so clean...
If you can use help to do the porting, just let me know!
terje
02-24-2008, 01:51 AM
This is the biggest lack of pixelpost. Once we have proper URLs, PP will be unbeatable. :)
Nagru
03-01-2008, 05:01 PM
Been trying to get this to work for a couple hours now, but can't seem to do it. I'm new to the software -- does anyone have a simple walkthrough on how to actually install and get it running?
Would be extremely grateful :)
jaywilliams
03-01-2008, 06:55 PM
Yea, I originally built the post slug addon for use with Pixelpost v1.5. So obviously, it doesn't work with the latest v1.7.1
And eventually, when I upgrade my photoblog to v1.7.1, I will be releasing a new version of the Post Slug addon as well.
However, in the mean time, using a program such as WinMerge may help to you get it working. http://winmerge.org/
Jowra
04-16-2008, 07:17 PM
Jay, thank you for that mod.
It would be really great if you find the time, to update it to version 1.7.1.
Or could you direct us to which changes must be made? Database things?
Thanks.
Hi,
This addon sounds exactly what I'm after - has anybody succeeded in getting it to work with 1.7.1
Thanks
Finner
12-01-2008, 08:28 AM
Any chance of an update as to the dev status of this addon?
Have been keen to get this for 1.7.1 for quite a few months now :D
jaywilliams
12-01-2008, 01:46 PM
The post_slug addon runs quite well on v1.7.1. The problem is, if you want the clean mod_rewrite urls, you need to add various hacks to the core files, which is a bit messy.
I've partially ported it, well, ported it enough, for use on my photoblog, running 1.7.1, but I was rather hesitant to do a full release, as not every template tag has been ported.
However, if you'd like, I can release what I do have, and you can make any changes you'd like yourself.
kevincrafts
12-02-2008, 12:21 AM
I'd like to see what you have Jay
Finner
12-02-2008, 06:22 AM
I'd like to see what you've got too - I don't mind hacking the core files, although i most likely wouldn't be making any changes to it beyond what's necessary to get it working.
Matthias70
12-07-2008, 07:00 PM
Hi Jay,
I would like to see this plugin working with 1.7.1, too ;-)
Thanks
Matthias
Omar1000
03-12-2009, 10:06 AM
Just to keep this discussion alive. Would be great to have PostSlug for Pixepost171. I think for SEO it is still important.
Any new informations about the PostSlug addon?
rymus
03-24-2009, 12:03 PM
I'd like to add my name to the increasingly large number of posters that are interested in getting this going with a 1.7.1 install :)
piclab
05-13-2009, 11:05 PM
I'd like to add my name to the increasingly large number of posters that are interested in getting this going with a 1.7.1 install :)
I to :)
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.