Beispiel #1
0
 static function buildGroupsQuery($listId)
 {
     $user =& JFactory::getUser();
     $subid = modMailupHelper::getSubId($user->id);
     $select = "\n\t\t\ta.id, \n\t\t\ta.groupid, \n\t\t\ta.alias\n\t\t";
     $from = "\n\t\t\t#__mailup_group a \n\t\t";
     $where = array("a.visible=1", "a.listid={$listId}");
     if ($subid) {
         $select .= ", IFNULL(u.enabled, 0) enabled, IFNULL(u.status, 0) status";
         $from .= "\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t#__mailup_groupsub u\n\t\t\t\tON\n\t\t\t\t\tu.groupid=a.groupid\n\t\t\t\tAND\n\t\t\t\t\tu.subid={$subid}\n\t\t\t";
         //$where[] = "s.userid={$user->id}";
     } else {
         $select .= ", 0 enabled, 0 status";
     }
     return modMailupHelper::buildQuery($select, $from, $where);
 }