PDA

View Full Version : Addon Request: Categories Mod


spazzwig
11-19-2005, 07:08 AM
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 :D

Thanks in advance to tinyblob! Also to anyone else who would like to contribute.

tinyblob
11-19-2005, 10:11 AM
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?

sal
11-19-2005, 10:26 AM
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:
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. :D

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

spazzwig
11-19-2005, 10:34 AM
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...

tinyblob
11-19-2005, 11:11 AM
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.

spazzwig
11-19-2005, 06:42 PM
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.

tinyblob
11-19-2005, 07:15 PM
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.

unmake
11-20-2005, 05:32 AM
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
$querystr = "select t1.cat_id,t2.name from " . $pixelpost_db_prefix . "catassoc
...
$query = mysql_query($querystr);
$row = mysql_fetch_row($query);
add something like:
$thiscategory = $row[0];
below it - that gets you a variable with the current image's category.

then copy this stuff:
if (function_exists(gd_info)) {
$gd_info = gd_info();
if ($gd_info != "")
...
} // gd_info()
} // func exist
and modify this section:
$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 ;)

tinyblob
11-20-2005, 10:29 AM
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?!

Sivani
11-20-2005, 02:58 PM
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 :-) )

Sivani
11-20-2005, 04:38 PM
While I am wishing out loud...

This would probably be a different add-on, but perhaps someone can point me to an existing one (if any).

For those of you familiar with Movable Type: it has a power editing mode where all the posts are listed with editable fields for title, date, some settings and categories.

It would be great if the "images" under admin had a similar feature, especially for those times when you upload a whole lot of images automatically, or when you decide to reorganize your categories, adding some and deleting others.

Ideally it would work something like this, where _x_ means x is editable.

[img] _Title_ _Date_ _dropdownlist_of_categories_ filename.jpg _delete_

This would mean one would have to edit the old-fashioned way to add a text description or change the thumbnail, but everything else can be changed for several images at once, making the process a whole lot less painful.

So, does this exist? If not, should I post a separate add-on request? Is it something that would be appealing to others?

Thanks,

Sivani

tinyblob
11-20-2005, 04:39 PM
Sivani, thanks for the URL i'll check it out later.
That's the basic premise i'm going with. Which will be useful for people like spazzwig, who will have a categories page in forefront.

Your solution might look something like this:

This image is 1/10 in the Studio category.
This image is also in the following categories:
Light | Colour | People | Portraits

But again, which category do you use as the default if one hasn't been passed in the URL?

I should really have coded this today...

Sivani
11-20-2005, 05:07 PM
But again, which category do you use as the default if one hasn't been passed in the URL?

Whichever was the last category passed, I would guess. If none were passed, use "all," which allows the standard pixelpost viewing through everything.

IOW, remember the last selected category.

If (selected_category==NULL):
selected_category="all"

tinyblob
11-21-2005, 01:08 PM
I'm actively working on this addon as of today.. but it won't be released till after Pixelpost v1.5 debuts, as it is taking advantage of some new features which you'll all enjoy.
Those of you who have requested this mod, i'd appreciate dummy pages or fake screenshots to let me see how you're visualising this working for you. That way i can tailor the addon around your needs as preference.

tinyblob
11-22-2005, 10:32 AM
Good news.
As of about 3 minutes ago, the main requirements of this Addon are now complete.

I'm successfully constraining image browsing on the main page to the current category. It breaks down as follows:

The "homepage" works as usual, unless a category is selected. If one has been selected, then only thumbnails from that category are displayed. Clicking the image takes you to the next image in that category.

There's a new tag, which creates text stating something along the lines of:
"This image is 1/20 in the [studio] category, it also belongs in [people], [portraits] and [mono]".
Which relates to the currently displayed image. Anything in square braces is a link.

I also added category descriptions, which are simply added as a tag, wherever you want them to display.

There are several possible ways to select categories.

You can use a tag to display them on the page, which pulls them from the database and formats them however you want. This solution is good because it's dynamic, and will obviously be updated when/if you add more categories. The addon allows you to add HTML.

You can hard code them in your template. Useful if you want to add graphics or whatever. This is a good solution for those that aren't going to add categories randomly, and who want to use an intricate design.

You can also get to them through the text which displays the categories the current image belongs to.

Although it's working, i'm still not finished with the addon. Thanks to our industrious leader, i'm working with a dev version of v1.5, so i should be able to release the addon very soon after v1.5 launches.

Expansion:
I'm going to be adding controls to the administration section. These MIGHT involve hacks to the normal pages, for example, adding category descriptions and possibly picking default categories when posting images. But we'll see how it goes.
I also MIGHT add facility to upload "header" graphics for categories, this would play nice alongside the descriptions. Again, we'll see.
Last but not least, i may add facility whereby a categories selection screen loads as default, rather than the current "home" page. For those of you that want category selection to be your main focus. People running portfolio sites or commercial websites might find this useful.

Note:
Apart from Sivani i've had NO direct feedback about this addon. Unless people let me know what they want and think, i'll be going with the bare minimum compliment of features that i think is suitable. There's a fair chance i wont even be using this addon myself. So please, let me know what you're thinking.

Sivani
11-22-2005, 04:13 PM
Has anyone told you lately that you are a marvel?

It sounds as if you are doing a fantastic job; I can't wait until v1.5 is release ready.

(Any chance that this will be rolled into v1.5 along with some other addons like "New Copy Folder" etc?)

tinyblob
11-22-2005, 05:05 PM
I would assume not. I imagine the addons released with Pixelpost are all written by the dev team. I'm not part of the team so it might be troublesome to chase up any problems that might exist.
Plus, i'm trying to make it modular.. Several addons, so people can pick and choose what they want. So it might be quite confusing to have a few addons in there. Plus, the category description "addon" will actually be a hack. So that wouldn't be included.
If the dev team want to include addons they will, but i imagine they'd want addons that had proven themselves over time.
I'll keep you posted.

sal
11-22-2005, 09:26 PM
Hi tinyblob,
I haven't found the time to read a lot in this forum.
Now that I have some quiet minutes to read and write, I'm totally surprised how far the things have gone in this special thread...
You have completed the addon? Wow! I never thought that this could be done so quick. You must be a genious ;)

Yes, I feel ashamed that I didn't spend much time here and offer help.
(In fact i could not help very much because I know almost nothing about that PHP stuff - I have completely trust in you.)
But I could have given some feedback...

Well, Sivani described it perfectly:
Is it possible to allow users to select a category and then let them browse through that category on the main page (image_template.html)? In other words, once a category has been selected, clicking the image would take them to the previous item within that category?
I couldn't say it better.

What you write know about your results sounds great.
I'm very curious and can't wait until its relaese...
I also tried your other addon (Category Thumbnails) and it works great out of the box.
So I'm sure, you made again a good job.
Thank you very much for spending your time on this...

regards
sal

tinyblob
11-22-2005, 09:33 PM
once i've ironed out some bugs, i'll upload a preview version for you guys to look at ;)

spazzwig
11-23-2005, 09:54 AM
Wow, this looks great! A lot happened while I was gone... tinyblob you rock. This looks great.

Just wanted to get a kudos in now that I'm back. I'll post again after I've gathered my thoughts together.

Thanks again!

ttlive
12-07-2005, 06:18 PM
amazing,fantastic,marvelouse!! :)

I might not need the category description but if I don't have to use it I don't care. :)

Everything else I read in this thread is just what I' m waiting for.. :)

Dada
12-28-2005, 10:15 AM
hey there! i'm anxiously reading about the one thing i really do miss with pixelpost - categories! I need a combi of a blog and a gallery, so this would be perfect.

any news when it will be available? if there ist a kind of a beta test i will glady sign up :-)

regards,
dada

ook
01-06-2006, 03:23 PM
Just thought I would post my thoughts here as well. I'm really looking forward to being able to have galleries that are based off of categories. Indeed it would seem that the future of a feature like this would be to allow people to log in and restrict or allow access to certain categories.

- ook

spipasucci
01-26-2006, 02:51 PM
Throwing in my 2 cents as well...Really looking forward to this. Even just bare bones functionality like this would be welcome...

Tilnox
01-31-2006, 10:15 AM
i would love to have this:
http://www.absenter.org/
if you view some of the photos you would notice the table under changes colors
i would love to have that on my pixelpost site!

rekkid
01-31-2006, 07:49 PM
i would love to have this:
http://www.absenter.org/
if you view some of the photos you would notice the table under changes colors
i would love to have that on my pixelpost site!


look into the background color changer plugin. you dont have to use it for your background

Tilnox
02-10-2006, 08:25 AM
where is it?? i can find it!!

Tilnox
02-10-2006, 08:33 AM
found it
http://www.pixelpost.org/v1/index.php?x=downloads&details=119

ttlive
05-01-2006, 09:57 AM
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?

I am not looking for the "background color changer".. ist the "category browsing" already somwhere available?

I just changed to 1.5 and now I just wonder what I could integrate within the next weeks/month on my side.

GeoS
05-01-2006, 10:13 AM
There is only something like this:
http://www.pixelpost.org/v1/index.php?x=downloads&details=156

meesh
05-24-2006, 05:15 AM
where can we download this addon? (for the categories?)

jdleung
05-24-2006, 06:07 AM
where can we download this addon? (for the categories?)
:confused:

right on the 30th floor. just before your post!