Tags Album

cinpou
cinpou's picture

Joined: 2009-05-10
Posts: 5
Posted: Mon, 2009-05-11 08:15

Hi!

I'm creating a module for gallery3 to manage and organize master tags.
It can create categories of tags like "people" "places" "events" and sub-categories (familly, friends, birthday,...)
I think it's a good way to navigate through the tags (like f-spot)

I've played with gallery3 all the week-end and begin to understand how it works (very nice system!), but i can't add an admin panel for the master tags manager (/admin/tagsalbums)

could you give me something to read about this or give me a topic?

in another way, do you prefer that i create a new module or edit the "tags" module?

thx

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2009-05-11 17:05

To make an admin controller that responds to the admin/mastertags url, create a file called "admin_mastertags.php" in any controllers directory (you probably want to put it in the controllers directory of your new module) containing:

<?
class Admin_MasterTags_Controller extends Admin_Controller {
  public function index() {
    print "<h1>Hi</h1>";
  }
}
?>

You can look at the other admin controllers to get an idea of how they work. Happy to answer questions for you.

 
cinpou
cinpou's picture

Joined: 2009-05-10
Posts: 5
Posted: Mon, 2009-05-11 22:24

Thanks!

I can discover a bit more of the capacities of Kohana.

I allready read the database, it becomes to be funny.

I probably post later about the way to create a visual tree, manage it (show or hide a children), and move a child in a parent.

Cheers

 
cinpou
cinpou's picture

Joined: 2009-05-10
Posts: 5
Posted: Sun, 2009-05-17 10:33

Then, i searched a lot since my last comment.
I know to manipulate a bit ORM now, and make sql request, but i can't organize my tree...

I wanted to view a tree like this:

-> People (tagalbums, id=1, parent_id=0)
   -> Friends (tagalbums, id=2, parent_id=1)
      ->Name1 (tagalbums, id=3, parent_id=2)
            ->List of items with tags People+Friends+Name1
      ->Name2 (tagalbums, id=4, parent_id=2)
            ->List of items with tags People+Friends+Name2
      ->Name3 (tagalbums, id=5, parent_id=2)
            ->List of items with tags People+Friends+Name3
      -> Family (tagalbums, id=6, parent_id=1)
            ...etc...
      -> Events (tagalbums, id=27, parent_id=0)
            ...etc...

Could you give me a way to create and display this tree in a menu?(a "order by id" is of course unappropriate...)

Finally i don't know if it's possible. I found an article from NinjaPenguin about Orm_tree, but not enough explanations for my level...

I also ask this question in the Kohana forum, but no answer...

Thanks for your help!

Thanks

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2009-05-17 21:30

Gallery 3 uses ORM_MPTT to manage an MPTT tree, which we find pretty efficient. I'm not entirely clear about what it is that you're doing here so I'm not sure that I can recommend either ORM_Tree or ORM_MPTT for you. I suggest that you start off small instead and work your way up to something harder. Probably the easiest way to start would be to just create one level of tags for now and make things work with that, then we can look at your code and help you create a tree structure on top of it. How does that sound?

 
cinpou
cinpou's picture

Joined: 2009-05-10
Posts: 5
Posted: Tue, 2009-05-19 05:41

Thanks for your response, i'll read more about MPTT tree.

You can have a look on my gallery:
http://atlantice.hd.free.fr/gallery3

I send you my module.

Thanks. I'm waiting for your advice!

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2009-05-30 00:30

Now that we've moved to git, the best way for you and I to work on this would be for you to create a fork of Gallery3 on GitHub and then I can fork your code and we can work together on making changes. I looked over your zip file and it's mostly just a clone of the tag module so I'm not sure what I can review here. Your site isn't loading for me currently so I can't test it out :-/ Let me know when you've got a clone up on github and there's something for me to look at and I'll help.

---
Gallery 3 problems? Check gallery3/var/logs before you post!
Gallery 3 latest code: http://github.com/gallery/gallery3/zipball/master
Gallery 3 from git: http://codex.gallery2.org/Gallery:Using_Git

 
cinpou
cinpou's picture

Joined: 2009-05-10
Posts: 5
Posted: Sat, 2009-05-30 09:00

thx!

sorry for the url, i've a problem with my server, i have to turn it off this night, that's probably why you can't access to my gallery.

i'm working on another subject (a nice interface for a smf forum with jquery), i will advance a bit more in June.

i use the tag module to begin, but it create a different sql tab, and a different display...