Mark.B
03-24-2009, 08:38 PM
I am using THIS (https://vborg.vbsupport.ru/showthread.php?t=198477&highlight=postbit+album) mod to try and get a link to show in postbit/postbit legacy if a user has any albums. However, as written the mod does not work for me (3.8.1 PL1). The mod author is not about so I am trying to fix it myself.
The problem is that this conditional is always returning false:
if (!empty($post['hasalbum']))
So the code does not show up. I can remove the conditional and the code will show fine, but obviously for everyone, even if they have no album.
The sub query being used at hook location showthread_query is this:
$hook_query_fields .= ",album.userid as hasalbum";
$hook_query_joins .= "LEFT JOIN (SELECT state, userid, MAX(albumid) AS hasalbum FROM " . TABLE_PREFIX . "album GROUP BY userid) album ON(user.userid = album.userid AND album.state = 'public')";
I can't work out why this isn't working for me....looking at the thread it works for some and not others. What's wrong? What other conditional could I replace that conditional with to try and make it work?
The problem is that this conditional is always returning false:
if (!empty($post['hasalbum']))
So the code does not show up. I can remove the conditional and the code will show fine, but obviously for everyone, even if they have no album.
The sub query being used at hook location showthread_query is this:
$hook_query_fields .= ",album.userid as hasalbum";
$hook_query_joins .= "LEFT JOIN (SELECT state, userid, MAX(albumid) AS hasalbum FROM " . TABLE_PREFIX . "album GROUP BY userid) album ON(user.userid = album.userid AND album.state = 'public')";
I can't work out why this isn't working for me....looking at the thread it works for some and not others. What's wrong? What other conditional could I replace that conditional with to try and make it work?