/**
  * Executes list action
  *
  * @param sfRequest $request A request object
  */
 public function executeList($request)
 {
     $this->profiles = Doctrine::getTable('Profile')->retrievesAll();
     $this->option_form = array();
     foreach ($this->profiles as $value) {
         $this->option_form[$value->getId()] = array();
         foreach ($value->getProfileOption() as $option) {
             $this->option_form[$value->getId()][$option->getId()] = new ProfileOptionForm(Doctrine::getTable('ProfileOption')->find($option->getId()));
         }
         $newProfileOption = new ProfileOption();
         $newProfileOption->setProfileId($value->getId());
         $this->option_form[$value->getId()][] = new ProfileOptionForm($newProfileOption);
     }
 }
 public function setTableDefinition()
 {
     parent::setTableDefinition();
     foreach ($this->getTable()->getColumns() as $name => $column) {
         $this->mapValue($name);
     }
 }
 public function save($con = null)
 {
     $profile = parent::save($con);
     $values = $this->getValues();
     if (!$values['is_edit_public_flag']) {
         Doctrine_Query::create()->update('MemberProfile')->set('public_flag', $values['default_public_flag'])->where('lft = 1')->andWhere('profile_id = ?', $profile->getId())->execute();
     }
     if ($values['form_type'] === 'date') {
         if (!$profile->getProfileOption()->count()) {
             $dateField = array('year', 'month', 'day');
             foreach ($dateField as $k => $field) {
                 $profileOption = new ProfileOption();
                 $profileOption->setSortOrder($k);
                 $profileOption->setProfile($profile);
                 $profileOption->save();
             }
         }
     }
 }
Example #4
0
 /**
  * Executes list action
  *
  * @param sfRequest $request A request object
  */
 public function executeList($request)
 {
     $this->profiles = Doctrine::getTable('Profile')->retrievesAll();
     $this->option_form = array();
     foreach ($this->profiles as $value) {
         $this->option_form[$value->getId()] = array();
         foreach ($value->getProfileOption() as $option) {
             $this->option_form[$value->getId()][$option->getId()] = new ProfileOptionForm(Doctrine::getTable('ProfileOption')->find($option->getId()));
         }
         $newProfileOption = new ProfileOption();
         $newProfileOption->setProfileId($value->getId());
         $this->option_form[$value->getId()][0] = new ProfileOptionForm($newProfileOption);
     }
     if ($request->isMethod('post')) {
         $parameter = $request->getParameter('profile_option');
         $profileId = $parameter['profile_id'];
         $profileOptionId = $parameter['id'] ? $parameter['id'] : 0;
         if (isset($this->option_form[$profileId][$profileOptionId])) {
             $this->option_form[$profileId][$profileOptionId]->bind($parameter);
         }
     }
 }
Example #5
0
 * Website: http://www.bluethrust.com
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/rank.php";
include_once "../../../../classes/consoleoption.php";
include_once "../../../../classes/profilecategory.php";
include_once "../../../../classes/profileoption.php";
$consoleObj = new ConsoleOption($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$profileCatObj = new ProfileCategory($mysqli);
$profileObj = new ProfileOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Profile Options");
$consoleObj->select($cID);
$_GET['cID'] = $cID;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    $selectedOption = "";
    $addSQL = "";
    if ($member->hasAccess($consoleObj) && $profileCatObj->select($_POST['catID'])) {
        if ($_POST['oID'] != "" and $profileObj->SELECT($_POST['oID'])) {
            $addSQL = " AND profileoption_id != '" . $_POST['oID'] . "'";
            $profileOptionInfo = $profileObj->get_info_filtered();
            if ($profileOptionInfo['profilecategory_id'] == $_POST['catID']) {
                $arrAssociates = $profileCatObj->getAssociateIDs("ORDER BY sortnum");
                $highestIndex = count($arrAssociates) - 1;
                $arrFlipped = array_flip($arrAssociates);
 public function filterMemberIdByProfileOption($ids, $column, $value, ProfileOption $item, $publicFlag = 1)
 {
     $_result = array();
     $q = Doctrine::getTable('MemberProfile')->createQuery('m')->select('m.member_id')->where('m.' . $column . '= ?', $value)->andWhere('m.profile_option_id = ?', $item->getId());
     if (is_integer($publicFlag)) {
         $q->addFrom('MemberProfile pm')->andWhere('m.tree_key = pm.id')->andWhere('pm.public_flag <= ?', $publicFlag);
     }
     $list = $q->execute();
     foreach ($list as $value) {
         $_result[] = $value->getMemberId();
     }
     if (is_array($ids)) {
         $ids = array_values(array_intersect($ids, $_result));
     } else {
         $ids = array_values($_result);
     }
     return $ids;
 }
Example #7
0
 public function save($con = null)
 {
     $profile = parent::save($con);
     $values = $this->getValues();
     if ('date' === $values['form_type']) {
         if (!$profile->getProfileOption()->count()) {
             $dateField = array('year', 'month', 'day');
             foreach ($dateField as $k => $field) {
                 $profileOption = new ProfileOption();
                 $profileOption->setSortOrder($k);
                 $profileOption->setProfile($profile);
                 $profileOption->save();
             }
         }
     }
 }
Example #8
0
 * License: http://www.bluethrust.com/license.php
 *
 */
if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") {
    exit;
} else {
    $memberInfo = $member->get_info_filtered();
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
include_once $prevFolder . "classes/profilecategory.php";
include_once $prevFolder . "classes/profileoption.php";
$cID = $_GET['cID'];
$profileOptionObj = new ProfileOption($mysqli);
$profileCatObj = new ProfileCategory($mysqli);
if (!$profileOptionObj->select($_GET['oID'])) {
    die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "members';</script>");
}
$profileOptionInfo = $profileOptionObj->get_info_filtered();
echo "\n\n<script type='text/javascript'>\n\$(document).ready(function() {\n\$('#breadCrumb').html(\"<a href='" . $MAIN_ROOT . "'>Home</a> > <a href='" . $MAIN_ROOT . "members'>My Account</a> > <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'>Manage Profile Options</a> > " . $profileOptionInfo['name'] . "\");\n});\n</script>\n";
$dispError = "";
if ($_POST['submit']) {
    // Check Option Name
    if (trim($_POST['optionname']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must give the profile option a name.<br>";
    }
    // Check Category
    if (!$profileCatObj->select($_POST['optioncategory'])) {
Example #9
0
 * E-mail: support@bluethrust.com
 * Website: http://www.bluethrust.com
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/rank.php";
include_once "../../../../classes/consoleoption.php";
include_once "../../../../classes/profileoption.php";
include_once "../../../../classes/profilecategory.php";
$consoleObj = new ConsoleOption($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$profileOptionObj = new ProfileOption($mysqli);
$profileCatObj = new ProfileCategory($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Profile Options");
$consoleObj->select($cID);
$_GET['cID'] = $cID;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($member->hasAccess($consoleObj) && $profileOptionObj->select($_POST['oID'])) {
        define("MEMBERRANK_ID", $memberInfo['rank_id']);
        if ($_POST['confirm'] == 1) {
            $profileOptionObj->delete();
            include "main.php";
        } else {
            $profileOptionName = $profileOptionObj->get_info_filtered("name");
            echo "<p align='center'>Are you sure you want to delete the profile option <b>" . $profileOptionName . "</b>?</p>";
        }
Example #10
0
 * E-mail: support@bluethrust.com
 * Website: http://www.bluethrust.com
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/rank.php";
include_once "../../../../classes/consoleoption.php";
include_once "../../../../classes/profileoption.php";
include_once "../../../../classes/profilecategory.php";
$consoleObj = new ConsoleOption($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$profileOptionObj = new ProfileOption($mysqli);
$profileCatObj = new ProfileCategory($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Profile Options");
$consoleObj->select($cID);
$_GET['cID'] = $cID;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($member->hasAccess($consoleObj) && $profileOptionObj->select($_POST['oID'])) {
        define('MEMBERRANK_ID', $memberInfo['rank_id']);
        $profileOptionInfo = $profileOptionObj->get_info();
        $profileCatObj->select($profileOptionInfo['profilecategory_id']);
        $arrAssociates = $profileCatObj->getAssociateIDs("ORDER BY sortnum");
        array_unshift($arrAssociates, "");
        unset($arrAssociates[0]);
        $intSortNum = $profileOptionInfo['sortnum'];
        $moveUp = $intSortNum - 1;
Example #11
0
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") {
    exit;
} else {
    $memberInfo = $member->get_info_filtered();
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
$cID = $_GET['cID'];
$profileCategoryObj = new ProfileCategory($mysqli);
$profileOptionObj = new ProfileOption($mysqli);
$gameObj = new Game($mysqli);
$arrGames = $gameObj->getGameList();
$consoleCatSettingObj = new Basic($mysqli, "consolecategory", "consolecategory_id");
$arrSocialMediaInfo = $member->objSocial->get_entries(array(), "ordernum DESC");
// Setup Default Console Category Select Options
$arrPrivileges = $memberRank->get_privileges();
$arrConsoleCats = array();
$consoleSettingObj = new ConsoleOption($mysqli);
foreach ($arrPrivileges as $consoleOptionID) {
    $consoleSettingObj->select($consoleOptionID);
    $consoleCatID = $consoleSettingObj->get_info("consolecategory_id");
    if (!in_array($consoleCatID, $arrConsoleCats)) {
        $consoleCatSettingObj->select($consoleCatID);
        $consoleCatOrder = $consoleCatSettingObj->get_info("ordernum");
        $arrConsoleCats[$consoleCatOrder] = $consoleCatID;
Example #12
0
<?php

if (!defined("SHOW_PROFILE_MAIN")) {
    exit;
}
// CUSTOM PROFILE OPTIONS
$profileCatObj = new ProfileCategory($mysqli);
$profileOptionObj = new ProfileOption($mysqli);
$member->select($memberInfo['member_id']);
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "profilecategory ORDER BY ordernum DESC");
while ($row = $result->fetch_assoc()) {
    $profileCatObj->select($row['profilecategory_id']);
    $arrProfileOptions = $profileCatObj->getAssociateIDs("ORDER BY sortnum");
    echo "\n\t\t<div class='formTitle' style='text-align: center; margin-top: 20px'>" . $profileCatObj->get_info_filtered("name") . "</div>\n\t\t<table class='profileTable' style='border-top-width: 0px'>\n\t";
    foreach ($arrProfileOptions as $profileOptionID) {
        $profileOptionObj->select($profileOptionID);
        echo "\n\t\t\n\t\t<tr>\n\t\t\t<td class='profileLabel alternateBGColor' valign='top'>" . $profileOptionObj->get_info_filtered("name") . ":</td>\n\t\t\t<td class='main' style='padding-left: 10px' valign='top'>" . $member->getProfileValue($profileOptionID) . "</td>\n\t\t</tr>\n\t\t\n\t\t";
    }
    echo "</table>";
}
Example #13
0
 *
 */
if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") {
    exit;
} else {
    $memberInfo = $member->get_info();
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
$cID = $_GET['cID'];
include_once $prevFolder . "classes/profilecategory.php";
include_once $prevFolder . "classes/profileoption.php";
$profileCatObj = new ProfileCategory($mysqli);
$profileOptionObj = new ProfileOption($mysqli);
if ($_POST['submit']) {
    // Check Option Name
    if (trim($_POST['optionname']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must give the profile option a name.<br>";
    }
    // Check Category
    if (!$profileCatObj->select($_POST['optioncategory'])) {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid profile category.<br>";
    } else {
        // Check Order
        $arrProfileOptionIDs = $profileCatObj->getAssociateIDs();
        $blnOrderCheck1 = $_POST['optionorder'] == "first" && count($arrProfileOptionIDs) > 0;
        $blnOrderCheck2 = !in_array($_POST['optionorder'], $arrProfileOptionIDs) && $_POST['optionorder'] != "first";