Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #1  
Old 03-10-2006, 10:02 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
Lightbulb Addon: GeoS Show Category ADDON

Name:
GeoS Show Category ADDON

DESC:
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:
http://www.xoverip.info/pb/


Installation:
Just copy it to addons directory. Then add proper tags to your image_template.html and browse_template.html files and thats all.

Available tags:
<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

Addon page:
http://www.pixelpost.org/extend/addo...show-category/

Download:
http://www.pixelpost.org/extend/addo...show-category/

History 57:[*]Fixed alternative language support (thx KArin)

History 55:
  • New tag - <SC_CATEGORY_LINKS_AS_LIST_PAGED> - gives the list with links to categories redirecting to the newest image in selected cat. It shows also the number of images in bracket. (thx to Vernon Trent for inspiration)
  • Now there is no need to set any configuration inside addon code - all data are stored in DB.
  • Added support of bilingual category names - based on Pixelpost 1.6 (thx goes to luxtom)
  • Added tags for filename of next and previous thumbnail - <SC_IMAGE_PREVIOUS_THUMB_NAME> and <SC_IMAGE_NEXT_THUMB_NAME> (this time thx also goes to luxtom)

History 46:
History 31:
  • fixed buggy redirection to the first image (now it doesnt redirect to images from future set)
  • fixed another bug with for first IF statement
  • small code optimization

History 30:
  • fixed bug with link to "next" subpage in browse template (thx to budgie)

History 28:
  • finally finished full multicategory show support (now it also works where user is going from browse template to image template)
  • now archive has got sample template using all features of addon
  • fixed bug with images not ordered descending by date in one of cases in browse mode

History 25:
  • fixed bug of not showing thumbnails in browse_template (thx to ullmannn)
  • fixed bug of incorrect version numbering

History 24:
  • at first here it is - new method of version numbering as I'm currently using SVN in my development process
  • all who use this addon also in archives now they can use paging support - there is 1 new tag &lt;SC_THUMBNAILS_NAV&gt; which gives page navigation through thumbnails in browse_template
  • now inside selectable list with categories active one is marked
  • all unique elements visible in HTML code have own ID or class (if there is more same elements)
  • as some of users were saying about problems with chr(10) at ends of lines now there isn't such solutions
  • as archive now supports links with multiple categories next point on TODO list is to add such support in image preview mode (currenly there is no way to go from archive and watch just selected categories straight from it; there is such option only at start watching images from image preview navigation)

History 1.6:
  • 2 new tags <SC_THUMB_ROW> and <SC_THUMB_ROW_REV> which gives option to put row of thumbnails with same category as current; there is additional configuration variable $sc_th_row for enable/disable this future

History 1.5.1:
  • fix SQL query for categories dropdown list which now does not give option to go to image which is not public available (thx RobbieMc)

History 1.5:
  • tags which are not anymore present: <SC_IMAGE_NAME>, <SC_IMAGE_TITLE>, <SC_IMAGE_ID>, <SC_IMAGE_DATETIME>, <SC_IMAGE_DATETIME_FORMATTED>, <SC_IMAGE_NOTES>, <SC_IMAGE_NOTES_CLEAN>, <SC_IMAGE_NOTES_NO_MARKDOWN>, <SC_IMAGE_WIDTH>, <SC_IMAGE_HEIGHT>, <SC_IMAGE_THUMB_WIDTH>, <SC_IMAGE_THUMB_HEIGHT>, <SC_IMAGE_CATEGORY>
  • now there are comments to code
  • now previous & next title when are empty are set with proper text for it - No Previous Image & No Next Image (thx to RobbieMc)
  • code for showing first image in category (when URL has got only category variable in query string) is optimized - instead of additional SQL querys and code for additional tags there is redirect to show image in "standard" way; this makes enable EXIF and whole rest of futures which were available before installing this addon and before case which we are talking in this point
  • starting from this version there is archive to previous version for people who wants to get older versions (from many reasons) - this will be a standard for all my new developed addons

History 1.4:
  • Added new tags for description of current image: <SC_IMAGE_NAME>, <SC_IMAGE_TITLE> <SC_IMAGE_ID>, <SC_IMAGE_DATETIME>, <SC_IMAGE_DATETIME_FORMATTED>, <SC_IMAGE_NOTES>, <SC_IMAGE_NOTES_CLEAN>, <SC_IMAGE_NOTES_NO_MARKDOWN>, <SC_IMAGE_WIDTH>, <SC_IMAGE_HEIGHT>, <SC_IMAGE_THUMB_WIDTH>, <SC_IMAGE_THUMB_HEIGHT>
  • Added new tag <SC_IMAGE_CATEGORY> for category list to which belongs current image
  • Added new tag <SC_THUMBNAILS> for browser template usage with all futures available in my addon; there is additional configuration variable $sc_browse_cat for enable/disable this future (thx for inspiaration to RobbieMc)
  • Now tag <SC_CAT_NAME> is set to "every category" when we are not watching one of available categories (thx to RobbieMc)

History 1.3:
  • Added new tags <SC_IMAGE_PREVIOUS_DATETIME_FORM> and <SC_IMAGE_NEXT_DATETIME_FORM> for formated date of previous and next image
  • Added new tag <SC_BROWSE_CATEGORY> which gives form with selectable category (thx for inspiaration to RobbieMc)
  • Added configuration variables inside script which tell if code for form with selectable category should be executed (for this who dont use this form it will speed up addon) and if you want to get current image ID under sc_image_next_id or sc_image_previous_id when you are watching image at one of ends (once more time thx to RobbieMc)

History 1.2:
  • Added new tag for category ID <SC_CAT_ID> (thx RobbieMc).
  • Bugfix of next links problem (thx jdleung)

History 1.1:
  • First public version
__________________
photoblog | portfolio | addons | Donate

Last edited by GeoS; 11-07-2007 at 08:53 PM.
Reply With Quote
  #2  
Old 03-10-2006, 11:34 PM
RobbieMc Offline
pp veteran
 
Join Date: Feb 2006
Location: Canada
Posts: 78
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.
Reply With Quote
  #3  
Old 03-11-2006, 12:22 AM
jdleung Offline
pixelpost guru
 
Join Date: Feb 2006
Location: Foshan, China
Posts: 553
Thumbs up

SMART IDEA!
GREAT ADDON!
__________________
jdleung's.com @ flickr @ fotoblogs.cn & Addons:Month Calendar & Slideshow & Flickr comment & Modified Addon: Calendar
Reply With Quote
  #4  
Old 03-11-2006, 06:36 AM
blinking8s's Avatar
blinking8s+ Offline
über loafer
 
Join Date: Oct 2004
Location: Bowling Green, Ky
Posts: 3,428
Send a message via ICQ to blinking8s Send a message via AIM to blinking8s Send a message via MSN to blinking8s Send a message via Skype™ to blinking8s
nice, this has been in high demand for a while, i'll have to check it out when i get home
__________________
i should say more clever stuff
Reply With Quote
  #5  
Old 03-11-2006, 09:21 AM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
Quote:
Originally Posted by RobbieMc
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.
Good questions - it is what I was waiting for

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)
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #6  
Old 03-11-2006, 02:27 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
There was an update:

Quote:
History 1.2:
1. Added new tag for category ID <SC_CAT_ID> (thx RobbieMc).
2. Bugfix of next links problem (thx jdleung).

History 1.1:
1. First public version
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #7  
Old 03-12-2006, 01:43 AM
jdleung Offline
pixelpost guru
 
Join Date: Feb 2006
Location: Foshan, China
Posts: 553
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;
}

Have fun.

Thanks again,GeoS.
__________________
jdleung's.com @ flickr @ fotoblogs.cn & Addons:Month Calendar & Slideshow & Flickr comment & Modified Addon: Calendar
Reply With Quote
  #8  
Old 03-12-2006, 03:14 AM
RobbieMc Offline
pp veteran
 
Join Date: Feb 2006
Location: Canada
Posts: 78
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.
Reply With Quote
  #9  
Old 03-13-2006, 01:56 AM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
There is an update.

Quote:
History 1.3:
1. Added new tags <SC_IMAGE_PREVIOUS_DATETIME_FORM> and <SC_IMAGE_NEXT_DATETIME_FORM> for formated date of previous and next image
2. Added new tag <SC_BROWSE_CATEGORY> which gives form with selectable category (thx for inspiaration to RobbieMc)
3. Added configuration variables inside script which tell if code for form with selectable category should be executed (for this who dont use this form it will speed up addon) and if you want to get current image ID under sc_image_next_id or sc_image_previous_id when you are watching image at one of ends (once more time thx to RobbieMc)
1) Now you (RobbieMC) got variable for it in configuration part.
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.
__________________
photoblog | portfolio | addons | Donate

Last edited by GeoS; 03-26-2006 at 07:19 AM.
Reply With Quote
  #10  
Old 03-13-2006, 03:40 AM
RobbieMc Offline
pp veteran
 
Join Date: Feb 2006
Location: Canada
Posts: 78
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.

Rob
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 12:01 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs