function MlClonetwoPageEditProcessor($iId) { global $logged; $this->aPages = array(0 => array(), 1 => array()); // double arrays (for couples) $this->aValues = array(0 => array(), 1 => array()); $this->aErrors = array(0 => array(), 1 => array()); //$iId = bx_get('ID'); $this->iPageID = (int) $iId; $iPageInfo = db_arr("SELECT `uri`, `author_id` FROM `ml_clonetwo_main` WHERE `id` = {$this->iPageID} LIMIT 1"); $this->sUri = $iPageInfo['uri']; //$this -> sSubCategory = $iPageInfo['SubCategory']; //$this -> sMainCategory = $iPageInfo['MainCategory']; // basic checks $iMemberID = getLoggedId(); // check if this member is owner if ($iPageInfo['author_id'] == $iMemberID) { $this->iArea = 2; } $this->bAjaxMode = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) and $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'); $this->bForceAjaxSave = bx_get('force_ajax_save'); $this->aFormPrivacy['form_attrs']['action'] = BX_DOL_URL_ROOT . 'modules/modloaded/clonetwo/edit.php?page_id=' . $this->iPageID; $this->aFormPrivacy['inputs']['profile_id']['value'] = $this->iPageID; $this->aFormPrivacy['inputs']['save_privacy']['value'] = _t('_edit_profile_privacy_save'); //parent::BxDolPageView('page_edit'); }
/** * page code function */ function PageCompPageMainCode() { global $site; global $short_date_format; $messageID = (int) $_GET['message']; $memberID = (int) $_COOKIE['memberID']; $sender_sql = "SELECT `Sender` FROM `Messages` WHERE `Recipient` = '{$memberID}' AND `ID` = '{$messageID}'"; $sender_arr = db_arr($sender_sql); $senderID = (int) $sender_arr['Sender']; $message_sql = "SELECT m.`Text`, m.`Subject`, DATE_FORMAT( m.`Date`, '{$short_date_format}' ) AS `Date`, p.Status FROM `Messages` AS m LEFT JOIN Profiles AS p ON m.Sender = p.ID WHERE m.`ID` = '{$messageID}' AND `Recipient` = '{$memberID}'"; // Did you find me, Smoge? I see you... $message_arr = db_arr($message_sql); $ret = ''; $ret .= '<div class="profile_ditails_block">'; $ret .= ProfileDetails($senderID); $ret .= '<div class="clear_both"></div>'; $ret .= '</div>'; $ret .= '<div class="m_block">'; $ret .= '<div class="m_subject_date">'; $ret .= '<div class="name">'; $ret .= _t('_Date') . ':'; $ret .= '</div>'; $ret .= '<div class="value">'; $ret .= $message_arr['Date']; $ret .= '</div>'; $ret .= '<div class="name">'; $ret .= _t('_Subject') . ':'; $ret .= '</div>'; $ret .= '<div class="value">'; $ret .= process_smiles(process_line_output($message_arr['Subject'])); $ret .= '</div>'; $ret .= '</div>'; $ret .= '<div class="m_text">'; $ret .= process_html_output($message_arr['Text'], 150); $ret .= '</div>'; $ret .= '<div class="clear_both"></div>'; $ret .= '</div>'; if ($message_arr['Status'] == 'Active') { $ret .= '<div class="reply">'; $ret .= '<a href="' . $site['url'] . 'compose.php?ID=' . $senderID . '&messageID=' . $messageID . '&subject=' . process_smiles(process_line_output($message_arr['Subject'])) . '">Reply</a>'; $ret .= '</div>'; $ret .= '<div class="reply">'; $ret .= "<a onClick=\"javascript:window.open( 'list_pop.php?action=spam&ID=" . $senderID . "', '', 'width=500,height=200,menubar=no,status=no,resizeable=no,scrollbars=no,toolbar=no,location=no' );\" href=\"javascript:void(0)\">" . _t('_Spam report') . "</a>"; $ret .= '</div>'; $ret .= '<div class="reply">'; $ret .= '<a href="messages_inbox.php?action=delete&message=' . $messageID . '">' . _t('_Delete') . '</a>'; $ret .= '</div>'; $ret .= '<div class="clear_both"></div>'; } else { $ret .= ''; } //$ret .= '</div>'; //#################################################### $ret .= '<div style="position:relative; height:20px;"></div>'; $ret .= PageCorespondence($memberID, $senderID); $ret .= '<div class="clear_both"></div>'; return $ret; }
/** * page code function */ function ThisPageMainCode() { global $logged; global $member; // create poll section ------------------------------------------------------------------- $ret .= '<div class="createPollSection">'; $query = "SELECT COUNT(id_poll) FROM ProfilesPolls WHERE id_profile = '{$member['ID']}'"; $ras_arr = db_arr($query); $polls_num = db_arr($query); $profile_poll_num = getParam("profile_poll_num"); if ($profile_poll_num && $polls_num[0] < $profile_poll_num) { // limit number of polls $ret .= ShowPollCreationForm(); } else { $ret .= _t('_max_poll_reached'); } $ret .= '</div>'; // show polls section -------------------------------------------------------------------- $ret .= '<div class="pollContainer" id="pol_container">'; $ret .= '<div class="clear_both"></div>'; $query = "SELECT id_poll, poll_status FROM ProfilesPolls WHERE id_profile = '{$member['ID']}'"; $polls_num = db_res($query); while ($poll_arr = mysql_fetch_array($polls_num)) { $uID = $poll_arr['id_poll']; $ret .= '<div id="pol_container_pol_' . $uID . '" class="controlsDiv">'; $ret .= ShowPoll($uID); $ret .= '<div class="innerControlBlock">'; //$ret .= '<div class="controlsHeader">' . _t('_controls') . ':</div>'; $sCurStatus = ''; $sCTStatus = ''; $status_change_to = ''; if ('active' == $poll_arr['poll_status']) { $sCurStatus = _t('_Active'); $sCTStatus = _t('_Disabled'); $status_change_to = 'disabled'; } else { $sCurStatus = _t('_Disabled'); $sCTStatus = _t('_Active'); $status_change_to = 'active'; } $ret .= "<span id=\"poll_status_{$uID}\" style=\"padding: 0px 2px;\"></span>"; $ret .= '<span class="deleteDiv"><a href="#" onclick=" if ( window.confirm(\'' . _t('_are you sure?') . '\') ) { send_data( \'\', \'delete\', \'\', \'' . $uID . '\' ); del_question_bar( document.getElementById(\'pol_container\'), document.getElementById(\'pol_container_pol_' . $uID . '\') ); } return false;">' . _t('_delete') . '</a></span>'; $ret .= '<script language="javascript"> poll_status_show( \'' . $uID . '\', \'poll_status_' . $uID . '\', \'' . $poll_arr['poll_status'] . '\', \'' . $status_change_to . '\', \'' . $sCurStatus . '\', \'' . $sCTStatus . '\' ); </script>'; $ret .= '</div>'; $ret .= '</div>'; } // if no polls if (!$uID) { $ret .= _t_err('_no poll'); } $ret .= '<div class="clear_both"></div>'; $ret .= '</div>'; return $ret; }
/** * get a quote from the database * returns HTML text that represents quote - text and author */ function quote_get() { global $quote_table; global $quote_html; $arr = db_arr("SELECT `Text`, `Author` FROM {$quote_table} ORDER BY RAND() LIMIT 1"); $ret = $quote_html; $ret = str_replace('%Text%', process_text_output($arr['Text']), $ret); $ret = str_replace('%Author%', process_line_output($arr['Author']), $ret); return $ret; }
function genProfileCSS($ID) { global $site; $ret = ''; $query = "SELECT * FROM `ProfilesSettings` WHERE `IDMember` = '{$ID}'"; $arr = db_arr($query); if ($arr['IDMember']) { $ret = "<style type=\"text/css\">\r\n\t\t\t body\r\n\t\t\t {\r\n\t\t\t \tbackground-image: url( {$site['profileBackground']}{$arr['BackgroundFilename']});\r\n\t\t\t \tbackground-color: {$arr['BackgroundColor']};\r\n\t\t\t \tbackground-repeat:repeat;\r\n\t\t\t }\r\n\t\t\t div#right_column_content\r\n\t\t\t {\r\n\t\t\t \tcolor: {$arr['FontColor']};\r\n\t\t\t \tfont-size: {$arr['FontSize']}px;\r\n\t\t\t \tfont-family: {$arr['FontFamily']};\r\n\t\t\t }\r\n\t\t\t div#divUnderCustomization\r\n\t\t\t {\r\n\t\t\t \tcolor: {$arr['FontColor']};\r\n\t\t\t \tfont-size: {$arr['FontSize']}px;\r\n\t\t\t \tfont-family: {$arr['FontFamily']};\r\n\t\t\t }\r\n\t\t\t\t</style>"; } return $ret; }
function getHomepageInfo($sUser, $sPwd) { if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) { return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct")); } $aRet = BxDolXMLRPCUtil::getUserInfo($iId); $aRet['unreadLetters'] = new xmlrpcval(getNewLettersNum($iId)); $aFriendReq = db_arr("SELECT count(*) AS `num` FROM `sys_friend_list` WHERE `Profile` = {$iId} AND `Check` = '0'"); $aRet['friendRequests'] = new xmlrpcval($aFriendReq['num']); return new xmlrpcval($aRet, "struct"); }
function serviceGetVideoArray($iPicId, $sImgType = 'browse') { $iPicId = (int) $iPicId; $sqlQuery = "SELECT a.`ID` as `id`,\r\n\t\t\t\t\t\t\ta.`Title` as `title`,\r\n\t\t\t\t\t\t\ta.`Description` as `description`,\r\n\t\t\t\t\t\t\ta.`Uri` as `uri`,\r\n\t\t\t\t\t\t\ta.`Owner` as `owner`,\r\n\t\t\t\t\t\t\ta.`Date` as `date`,\r\n\t\t\t\t\t\t\ta.`Video`,\r\n\t\t\t\t\t\t\ta.`Source`,\r\n\t\t\t\t\t\t\tb.`id_album` as `album_id`\r\n\t\t\t\t\t\tFROM `RayVideoFiles` as a\r\n\t\t\t\t\t\tLEFT JOIN `sys_albums_objects` as b ON b.`id_object` = a.`ID`\r\n\t\t\t\t\t\tLEFT JOIN `sys_albums` as c ON c.`ID`=b.`id_album`\r\n\t\t\t\t\t\tWHERE a.`ID`='{$iPicId}' AND c.`Type`='bx_videos'"; $aImageInfo = db_arr($sqlQuery); if (empty($aImageInfo) || !is_array($aImageInfo)) { return array(); } $sImg = $aImageInfo['id'] . $this->aConstants['picPostfix'][$sImgType]; $sFileName = $sImg != '' && extFileExists($this->aConstants['filesDir'] . $sImg) ? $this->aConstants['filesUrl'] . $sImg : ''; return array('file' => $sFileName, 'title' => $aImageInfo['title'], 'owner' => $aImageInfo['owner'], 'description' => $aImageInfo['description'], 'width' => (int) $this->oModule->_oConfig->getGlParam('browse_width') + 2 * 2, 'height' => (int) (int) $this->oModule->_oConfig->getGlParam('browse_height') + 2 * 2, 'url' => $this->getCurrentUrl('file', $iPicId, $aImageInfo['uri']), 'video' => $aImageInfo['Video'], 'source' => $aImageInfo['Source'], 'album_id' => $aImageInfo['album_id']); }
/** * page code function */ function PageCompPageMainCode() { global $_page; global $site; $show_form = true; $action_result = _t("_FORGOT", $site['title']); ob_start(); if ($_POST['Email']) { // Test if eneterd email is not valid if (!eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,4}\$", $_POST['Email'])) { $_page['header'] = _t("_Error"); $_page['header_text'] = _t("_Incorrect Email"); $action_result = _t("_INCORRECT_EMAIL"); } else { // Check if entered email is in the base $sEmail = htmlspecialchars_adv($_POST['Email']); $memb_arr = db_arr("SELECT `ID` FROM `Profiles` WHERE `Email` = '{$sEmail}'"); if ($memb_arr['ID']) { $recipient = $sEmail; $message = getParam("t_Forgot"); $subject = getParam('t_Forgot_subject'); generateNewPwd($memb_arr['ID']); $mail_ret = sendMail($recipient, $subject, $message, $memb_arr['ID']); $sQuery = "UPDATE `Profiles` SET `Password` = md5(`Password`) WHERE `ID`='{$memb_arr['ID']}'"; db_res($sQuery); createUserDataFile($memb_arr['ID']); if (!$mail_ret) { $_page['header'] = _t("_Recognized"); $_page['header_text'] = _t("_RECOGNIZED", $site['title']); $action_result = _t("_MEMBER_RECOGNIZED_MAIL_NOT_SENT", $site['title']); $show_form = false; } $_page['header'] = _t("_Recognized"); $_page['header_text'] = _t("_RECOGNIZED", $site['title']); $action_result = _t("_MEMBER_RECOGNIZED_MAIL_SENT", $site['url'], $site['title']); $show_form = false; } else { $_page['header'] = _t("_Not Recognized"); $_page['header_text'] = _t("_NOT_RECOGNIZED", $site['title']); $action_result = _t("_MEMBER_NOT_RECOGNIZED", $site['title']); } } } echo "<table width=\"100%\" cellpadding=4 cellspacing=4>\r\n\t\t\t<td align=center class=text2>\n"; echo $action_result; if ($show_form) { send_form(); } echo "\r\n\t\t\t</td></table>\n"; $ret = ob_get_contents(); ob_end_clean(); return $ret; }
/** * page code function */ function PageCompPageMainCode() { global $site; $messageID = (int) $_GET['message']; $memberID = (int) $_COOKIE['memberID']; $sender_sql = "SELECT `Recipient` FROM `Messages` WHERE `Sender` = '{$memberID}' AND `ID` = '{$messageID}'"; $sender_arr = db_arr($sender_sql); $senderID = $sender_arr['Recipient']; $message_sql = "SELECT m.`Text`, m.`Subject`, DATE_FORMAT( m.`Date`, '%Y-%m-%d' ) AS `Date`, p.Status FROM `Messages` AS m LEFT JOIN Profiles AS p ON m.Recipient = p.ID WHERE m.`ID` = '{$messageID}'"; // AND`Sender` = '$senderID'"; $message_arr = db_arr($message_sql); $ret = ''; $ret .= '<div class="profile_ditails_block">'; $ret .= ProfileDetails($senderID); $ret .= '<div class="clear_both"></div>'; $ret .= '</div>'; $ret .= '<div class="m_block">'; $ret .= '<div class="m_subject_date">'; $ret .= '<div class="name">'; $ret .= _t('_Date') . ':'; $ret .= '</div>'; $ret .= '<div class="value">'; $ret .= $message_arr['Date']; $ret .= '</div>'; $ret .= '<div class="name">'; $ret .= _t('_Subject') . ':'; $ret .= '</div>'; $ret .= '<div class="value">'; $ret .= process_smiles(process_line_output($message_arr['Subject'])); $ret .= '</div>'; $ret .= '</div>'; $ret .= '<div class="m_text">'; $ret .= process_html_output($message_arr['Text'], 80); $ret .= '</div>'; $ret .= '<div class="clear_both"></div>'; $ret .= '</div>'; //$ret .= '<div class="reply_block">'; if ($message_arr['Status'] == 'Active') { $ret .= '<div class="reply">'; $ret .= '<a href="' . $site['url'] . 'compose.php?ID=' . $senderID . '">Write new Message</a>'; $ret .= '</div>'; $ret .= '<div class="clear_both"></div>'; } else { $ret .= ''; } //#################################################### $ret .= '<div style="position:relative; height:20px;"></div>'; $ret .= PageCorespondence($memberID, $senderID); $ret .= '<div class="clear_both"></div>'; return $ret; }
/** * Prints total members statisric */ function contr_panel_members_total($w = "") { global $site; global $prof; global $PageCompMemberStat_db_num; $free_mode = getParam("free_mode") == "on" ? 1 : 0; // members statistics $total_c2 = strlen($_POST['total_c2']) ? $_POST['total_c2'] : getParam("default_country"); $total_arr = db_arr("SELECT COUNT(ID) FROM `Profiles` WHERE Status = 'Active'"); $total_arr_week = db_arr("SELECT COUNT(ID) FROM `Profiles` WHERE Status = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(LastReg)) <= 7"); if (!$free_mode) { $total_arr_gold = getMembersCount(MEMBERSHIP_ID_STANDARD, '', true); } $total_c_arr = db_arr("SELECT COUNT(ID) FROM `Profiles` WHERE Status = 'Active' AND `Country` = '" . process_db_input($total_c2) . "'"); $total_members = $total_arr[0]; $total_c_members = $total_c_arr[0]; $c_arr = $prof['countries']; $ret = ''; $ret .= '<div class="totalRegBlock">'; $ret .= '<div class="clear_both"></div>'; $ret .= '<div style="position:relative; float:left;"><img src="' . $site['icons'] . 'group.gif" alt="" /></div>'; $ret .= '<div style="position:relative; float:left; white-space:nowrap; left:5px; font-weight:bold; color:#000;">' . _t("_Total Registered") . '</div>'; $ret .= '<div class="clear_both"></div>'; $ret .= '<div style="position:relative; margin:0px 0px;"></div>'; $ret .= '<div class="member_stat_block">'; $ret .= '<div><img src="' . $site['icons'] . 'us.gif" alt="" /><span style="margin-left:5px;">' . _t("_Total") . ' - ' . $total_arr[0] . '</span></div>'; if (!$free_mode) { $ret .= '<div><img src="' . $site['icons'] . 'us.gif" alt="" /><span style="margin-left:5px;">' . _t("_Gold Members") . ' - ' . $total_arr_gold . '</span></div>'; } $ret .= '<div><img src="' . $site['icons'] . 'us.gif" alt="" /><span style="margin-left:5px;">' . _t("_New this week") . ' - ' . $total_arr_week[0] . '</span></div>'; $ret .= '<div><img src="' . $site['icons'] . 'us.gif" alt="" /><span style="margin-left:5px;">' . $total_c_members . ' ' . _t("_members") . ' ' . _t("_from") . '</span></div>'; $ret .= '<div class="mem_stat_country">'; $ret .= '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="cForm2">'; $ret .= '<input type="hidden" name="total_c2" value="' . $total_c2 . '" />'; $ret .= '<select class="mem_stat_country_select" name="total_c2" onChange="javascript:this.form.submit();">'; foreach ($c_arr as $key => $value) { $ret .= '<option value="' . $key . '"'; if ($key == $total_c2) { $ret .= ' selected="selected"'; } $ret .= '>' . _t('__' . $value) . '</option>'; } $ret .= '</select>'; $ret .= '</form>'; $ret .= '</div>'; $ret .= '</div>'; $ret .= '</div>'; return $ret; }
/** * page code function */ function PageCompPageMainCode() { global $short_date_format; $story_id = (int) $_GET['ID']; $out = ""; $query = "SELECT `Profiles`.`ID`, DATE_FORMAT(`Stories`.`Date`, '{$short_date_format}' ) AS 'Date', `Stories`.`Header`, `Stories`.`Text`, `Profiles`.`NickName` FROM `Stories` LEFT JOIN `Profiles` ON (`Stories`.`Sender` = `Profiles`.`ID`) WHERE `Stories`.`ID` = {$story_id} ORDER BY `Stories`.`Date` DESC"; $arr = db_arr($query); if (!$arr) { return "<center>" . _t("_No success story available.") . "</center>"; } $story_header = process_text_output($arr['Header']); $story_text = process_html_output($arr['Text']); $out .= "\r\n\t\t<table width=\"100%\" cellpadding=4 cellspacing=4><td align=center class=text2>\r\n\t\t\t<td>\r\n\t\t\t\t<table cellspacing=1 cellpadding=2 class=small width=100%>\r\n\t\t\t\t\t<tr class=panel>\r\n\t\t\t\t\t\t<td align=center width=15%>{$arr['Date']}</td>\r\n\t\t\t\t\t\t<td align=center width=15%><a href='" . getProfileLink($arr['ID']) . "'>{$arr['NickName']}</td>\r\n\t\t\t\t\t\t<td aling=left> <b>{$story_header}</b></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t\t<table cellspacing=1 cellpadding=2 class=small width=100%>\r\n\t\t\t\t\t<tr class=panel>\r\n\t\t\t\t\t\t<td aling=left>{$story_text}</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t</td>\r\n\t\t</table>\n"; return $out; }
function serviceGetEntry($iId, $sType = 'browse') { $iId = (int) $iId; $sqlQuery = "SELECT a.`ID` as `id`,\n a.`Title` as `title`,\n a.`Description` as `description`,\n a.`Uri` as `uri`,\n a.`Owner` as `owner`,\n a.`Date` as `date`,\n a.`Video`,\n a.`Source`,\n a.`Rate` AS `rate`,\n a.`RateCount` AS `rate_count`,\n a.`CommentsCount` AS `comments_count`,\n a.`Views` AS `views_count`,\n a.`Status` AS `status`,\n b.`id_album` as `album_id`\n FROM `RayVideoFiles` as a\n LEFT JOIN `sys_albums_objects` as b ON b.`id_object` = a.`ID`\n LEFT JOIN `sys_albums` as c ON c.`ID`=b.`id_album`\n WHERE a.`ID`='{$iId}' AND c.`Type`='bx_videos'"; $aImageInfo = db_arr($sqlQuery); if (empty($aImageInfo) || !is_array($aImageInfo)) { return array(); } $sFileName = $sFilePath = ''; $sImg = $aImageInfo['id'] . $this->aConstants['picPostfix'][$sType]; if ($sImg != '' && extFileExists($this->aConstants['filesDir'] . $sImg)) { $sFileName = $this->aConstants['filesUrl'] . $sImg; $sFilePath = $this->aConstants['filesDir'] . $sImg; } return array('id' => $aImageInfo['id'], 'file' => $sFileName, 'file_path' => $sFilePath, 'title' => $aImageInfo['title'], 'owner' => $aImageInfo['owner'], 'description' => $aImageInfo['description'], 'width' => (int) $this->oModule->_oConfig->getGlParam('browse_width') + 2 * 2, 'height' => (int) (int) $this->oModule->_oConfig->getGlParam('browse_height') + 2 * 2, 'url' => $this->getCurrentUrl('file', $iId, $aImageInfo['uri']), 'video' => $aImageInfo['Video'], 'source' => $aImageInfo['Source'], 'rate' => $aImageInfo['rate'], 'rate_count' => $aImageInfo['rate_count'], 'comments_count' => $aImageInfo['comments_count'], 'views_count' => $aImageInfo['views_count'], 'status' => $aImageInfo['status'], 'album_id' => $aImageInfo['album_id']); }
function banner_put($ID = 0, $Track = 1) { global $bann_click_url; if (!$ID) { // Get only banners that are active and for which promotion period has not expired. $bann_arr = db_arr("SELECT `ID`, `Url`, `Text` FROM `Banners` WHERE `Active` <> 0 AND `campaign_start` <= NOW() AND `campaign_end` >= NOW() ORDER BY RAND() LIMIT 1"); } else { $bann_arr = db_arr("SELECT `ID`, `Url`, `Text` FROM `Banners` WHERE `ID` = {$ID} LIMIT 1"); } if (!$bann_arr) { return ""; } if ($Track) { db_res("INSERT INTO `BannersShows` SET `ID` = {$bann_arr['ID']}, `Date` = NOW(), `IP` = '" . $_SERVER['REMOTE_ADDR'] . "'", 0); } return "<a target=\"_blank\" href=\"{$bann_click_url}?{$bann_arr['ID']}\" onmouseout=\"ce()\" onfocus=\"ss('{$bann_arr['Url']}')\" onmouseover=\"return ss('{$bann_arr['Url']}')\">{$bann_arr['Text']}</a>"; }
/** * Static method to get an instance of a module's class. * * NOTE. The prefered usage is to get an instance of [ClassPrefix]Module class. * But if it's needed an instance of class which has constructor without parameters * or with one parameter(an array with module's info) it can be retrieved. * * @param $sClassName module's class name. */ function getInstance($sClassName) { if (empty($sClassName)) { return null; } if (isset($GLOBALS['bxDolClasses'][$sClassName])) { return $GLOBALS['bxDolClasses'][$sClassName]; } else { $aModule = db_arr("SELECT * FROM `sys_modules` WHERE INSTR('" . $sClassName . "', `class_prefix`)=1 LIMIT 1"); if (empty($aModule) || !is_array($aModule)) { return null; } $sClassPath = BX_DIRECTORY_PATH_MODULES . $aModule['path'] . '/classes/' . $sClassName . '.php'; if (!file_exists($sClassPath)) { return null; } require_once $sClassPath; $GLOBALS['bxDolClasses'][$sClassName] = new $sClassName($aModule); return $GLOBALS['bxDolClasses'][$sClassName]; } }
function _getMessage($sUser, $sPwd, $iMsgId, $isInbox) { $aRet = array(); if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) { return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct")); } $aMsgs = array(); $iMsgId = (int) $iMsgId; $sJoinOn = $isInbox ? " `m`.`Sender` = `p`.`ID` " : " `m`.`Recipient` = `p`.`ID` "; $aRow = db_arr("SELECT \r\n `m`.`ID`, `m`.`Date`, `m`.`Sender`, `m`.`Recipient`, `m`.`Subject`, `m`.`Text`, `m`.`New`, \r\n `p`.`NickName` AS `Nick` \r\n FROM `sys_messages` AS `m`\r\n LEFT JOIN `Profiles` AS `p` ON ({$sJoinOn})\r\n WHERE `m`.`ID` = '{$iMsgId}'"); if ($aRow) { $sIcon = BxDolXMLRPCUtil::getThumbLink($isInbox ? $aRow['Sender'] : $aRow['Recipient'], 'thumb'); $aMsg = array('ID' => new xmlrpcval($aRow['ID']), 'Date' => new xmlrpcval($aRow['Date']), 'Sender' => new xmlrpcval($aRow['Sender']), 'Recipient' => new xmlrpcval($aRow['Recipient']), 'Subject' => new xmlrpcval($aRow['Subject']), 'Text' => new xmlrpcval($aRow['Text']), 'New' => new xmlrpcval($aRow['New']), 'Nick' => new xmlrpcval($aRow['Nick']), 'Thumb' => new xmlrpcval($sIcon)); if ($isInbox && $aRow['New']) { db_res("UPDATE `sys_messages` SET `New` = 0 WHERE `ID` = '{$iMsgId}'"); } } else { return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct")); } return new xmlrpcval($aMsg, "struct"); }
function _getMessage($sUser, $sPwd, $iMsgId, $isInbox) { $aRet = array(); if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) { return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct")); } $aMsgs = array(); $iMsgId = (int) $iMsgId; $sFieldsAdd = $isInbox ? ", `m`.`Sender` AS `AuthorID`" : ", `m`.`Recipient` AS `AuthorID` "; $aRow = db_arr("SELECT\n `m`.`ID`, UNIX_TIMESTAMP(`m`.`Date`) AS `Date`, `m`.`Sender`, `m`.`Recipient`, `m`.`Subject`, `m`.`Text`, `m`.`New` {$sFieldsAdd}\n FROM `sys_messages` AS `m`\n WHERE `m`.`ID` = '{$iMsgId}'"); if ($aRow) { $sIcon = BxDolXMLRPCUtil::getThumbLink($isInbox ? $aRow['Sender'] : $aRow['Recipient'], 'thumb'); $aMsg = array('ID' => new xmlrpcval($aRow['ID']), 'Date' => new xmlrpcval(defineTimeInterval($aRow['Date'])), 'Sender' => new xmlrpcval($aRow['Sender']), 'Recipient' => new xmlrpcval($aRow['Recipient']), 'Subject' => new xmlrpcval($aRow['Subject']), 'Text' => new xmlrpcval($aRow['Text']), 'New' => new xmlrpcval($aRow['New']), 'Nick' => new xmlrpcval(getUsername($aRow['AuthorID'])), 'UserTitleInterlocutor' => new xmlrpcval(getNickName($aRow['AuthorID'])), 'Thumb' => new xmlrpcval($sIcon)); if ($isInbox && $aRow['New']) { db_res("UPDATE `sys_messages` SET `New` = 0 WHERE `ID` = '{$iMsgId}'"); } } else { return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct")); } return new xmlrpcval($aMsg, "struct"); }
function printNewsPanel($iLimit = 0, $iPreview = 128) { global $site; $php_date_format = getParam('php_date_format'); // news $news_limit_chars = getParam("max_news_preview"); $bNewsFriendly = getParam('permalinks_news') == 'on' ? true : false; $news_res = getNewsList($iLimit); $news_count = db_arr("SELECT COUNT(*) FROM `News`"); $news_counter = $news_count['0']; $ret = ''; if ($news_counter > 0) { while ($news_arr = mysql_fetch_assoc($news_res)) { $ret .= '<div class="newsWrap">'; $ret .= '<div class="newsHead">'; $ret .= '<a href="' . getNewsUrl($news_arr['newsID'], $news_arr['NewsUri'], $bNewsFriendly) . '">'; $ret .= process_line_output($news_arr['Header']); $ret .= '</a>'; $ret .= '</div>'; //$ret .= '<div class="newsInfo"><img src="' . getTemplateIcon( 'clock.gif' ) . '" />' . date( $php_date_format, $news_arr['Date'] ) . '</div>'; $ret .= '<div class="newsInfo"><img src="' . getTemplateIcon('clock.gif') . '" />' . LocaledDataTime($news_arr['Date']) . '</div>'; $ret .= '<div class="newsText">'; //$ret .= process_text_withlinks_output( $news_arr['Snippet'] ); $ret .= process_html_output($news_arr['Snippet']); $ret .= '</div>'; $ret .= '</div>'; } if ($news_counter > $max_news_on_home) { $sNewsLink = $bNewsFriendly ? $site['url'] . 'news/' : $site['url'] . 'news.php'; $ret .= '<div class="newsReadMore">'; $ret .= '<a href="' . $sNewsLink . '">' . _t("_Read news in archive") . '</a>'; $ret .= '</div>'; } } else { $ret .= '<div class="no_result"><div>' . _t("_No news available") . '</div></div>'; } return $ret; }
function getArticleEditForm($iArticleID = '') { $sEditArticleC = _t('_Edit Article'); $sArticlesC = _t('_Articles'); $sArticleC = _t('_Article'); $sArticleTitleC = _t('_Article Title'); $sSelectCategoryC = _t('_Select Category'); $sPrintAsC = _t('_Print As'); $rCatories = $this->getArticlesCategoriesList(true); if ((int) $iArticleID) { $articleQuery = "\r\n\t\t\t\tSELECT `Articles`.`ArticlesID`, `Articles`.`CategoryID`, `Articles`.`Date`,\r\n\t\t\t\t\t\t`Articles`.`Title`, `Articles`.`Text`, `Articles`.`ArticleFlag`, `ArticlesCategory`.`CategoryName`\r\n\t\t\t\tFROM `Articles`\r\n\t\t\t\tINNER JOIN `ArticlesCategory` ON `ArticlesCategory`.`CategoryID` = `Articles`.`CategoryID`\r\n\t\t\t\tWHERE `Articles`.`ArticlesID` = '{$iArticleID}';\r\n\t\t\t"; $aArticle = db_arr($articleQuery); } $sCategoryNameAd = ''; if ($iArticleID && strlen($aArticle['CategoryName'])) { $sCategoryNameAd = <<<EOF <span>></span> <span><a href="{$this->sUrl}articles.php?catID={$aArticle['CategoryID']}&action=viewcategory">{$aArticle['CategoryName']}</a></span> <span>></span> <span>{$sEditArticleC}</span> EOF; } $sRetCateg = ''; while ($aCategory = mysql_fetch_assoc($rCatories)) { if ($aArticle['CategoryID'] == $aCategory['CategoryID']) { $sSelectedCategory = ' selected="selected"'; } else { $sSelectedCategory = ''; } $sRetCateg .= '<option value="' . $aCategory['CategoryID'] . '"' . $sSelectedCategory . '>' . process_line_output(strmaxtextlen($aCategory['CategoryName'], 50)) . '</option>' . "\n"; } $sArticleActions = ''; if ((int) $iArticleID) { $sArticleActions .= '<input type="hidden" name="edit_article" value="true" />' . "\n"; $sArticleActions .= '<input type="hidden" name="articleID" value="' . $iArticleID . '" />' . "\n"; } else { $sArticleActions .= '<input type="hidden" name="add_article" value="true" />' . "\n"; } $sTitle = process_line_output($aArticle['Title']); $textSelected = $aArticle['ArticleFlag'] == 'Text' ? ' selected="selected"' : ''; $htmlSelected = $aArticle['ArticleFlag'] == 'HTML' ? ' selected="selected"' : ''; $ret = <<<EOF <div class="navigationLinks"> \t<span><a href="{$this->sUrl}articles.php">{$sArticlesC}</a></span> \t{$sCategoryNameAd} </div> <script type="text/javascript"> function checkForm() { \tvar el; \tvar hasErr = false; \tvar fild = ""; \tel = document.getElementById("articleTitle"); \tif( el.value.length < 3 ) { \t\tel.style.backgroundColor = "pink"; \t\thasErr = true; \t\tfild += " Article Title"; \t} else { \t\tel.style.backgroundColor = "#fff"; \t} \tel = document.getElementById("articleBody"); \tif( el.value.length < 3 ) { \t\tif (typeof tinyMCE != 'undefined') {//here Tiny \t\t\tif( tinyMCE.selectedElement.innerHTML.length < 3 ) { \t\t\t\tel.style.backgroundColor = "pink"; \t\t\t\thasErr = true; \t\t\t\tfild += " Article text"; \t\t\t} else { \t\t\t\tel.style.backgroundColor = "#fff"; \t\t\t} \t\t} \t} else { \t\tel.style.backgroundColor = "#fff"; \t} \tel = document.getElementById("categoryID"); \tif( el.value.length < 1 ) { \t\tel.style.backgroundColor = "pink"; \t\thasErr = true; \t\tfild += " Category "; \t} else { \t\tel.style.backgroundColor = "#fff"; \t} \tel = document.getElementById("flag"); \tif( el.value.length < 1 ) { \t\tel.style.backgroundColor = "pink"; \t\thasErr = true; \t\tfild += " Text type "; \t} else { \t\tel.style.backgroundColor = "#fff"; \t} \tif (hasErr) { \t\talert( "Please fill next fields first!" + fild ) \t\treturn false; \t} else { \t\treturn true; \t} } </script> <div class="articlesFormBlock"> \t<form method="post" action="{$this->sUrl}articles.php" onsubmit="return checkForm();"> \t\t<div>{$sArticleTitleC}</div> \t\t<div> \t\t\t<input type="text" name="title" id="articleTitle" class="catCaption" value="{$sTitle}" /> \t\t</div> \t\t<div>{$sArticleC}</div> \t\t<div style="margin-bottom:7px;"> \t\t\t<textarea name="article" id="articleBody" class="classfiedsTextArea articl">{$aArticle['Text']}</textarea> \t\t</div> \t\t<div style="margin-bottom:7px;"> \t\t\t<select name="categoryID" id="categoryID"> \t\t\t\t<option value="">{$sSelectCategoryC}</option> \t\t\t\t{$sRetCateg} \t\t\t</select> \t\t</div> \t\t<div style="margin-bottom:7px;"> \t\t\t<input type="hidden" name="flag" value="HTML" /> \t\t\t<!-- <select name="flag" id="flag"> \t\t\t\t<option value="">{$sPrintAsC}</option> \t\t\t\t<option value="Text"{$textSelected}>Text</option> \t\t\t\t<option value="HTML"{$htmlSelected}>HTML</option> \t\t\t</select> --> \t\t</div> \t\t<div> \t\t\t<input type="submit" value="Submit"> \t\t\t{$sArticleActions} \t\t</div> \t</form> </div> EOF; return $ret; }
showError(_t('_Please login before using Ray chat')); } } else { showError(_t('_Ray is not enabled. Select <link> another module', $_SERVER['PHP_SELF'])); } exit; } // end of Ray support if ($isAdmin) { modules_login($adminName, $moduleName, 1); } else { if ($isMember) { $memberID = $_COOKIE['memberID']; // Extract module type from database by the module name, do not rely on GET, // because it is a hole: user can crack membership restrictions list($moduleType) = db_arr("SELECT `Type` FROM `Modules` WHERE `Name` = '{$dbModuleName}'"); if (strlen(trim($moduleType)) == 0) { showError(_t('_Invalid module name or invalid row in database') . 'ModuleName = "' . $moduleName . '"'); } // If module is forum or chat, then check if member is allowed to use the module switch ($moduleType) { case 'forum': $check_res = checkAction($memberID, ACTION_ID_USE_FORUM); if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) { showError($check_res[CHECK_ACTION_MESSAGE]); exit; } checkAction($memberID, ACTION_ID_USE_FORUM, true); break; case 'chat': $check_res = checkAction($memberID, ACTION_ID_USE_CHAT);
if (MemberDeleteNews()) { $action_result .= "News was deleted"; } else { $action_result .= "News deleting failed"; } } $_page['header'] = "News"; $_page['header_text'] = "News compose"; TopCodeAdmin(); ContentBlockHead("News"); if (strlen($action_result)) { echo "<br><center><div class=\"err\">{$action_result}</div></center><br>\n"; } MemberPrintNews(); if ((int) $_GET['edit_id'] != 0) { $news_arr = db_arr("SELECT `ID`, DATE_FORMAT(`Date`, '{$short_date_format}' ) AS 'Date', `Header`, `Snippet`, `Text` FROM `News` WHERE `ID` = " . (int) $_GET['edit_id']); } ContentBlockFoot(); ContentBlockHead("News compose"); ?> <form method="post" action="news.php"> <table style="border:1px solid gray;background-color:#EEEEEE;margin:0px auto;"> <tr> <td style="text-align:right;font-weight:bold;padding:3px;">Header:</td> <td style="padding:3px;"> <input name="header" style="width:380px;" value="<?php echo htmlspecialchars($news_arr['Header']); ?> ">
function getManageBannersBlock() { $sAsNew = _t('_adm_bann_Insert_as_new'); $sErrorC = _t('_Error Occured'); $sApplyChangesC = _t('_Submit'); $sTopC = _t('_Top'); $sLeftC = _t('_adm_bann_Left'); $sRightC = _t('_adm_bann_Right'); $sBottomC = _t('_Bottom'); $sHShiftC = _t('_adm_bann_HShift'); $sVShiftC = _t('_adm_bann_VShift'); $sTitleC = _t('_Title'); $sUrlC = _t('_URL'); $sActiveC = _t('_Active'); $sTextC = _t('_Text'); $sStartDateC = _t('_Start date'); $sEndDateC = _t('_Expiration date'); $sDefaultC = _t('_adm_bann_default'); $sPositionOnPageC = _t('_adm_bann_Position_on_the_page'); // get start & end dates $start_date_default = "2008-01-01 00:00:00"; $end_date_default = "2015-01-01 00:00:00"; $start_date = bx_get('start_date') !== false ? bx_get('start_date') : $start_date_default; $end_date = bx_get('end_date') !== false ? bx_get('end_date') : $end_date_default; $Title = $Url = $Active = $Text = $Position = $lhshift = $lvshift = $rhshift = $rvshift = ''; $iBannerID = (int) $_GET['banner_id']; $action = "new"; if ($iBannerID > 0 && !strlen(bx_get('action'))) { //banner edit $banns_arr = db_arr("SELECT * FROM `sys_banners` WHERE `ID`='{$iBannerID}'"); $action = "modify"; $Title = $banns_arr['Title']; $Url = $banns_arr['Url']; $Text = $banns_arr['Text']; $Active = $banns_arr['Active']; $Position = $banns_arr['Position']; $lhshift = $banns_arr['lhshift']; $lvshift = $banns_arr['lvshift']; $rhshift = $banns_arr['rhshift']; $rvshift = $banns_arr['rvshift']; list($iYearStart, $iMonthStart, $iDayStart) = explode('-', $banns_arr['campaign_start']); //$start_date = "{$iDayStart}/{$iMonthStart}/{$iYearStart}"; $start_date = "{$iYearStart}-{$iMonthStart}-{$iDayStart} 00:00:00"; list($iYearEnd, $iMonthEnd, $iDayEnd) = explode('-', $banns_arr['campaign_end']); //$end_date = "{$iDayEnd}/{$iMonthEnd}/{$iYearEnd}"; $end_date = "{$iYearEnd}-{$iMonthEnd}-{$iDayEnd} 00:00:00"; } $sFormTitle = htmlspecialchars($Title); $sFormUrl = htmlspecialchars($Url); $sFormActiveState = $Active ? 'checked="checked"' : ''; $sFormActiveStateVal = $Active ? 'yes' : ''; $sFormActiveStateChk = $Active ? true : false; $sFormBannerText = $Text; $sFormStartDate = $start_date; $sFormStartDateDef = $start_date_default; $sFormEndDate = $end_date; $sFormEndDateDef = $end_date_default; $sTopPosState = substr_count($Position, "1") > 0 ? 'checked="checked"' : ''; $sLeftPosState = substr_count($Position, "2") > 0 ? 'checked="checked"' : ''; $sRightPosState = substr_count($Position, "3") > 0 ? 'checked="checked"' : ''; $sBottomPosState = substr_count($Position, "4") > 0 ? 'checked="checked"' : ''; $sTopShift = substr_count($Position, "2") > 0 ? $lhshift : ''; $sLeftShift = substr_count($Position, "2") > 0 ? $lvshift : ''; $sRightShift = substr_count($Position, "3") > 0 ? $rhshift : ''; $sBottomShift = substr_count($Position, "3") > 0 ? $rvshift : ''; $sActionAdd = $action == "modify" ? $sAsNew . ' <input type=checkbox name=as_new />' : ''; $sCustomPositions = <<<EOF <table border=0 width=100% cellspacing=10 cellpading=20> \t<tr> \t\t<td colspan=5 align=center><input type=checkbox name="pos_top" {$sTopPosState} />{$sTopC}</td> \t</tr> \t<tr> \t\t<td colspan=2 align=center><input type=checkbox name="pos_left" {$sLeftPosState} />{$sLeftC}</td> \t\t<td> </td> \t\t<td colspan=2 align=center><input type=checkbox name="pos_right" {$sRightPosState} />{$sRightC}</td> \t</tr> \t<tr> \t\t<td>{$sHShiftC}</td> \t\t<td>{$sVShiftC}</td> \t\t<td> </td> \t\t<td>{$sHShiftC}</td> \t\t<td>{$sVShiftC}</td> \t</tr> \t<tr> \t\t<td><input name="lhshift" type=input size=5 value={$sTopShift} /></td> \t\t<td><input name="lvshift" type=input size=5 value={$sLeftShift} /></td> \t\t<td> </td> \t\t<td><input name="rhshift" type=input size=5 value={$sRightShift} /></td> \t\t<td><input name="rvshift" type=input size=5 value={$sBottomShift} /></td> \t</tr> \t<tr> \t\t<td colspan=5 align=center><input type=checkbox name="pos_bottom" {$sBottomPosState} />{$sBottomC}</td> \t</tr> </table> {$sActionAdd} EOF; $aForm = array('form_attrs' => array('name' => 'apply_ip_list_form', 'action' => $GLOBALS['site']['url_admin'] . 'banners.php', 'method' => 'post'), 'params' => array('db' => array('table' => 'sys_banners', 'key' => 'ID', 'submit_name' => 'add_button')), 'inputs' => array('BannerTitle' => array('type' => 'text', 'name' => 'Title', 'value' => $sFormTitle, 'caption' => $sTitleC, 'required' => true, 'checker' => array('func' => 'length', 'params' => array(2, 128), 'error' => _t('_chars_to_chars', 2, 128)), 'db' => array('pass' => 'Xss')), 'BannerUrl' => array('type' => 'text', 'name' => 'Url', 'value' => $sFormUrl, 'caption' => $sUrlC, 'required' => false, 'db' => array('pass' => 'Xss')), 'BannerActive' => array('type' => 'checkbox', 'name' => 'Active', 'caption' => $sActiveC, 'value' => 1, 'checked' => $sFormActiveStateChk), 'BannerText' => array('type' => 'textarea', 'name' => 'Text', 'value' => $sFormBannerText, 'caption' => $sTextC, 'required' => true, 'checker' => array('func' => 'length', 'params' => array(10, 32000), 'error' => _t('_chars_to_chars', 10, 32000)), 'db' => array('pass' => 'All')), 'StartDate' => array('type' => 'datetime', 'name' => 'start_date', 'value' => $sFormStartDate, 'caption' => $sStartDateC, 'label' => "{$sDefaultC}: {$sFormStartDateDef}", 'required' => true, 'checker' => array('func' => 'DateTime', 'error' => $sErrorC), 'display' => 'filterDate'), 'EndDate' => array('type' => 'datetime', 'name' => 'end_date', 'value' => $sFormEndDate, 'caption' => $sEndDateC, 'label' => "{$sDefaultC}: {$sFormEndDateDef}", 'required' => true, 'checker' => array('func' => 'DateTime', 'error' => $sErrorC), 'display' => 'filterDate'), 'Positions' => array('type' => 'custom', 'name' => 'Position', 'caption' => $sPositionOnPageC, 'content' => $sCustomPositions), 'ID' => array('type' => 'hidden', 'name' => 'banner_id', 'value' => $iBannerID), 'Action' => array('type' => 'hidden', 'name' => 'action', 'value' => $action), 'add_button' => array('type' => 'submit', 'name' => 'add_button', 'value' => $sApplyChangesC))); $sResult = ''; $oForm = new BxTemplFormView($aForm); $oForm->initChecker(); if ($oForm->isSubmittedAndValid()) { list($iYearStart, $iMonthStart, $iDayStart) = explode('-', $oForm->getCleanValue('start_date')); $sDateStart = "{$iYearStart}-{$iMonthStart}-{$iDayStart}"; list($iYearEnd, $iMonthEnd, $iDayEnd) = explode('-', $oForm->getCleanValue('end_date')); $sDateEnd = "{$iYearEnd}-{$iMonthEnd}-{$iDayEnd}"; $sCurTime = date("Y-m-d"); // 2010-12-31 $iLastId = (int) $oForm->getCleanValue('banner_id'); $banner_pos = ""; if ($oForm->getCleanValue('pos_top') == "on") { $banner_pos .= '1'; } if ($oForm->getCleanValue('pos_left') == "on") { $banner_pos .= '2'; } if ($oForm->getCleanValue('pos_right') == "on") { $banner_pos .= '3'; } if ($oForm->getCleanValue('pos_bottom') == "on") { $banner_pos .= '4'; } $banner_pos = (int) $banner_pos; $banner_lhshift = (int) $oForm->getCleanValue('lhshift'); $banner_lvshift = (int) $oForm->getCleanValue('lvshift'); $banner_rhshift = (int) $oForm->getCleanValue('rhshift'); $banner_rvshift = (int) $oForm->getCleanValue('rvshift'); $aValsAdd = array('Position' => $banner_pos, 'Active' => '' != $oForm->getCleanValue('Active') ? 1 : 0, 'Created' => $sCurTime, 'campaign_start' => $sDateStart, 'campaign_end' => $sDateEnd, 'lhshift' => $banner_lhshift, 'lvshift' => $banner_lvshift, 'rhshift' => $banner_rhshift, 'rvshift' => $banner_rvshift); if ($oForm->getCleanValue('action') == 'modify' && $oForm->getCleanValue('as_new') != "on" && $iLastId > 0) { $oForm->update($iLastId, $aValsAdd); } if ($oForm->getCleanValue('action') == 'new' || $oForm->getCleanValue('as_new') == "on" && $oForm->getCleanValue('action') == 'modify') { $iLastId = $oForm->insert($aValsAdd); } $sResult = $iLastId > 0 ? MsgBox(_t('_Success'), 3) : MsgBox($sErrorC); } return DesignBoxContent(_t('_adm_bann_title'), $sResult . $oForm->getCode(), 1); }
function uriCheckUniq($s, $sTable, $sField) { return !db_arr("SELECT 1 FROM {$sTable} WHERE {$sField} = '{$s}' LIMIT 1"); }
function getSiteStat($sMode = '') { global $site; $iMin = getParam("member_online_time"); $aStat = array('all' => array('capt' => _t("_Members"), 'query' => "SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status` = 'Active'", 'link' => 'browse.php', 'adm_query' => "", 'adm_link' => "profiles.php"), 'pph' => array('capt' => _t("_Photos"), 'query' => "SELECT COUNT(`medID`) FROM `sharePhotoFiles` WHERE `Approved`='true'", 'link' => 'browsePhoto.php', 'adm_query' => "", 'adm_link' => ""), 'evs' => array('capt' => _t("_Events"), 'query' => "SELECT COUNT(`ID`) FROM `SDatingEvents` WHERE `Status`='Active'", 'link' => 'events.php?show_events=all&action=show', 'adm_query' => "", 'adm_link' => ""), 'onl' => array('capt' => _t("_Online"), 'query' => "SELECT COUNT(`ID`) AS `count_onl` FROM `Profiles` WHERE `LastNavTime` > SUBDATE(NOW(), INTERVAL {$iMin} MINUTE)", 'link' => 'search_result.php?online_only=1', 'adm_query' => "", 'adm_link' => ""), 'pvi' => array('capt' => _t("_Videos"), 'query' => "SELECT COUNT(`ID`) FROM `RayMovieFiles` WHERE `Approved`='true'", 'link' => 'browseVideo.php', 'adm_query' => "", 'adm_link' => ""), 'pls' => array('capt' => _t("_Polls"), 'query' => "SELECT COUNT(`id_poll`) FROM `ProfilesPolls` WHERE `poll_approval`='1'", 'link' => 'polls.php', 'adm_query' => "", 'adm_link' => ""), 'ntd' => array('capt' => _t("_New Today"), 'query' => "SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status` = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(`LastReg`)) <= 1", 'link' => '', 'adm_query' => "", 'adm_link' => ""), 'pmu' => array('capt' => _t("_Music"), 'query' => "SELECT COUNT(`ID`) FROM `RayMusicFiles` WHERE `Approved`='true'", 'link' => 'browseMusic.php', 'adm_query' => "", 'adm_link' => ""), 'tps' => array('capt' => _t("_Topics"), 'query' => "SELECT IF( NOT ISNULL( SUM(`forum_topics`)), SUM(`forum_posts`), 0) AS `Num` FROM `pre_forum`", 'link' => 'orca', 'adm_query' => "", 'adm_link' => ""), 'nwk' => array('capt' => _t("_This Week"), 'query' => "SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status` = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(`LastReg`)) <= 7", 'link' => '', 'adm_query' => "", 'adm_link' => ""), 'pvd' => array('capt' => _t("_Profile Videos"), 'query' => "SELECT `Approved` FROM `RayVideoStats`", 'link' => '', 'adm_query' => "", 'adm_link' => "", 'hide' => false), 'pts' => array('capt' => _t("_Posts"), 'query' => "SELECT IF( NOT ISNULL( SUM(`forum_posts`)), SUM(`forum_posts`), 0) AS `Num` FROM `pre_forum` ", 'link' => 'orca', 'adm_query' => "", 'adm_link' => ""), 'nmh' => array('capt' => _t("_This Month"), 'query' => "SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status` = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(`LastReg`)) <= 30", 'link' => '', 'adm_query' => "", 'adm_link' => ""), 'tgs' => array('capt' => _t("_Tags"), 'query' => "SELECT COUNT( DISTINCT `Tag` ) FROM `Tags`", 'link' => '', 'adm_query' => "", 'adm_link' => ""), 'ars' => array('capt' => _t("_Articles"), 'query' => "SELECT COUNT(`ArticlesID`) FROM `Articles`", 'link' => 'articles.php', 'adm_query' => "", 'adm_link' => ""), 'nyr' => array('capt' => _t("_This Year"), 'query' => "SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status` = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(`LastReg`)) <= 365", 'link' => '', 'adm_query' => "", 'adm_link' => ""), 'grs' => array('capt' => _t("_Groups"), 'query' => "SELECT COUNT(`ID`) FROM `Groups` WHERE `status`='Active'", 'link' => 'groups_home.php', 'adm_query' => "", 'adm_link' => ""), 'cls' => array('capt' => _t("_Classifieds"), 'query' => "SELECT COUNT(`ID`) FROM `ClassifiedsAdvertisements` WHERE `Status`='active'", 'link' => 'classifieds.php?Browse=1', 'adm_query' => "", 'adm_link' => ""), 'frs' => array('capt' => _t("_Friends"), 'query' => "SELECT COUNT(`ID`) FROM `FriendList` WHERE `Check`='1'", 'link' => '', 'adm_query' => "", 'adm_link' => "")); if ($sMode == 'admin') { $aAdmin = array('all' => array('adm_query' => "SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status`!='Active'", 'adm_link' => 'profiles.php?profiles=Approval'), 'pph' => array('adm_query' => "SELECT COUNT(`medID`) FROM `sharePhotoFiles` WHERE `Approved`='false'", 'adm_link' => 'browsePhoto.php'), 'evs' => array('adm_query' => "SELECT COUNT(`ID`) FROM `SDatingEvents` WHERE `Status`!='Active'", 'adm_link' => 'sdating_admin.php'), 'onl' => array('adm_query' => "", 'adm_link' => ''), 'pvi' => array('adm_query' => "SELECT COUNT(`ID`) FROM `RayMovieFiles` WHERE `Approved`!='true'", 'adm_link' => 'browseVideo.php'), 'pls' => array('adm_query' => "SELECT COUNT(`id_poll`) FROM `ProfilesPolls` WHERE `poll_approval`!='1'", 'adm_link' => 'post_mod_ppolls.php'), 'ntd' => array('adm_query' => "", 'adm_link' => ''), 'pmu' => array('adm_query' => "SELECT COUNT(`ID`) FROM `RayMusicFiles` WHERE `Approved`!='true'", 'adm_link' => 'browseMusic.php'), 'tps' => array('adm_query' => "", 'adm_link' => ''), 'nwk' => array('adm_query' => "", 'adm_link' => ''), 'tgs' => array('adm_query' => "", 'adm_link' => ''), 'pts' => array('adm_query' => "", 'adm_link' => ''), 'nmh' => array('adm_query' => "", 'adm_link' => ''), 'frs' => array('adm_query' => "", 'adm_link' => ''), 'ars' => array('adm_query' => "", 'adm_link' => 'articles.php'), 'nyr' => array('adm_query' => "", 'adm_link' => ''), 'grs' => array('adm_query' => "SELECT COUNT(`ID`) FROM `Groups` WHERE `status`!='Active'", 'adm_link' => 'groups.php'), 'cls' => array('adm_query' => "SELECT COUNT(`ID`) FROM `ClassifiedsAdvertisements` WHERE `Status` != 'active'", 'adm_link' => 'manage_classifieds.php'), 'pvd' => array('adm_query' => "", 'adm_link' => 'javascript: openRayWidget(\'video\',\'admin\',\'{adminLogin}\',\'{adminPass}\');')); $sAdd = '_a'; $sProfVideo = getApplicationContent('video', 'stat', array(), true); } else { $aAdmin = ''; $sProfVideo = ''; } $sCode = $sProfVideo . '<div>'; foreach ($aStat as $sKey => $sVal) { $sLink = strlen($sVal['link']) > 0 ? '<a href="' . $site['url'] . $sVal['link'] . '">' . $sVal['capt'] . '</a>' : $sVal['capt']; if ($sVal['hide'] === true && $sMode != 'admin') { continue; } if (!is_array($aAdmin)) { $iNum = strlen($sVal['query']) > 0 ? db_value($sVal['query']) : 0; if ($sKey == 'pls') { $iNum = $iNum + db_value("SELECT COUNT(`ID`) FROM `polls_q` WHERE `Active`='on'"); } } else { $iNum = strlen($aAdmin[$sKey]['adm_query']) > 0 ? db_value($aAdmin[$sKey]['adm_query']) : 0; if (strlen($aAdmin[$sKey]['adm_link']) > 0) { if (substr($aAdmin[$sKey]['adm_link'], 0, strlen('javascript:')) == 'javascript:') { $sHref = 'javascript:void(0);'; $sOnclick = 'onclick="' . $aAdmin[$sKey]['adm_link'] . '"'; $aAdmin = db_arr("SELECT * FROM `Admins` LIMIT 1"); $sOnclick = str_replace('{adminLogin}', $aAdmin['Name'], $sOnclick); $sOnclick = str_replace('{adminPass}', $aAdmin['Password'], $sOnclick); } else { $sHref = $aAdmin[$sKey]['adm_link']; $sOnclick = ''; } $sLink = '<a href="' . $sHref . '" ' . $sOnclick . '>' . $sVal['capt'] . '</a>'; } else { $sLink = $sVal['capt']; } if ($sKey == 'pls') { $iNum = $iNum + db_value("SELECT COUNT(`ID`) FROM `polls_q` WHERE `Active`<>'on'"); } } switch ($sKey) { case 'all': case 'onl': case 'ntd': case 'nwk': case 'nmh': case 'nyr': $sIcon = 'mbs.gif'; break; case 'all': $sIcon = 'us.gif'; break; case 'pvi': case 'pvd': $sIcon = 'pvi.gif'; break; default: $sIcon = $sKey . '.gif'; } $sCode .= '<div class="siteStatUnit" id="' . $sKey . $sAdd . '"><img src="' . getTemplateIcon($sIcon) . '" /> ' . $iNum . ' ' . $sLink . '</div>'; } $sCode .= '</div><div class="clear_both"></div>'; return $sCode; }
function getModuleArray() { return db_arr("SELECT * FROM `sys_modules` WHERE `title` = 'Store' AND `class_prefix` = 'BxStore' LIMIT 1"); }
} } // --------------- page variables and login $_page['name_index'] = 1; $logged['member'] = member_auth(0, false); $_page['header'] = _t("_Forgot password?"); $_page['header_text'] = _t("_Password retrieval", $site['title']); // --------------- page components $_ni = $_page['name_index']; $aForm = array('form_attrs' => array('name' => 'forgot_form', 'action' => BX_DOL_URL_ROOT . 'forgot.php', 'method' => 'post'), 'params' => array('db' => array('submit_name' => 'do_submit'), 'checker_helper' => 'BxDolForgotCheckerHelper'), 'inputs' => array(array('type' => 'email', 'name' => 'Email', 'caption' => _t('_My Email'), 'value' => isset($_POST['Email']) ? $_POST['Email'] : '', 'required' => true, 'checker' => array('func' => 'email', 'error' => _t('_Incorrect Email'))), array('type' => 'captcha', 'name' => 'captcha', 'caption' => _t('_Enter Captcha'), 'required' => true, 'checker' => array('func' => 'captcha', 'error' => _t('_Incorrect Captcha'))), array('type' => 'submit', 'name' => 'do_submit', 'value' => _t("_Retrieve my information")))); $oForm = new BxTemplFormView($aForm); $oForm->initChecker(); if ($oForm->isSubmittedAndValid()) { // Check if entered email is in the base $sEmail = process_db_input($_POST['Email'], BX_TAGS_STRIP); $memb_arr = db_arr("SELECT `ID` FROM `Profiles` WHERE `Email` = '{$sEmail}'"); $recipient = $sEmail; $rEmailTemplate = new BxDolEmailTemplates(); $aTemplate = $rEmailTemplate->getTemplate('t_Forgot', $memb_arr['ID']); $aPlus['Password'] = generateUserNewPwd($memb_arr['ID']); $aProfile = getProfileInfo($memb_arr['ID']); $mail_ret = sendMail($recipient, $aTemplate['Subject'], $aTemplate['Body'], $memb_arr['ID'], $aPlus, 'html', false, true); // create system event require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php'; $oZ = new BxDolAlerts('profile', 'password_restore', $memb_arr['ID']); $oZ->alert(); $_page['header'] = _t("_Recognized"); $_page['header_text'] = _t("_RECOGNIZED", $site['title']); if ($mail_ret) { $action_result = _t("_MEMBER_RECOGNIZED_MAIL_SENT", $site['url'], $site['title']); } else {
/** * Stores specified member as participant of specified event and sends notification * letter to him * * @param int $memberID - member ID * @param int $eventID - event ID * @param int $transactionID - transaction ID in the database * * @return int/bool - true on success, 3 on mail wasn't sent, false otherwise * * */ function purchaseTicket($memberID, $eventID, $transactionID) { global $site; global $date_format; // argument validation $memberID = (int) $memberID; $eventID = (int) $eventID; $transactionID = (int) $transactionID; if ($transactionID == 0) { $transactionID = 'NULL'; } $memberArr = getProfileInfo($memberID); $eventArr = db_arr("SELECT `ID`, `Title`, `Place`, DATE_FORMAT(`EventStart`, '{$date_format}' ) AS EventStart, `TicketPriceFemale`, `TicketPriceMale`, `TicketCountFemale`, `TicketCountMale` FROM `SDatingEvents`\n\t\t\t\t\tWHERE `ID` = {$eventID}\n\t\t\t\t\tAND `Status` = 'Active'"); $participantUID = $memberArr['NickName'] . $eventID . rand(100, 999); $res = db_res("INSERT INTO `SDatingParticipants` SET `IDEvent` = {$eventID}, `IDMember` = {$memberID}, `ParticipantUID` = '{$participantUID}', `TransactionID` = {$transactionID}", 0); $subject = getParam('t_SDatingCongratulation_subject'); $messageText = getParam('t_SDatingCongratulation'); $aPlus = array(); $aPlus['NameSDating'] = $eventArr['Title']; $aPlus['PlaceSDating'] = $eventArr['Place']; $aPlus['WhenStarSDating'] = $eventArr['EventStart']; $aPlus['PersonalUID'] = $participantUID; $aPlus['LinkSDatingEvent'] = $site['url'] . 'events.php?action=show_info&event_id=' . $eventID; $mailRes = sendMail($memberArr['Email'], $subject, $messageText, $memberID, $aPlus); if ($res) { return $mailRes ? true : 3; } else { return false; } }
$status_text = 'Failed to update moderator.'; } } // Init global variables from GET array. // Init current page. $page = (int) $_GET['page']; if (!$page) { $page = 1; } // Init number of records per page. $p_per_page = (int) $_GET['p_per_page']; if (!$p_per_page) { $p_per_page = 30; } // Init total number of records to display. $p_num = db_arr('SELECT COUNT(*) FROM `moderators`;'); $p_num = $p_num[0]; // Init page number. $pages_num = ceil($p_num / $p_per_page); $real_first_p = (int) ($page - 1) * $p_per_page; $page_first_p = $real_first_p + 1; $sQuery = "\n\tSELECT\n\t\t\t`id`,\n\t\t\t`name`,\n\t\t\t`email`,\n\t\t\t`status`,\n\t\t\tDATE_FORMAT(`reg_date`, '{$date_format}' ) AS reg_date\n\tFROM\n\t\t\t`moderators`\n\tLIMIT {$real_first_p}, {$p_per_page};"; $result = db_res("{$sQuery}"); $page_p_num = mysql_num_rows($result); $_page['header'] = 'Manage Moderators'; // Set page title. TopCodeAdmin(); ContentBlockHead(''); ?> <?php
</a> </td> <td class="prof_stat_<?php echo $val; ?> " style="width: 50px; text-align: right;"> <?php echo $n_arr[0]; ?> </td> </tr> <?php } if (getParam("autoApproval_ifNoConfEmail") != 'on' && $val != 'Active') { $sActEmColor = ' #66CC66'; $n_arr = db_arr("SELECT COUNT(*) FROM `Profiles` WHERE `Status`='Unconfirmed'"); if ($n_arr[0]) { ?> <tr> <td class="text" style="background-color: #ffffff; text-align: left; vertical-align: middle; padding-left: 20px;"> <img src="images/arrow.gif" /> <a href="profiles.php?profiles=Unconfirmed"> With unconfirmed emails </a> </td> <td class="prof_stat_<?php echo $val; ?> " style="width: 50px; text-align: right;"> <?php echo $n_arr[0];
function getArticle($iArticleID) { global $short_date_format; if (!(int) $iArticleID) { return ''; } else { $sArticleQuery = "\n\t\t\t\tSELECT\n\t\t\t\t\t\t`Title`,\n\t\t\t\t\t\t`Text`,\n\t\t\t\t\t\t`Articles`.`CategoryID`,\n\t\t\t\t\t\tDATE_FORMAT( `Date`, '{$short_date_format}' ) AS Date,\n\t\t\t\t\t\t`ArticlesID`,\n\t\t\t\t\t\t`CategoryName`,\n\t\t\t\t\t\t`ArticleFlag`\n\t\t\t\tFROM\n\t\t\t\t\t\t`Articles`\n\t\t\t\tINNER JOIN `ArticlesCategory` ON `Articles`.`CategoryID` = `ArticlesCategory`.`CategoryID`\n\t\t\t\tWHERE\n\t\t\t\t\t\t`ArticlesID` = '{$iArticleID}'\n\t\t\t\tLIMIT 1;\n\n\t\t"; } $aArticle = db_arr($sArticleQuery); $ret = ''; $ret .= '<div class="navigationLinks">' . "\n"; $ret .= '<span>' . "\n"; $ret .= '<a href="articles.php">' . "\n"; $ret .= 'Articles' . "\n"; $ret .= '</a>' . "\n"; $ret .= '</span>' . "\n"; $ret .= '<span>' . "\n"; $ret .= '>' . "\n"; $ret .= '</span>' . "\n"; $ret .= '<span>' . "\n"; $ret .= '<a href="articles.php?catID=' . $aArticle['CategoryID'] . '&action=viewcategory">' . "\n"; $ret .= process_line_output($aArticle['CategoryName']) . "\n"; $ret .= '</a>' . "\n"; $ret .= '</span>' . "\n"; $ret .= '<span>' . "\n"; $ret .= '>' . "\n"; $ret .= '</span>' . "\n"; $ret .= '<span>' . "\n"; $ret .= process_line_output($aArticle['Title']) . "\n"; $ret .= '</span>' . "\n"; $ret .= '</div>' . "\n"; $ret .= '<div class="articleBlock">' . "\n"; $ret .= '<div class="mainTitle">' . "\n"; $ret .= process_line_output($aArticle['Title']) . "\n"; $ret .= '</div>' . "\n"; $ret .= '<div class="date">' . "\n"; $ret .= $aArticle['Date'] . "\n"; $ret .= '</div>' . "\n"; $ret .= '<div>' . "\n"; if ($aArticle['ArticleFlag'] == 'HTML') { $ret .= process_html_output($aArticle['Text']) . "\n"; } else { $ret .= process_text_output($aArticle['Text']) . "\n"; } $ret .= '</div>' . "\n"; $ret .= '</div>' . "\n"; return $ret; }
function _getImageDbInfo($iId) { $iId = (int) $iId; $sqlQuery = "SELECT a.`ID` as `id`,\n \t\t\t\t\ta.`Ext` as `ext`,\n \t\t\t\t\ta.`Title` as `title`,\n \t\t\t\t\ta.`Desc` as `description`,\n \t\t\t\t\ta.`Uri` as `uri`,\n \t\t\t\t\ta.`Owner` as `owner`,\n \t\t\t\t\ta.`Date` as `date`,\n \t\t\t\t\ta.`Rate` as `rate`,\n \t\t\t\t\ta.`Hash`,\n \t\t\t\t\tb.`id_album` as `album_id`\n\t\t\t\t\t\t\tFROM `bx_photos_main` as a\n\t\t\t\t\t\t\tLEFT JOIN `sys_albums_objects` as b ON b.`id_object` = a.`ID`\n\t\t\t\t\t\t\tLEFT JOIN `sys_albums` as c ON c.`ID`=b.`id_album`\n\t\t\t\t\t\t\tWHERE a.`ID`='" . $iId . "' AND a.`Status`<>'disapproved' and c.`Type`='bx_photos'"; $aImageInfo = $iId ? db_arr($sqlQuery) : null; return $aImageInfo; }