I modified the module to show all galleries in the block Galleries.
Changed the _gallery_assist_get_blockdata to accept the $delta value

function _gallery_assist_get_blockdata($u, $delta) {

if ($delta==0) {
$query_str = "SELECT p.pid, p.uid, p.tpath, p.opath, f.timestamp, t.ptitle, g.gid, g.data, n.title, n.type, n.nid
FROM {gallery_assist_item} p
JOIN {gallery_assist_translated} t ON p.pid = t.pid
JOIN {files} f ON p.fid = f.fid
JOIN {gallery_assist} g ON p.gid = g.gid
JOIN {node} n ON g.nid = n.nid
GROUP BY g.gref
ORDER BY f.timestamp DESC";
} else {
$query_str = "SELECT p.pid, p.uid, p.tpath, p.opath, f.timestamp, t.ptitle, g.gid, g.data, n.title, n.type, n.nid
FROM {gallery_assist_item} p
JOIN {gallery_assist_translated} t ON p.pid = t.pid
JOIN {files} f ON p.fid = f.fid
JOIN {gallery_assist} g ON p.gid = g.gid
JOIN {node} n ON g.nid = n.nid
WHERE p.uid = %d
GROUP BY g.gref
ORDER BY f.timestamp DESC";
}
//$result = db_query(db_rewrite_sql($query_str, 'n', 'nid'), $u);
$result = db_query(db_rewrite_sql($query_str), $u);
while ($r = db_fetch_object($result)) {
$count = db_result(db_query("SELECT count(*) FROM {gallery_assist_item} WHERE gid = %d", $r->gid));
$my[$r->nid] = $r;
}

return array(
'count' => $count,
'result' => $my,
);
}

CommentFileSizeAuthor
#6 Galleries-block-issue.gif26.28 KBzirafi
gallery_assist.zip26.33 KBPedro Duarte

Comments

jcmc’s picture

Category: bug » feature

The issue is but not a bug report.

the are three blocks for gallery assist and each block shows correct regarding the concept the data (images).
This should be a feature request but to this time offert the module Gallery Assist Views the solution for this purpose.

The next is, the block My Galleries shows all Galleries from a user and can the display format can be changed to covers in the block conf.
Also for me is this report a feature request that is all ready implemented.

I change the status.

jcmc’s picture

Status: Active » Fixed
zirafi’s picture

Hi Juan,

Yes, Gallery Assist adds three Blocks and none of them helped me. I could not find a solution so far to configure a block for the galleries posted on my site. Could you let me know.

thanks

jcmc’s picture

Status: Fixed » Active

Hi paradesi,

what do you think/hope have the block to do/show?

Regards

zirafi’s picture

Hi Juan,

I posted the following question in this "http://drupal.org/node/647636" thread but, this one was closed already and not sure whether it will be looked into. Hence I am pasting the same question here.

I did enable all three blocks and found "My Galleries" and "Galleries" blocks appeared where ever they were set to. But I am seeing following new issues.

1. "Galleries" block:

1.a. I enabled this block and made it to content page. It was saved fine but the "Galleries" block overlaps other blocks as shown in the attached snap. Could you let me know how to fix this?
1.b. "Galleries" block appears only for "admin" gallery

2. Regarding your step "5- Configure the Gallery Block and entry the NID of the just created node" (http://drupal.org/node/647636). Could you let me know what is NID and how to get this? and how to make use of "Gallery Block"?

I think I am getting there slowly.

thanks

zirafi’s picture

StatusFileSize
new26.28 KB

Attaching the snap now.

bradipo’s picture

I ave the same problem of paradesi, in the block galleries appear only the gallery_assit created by admin user. I debug the code and I find a problem in function _gallery_assist_block_display($delta) . In this function the SQL SELECT

"SELECT DISTINCT(t.gref), t.ptitle, t.nid, p.pid, p.tpath, p.opath, t.lang, g.ref, g.show_in_homepage_block, n.title, n.created
FROM {gallery_assist_translated} t
JOIN {gallery_assist_item} p ON p.pid = t.pid
JOIN {gallery_assist} g ON g.nid = t.nid
JOIN {node} n ON n.nid = t.nid
WHERE p.uid = %d $tlang $cover
ORDER BY n.created DESC
LIMIT %d
"
seems be wrong. I change it whit

"
SELECT DISTINCT(t.gref), t.ptitle, t.nid, p.pid, p.tpath, p.opath, t.lang, g.ref, g.show_in_homepage_block, n.title, n.created
FROM {gallery_assist_translated} t
JOIN {gallery_assist_item} p ON p.pid = t.pid
JOIN {gallery_assist} g ON g.nid = t.nid
JOIN {node} n ON n.nid = t.nid
WHERE g.show_in_homepage_block = %d $tlang $cover
ORDER BY n.created DESC
"
and now i view all gallery_assist in block Galleries.

zirafi’s picture

Hi,

Could you share the demo page of your site in which you fixed the above code. I will look at it and apply the above change.

And also could you let me know which file you modified the above code?

thank you,
~Paradesi

GigantPlus’s picture

I tried this, @bradipo, and it works, but blocks the administration module, it gives an error. Not the right way, unfortunately. I think that should create an entirely new block for this function.