Lee Wilson1424296141 Posted July 27, 2011 at 11:50 AM Share Posted July 27, 2011 at 11:50 AM I need the ability to limit the number of listings a user can post for Jreviews 2.3x on J1.6 or above. I had an old hack that worked in listings_controller.php for joomla 1.5 but this nolonger works. /* LIMIT NUMBER OF LISTINGS */ $user =& JFactory::getUser(); $userID = $user->get('id'); $db =& JFactory::getDBO(); $query = 'SELECT count(*) FROM `jos_content` where created_by=' . $userID . ' AND sectionid='.(int) $this->data['Listing']['sectionid'].' AND sectionid IN (5)'; $db->setQuery($query); $numPosts = $db->loadResult(); if($numPosts >= 1) { $update_html = 'You already submitted a listing'; } else { $update_html = $this->render('listings','create_form'); } /* LIMIT NUMBER OF LISTINGS END */ Please get in touch if you are interested. Link to comment
OpenSource Technologies Posted July 27, 2011 at 01:28 PM Share Posted July 27, 2011 at 01:28 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Recommended Posts