Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #1  
Old 11-19-2005, 07:08 AM
spazzwig Offline
forum loafer
 
Join Date: Oct 2005
Location: San Francisco, CA
Posts: 8
Talking Addon Request: Categories Mod

Hi, this thread is to bring together ideas for a Category addon that tinyblob has offered to work on.

He already made a great addon called Category Thumbnails (see this thread: http://forum.pixelpost.org/showthread.php?p=18131) from a request I had. This seems like a natural evolution.

Thoughts thus far:

1. Ability to constrict browsing to the category(ies) of the image being viewed.

2. Ability to display "this image is number XX of XX in the XX category" text.

3. Integration of what's already accomplished with the Category Thumbnails addon?


Please post other ideas / wishlist stuff in this thread so we can come up with the features for what will be a great addon

Thanks in advance to tinyblob! Also to anyone else who would like to contribute.
Reply With Quote
  #2  
Old 11-19-2005, 10:11 AM
tinyblob's Avatar
tinyblob Offline
team pixelpost
 
Join Date: Nov 2005
Location: scotland
Posts: 523
All three of those are no problem, i will also add:

4. Category descriptions

So that viewing the "homepage" for that category can have a descriptive header.

Any more suggestions?
__________________
touchnothing.net
Reply With Quote
  #3  
Old 11-19-2005, 10:26 AM
sal Offline
forum loafer
 
Join Date: Sep 2005
Posts: 14
Thumbs up Browsing categories

Hi spazzwig,
you're too fast

So, I wan't to join this request and,
as you have already written, these three points are great to have:
Quote:
1. Ability to constrict browsing to the category(ies) of the image being viewed.

2. Ability to display "this image is number XX of XX in the XX category" text.

3. Integration of what's already accomplished with the Category Thumbnails addon?
Tinyblob's idea to have a category description would make it perfekt.

But (to keep in mind, that pixelpost should stay clean and simple) for me that would be more than enough.

So, thanks a lot in advance to all who would like to spend some time in creating this addon.

regards
sal
__________________
fighting-with-light.com
Reply With Quote
  #4  
Old 11-19-2005, 10:34 AM
spazzwig Offline
forum loafer
 
Join Date: Oct 2005
Location: San Francisco, CA
Posts: 8
I can't really think of anything more either, that seems to add just the right amount of flexibility to categories.

I had a thought regarding #1 (Ability to constrict browsing to the category(ies) of the image being viewed)... I'm not sure what the best approach is here since in the case of multiple categories assigned to images there can be category overlap that would make the browsing jump categories from image to image. Any thoughts (and did that make sense)?

Maybe best to keep the category that you came from to view the image, but then what about when someone follows a link in to the image directly? Or make a provision for setting the dominant category for images that have more than one?

Example - How would you progress through the following? What about when the visiter comes in from a direct link to image02, which category do you constrain the browsing in?:

Image01 - Category01 & Category02
Image02 - Category01 & Category03
Image03 - Category03 & Category05

Personally I haven't been using multiple categories, but I can see where having them could make this a bit complicated...

Last edited by spazzwig; 11-19-2005 at 10:45 AM. Reason: added example
Reply With Quote
  #5  
Old 11-19-2005, 11:11 AM
tinyblob's Avatar
tinyblob Offline
team pixelpost
 
Join Date: Nov 2005
Location: scotland
Posts: 523
You've hit the nail on the head again my friend. But the severity depends on the way people want to display the information.
For example, on my blog i have "Category: [xxxx]" under the photo. It wouldn't be hard to loop through all the results, separating them with line breaks, so i might end up with:
Category: [studio]
Category: [people]
But that won't suit everyone, which is the reason i'm hoping people will explain how they'd like it to appear in their blogs.
__________________
touchnothing.net
Reply With Quote
  #6  
Old 11-19-2005, 06:42 PM
spazzwig Offline
forum loafer
 
Join Date: Oct 2005
Location: San Francisco, CA
Posts: 8
That sounds reasonable to me, probably with the option to choose what to separate with (line breaks, or ability to choose some character like " | ", etc.).

What I see as a bigger challenge is figuring out which thumbnails to display if using the <IMAGE_THUMBNAIL_ROW> nav option on the image page. With the text you can provide choices as above, but seems a bit clumsy to have a separate row of thumbs for each category an image is in.

I have some ideas brewing, interested to hear any thoughts tho.
Reply With Quote
  #7  
Old 11-19-2005, 07:15 PM
tinyblob's Avatar
tinyblob Offline
team pixelpost
 
Join Date: Nov 2005
Location: scotland
Posts: 523
separators would be done with the same principal i used in my new short-notes addon. you can add html which appears before, after, and in-between.

as for the second point.. with good database structure, and the right code, anything is possible. it's just making it user friendly and flexible that's hard

i'll have a look in a little while, just got home and it's VERY cold in scotland today.
__________________
touchnothing.net
Reply With Quote
  #8  
Old 11-20-2005, 05:32 AM
unmake Offline
forum loafer
 
Join Date: Nov 2005
Posts: 10
I managed to get this (category thumbnails for the current image) working by copy+pasting a a bunch of code from the main index.php into an addon.php.

you'll need the block which begins with
Code:
$querystr = "select t1.cat_id,t2.name from " . $pixelpost_db_prefix . "catassoc
...
$query = mysql_query($querystr);
$row = mysql_fetch_row($query);
add something like:
Code:
$thiscategory = $row[0];
below it - that gets you a variable with the current image's category.

then copy this stuff:
Code:
if (function_exists(gd_info)) {
    $gd_info = gd_info();
    if ($gd_info != "")
...
    } // gd_info()
} // func exist
and modify this section:
Code:
        $thumbs_ahead = mysql_query("select 1,t2.id,headline,image,datetime
                              from {$pixelpost_db_prefix}catassoc as t1
                              inner join {$pixelpost_db_prefix}pixelpost t2 on t2.id = t1.image_id
                              where t1.cat_id = '" . $thiscategory . "'
                              AND (datetime > '$image_datetime')
                              AND (datetime<='$cdate')
                              order by datetime asc limit 0,$aheadlimit");
note the addition of the $thiscategory] match. Do the same for $thumbs_behind, and copy one of the thumbnail tags with a tag of your invention.

This will just work on one category, and can probably be done in a cleaner fashion.. but it works
Reply With Quote
  #9  
Old 11-20-2005, 10:29 AM
tinyblob's Avatar
tinyblob Offline
team pixelpost
 
Join Date: Nov 2005
Location: scotland
Posts: 523
unmake, yeah that'll work, good job! however.. it's not the code that's the difficult part, it's the logic and the aesthetics.
brain dump.

Assumption: A photo belongs to multiple categories
Problem: How do we display those categories on the page?
Possible solution: We offer two tags, one for a horizontal list, one for a vertical life. We allow HTML to be added before, after and between the categories being displayed.

Problem: How do we determine which of the categories should be the main one?
Possible solution: Without implementing some kind of weighting system, or modifying the category link table, this is pretty impossible. Even then it would require a hack to the image upload process for it to work effectively. So for the time being it'll be first come first served.

Problem: If you're looking at an image from category X, and you click on another image, which is both in category X and category Y, how does it know which to display?
Possible solution: This is pretty trivial, the current category will be passed in the link. If the image clicked turns out to be in that category, it'll show the rest with preference. The problem is.. if the photo is in two categories.. how does it know which one to pass in the link?

Problem: Image thumbnails should be shown for the category the image belongs to.
Possible solution: Again, not really a problem, as evidenced in my cat_thumbs mod. But, again, the problem is knowing which category to display if a photo is in multiple categories?!
__________________
touchnothing.net
Reply With Quote
  #10  
Old 11-20-2005, 02:58 PM
Sivani Offline
forum loafer
 
Join Date: Nov 2005
Posts: 8
At first I thought I was just wishing for the moon, but then I found an application that showed me it was possible. http://minimalgallery.net/

If you look at the way in which it is implemented there: images can belong to multiple categories, but once you select a category to browse, you browse the images within that category only.

If any image you are viewing belongs to another category, you can choose to change categories to the other one, and then view that category only. (The categories are the "colors" "feelings" "light" etc.)

Perhaps if there was a variable that stored "selected_category" and passed that from image to image, rather than selecting the category from the image?

(I don't know whether that is feasible. I have never coded php - my dayjob is coding C++, Java and Python :-) )
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 06:18 PM.

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