i have og:galleries installed, created some images , they work fine, but, how are group members (or even non-group members) access the galleries, the module doesn't crete any menu item or block for this purpose, the only way is trought the "galleries" tab en the ghp, but only the group admin can view that, i've looked up and found this code to create a block that lists taxonomy terms:

$vid = 1; /* <---- put correct vocabulary ID here */
$terms = taxonomy_get_tree($vid);
print "<div class=\"item-list\">";
print "<ul>";
foreach ( $terms as $term ) {
$tcount = taxonomy_term_count_nodes($term->tid);
print "<li>".
l($term->name." (".$tcount.")",'taxonomy/term/'.$term->tid, array('title' => $tcount." posts in ".$term->name)).
"</li>";
} /* end foreach */
print "</ul>";
print "</div>";

but thats not enought, i need that the "$vid" loads automatically the current group's galleries vocabulary. so i'd need to add some code en the first line: $vid = the vocabulary for the groups galleries;

any help will be welcome

Comments

leanazulyoro’s picture

i'm approaching, excuse but my php skill aren't the best, i addes this function to the first line:

og_galleries_get_group_vid($gid);

at this point i have to especifi the actual group id inbetween the brackets.
now, what is the variable for the current group's id?

leanazulyoro’s picture

well, seems like i solved this:

$result = db_query("SELECT * FROM {og}");
while ($groups = db_fetch_array($result)) {
    $vid = og_galleries_get_group_vid($groups['nid']);
}
$terms = taxonomy_get_tree($vid);
print "<div class=\"item-list\">";
print "<ul>";
foreach ( $terms as $term ) {
$tcount = taxonomy_term_count_nodes($term->tid);
print "<li>".
l($term->name." (".$tcount.")",'taxonomy/term/'.$term->tid, array('title' => $tcount." posts in ".$term->name)).
"</li>";
} /* end foreach */
print "</ul>";
print "</div>";

i'm still getting some trouble, i don't know why, but i have one of my groups in wich it is not working, when i figure this out i'll let know.
but basicaly that's it, that is a code snippet to create a list of the group's galleryes with the number of images in each.

leanazulyoro’s picture

mmm not quite working yet, it works onl for the last created group, no idea why, any help?

leanazulyoro’s picture

Status: Active » Closed (fixed)

ok, no one actually replied but me, that's ok, i found help somewhere else and here's the final code, for those who need a list of the groups galleries from og_galleries.module:

$group_node = og_get_group_context();
$vid = og_galleries_get_group_vid($group_node->nid );
$terms = taxonomy_get_tree($vid);
print "<div class=\"item-list\">";
print "<ul>";
foreach ( $terms as $term ) {
$tcount = taxonomy_term_count_nodes($term->tid);
print "<li>".
l($term->name." (".$tcount.")",'taxonomy/term/'.$term->tid, array('title' => $tcount." posts in ".$term->name)).
"</li>";
} /* end foreach */
print "</ul>";
print "</div>";
leanazulyoro’s picture

Status: Closed (fixed) » Fixed
najibx’s picture

where does this code go? create a node with PHP input? how do we link there ...

Anyhow, how do we go about to Implementation of hook_og_create_links() just like og_forum, so I can have a link on group's menu

--> function og_forum_og_create_links($group) {

leanazulyoro’s picture

Priority: Critical » Normal
Status: Fixed » Closed (fixed)

Sorry najibx, i don't undertand what you just said :P . i'm not an advanced developer, not even intermediate. i just found a peace of code somewhere and managed toi modify it to do whant i wanted, i actually found help from other user of the site.
and i just realises that the final result is not actually what i wanted: it list taxonomy terms, and links to the list of nodes that are in it. but doesn't display them as the og_gallerie view, so i close this post, and open a new one, sorry i can't help u