예제 #1
0
function b_yogurt_friends_show($options)
{
    global $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsUser;
    $myts =& MyTextSanitizer::getInstance();
    $block = array();
    if (!empty($xoopsUser)) {
        /**
         * Filter for fetch votes ishot and isnothot
         */
        $criteria_2 = new criteria('friend1_uid', $xoopsUser->getVar('uid'));
        /**
         * Creating factories of pictures and votes
         */
        //$album_factory      = new Xoopsyogurt_imagesHandler($xoopsDB);
        $friends_factory = new Xoopsyogurt_friendshipHandler($xoopsDB);
        $block['friends'] = $friends_factory->getFriends($options[0], $criteria_2, 0);
    }
    $block['lang_allfriends'] = _MB_YOG_ALLFRIENDS;
    return $block;
}
예제 #2
0
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include_once '../../mainfile.php';
include_once '../../header.php';
include_once 'class/yogurt_friendpetition.php';
include_once 'class/yogurt_friendship.php';
/**
* Factory of petitions created  
*/
$friendpetition_factory = new Xoopsyogurt_friendpetitionHandler($xoopsDB);
$friendship_factory = new Xoopsyogurt_friendshipHandler($xoopsDB);
/**
* Getting the uid of the user which user want to ask to be friend
*/
$friend1_uid = intval($_POST['friend_uid']);
$friend2_uid = intval($xoopsUser->getVar('uid'));
$criteria_friend1 = new Criteria('friend1_uid', $friend1_uid);
$criteria_friend2 = new Criteria('friend2_uid', $friend2_uid);
$criteria_delete1 = new CriteriaCompo($criteria_friend1);
$criteria_delete1->add($criteria_friend2);
$friendship_factory->deleteAll($criteria_delete1);
$criteria_friend1 = new Criteria('friend1_uid', $friend2_uid);
$criteria_friend2 = new Criteria('friend2_uid', $friend1_uid);
$criteria_delete1 = new CriteriaCompo($criteria_friend1);
$criteria_delete1->add($criteria_friend2);
$friendship_factory->deleteAll($criteria_delete1);
예제 #3
0
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include_once '../../mainfile.php';
$xoopsOption['template_main'] = 'yogurt_index.html';
include_once '../../header.php';
include_once 'class/yogurt_friendpetition.php';
include_once 'class/yogurt_friendship.php';
/**
* Factory of petitions created
*/
$friendpetition_factory = new Xoopsyogurt_friendpetitionHandler($xoopsDB);
$friendship_factory = new Xoopsyogurt_friendshipHandler($xoopsDB);
$petition_id = intval($_POST['petition_id']);
$friendship_level = intval($_POST['level']);
$uid = intval($xoopsUser->getVar('uid'));
if (!$GLOBALS['xoopsSecurity']->check()) {
    redirect_header($_SERVER['HTTP_REFERER'], 3, _MD_YOGURT_TOKENEXPIRED);
}
$criteria = new criteriaCompo(new criteria('friendpet_id', $petition_id));
$criteria->add(new criteria('petioned_uid', $uid));
if ($friendpetition_factory->getCount($criteria) > 0) {
    if ($friendship_level > 0 && ($petition = $friendpetition_factory->getObjects($criteria))) {
        $friend1_uid = $petition[0]->getVar('petitioner_uid');
        $friend2_uid = $petition[0]->getVar('petioned_uid');
        $newfriendship1 = $friendship_factory->create(true);
        $newfriendship1->setVar('level', 3);
        $newfriendship1->setVar('friend1_uid', $friend1_uid);
예제 #4
0
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include_once '../../mainfile.php';
include_once '../../header.php';
include_once '../../class/criteria.php';
include_once 'class/yogurt_friendship.php';
if (!$xoopsUser) {
    redirect_header('index.php');
}
$friendship_factory = new Xoopsyogurt_friendshipHandler($xoopsDB);
$friend2_uid = intval($_POST['friend_uid']);
$marker = !empty($_POST['marker']) ? intval($_POST['marker']) : 0;
$friend = new XoopsUser($friend2_uid);
if ($marker == 1) {
    $level = $_POST['level'];
    $cool = $_POST['cool'];
    $sexy = $_POST['hot'];
    $trusty = $_POST['trust'];
    $fan = $_POST['fan'];
    $friendship_id = intval($_POST['friendship_id']);
    $criteria = new criteria('friendship_id', $friendship_id);
    $friendships = $friendship_factory->getObjects($criteria);
    $friendship = $friendships[0];
    $friendship->setVar('level', $level);
    $friendship->setVar('cool', $cool);