function _processProfileDelete($oAlert)
 {
     $oPC = new BxDolProfilesController();
     if (getParam('unregisterusernotify') == 'on') {
         $oPC->sendUnregisterUserNotify($oAlert->aExtras['profile_info']);
     }
 }
 function getBlockCode_All($iBlockId)
 {
     $oCateg = new BxBaseCategories();
     $oCateg->getTagObjectConfig();
     $this->_aParam['common'] = false;
     return array($oCateg->display($this->_aParam, $iBlockId, '', true, getParam('categ_show_columns'), $this->_sUrl), array(), array(), $this->_sTitle);
 }
 /**
  * Get captcha object instance by object name
  *
  * @param $sObject object name
  * @return object instance or false on error
  */
 public static function getObjectInstance($sObject = false)
 {
     if (!$sObject) {
         $sObject = getParam('sys_captcha_default');
     }
     if (isset($GLOBALS['bxDolClasses']['BxDolCaptcha!' . $sObject])) {
         return $GLOBALS['bxDolClasses']['BxDolCaptcha!' . $sObject];
     }
     $aObject = BxDolCaptchaQuery::getCaptchaObject($sObject);
     if (!$aObject || !is_array($aObject)) {
         return false;
     }
     if (empty($aObject['override_class_name'])) {
         return false;
     }
     $sClass = $aObject['override_class_name'];
     if (!empty($aObject['override_class_file'])) {
         require_once BX_DIRECTORY_PATH_ROOT . $aObject['override_class_file'];
     } else {
         bx_import($sClass);
     }
     $o = new $sClass($aObject);
     if (!$o->isAvailable()) {
         return false;
     }
     return $GLOBALS['bxDolClasses']['BxDolCaptcha!' . $sObject] = $o;
 }
Beispiel #4
0
 /**
  *  return assoc array of all frofile fields
  */
 function getProfileData()
 {
     global $aUser;
     $bUseCacheSystem = getParam('enable_cache_system') == 'on' ? true : false;
     $oPDb = new BxDolProfileQuery();
     $sProfileCache = BX_DIRECTORY_PATH_CACHE . 'user' . $this->_iProfileID . '.php';
     if ($bUseCacheSystem && file_exists($sProfileCache) && is_file($sProfileCache)) {
         require_once $sProfileCache;
         $this->_aProfile = $aUser[$this->_iProfileID];
     } else {
         $this->_aProfile = $oPDb->getProfileDataById($this->_iProfileID);
     }
     //get couple data
     if ($this->_aProfile['Couple']) {
         $this->bCouple = true;
         $this->_iCoupleID = $this->_aProfile['Couple'];
         $sProfileCache = BX_DIRECTORY_PATH_CACHE . 'user' . $this->_iCoupleID . '.php';
         if ($bUseCacheSystem && file_exists($sProfileCache) && is_file($sProfileCache)) {
             require_once $sProfileCache;
             $this->_aCouple = $aUser[$this->_iCoupleID];
         } else {
             $this->_aCouple = $oPDb->getProfileDataById($this->_iCoupleID);
         }
     }
     return $this->_aProfile;
 }
 function __construct($iYear, $iMonth)
 {
     $aMonths = array(1 => '_January', 2 => '_February', 3 => '_March', 4 => '_April', 5 => '_May', 6 => '_June', 7 => '_July', 8 => '_August', 9 => '_September', 10 => '_October', 11 => '_November', 12 => '_December');
     // input values
     $this->iYear = (int) $iYear ? (int) $iYear : date('Y');
     $this->iMonth = (int) $iMonth ? (int) $iMonth : date('m');
     $this->iDay = date('d');
     $this->sMonthName = _t($aMonths[(int) $this->iMonth]);
     $this->iNumDaysInMonth = date('t', mktime(0, 0, 0, $this->iMonth + 1, $iDay, $this->iYear));
     $this->iFirstWeekDay = (int) date('w', mktime(0, 0, 0, $this->iMonth, 1, $this->iYear));
     // previous month year, month
     $this->iPrevYear = $this->iYear;
     $this->iPrevMonth = $this->iMonth - 1;
     if ($this->iPrevMonth <= 0) {
         $this->iPrevMonth = 12;
         $this->iPrevYear--;
     }
     // next month year, month
     $this->iNextYear = $this->iYear;
     $this->iNextMonth = $this->iMonth + 1;
     if ($this->iNextMonth > 12) {
         $this->iNextMonth = 1;
         $this->iNextYear++;
     }
     // week config
     list($this->iWeekStart, $this->iWeekEnd) = getParam('sys_calendar_starts_sunday') == 'on' ? array(0, 7) : array(1, 8);
     if ($this->iFirstWeekDay < $this->iWeekStart) {
         $this->iFirstWeekDay = $this->iWeekEnd - 1;
     }
 }
function send_cupid_email($aAnyProf, $iSelCupID)
{
    global $site;
    $message = getParam("t_CupidMail");
    $subject = getParam('t_CupidMail_subject');
    $subject = addslashes($subject);
    $recipient = $aAnyProf['Email'];
    $headers = "From: {$site['title']} <{$site['email_notify']}>";
    $headers2 = "-f{$site['email_notify']}";
    $message = str_replace("<SiteName>", $site['title'], $message);
    $message = str_replace("<Domain>", $site['url'], $message);
    $message = str_replace("<RealName>", $aAnyProf['NickName'], $message);
    $message = str_replace("<StrID>", $aAnyProf['ID'], $message);
    $message = str_replace("<MatchProfileLink>", getProfileLink($iSelCupID), $message);
    $message = addslashes($message);
    if ('Text' == $aAnyProf['EmailFlag']) {
        $message = html2txt($message);
    }
    if ('HTML' == $aAnyProf['EmailFlag']) {
        $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=UTF-8\r\n" . $headers;
    }
    $sql = "INSERT INTO `NotifyQueue` SET `Email` = {$aAnyProf['ID']}, Msg = 0, `From` = 'ProfilesMsgText', Creation = NOW(), MsgText = '{$message}', MsgSubj = '{$subject}'";
    $res = db_res($sql);
    return true;
}
Beispiel #7
0
 function __construct()
 {
     parent::__construct();
     if (class_exists('BxDolDb') && BxDolDb::getInstance()) {
         $this->_aConfig['aLessConfig']['bx-page-width'] = getParam('main_div_width');
     }
 }
 /**
  * @description : function will generate profile block (used the profile template );
  * @return : Html presentation data ;
  */
 function PrintSearhResult($aProfileInfo, $aCoupleInfo = '', $aExtendedKey = null, $sTemplateName = '', $oCustomTemplate = null)
 {
     global $site;
     global $aPreValues;
     $iVisitorID = getLoggedId();
     $bExtMode = !empty($_GET['mode']) && $_GET['mode'] == 'extended' || !empty($_GET['search_result_mode']) && $_GET['search_result_mode'] == 'ext';
     $isShowMatchPercent = $bExtMode && $iVisitorID && $iVisitorID != $aProfileInfo['ID'] && getParam('view_match_percent') && getParam('enable_match');
     $sProfileThumb = get_member_thumbnail($aProfileInfo['ID'], 'none', !$bExtMode, 'visitor');
     $sProfileMatch = $isShowMatchPercent ? $GLOBALS['oFunctions']->getProfileMatch($iVisitorID, $aProfileInfo['ID']) : '';
     $sProfileNickname = '<a href="' . getProfileLink($aProfileInfo['ID']) . '">' . getNickName($aProfileInfo['ID']) . '</a>';
     $sProfileInfo = $GLOBALS['oFunctions']->getUserInfo($aProfileInfo['ID']);
     $sProfileDesc = strmaxtextlen($aProfileInfo['DescriptionMe'], 130);
     $sProfileZodiac = $bExtMode && getParam('zodiac') ? $GLOBALS['oFunctions']->getProfileZodiac($aProfileInfo['DateOfBirth']) : '';
     $sProfile2ASc1 = $sProfile2ASc2 = $sProfile2Nick = $sProfile2Desc = $sProfile2Info = $sProfile2Zodiac = '';
     if ($aCoupleInfo) {
         $sProfile2Nick = '<a href="' . getProfileLink($aCoupleInfo['ID']) . '">' . getNickName($aCoupleInfo['ID']) . '</a>';
         $sProfile2Info = $GLOBALS['oFunctions']->getUserInfo($aCoupleInfo['ID']);
         $sProfile2Desc = strmaxtextlen($aCoupleInfo['DescriptionMe'], 130);
         $sProfile2Zodiac = $bExtMode && getParam('zodiac') ? $GLOBALS['oFunctions']->getProfileZodiac($aCoupleInfo['DateOfBirth']) : '';
         $sProfile2ASc1 = 'float:left;width:31%;margin-right:10px;';
         $sProfile2ASc2 = 'float:left;width:31%;display:block;';
     } else {
         $sProfile2ASc2 = 'display:none;';
     }
     $aKeys = array('thumbnail' => $sProfileThumb, 'match' => $sProfileMatch, 'nick' => $sProfileNickname, 'info' => $sProfileInfo, 'i_am_desc' => $sProfileDesc, 'zodiac_sign' => $sProfileZodiac, 'nick2' => $sProfile2Nick, 'info2' => $sProfile2Info, 'i_am_desc2' => $sProfile2Desc, 'zodiac_sign2' => $sProfile2Zodiac, 'add_style_c1' => $sProfile2ASc1, 'add_style_c2' => $sProfile2ASc2);
     if ($aExtendedKey and is_array($aExtendedKey) and !empty($aExtendedKey)) {
         foreach ($aExtendedKey as $sKey => $sValue) {
             $aKeys[$sKey] = $sValue;
         }
     } else {
         $aKeys['ext_css_class'] = '';
     }
     return $oCustomTemplate ? $oCustomTemplate->parseHtmlByName($sTemplateName, $aKeys) : $GLOBALS['oSysTemplate']->parseHtmlByName($sTemplateName, $aKeys);
 }
Beispiel #9
0
 function getBlockCode_ViewImage()
 {
     $sSiteUrl = $this->_aSite['url'];
     $aFile = BxDolService::call('photos', 'get_photo_array', array($this->_aSite['photo'], 'file'), 'Search');
     $sImage = $aFile['no_image'] ? '' : $aFile['file'];
     // BEGIN STW INTEGRATION
     if (getParam('bx_sites_account_type') != 'No Automated Screenshots') {
         if ($sImage == '') {
             $aSTWOptions = array();
             bx_sites_import('STW');
             $sThumbHTML = getThumbnailHTML($sSiteUrl, $aSTWOptions, false, false);
         }
     }
     // END STW INTEGRATION
     $sVote = '';
     if (strncasecmp($sSiteUrl, 'http://', 7) !== 0 && strncasecmp($sSiteUrl, 'https://', 8) !== 0) {
         $sSiteUrl = 'http://' . $sSiteUrl;
     }
     if ($this->_oConfig->isVotesAllowed() && $this->_oSites->oPrivacy->check('rate', $this->_aSite['id'], $this->_oSites->iOwnerId)) {
         bx_import('BxTemplVotingView');
         $oVotingView = new BxTemplVotingView('bx_sites', $this->_aSite['id']);
         if ($oVotingView->isEnabled()) {
             $sVote = $oVotingView->getBigVoting();
         }
     }
     $sContent = $this->_oTemplate->parseHtmlByName('view_image.html', array('title' => $this->_aSite['title'], 'site_url' => $sSiteUrl, 'site_url_view' => $this->_aSite['url'], 'bx_if:is_image' => array('condition' => $sThumbHTML == false, 'content' => array('image' => $sImage ? $sImage : $this->_oTemplate->getImageUrl('no-image-thumb.png'))), 'bx_if:is_thumbhtml' => array('condition' => $sThumbHTML != '', 'content' => array('thumbhtml' => $sThumbHTML)), 'vote' => $sVote, 'view_count' => $this->_aSite['views']));
     return array($sContent, array(), array(), false);
 }
 function genSiteServiceMenu()
 {
     $bLogged = isLogged();
     $aMenuItem = array();
     $sMenuPopupId = '';
     $sMenuPopupContent = '';
     if ($bLogged) {
         bx_import('BxTemplMenuService');
         $oMenu = new BxTemplMenuService();
         if ($oMenu->aMenuInfo['memberID'] != 0) {
             $aProfile = getProfileInfo($oMenu->aMenuInfo['memberID']);
         }
         $sThumbSetting = getParam('sys_member_info_thumb_icon');
         bx_import('BxDolMemberInfo');
         $o = BxDolMemberInfo::getObjectInstance($sThumbSetting);
         $sThumbUrl = $o ? $o->get($aProfile) : '';
         $o = BxDolMemberInfo::getObjectInstance($sThumbSetting . '_2x');
         $sThumbTwiceUrl = $o ? $o->get($aProfile) : '';
         if (!$sThumbTwiceUrl) {
             $sThumbTwiceUrl = $sThumbUrl;
         }
         $bThumb = !empty($sThumbUrl);
         $aMenuItem = array('bx_if:show_fu_thumb_image' => array('condition' => $bThumb, 'content' => array('image' => $sThumbUrl, 'image_2x' => $sThumbTwiceUrl)), 'bx_if:show_fu_thumb_icon' => array('condition' => !$bThumb, 'content' => array()), 'thumbnail' => get_member_icon($oMenu->aMenuInfo['memberID']), 'title' => getNickName($oMenu->aMenuInfo['memberID']));
         $sMenuPopupId = 'sys-service-menu-' . time();
         $sMenuPopupContent = $this->transBox($oMenu->getCode());
     }
     return $GLOBALS['oSysTemplate']->parseHtmlByName('extra_service_menu_wrapper.html', array('bx_if:show_for_visitor' => array('condition' => !$bLogged, 'content' => array()), 'bx_if:show_for_user' => array('condition' => $bLogged, 'content' => $aMenuItem), 'menu_popup_id' => $sMenuPopupId, 'menu_popup_content' => $sMenuPopupContent));
 }
 function unit($aData, $isCheckPrivateContent = true, $sTemplateName = 'unit.html')
 {
     $oModule = BxDolModule::getInstance($this->MODULE);
     $CNF =& $oModule->_oConfig->CNF;
     if ($isCheckPrivateContent && CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $oModule->checkAllowedView($aData))) {
         $aVars = array('summary' => $sMsg);
         return $this->parseHtmlByName('unit_private.html', $aVars);
     }
     // get thumb url
     $sPhotoThumb = '';
     if ($aData[$CNF['FIELD_THUMB']]) {
         bx_import('BxDolImageTranscoder');
         $oImagesTranscoder = BxDolImageTranscoder::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW']);
         if ($oImagesTranscoder) {
             $sPhotoThumb = $oImagesTranscoder->getImageUrl($aData[$CNF['FIELD_THUMB']]);
         }
     }
     // get entry url
     bx_import('BxDolPermalinks');
     $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]);
     bx_import('BxDolProfile');
     $oProfile = BxDolProfile::getInstance($aData[$CNF['FIELD_AUTHOR']]);
     if (!$oProfile) {
         bx_import('BxDolProfileUndefined');
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     // get summary
     $sLinkMore = ' <a title="' . bx_html_attribute(_t('_sys_read_more', $aData[$CNF['FIELD_TITLE']])) . '" href="' . $sUrl . '"><i class="sys-icon ellipsis-h"></i></a>';
     $sSummary = strmaxtextlen($aData[$CNF['FIELD_TEXT']], (int) getParam($CNF['PARAM_CHARS_SUMMARY']), $sLinkMore);
     $sSummaryPlain = BxTemplFunctions::getInstance()->getStringWithLimitedLength(strip_tags($sSummary), (int) getParam($CNF['PARAM_CHARS_SUMMARY_PLAIN']));
     // generate html
     $aVars = array('id' => $aData[$CNF['FIELD_ID']], 'content_url' => $sUrl, 'title' => bx_process_output($aData[$CNF['FIELD_TITLE']]), 'summary' => $sSummary, 'author' => $oProfile->getDisplayName(), 'author_url' => $oProfile->getUrl(), 'entry_posting_date' => bx_time_js($aData[$CNF['FIELD_ADDED']], BX_FORMAT_DATE), 'module_name' => _t($CNF['T']['txt_sample_single']), 'ts' => $aData[$CNF['FIELD_ADDED']], 'bx_if:thumb' => array('condition' => $sPhotoThumb, 'content' => array('title' => bx_process_output($aData[$CNF['FIELD_TITLE']]), 'summary_attr' => bx_html_attribute($sSummaryPlain), 'content_url' => $sUrl, 'thumb_url' => $sPhotoThumb ? $sPhotoThumb : '')), 'bx_if:no_thumb' => array('condition' => !$sPhotoThumb, 'content' => array('content_url' => $sUrl, 'summary_plain' => $sSummaryPlain)));
     return $this->parseHtmlByName($sTemplateName, $aVars);
 }
 function getBlockCode_SearchResults()
 {
     $this->_oTemplate->addJs('http://www.google.com/jsapi');
     $a = parse_url($GLOBALS['site']['url']);
     $aVars = array('is_image_search' => 'on' == getParam('bx_gsearch_separate_images') ? 1 : 0, 'is_tabbed_search' => 'on' == getParam('bx_gsearch_separate_tabbed') ? 1 : 0, 'domain' => $a['host'], 'keyword' => str_replace('"', '\\"', stripslashes($_GET['keyword'])), 'suffix' => 'adv', 'separate_search_form' => 1);
     return $this->_oTemplate->parseHtmlByName('search', $aVars);
 }
Beispiel #13
0
function adm_hosting_promo()
{
    if (getParam('feeds_enable') != 'on') {
        return '';
    }
    return DesignBoxAdmin(_t('_adm_txt_hosting_title'), $GLOBALS['oAdmTemplate']->parseHtmlByName('hosting_promo.html', array()), '', '', 11);
}
 protected function _action($sCache, $sMode = 'clear')
 {
     $sFuncCacheObject = $sMode == 'clear' ? '_clearObject' : '_getSizeObject';
     $sFuncCacheFile = $sMode == 'clear' ? '_clearFile' : '_getSizeFile';
     $mixedResult = false;
     switch ($sCache) {
         case 'db':
             if (getParam('sys_db_cache_enable') != 'on') {
                 break;
             }
             $oCacheDb = BxDolDb::getInstance()->getDbCacheObject();
             $mixedResult = $this->{$sFuncCacheObject}($oCacheDb, 'db_');
             break;
         case 'template':
             if (getParam('sys_template_cache_enable') != 'on') {
                 break;
             }
             $oCacheTemplates = BxDolTemplate::getInstance()->getTemplatesCacheObject();
             $mixedResult = $this->{$sFuncCacheObject}($oCacheTemplates, BxDolStudioTemplate::getInstance()->getCacheFilePrefix($sCache));
             break;
         case 'css':
             if (getParam('sys_template_cache_css_enable') != 'on') {
                 break;
             }
             $mixedResult = $this->{$sFuncCacheFile}(BxDolStudioTemplate::getInstance()->getCacheFilePrefix($sCache), BX_DIRECTORY_PATH_CACHE_PUBLIC);
             break;
         case 'js':
             if (getParam('sys_template_cache_js_enable') != 'on') {
                 break;
             }
             $mixedResult = $this->{$sFuncCacheFile}(BxDolStudioTemplate::getInstance()->getCacheFilePrefix($sCache), BX_DIRECTORY_PATH_CACHE_PUBLIC);
             break;
     }
     return $mixedResult;
 }
Beispiel #15
0
/**
 * page code function
 */
function PageCompMainCode()
{
    ob_start();
    $oAccount = BxDolAccount::getInstance();
    $aAccountInfo = $oAccount ? $oAccount->getInfo() : false;
    if (!$aAccountInfo) {
        return DesignBoxContent("Send Email example", 'Please login first', BX_DB_PADDING_DEF);
    }
    echo "<h2>Account info</h2>";
    echo "Email: " . $aAccountInfo['email'] . '<br />';
    echo "Email Confirmed: " . ($aAccountInfo['email_confirmed'] ? 'yes' : 'no') . '<br />';
    echo "Receive site updates: " . ($aAccountInfo['receive_updates'] ? 'yes' : 'no') . '<br />';
    echo "Receive site newsletters: " . ($aAccountInfo['receive_news'] ? 'yes' : 'no') . '<br />';
    echo "Site emails are sent from: " . getParam('site_email_notify') . '<br />';
    $a = array('sys' => array('title' => "Send me system email", 'type' => BX_EMAIL_SYSTEM, 'subj' => 'System Email', 'body' => 'This is system email <br /> {unsubscribe}'), 'notif' => array('title' => "Send me notification", 'type' => BX_EMAIL_NOTIFY, 'subj' => 'Notification Email', 'body' => 'This is notification email<br /> {unsubscribe}'), 'mass' => array('title' => "Send me bulk email", 'type' => BX_EMAIL_MASS, 'subj' => 'Bulk Email', 'body' => 'This is bulk email<br /> {unsubscribe}'));
    $sSendMail = bx_get('send');
    if ($sSendMail && isset($a[$sSendMail])) {
        echo "<h2>Send Email Result</h2>";
        $r = $a[$sSendMail];
        if (sendMail($aAccountInfo['email'], $r['subj'], $r['body'], 0, array(), $r['type'])) {
            echo MsgBox($r['subj'] . ' - successfully sent');
        } else {
            echo MsgBox($r['subj'] . ' - sent failed');
        }
    }
    echo "<h2>Send email</h2>";
    foreach ($a as $k => $r) {
        echo '<a href="samples/email.php?send=' . $k . '">' . $r['title'] . '</a><br />';
    }
    return DesignBoxContent("Send Email Example", ob_get_clean(), BX_DB_PADDING_DEF);
}
/**
 * Init function of API.
 */
function init()
{
    if ($paramArr = getParam()) {
        $repeat = $paramArr[0];
        for ($i = 1; $i < 101; $i++) {
            $halfNum = $i / 100;
            for ($j = 4; $j < 29; $j++) {
                $ogListArr = getRandOgList(1, 29, $j, $repeat);
                $total = 0;
                foreach ($ogListArr as $ogList) {
                    $statics = execute($ogList, $halfNum);
                    $total += $statics['count'];
                }
                $avgNumber = $total / $repeat;
                echo $avgNumber;
                if ($j < 28) {
                    echo ',';
                }
            }
            echo '<br>';
        }
    } else {
        printParamErr();
    }
}
 protected function __construct($aObject, $oStorage)
 {
     parent::__construct($aObject, $oStorage);
     $this->_sQueueStorage = getParam('sys_transcoder_queue_storage') ? 'sys_transcoder_queue_files' : '';
     $this->_oDb = new BxDolTranscoderVideoQuery($aObject);
     $this->_sQueueTable = $this->_oDb->getQueueTable();
 }
Beispiel #18
0
 function getRateFile(&$aData)
 {
     $aImg = $this->oMedia->serviceGetPhotoArray($aData[0]['id'], 'file');
     $iImgWidth = (int) getParam($this->sType . '_file_width');
     $aFile = array('fileBody' => $aImg['file'], 'infoWidth' => $iImgWidth > 0 ? $iImgWidth + 2 : '');
     return $this->oMedia->oTemplate->parseHtmlByName('rate_object_file.html', $aFile);
 }
Beispiel #19
0
 /**
  * @description : class constructor ;
  */
 function BxDolBrowse()
 {
     global $aPreValues;
     // read data from cache file ;
     $oCache = $GLOBALS['MySQL']->getDbCacheObject();
     $this->aMembersInfo = $oCache->getData($GLOBALS['MySQL']->genDbCacheKey('sys_browse_people'));
     if (null === $this->aMembersInfo) {
         $this->aMembersInfo = array();
     }
     // fill aDateBirthRange array ;
     $iStartDate = getParam('search_start_age');
     $iLastDate = getParam('search_end_age');
     // fill date of birth array
     while ($iStartDate <= $iLastDate) {
         $this->aDateBirthRange[$iStartDate . '-' . ($iStartDate + 2)] = 0;
         $iStartDate += 3;
     }
     // check permalink mode ;
     $this->bPermalinkMode = getParam('permalinks_browse') ? true : false;
     // check member on line time ;
     $this->iMemberOnlineTime = getParam("member_online_time");
     // fill sex array ;
     ksort($aPreValues['Sex'], SORT_STRING);
     foreach ($aPreValues['Sex'] as $sKey => $aItems) {
         $this->aSexRange[$sKey] = 0;
     }
     // fill country array ;
     ksort($aPreValues['Country'], SORT_STRING);
     foreach ($aPreValues['Country'] as $sKey => $aItems) {
         $this->aCountryRange[$sKey] = 0;
     }
 }
function dispatch()
{
    $p = getParam('p');
    $q = getParam('q');
    global $action, $pageTitle;
    $pageTitle = null;
    $action = 'home';
    switch ($p) {
        case "album":
            $action = 'album';
            actionAlbum($q);
            break;
        case "panorama":
            $action = 'panorama';
            actionPanorama($q);
            break;
        case "contact":
            $action = 'contact';
            actionContact();
            break;
        default:
            $action = 'home';
            actionHome();
            break;
    }
}
Beispiel #21
0
 function blockFiles(&$aData)
 {
     $iEntryId = $aData['id'];
     $aReadyMedia = array();
     if ($iEntryId) {
         $aReadyMedia = $GLOBALS['oBxStoreModule']->_oDb->getFiles($iEntryId, true);
     }
     if (!$aReadyMedia) {
         return '';
     }
     $aVars = array('bx_repeat:files' => array());
     $sCurrencySign = getParam('pmt_default_currency_sign');
     foreach ($aReadyMedia as $r) {
         $iMediaId = $r['media_id'];
         $a = BxDolService::call('files', 'get_file_array', array($iMediaId), 'Search');
         if (!$a['date']) {
             continue;
         }
         bx_import('BxTemplFormView');
         $oForm = new BxTemplFormView(array());
         $aInputBtnDownload = array('type' => 'submit', 'name' => 'bx_store_download', 'value' => _t('_bx_store_download'), 'attrs' => array('onclick' => "window.open ('" . BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . "download/{$r['id']}','_self');"));
         $aVars['bx_repeat:files'][] = array('id' => $iMediaId, 'title' => $a['title'], 'icon' => $a['file'], 'price' => $sCurrencySign . ' ' . $r['price'], 'for_group' => sprintf(_t('_bx_store_for_group'), $GLOBALS['oBxStoreModule']->getGroupName($r['allow_purchase_to'])), 'date' => defineTimeInterval($a['date']), 'bx_if:purchase' => array('condition' => $GLOBALS['oBxStoreModule']->isAllowedPurchase($r), 'content' => array('btn_purchase' => BxDolService::call('payment', 'get_add_to_cart_link', array($r['author_id'], $this->_oConfig->getId(), $r['id'], 1)))), 'bx_if:download' => array('condition' => $GLOBALS['oBxStoreModule']->isAllowedDownload($r), 'content' => array('btn_download' => $oForm->genInputButton($aInputBtnDownload))));
     }
     if (!$aVars['bx_repeat:files']) {
         return '';
     }
     return $this->parseHtmlByName('block_files', $aVars);
 }
    function serviceHelpdeskCode()
    {
        $sChatUrl = getParam('bx_chat_plus_url');
        if (!getParam('bx_chat_plus_helpdesk') || !$sChatUrl) {
            return '';
        }
        if (getParam('bx_chat_plus_helpdesk_guest_only') && isLogged()) {
            return '';
        }
        $aUrl = parse_url($sChatUrl);
        $sChatUrl = $aUrl['scheme'] . '://' . $aUrl['host'] . ($aUrl['port'] ? ':' . $aUrl['port'] : '');
        return <<<EOS

<!-- Start of Helpdesk Livechat Script -->
<script type="text/javascript">
(function(w, d, s, u) {
\tw.RocketChat = function(c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u;
\tvar h = d.getElementsByTagName(s)[0], j = d.createElement(s);
\tj.async = true; j.src = '{$sChatUrl}/packages/rocketchat_livechat/assets/rocket-livechat.js';
\th.parentNode.insertBefore(j, h);
})(window, document, 'script', '{$sChatUrl}/livechat');
</script>
<!-- End of Helpdesk Livechat Script -->

EOS;
    }
 public function processing()
 {
     if ('on' != getParam('sys_autoupdate_modules')) {
         return;
     }
     BxDolStudioInstallerUtils::getInstance()->performModulesUpgrade();
 }
 function isRemoveAllowedAll()
 {
     if ($this->_iId == $this->_getAuthorId() && getParam('enable_cmts_profile_delete') == 'on') {
         return true;
     }
     return parent::isRemoveAllowedAll();
 }
Beispiel #25
0
 function activate($sTemplate)
 {
     $aTemplate = BxDolModuleQuery::getInstance()->getModuleByName($sTemplate);
     if (empty($aTemplate) || !is_array($aTemplate)) {
         return array('code' => 1, 'message' => _t('_adm_err_operation_failed'));
     }
     $aTemplates = array();
     $iTemplates = $this->oDb->getTemplatesBy(array('type' => 'active'), $aTemplates);
     if ($iTemplates == 1 && $aTemplates[0]['name'] == $sTemplate) {
         return array('code' => 1, 'message' => _t('_adm_dsg_err_last_active'));
     }
     $sTemplateDefault = getParam('template');
     if ($aTemplate['uri'] == $sTemplateDefault) {
         return array('code' => 2, 'message' => _t('_adm_dsg_err_deactivate_default'));
     }
     $oInstallerUtils = BxDolStudioInstallerUtils::getInstance();
     $aResult = (int) $aTemplate['enabled'] == 0 ? $oInstallerUtils->perform($aTemplate['path'], 'enable') : $oInstallerUtils->perform($aTemplate['path'], 'disable');
     if ($aResult['code'] != 0) {
         return $aResult;
     }
     $oTemplate = BxDolStudioTemplate::getInstance();
     $aResult = array('code' => 0, 'message' => _t('_adm_scs_operation_done'));
     if ((int) $aTemplate['enabled'] == 0) {
         $aResult['content'] = $oTemplate->parseHtmlByName('page_content_2_col.html', array('page_menu_code' => $this->getPageMenu(), 'page_main_code' => $this->getPageCode()));
     } else {
         $aResult['content'] = "";
     }
     return $aResult;
 }
Beispiel #26
0
 /**
  * Constructor
  * @param string $sType     - system type
  * @param string $sAction   - system action
  * @param int    $iObjectId - object id
  * @param int    $iSenderId - sender (action's author) profile id, if it is false - then currectly logged in profile id is used
  */
 public function __construct($sUnit, $sAction, $iObjectId, $iSender = false, $aExtras = array())
 {
     parent::__construct();
     if (getParam('sys_db_cache_enable')) {
         $oDb = BxDolDb::getInstance();
         $oCache = $oDb->getDbCacheObject();
         $sCacheKey = $oDb->genDbCacheKey('sys_alerts');
         $aData = $oCache->getData($sCacheKey);
         if (null === $aData) {
             $aData = $this->getAlertsData();
             $oCache->setData($sCacheKey, $aData);
         }
     } else {
         $aData = $this->getAlertsData();
     }
     $this->_aAlerts = $aData['alerts'];
     $this->_aHandlers = $aData['handlers'];
     $this->sUnit = $sUnit;
     $this->sAction = $sAction;
     $this->iObject = (int) $iObjectId;
     $this->aExtras = $aExtras;
     if (false === $iSender) {
         $oProfile = BxDolProfile::getInstance();
         $this->iSender = $oProfile ? $oProfile->id() : 0;
     } else {
         $this->iSender = (int) $iSender;
     }
 }
 function getBlockCode_RelatedFiles()
 {
     $this->oSearch->clearFilters(array('activeStatus', 'albumType', 'allow_view', 'album_status'), array('albumsObjects', 'albums'));
     $bLike = getParam('useLikeOperator');
     if ($bLike != 'on') {
         $aRel = array($this->aFileInfo['medTitle'], $this->aFileInfo['medDesc'], $this->aFileInfo['medTags'], $this->aFileInfo['Categories']);
         $sKeywords = getRelatedWords($aRel);
         if (!empty($sKeywords)) {
             $this->oSearch->aCurrent['restriction']['keyword'] = array('value' => $sKeywords, 'field' => '', 'operator' => 'against');
         }
     } else {
         $sKeywords = $this->aFileInfo['medTitle'] . ' ' . $this->aFileInfo['medTags'];
         $aWords = explode(' ', $sKeywords);
         foreach (array_unique($aWords) as $iKey => $sValue) {
             if (strlen($sValue) > 2) {
                 $this->oSearch->aCurrent['restriction']['keyword' . $iKey] = array('value' => trim(addslashes($sValue)), 'field' => '', 'operator' => 'against');
             }
         }
     }
     $this->oSearch->aCurrent['restriction']['id'] = array('value' => $this->aFileInfo['medID'], 'field' => $this->oSearch->aCurrent['ident'], 'operator' => '<>', 'paramName' => 'fileID');
     $this->oSearch->aCurrent['sorting'] = 'score';
     $iLimit = (int) $this->oConfig->getGlParam('number_related');
     $iLimit = $iLimit == 0 ? 2 : $iLimit;
     $this->oSearch->aCurrent['paginate']['perPage'] = $iLimit;
     $sCode = $this->oSearch->displayResultBlock();
     $aBottomMenu = array();
     $bWrap = true;
     if ($this->oSearch->aCurrent['paginate']['totalNum'] > 0) {
         $sCode = $GLOBALS['oFunctions']->centerContent($sCode, '.sys_file_search_unit');
         $aBottomMenu = $this->oSearch->getBottomMenu('category', 0, $this->aFileInfo['Categories']);
         $bWrap = '';
     }
     return array($sCode, array(), $aBottomMenu, $bWrap);
 }
 /**
  * Submit spammer
  * @param @aValues - array with keys: ip, email, username
  * @return false - on error, or true - on success
  */
 public function submitSpammer($aValues, $sEvidences = false)
 {
     if (!getParam('bx_antispam_stopforumspam_enable')) {
         return false;
     }
     $sKey = getParam('bx_antispam_stopforumspam_api_key');
     if (!$sKey) {
         return false;
     }
     $sData = 'api_key=' . $sKey . '&evidence=' . ($sEvidences ? rawurlencode($sEvidences) : 'spammer');
     foreach ($this->_aKeys as $k => $b) {
         if (isset($aValues[$k])) {
             $sData .= '&' . ('ip' == $k ? 'ip_addr' : $k) . '=' . rawurlencode($aValues[$k]);
         }
     }
     $fp = fsockopen("www.stopforumspam.com", 80);
     fputs($fp, "POST /add.php HTTP/1.1\n");
     fputs($fp, "Host: www.stopforumspam.com\n");
     fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
     fputs($fp, "Content-length: " . strlen($sData) . "\n");
     fputs($fp, "Connection: close\n\n");
     fputs($fp, $sData);
     fclose($fp);
     return true;
 }
Beispiel #29
0
 function BxDolPFM($iArea)
 {
     $this->aColNames = array(1 => array('Page' => 'Join', 'Order' => 'JoinOrder', 'Block' => 'JoinBlock', 'ShowSysItems' => 'Couple,Captcha,TermsOfUse,ProfilePhoto', 'EditAdd' => array('JoinPage')), 2 => array('Page' => 'Edit', 'Order' => 'EditOwnOrder', 'Block' => 'EditOwnBlock'), 3 => array('Page' => 'Edit', 'Order' => 'EditAdmOrder', 'Block' => 'EditAdmBlock', 'ShowSysItems' => 'Featured,Status,Membership'), 4 => array('Page' => 'Edit', 'Order' => 'EditModOrder', 'Block' => 'EditModBlock', 'ShowSysItems' => 'Featured,Status,Membership'), 5 => array('Page' => 'View', 'Order' => 'ViewAdmOrder', 'Block' => 'ViewAdmBlock', 'ShowSysItems' => 'ID,DateReg,DateLastEdit,DateLastLogin,Status,Age'), 6 => array('Page' => 'View', 'Order' => 'ViewMembOrder', 'Block' => 'ViewMembBlock', 'ShowSysItems' => 'ID,DateReg,DateLastEdit,DateLastLogin,Status,Age'), 7 => array('Page' => 'View', 'Order' => 'ViewModOrder', 'Block' => 'ViewModBlock', 'ShowSysItems' => 'ID,DateReg,DateLastEdit,DateLastLogin,Status,Age'), 8 => array('Page' => 'View', 'Order' => 'ViewVisOrder', 'Block' => 'ViewVisBlock', 'ShowSysItems' => 'ID,DateReg,DateLastEdit,DateLastLogin,Status,Age'), 9 => array('Page' => 'Search', 'Order' => 'SearchSimpleOrder', 'Block' => 'SearchSimpleBlock', 'EditAdd' => array('SearchParams'), 'ShowSysItems' => 'ID,Keyword,Location,Couple'), 10 => array('Page' => 'Search', 'Order' => 'SearchQuickOrder', 'Block' => 'SearchQuickBlock', 'EditAdd' => array('SearchParams'), 'ShowSysItems' => 'ID,Keyword,Location,Couple'), 11 => array('Page' => 'Search', 'Order' => 'SearchAdvOrder', 'Block' => 'SearchAdvBlock', 'EditAdd' => array('SearchParams'), 'ShowSysItems' => 'ID,Keyword,Location,Couple'));
     $this->sLinkPref = '#!';
     //prefix for values links (@see predefined links)
     $this->aTypes = array('text' => 'Text', 'area' => 'TextArea', 'html_area' => 'HtmlTextArea', 'pass' => 'Password', 'date' => 'Date', 'select_one' => 'Selector', 'select_set' => 'Multiple Selector', 'num' => 'Number', 'range' => 'Range', 'bool' => 'Boolean (checkbox)');
     //altering table properties
     $this->aTypesAlter = array('text' => "varchar(255) NOT NULL {default}", 'area' => "text NOT NULL", 'html_area' => "text NOT NULL", 'pass' => "varchar(40) NOT NULL", 'date' => "date NOT NULL {default}", 'select_one' => "enum({values})", 'select_one_linked' => "varchar(255) NOT NULL default ''", 'select_set' => "set({values}) NOT NULL default ''", 'select_set_linked' => "set({values}) NOT NULL default ''", 'num' => "int(10) unsigned NOT NULL {default}", 'range' => "varchar(255) NOT NULL {default}", 'bool' => "tinyint(1) NOT NULL {default}");
     $this->iAreaID = (int) $iArea;
     if (!($this->iAreaID > 0 and isset($this->aColNames[$this->iAreaID]))) {
         return false;
     }
     // retrieve default language
     $sLangDfl = addslashes(getParam('lang_default'));
     $sQuery = "SELECT `ID` FROM `sys_localization_languages` WHERE `Name` = '{$sLangDfl}'";
     $this->sLangID = (int) db_value($sQuery);
     if (!$this->sLangID) {
         die('Cannot continue. Default language not found. Check the Basic Settings.');
     }
     $this->areaPageName = $this->aColNames[$this->iAreaID]['Page'];
     $this->areaOrderCol = $this->aColNames[$this->iAreaID]['Order'];
     $this->areaBlockCol = $this->aColNames[$this->iAreaID]['Block'];
     $this->areaSysItems = $this->aColNames[$this->iAreaID]['ShowSysItems'];
     $this->areaEditAddCols = $this->aColNames[$this->iAreaID]['EditAdd'];
     $this->aBlocks = array();
     $this->aItems = array();
     $this->aBlocksInac = array();
     $this->aItemsInac = array();
 }
Beispiel #30
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->_oDb = new BxDolPaymentsQuery();
     $this->_aObjects = $this->_oDb->getObjects();
     $this->_sActiveUri = getParam('sys_default_payment');
 }