Addon: GeoS Show Category ADDON
GeoS Show Category ADDON
This addon gives you possibility to watch images on front page within choosen category.
To do so you need to add extra variable to standard URL - category=CAT_ID.
I.e. URL should look like http://piotrgalas.com/index.php?show...00&category=10 - this will give you possibility to watch only images from caterogy with ID = 10
For URLs without specified category variable it works normally just like standard Pixelpost.
Plugin inspreated by jdleung needs - thx :)
PS In all my "fresh" addons there is always Paypal button thanks to which you can donate process of creating next releases of it. The amount of money doesnt matter - the most important for me is to see its worth to sleep less, to read about new technologies, to search new solutions and think about new ideas.
People ask where they can see it online. Right now I dont know any place where current version is running BUT very similar to this release you can see at Vernon Trents site. The only difference is that its one month old and released in unofficial way, especially for him. Take a look:
Just copy it to addons directory. Then add proper tags to your image_template.html and browse_template.html files and thats all.
<SC_IMAGE_PREVIOUS_ID> - gives ID of previous image
<SC_IMAGE_PREVIOUS_NAME> - gives filename of previous image
<SC_IMAGE_PREVIOUS_TITLE> - gives title of previous image
<SC_IMAGE_PREVIOUS_DATETIME> - gives date and time of previous image
<SC_IMAGE_PREVIOUS_DATETIME_FORM> - gives formated date and time of previous image
<SC_IMAGE_PREVIOUS_LINK> - gives link to previous image (just first part of HTML code - <a href=...>)
<SC_IMAGE_PREVIOUS_LINK_TXT> - gives text link to previous image (linked Previous text from localization file)
<SC_IMAGE_NEXT_ID> - gives ID of next image
<SC_IMAGE_NEXT_NAME> - gives filename of next image
<SC_IMAGE_NEXT_TITLE> - gives title of next image
<SC_IMAGE_NEXT_DATETIME> - gives date and time of next image
<SC_IMAGE_NEXT_DATETIME_FORM> - gives formated date and time of next image
<SC_IMAGE_NEXT_LINK> - gives link to next image (just first part of HTML code - <a href=...>)
<SC_IMAGE_NEXT_LINK_TXT> - gives text link to next image (linked Next text from localization file)
<SC_CAT_ID> - gives ID of current category
<SC_CAT_NAME> - gives name of current category
<SC_BROWSE_CATEGORY> - gives form with selectable category
<SC_THUMBNAILS> - gives thumbnails with it's category in link for browse_template
<SC_THUMBNAILS_NAV> - gives page navigation through thumbnails in browse_template
<SC_THUMB_ROW> - gives thumbnails row for image_template (if THUMBNAILROW in admin section is even then it's value will be incement by 1)
<SC_THUMB_ROW_REV> - gives thumbnails row, in reversed order, for image_template (if THUMBNAILROW in admin section is even then it's value will be increment by 1)
<SC_CATEGORY_LINKS_AS_LIST_PAGED> - gives list of categories linked to the newest image in category
<SC_IMAGE_NEXT_THUMB_NAME> - gives back filename of next thumbnail
<SC_IMAGE_PREVIOUS_THUMB_NAME> - gives back filename of previous thumbnail
History 57:[*]Fixed alternative language support (thx KArin)
This looks great, GeoS, exactly what I was looking for. I have a few questions though about implementation. How do you pass the CAT_ID variable from the first image viewed to the next? I can get the SC_IMAGE_ID to pass the next image in that category, but as soon as the page loads, the CAT_ID is lost. It needs a tag for CAT_ID but I can't find reference to one? Am I missing something here? Thanks.
nice, this has been in high demand for a while, i'll have to check it out when i get home
1. Today Ill try to add CAT_ID tag - its easy to do so at evening (my time is CET) there will be update.
2. Instead of linking only by SC_IMAGE_NEXT_ID it would be better to use prepared tag with link: SC_IMAGE_NEXT_LINK (which gives you <a href=...>) or its text version SC_IMAGE_NEXT_LINK (which gives whole text link with localizated string - <a href=...>Next</a> for english, <a href=...>Nastepny</a> for polish and so on)
There was an update:
my original intention is that first showing my favorite images(specified category) in the front page,and then visitors can choose to go into my blog site which is ordered by datetime(normal PP). So I'm thinking how to automatically show category image when the first page loaded.
and GeoS gave me a suggestion adding this:
if(!isset($_GET["category"])) $_GET["category"] = My_category_id ;
it works,but when I want to show images ordered by datetime without any category,it always goes to the specified category.
and the above code from Geos give me inspiration, and find codes in index.php, so add like this:
if (!isset($_GET['showimage']) && !is_numeric($_GET['showimage']) && !isset($_GET["category"]))
if(!isset($_GET["category"])) $_GET["category"] = My_category_id;
Thanks, GeoS, for the CAT_ID tag. This is damn near perfect now. I have, however, a few more observations about integration:
1) Thanks for the tip on using <SC_...TXT>. That is fine on the navigation bar, but what about the image link itself? I use <a href="index.php?showimage=<SC_IMAGE_PREVIOUS_ID>&a mp;category=<SC_CAT_ID>" which passes the catgeory to the next image, but does seem to have one small glitch. When you arrive at the first image in that category, it returns a empty ID, which causes a "Not Found" error message. Would it be possible to have the _PREVIOUS_ID> and _NEXT_ID> tags return the same image id if there are no more in the category (like the <IMAGE_PREVIOUS_ID> appears to do.) or perhaps the most recent again?
2) As I said, this addon now has all the functionality to allow browsing within a category, but you still need to get the CAT_ID into the URL. This can be hardcoded I know, but I have two new requests :-) that would make this perfect:
a) A new <SC_THUMNAILS> tag that would pass both the Image id and the category ID to the image page when a thumbnail is clicked. If "ALL" is selected in catgeory, then the ID would be empty and the image page would act as a blog;
b) The second one may be a little more controversial (because it starts to move away from the blog format) but I could see a new <SC_BROWSE_CATEGORY> tag that would add a drop down menu to the image page that would pass an image ID and category ID to the URL to begin restricting browsing. This one might be trickier because you would have to change the image as well, and I suspect the best change would be to load the latest image in that category. I could certainly live without this feature but would be quite happy to have the SC_THUMBNAILS.
Thanks again for all the great work.
There is an update.
Going back to this topic - you got SC_IMAGE_NEXT_LINK_TXT AND SC_IMAGE_PREVIOUS_LINK_TXT which shows up only if there are some pictures.
You can use SC_IMAGE_NEXT_LINK AND SC_IMAGE_PREVIOUS_LINK just like above but for rest of non-text elements (i.e. for images linking).
2) a) - I left it for future release
2) b) - Now it is implemented. I was trying to get one smart query for MySQL < 4.1 for a whole day but I didnt found such. There is only "small" automatic optimalization for MySQL >= 4.1 which speeds up query ~10%.
PS By default configuration is set to disable 1) and 2) b). Not everyone wants such behaviour and slower scripts.
Thanks again GeoS, for the script and for the amazing turnaround. I now have everything I need to finalize the blog template for my wife (the real photographer). I will post a link when I am done and it is live.
Long live PP.
|All times are GMT. The time now is 07:36 PM.|
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.