MyBBHacks.com Plugins for  MyBB

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working Module for ProPortal
#4
Untested but maybe try
Code:
global $mybb, $db; $groupsdata = $mybb->user['usergroup']; $wherestats = " LEFT JOIN ".TABLE_PREFIX."users AS m ON (m.uid = p.ID_MEMBER) LEFT JOIN ".TABLE_PREFIX."usergroups AS mg ON (m.usergroup = mg.gid) LEFT JOIN ".TABLE_PREFIX."gallery_usersettings AS s ON (s.ID_MEMBER = m.uid) LEFT JOIN ".TABLE_PREFIX."gallery_log_mark_view AS v ON (p.ID_PICTURE = v.ID_PICTURE AND v.ID_MEMBER = " . $mybb->user['uid'] . " AND v.user_id_cat = p.USER_ID_CAT) LEFT JOIN ".TABLE_PREFIX."gallery_catperm AS c ON (c.id_group IN ($groupsdata) AND c.id_cat = p.id_cat) WHERE ((s.private =0 || s.private IS NULL ) AND (s.password = '' || s.password IS NULL ) AND p.USER_ID_CAT !=0 AND p.approved =1) || (p.approved = 1 AND p.user_id_cat = 0 AND (c.view IS NULL || c.view = 1)) "; $result = $db->query(" SELECT p.ID_PICTURE, p.commenttotal, p.totalratings, p.rating, p.filesize, p.views, p.thumbfilename, p.title, p.ID_MEMBER, m.username, mg.namestyle,p.date, p.description, p.mature, v.ID_PICTURE as unread FROM ".TABLE_PREFIX."gallery_pic as p $wherestats GROUP BY p.ID_PICTURE ORDER BY RAND() LIMIT 1" ); $context['picture_list'] = array(); while($row = $db->fetch_array($result)) { $context['picture_list'][] = $row; } $db->free_result($result); foreach ($context['picture_list'] as $row) { echo '<a href="' . $mybb->settings['bburl'] . '/ezgallery.php?sa=view&id=', $row['ID_PICTURE'], '"><img src="', $mybb->settings['bburl'] . '/gallery/', $row['thumbfilename'], '" alt="" /></a><br />'; }
Like what I do? Support me at https://www.patreon.com/vbgamer45/
Reply


Messages In This Thread
Working Module for ProPortal - by Cobalt60 - 09-12-2019, 03:51 AM
RE: Working Module for ProPortal - by MyBBHacks - 09-12-2019, 04:26 AM
RE: Working Module for ProPortal - by Cobalt60 - 09-12-2019, 04:32 AM
RE: Working Module for ProPortal - by MyBBHacks - 09-12-2019, 04:46 AM
RE: Working Module for ProPortal - by Cobalt60 - 09-12-2019, 05:18 AM
RE: Working Module for ProPortal - by MyBBHacks - 09-12-2019, 05:28 AM
RE: Working Module for ProPortal - by Cobalt60 - 09-12-2019, 05:39 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)