function limit_free_listing_per_category($permission, $params) { $auth = S2Object::make('auth'); $listingPermissions = (S2Object::make('perm'))->__('listing'); // Only for logged-in users if ($auth->id <= 0) { return $permission; } $Model = new S2Model(); // Detect plan ID $planId = isset($params['paid_plan_id']) ? (int)$params['paid_plan_id'] : 0; if ($planId <= 0) { return $permission; } // Check if the plan is FREE $query = "SELECT price FROM #__jreviews_paid_plans WHERE plan_id = " . $planId; $price = $Model->query($query, 'loadResult'); if ((float)$price > 0) { // Paid plan → allow return $permission; } // Detect category $catId = 0; if (!empty($params['cat_id'])) { $catId = (int)$params['cat_id']; } elseif (!empty($params['category_id'])) { $catId = (int)$params['category_id']; } if ($catId <= 0) { return $permission; } // Count existing listings by user in that category $query = sprintf( "SELECT COUNT(*) FROM %s WHERE %s = %d AND catid = %d AND state = 1", EverywhereComContentModel::_LISTING_TABLE, EverywhereComContentModel::_LISTING_USER_ID, $auth->id, $catId ); $count = $Model->query($query,'loadResult'); if ($count >= 1) { $listingPermissions->setMessage( 'You can only create one free listing in this category. Please upgrade to a paid plan to add more.' ); return false; } return $permission; } Clickfwd\Hook\Filter::add('can_create_listing', 'limit_free_listing_per_category', 10);
12 results - showing 11 - 12
1 2
Details

Work the World: Healthcare Internships Overseas

Work Abroad WT Work the World 0

Work programs

Program type
We offer amazing opportunities to work with local healthcare professionals to learn unique approaches to low-resource healthcare. Encounter everything from unusually late-stage conditions, to tropical diseases. You'll also use, develop, and acquire skills when adjusting to new practices. You can be highly specific with your specialism, whether it's in...
Compare
Read more

InterExchange: Au Pair, Work and Travel Programs

Work Abroad I InterExchange 0
InterExchange Working Abroad offers amazing programs in over 20 countries around the world! Our Au Pair, Teach English, Volunteer, Work & travel programs give participants the opportunity to live, work and learn in another country and culture. Participants can experience life in countries throughout Africa, Asia, Europe,...
Compare
Read more
12 results - showing 11 - 12
1 2

Join the Verge Community

Verge Magazine Membership


Join our community of savvy travellers and put nearly two decades of inspiring articles, authoritative information and expert advice to work for you.

Show me more > Login >

 

JReviews Listings Module

Featured
Going overseas to live, work, teach, volunteer, or study? Interested in sharing yo...

Travel Intelligence Bulletin

Namibia

The latest openings overseas—direct to your inbox.

More information>

Subscriber Login

About

Travel with purpose; travel for good. Articles, resources and events for ethical and meaningful travel, volunteering, working and studying abroad.

Verge believes in travel for change. International experience creates global citizens, who can change our planet for the better. This belief is at the core of everything we do.

Sorry, this website uses features that your browser doesn’t support. Upgrade to a newer version of Firefox, Chrome, Safari, or Edge and you’ll be all set.

Like what you see?

Follow us on social media