OK - I think I'm onto something now. Looking at the actual queries within thumbinclude.php, I noticed that it was referencing tables that don't even exist (highlighted in yellow / bold below), i.e.
Code:
switch ($q_switch) {
case "most_views":
if ( !IsSet($cat) ) {
$group_title = "Most Popular Images - All Categories";
$query = "SELECT id,user,userid,cat,title,bigimage,views FROM photos WHERE bigimage!='' AND approved='1' $exclude_cat ORDER BY views DESC LIMIT $limit";
}
else {
$query = "SELECT id,user,userid,cat,title,bigimage,views FROM photopostphotos WHERE bigimage!='' AND approved='1' $exclude_cat AND cat in ($catquery) ORDER BY views DESC LIMIT $limit";
$group_title = "Most Popular Images - $catname";
}
When I installed photopost, this got installed into the same database as the vB forum. All of my photopost tables have a prefix of
photopost, i.e. photopostphotos, photopostcategories. I therefore looked through the file and changed the SQL statements I could find and changed them so that they had the prefix 'photopost' in front, i.e.
Code:
switch ($q_switch) {
case "most_views":
if ( !IsSet($cat) ) {
$group_title = "Most Popular Images - All Categories";
$query = "SELECT id,user,userid,cat,title,bigimage,views FROM photopostphotos WHERE bigimage!='' AND approved='1' $exclude_cat ORDER BY views DESC LIMIT $limit";
}
else {
$query = "SELECT id,user,userid,cat,title,bigimage,views FROM photopostphotos WHERE bigimage!='' AND approved='1' $exclude_cat AND cat in ($catquery) ORDER BY views DESC LIMIT $limit";
$group_title = "Most Popular Images - $catname";
}
I can't see how this would work given those SQL statements previously, but even when I change the SQL statements (4 x photopostphotos and 2 x photopostcategories), I still get the same 'Query Failed'.
It must be related to this, so any other ideas now?