$selectspec['source'].=" JOIN ^userfavorites AS selectfave ON ^posts.postid=selectfave.entityid WHERE selectfave.userid=$ AND selectfave.entitytype=$ AND ^posts.type='Q'";
$selectspec['source'].=' JOIN ^userfavorites AS selectfave ON ^posts.postid=selectfave.entityid WHERE selectfave.userid=$ AND selectfave.entitytype=$ AND ^posts.type="Q" ORDER BY created DESC';
Return the selectspec to retrieve an array of $userid's favorited users, with information about those users' accounts.
*/
{
require_onceQA_INCLUDE_DIR.'qa-app-updates.php';
$source='^users JOIN ^userpoints ON ^users.userid=^userpoints.userid JOIN ^userfavorites ON ^users.userid=^userfavorites.entityid WHERE ^userfavorites.userid=$ AND ^userfavorites.entitytype=$ ORDER BY handle';
'source'=>"^users JOIN ^userpoints ON ^users.userid=^userpoints.userid JOIN ^userfavorites ON ^users.userid=^userfavorites.entityid WHERE ^userfavorites.userid=$ AND ^userfavorites.entitytype=$",
Return the selectspec to retrieve an array of $userid's favorited tags, with information about those tags.
*/
{
require_onceQA_INCLUDE_DIR.'qa-app-updates.php';
$source='^words JOIN ^userfavorites ON ^words.wordid=^userfavorites.entityid WHERE ^userfavorites.userid=$ AND ^userfavorites.entitytype=$ ORDER BY tagcount DESC';
$arguments=array($userid,QA_ENTITY_TAG);
if(isset($limit)){
$limit=min($limit,QA_DB_RETRIEVE_TAGS);
$source.=' LIMIT #,#';
$arguments[]=$start;
$arguments[]=$limit;
}
returnarray(
'columns'=>array('word','tagcount'),
'source'=>"^words JOIN ^userfavorites ON ^words.wordid=^userfavorites.entityid WHERE ^userfavorites.userid=$ AND ^userfavorites.entitytype=$",