Product Info
Rating:
(1 Rating)
Read reviews
Page 7 of 7
API Functions
SIMContests provide a set of easy-to-use API functions to obtain certain useful information.
Note: before calling each function, make sure you require the file /components/com_simcontests/helpers/core.php
.
- Get SIMContest User object. Includes Joomla user object, and user's SIMContests settings and data
-
require_once(JPATH_SITE.'/components/com_simcontests/helpers/core.php'); // $user_id = user's id $user = SCHelper::getUser($user_id);
- Obtain the image src of user's avatar
-
require_once(JPATH_SITE.'/components/com_simcontests/helpers/core.php'); // $user_id = user's id // $thumb: true if you wish to display a thumb, or false if you wish to display large avatar $src = SCHelper::avatarSrc($user_id, $thumb); echo '<img src="'.$src.'" alt="User Avatar" />';
- Get the displayed name of user, depending if it's configured to be username, full name, or if user has set a nickname.
-
require_once(JPATH_SITE.'/components/com_simcontests/helpers/core.php'); // $user_id = user's id $name = SCHelper::displayName($user_id);
- Check if a user (User A) is following another user (User B).
-
require_once(JPATH_SITE.'/components/com_simcontests/helpers/core.php'); // $user_id = User A's id // $member_id = User B's id $is_following = SCHelper::isFollowing($user_id, $member_id); // returns true or false
- Obtain a entry submission's image src
-
require_once(JPATH_SITE.'/components/com_simcontests/helpers/core.php'); // $entry_id = entry's id // $thumb: true if you wish to display a thumb, or false if you wish to display large submission image $src = SCHelper::entryImage($entry_id, $thumb); echo '<img src="'.$src.'" alt="Entry" />';
- << Prev
- Next
Product Reviews Rate this product
Guest rated
cool
Posted on 10 November 2017|Was this review helpful to you? Yes No
|