当前位置: 首页>>代码示例>>PHP>>正文


PHP _format_when函数代码示例

本文整理汇总了PHP中_format_when函数的典型用法代码示例。如果您正苦于以下问题:PHP _format_when函数的具体用法?PHP _format_when怎么用?PHP _format_when使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_format_when函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displayItem

 function displayItem($aParams, &$aEntry)
 {
     $sSampleType = $aParams['sample_type'];
     $iViewerType = $aParams['viewer_type'];
     $bAdminPanel = $iViewerType == BX_TD_VIEWER_TYPE_ADMIN && (isset($aParams['admin_panel']) && $aParams['admin_panel'] || $sSampleType == 'admin');
     $sModuleUri = $this->_oConfig->getUri();
     $sLKLinkEdit = _t('_' . $sModuleUri . '_lcaption_edit');
     $aTmplVars = array('id' => $this->_oConfig->getSystemPrefix() . $aEntry['id'], 'caption' => str_replace("\$", "$", $aEntry['caption']), 'class' => !in_array($sSampleType, array('view')) ? ' ' . $this->sCssPrefix . '-text-snippet ' : '', 'date' => _format_when($aEntry['ago']), 'content' => str_replace("\$", "$", $aEntry['content']), 'link' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aEntry['uri'], 'bx_if:checkbox' => array('condition' => $bAdminPanel, 'content' => array('id' => $aEntry['id'])), 'bx_if:status' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_ADMIN, 'content' => array('status' => _t('_' . $sModuleUri . '_status_' . $aEntry['status']))), 'bx_if:featured' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_ADMIN && (int) $aEntry['featured'] == 1, 'content' => array()), 'bx_if:edit_link' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_ADMIN, 'content' => array('edit_link_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'admin/' . $aEntry['uri'], 'edit_link_caption' => $sLKLinkEdit)));
     return $this->parseHtmlByName('item.html', $aTmplVars);
 }
开发者ID:noormcs,项目名称:studoro,代码行数:10,代码来源:BxDolTextTemplate.php

示例2: getComment

 function getComment($iId, $iCmtId, $iAuthorId = 0)
 {
     global $sHomeUrl;
     $sFields = "'' AS `cmt_rated`,";
     $sJoin = '';
     if ($iAuthorId) {
         $sFields = '`r`.`cmt_rate` AS `cmt_rated`,';
         $sJoin = "LEFT JOIN {$this->_sTableTrack} AS `r` ON (`r`.`cmt_system_id` = " . $this->_aSystem['system_id'] . " AND `r`.`cmt_id` = `c`.`cmt_id` AND `r`.`cmt_rate_author_id` = {$iAuthorId})";
     }
     $aComment = $this->getRow("SELECT \r\n\t\t\t\t{$sFields}\r\n\t\t\t\t`c`.`cmt_id`, \r\n\t\t\t\t`c`.`cmt_parent_id`, \r\n\t\t\t\t`c`.`cmt_object_id`, \r\n\t\t\t\t`c`.`cmt_author_id`, \r\n\t\t\t\t`c`.`cmt_text`, \r\n\t\t\t\t`c`.`cmt_mood`,\r\n\t\t\t\t`c`.`cmt_rate`, \r\n\t\t\t\t`c`.`cmt_rate_count`, \r\n\t\t\t\t`c`.`cmt_replies`, \r\n\t\t\t\t(UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`c`.`cmt_time`)) AS `cmt_secs_ago`,\r\n\t\t\t\t`p`.`NickName` AS `cmt_author_name`\t\t\t\t\r\n\t\t\tFROM {$this->_sTable} AS `c`\r\n\t\t\tLEFT JOIN `Profiles` AS `p` ON (`p`.`ID` = `c`.`cmt_author_id`)\r\n\t\t\t{$sJoin}\r\n\t\t\tWHERE `c`.`cmt_object_id` = '{$iId}' AND `c`.`cmt_id` = '{$iCmtId}' \r\n\t\t\tLIMIT 1");
     $aComment['cmt_text'] = str_replace("[ray_url]", $sHomeUrl, $aComment['cmt_text']);
     $aComment['cmt_ago'] = _format_when($aComment['cmt_secs_ago']);
     return $aComment;
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:14,代码来源:BxDolCmtsQuery.php

示例3: getComments

 function getComments($iId, $iCmtParentId = 0, $iAuthorId = 0)
 {
     $sFields = "'' AS `cmt_rated`,";
     $sJoin = '';
     if ($iAuthorId) {
         $sFields = '`r`.`cmt_rate` AS `cmt_rated`,';
         $sJoin = "LEFT JOIN {$this->_sTableTrack} AS `r` ON (`r`.`cmt_system_id` = " . $this->_aSystem['system_id'] . " AND `r`.`cmt_id` = `c`.`cmt_id` AND `r`.`cmt_rate_author_id` = {$iAuthorId})";
     }
     $a = $this->getAll("SELECT \r\n\t\t\t\t{$sFields}\r\n\t\t\t\t`c`.`cmt_id`, \r\n\t\t\t\t`c`.`cmt_parent_id`, \r\n\t\t\t\t`c`.`cmt_object_id`, \r\n\t\t\t\t`c`.`cmt_author_id`, \r\n\t\t\t\t`c`.`cmt_text`, \r\n\t\t\t\t`c`.`cmt_rate`, \r\n\t\t\t\t`c`.`cmt_rate_count`, \r\n\t\t\t\t`c`.`cmt_replies`, \r\n\t\t\t\t(UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`c`.`cmt_time`)) AS `cmt_secs_ago`,\r\n\t\t\t\t`p`.`NickName` AS `cmt_author_name`,\r\n\t\t\t\t`m`.`med_file` AS `cmt_author_icon`\r\n\t\t\tFROM {$this->_sTable} AS `c`\r\n\t\t\tLEFT JOIN `Profiles` AS `p` ON (`p`.`ID` = `c`.`cmt_author_id`)\r\n\t\t\tLEFT JOIN `media` AS `m` ON (`m`.`med_id` = `p`.`PrimPhoto` AND `m`.`med_status` = 'active')\r\n\t\t\t{$sJoin}\r\n\t\t\tWHERE `c`.`cmt_object_id` = '{$iId}' AND `c`.`cmt_parent_id` = '{$iCmtParentId}'\r\n\t\t\tORDER BY `c`.`cmt_time` ASC");
     for (reset($a); list($k) = each($a);) {
         $a[$k]['cmt_ago'] = _format_when($a[$k]['cmt_secs_ago']);
     }
     return $a;
 }
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:14,代码来源:BxDolCmtsQuery.php

示例4: video_getList

function video_getList($sId)
{
    global $sModule;
    global $aXmlTemplates;
    global $sFilesPath;
    $sMode = getSettingValue($sModule, "listSource");
    $iCount = (int) getSettingValue($sModule, "listCount");
    if (!is_numeric($iCount) || $iCount <= 0) {
        $iCount = 10;
    }
    $oSource = new BxVideosSearch();
    $oSource->aCurrent['sorting'] = 'top';
    $oSource->aCurrent['paginate']['perPage'] = $iCount;
    $oSource->aCurrent['restriction']['id'] = array('value' => $sId, 'field' => 'ID', 'operator' => '<>');
    switch ($sMode) {
        case "Member":
            $sOwner = getValue("SELECT `Owner` FROM `" . MODULE_DB_PREFIX . "Files` WHERE `ID` = '" . $sId . "'");
            $oSource->aCurrent['restriction']['owner'] = array('value' => $sOwner, 'field' => 'Owner', 'operator' => '=');
            break;
        case "Related":
            $aFile = getArray("SELECT * FROM `" . MODULE_DB_PREFIX . "Files` WHERE `ID` = '" . $sId . "'");
            $oSource->aCurrent['restriction']['keyword'] = array('value' => $aFile['Title'] . " " . $aFile['Tags'] . " " . $aFile['Description'], 'field' => '', 'operator' => 'against');
            break;
        case "Top":
        default:
            $oSource->aCurrent['restriction']['id'] = array('value' => $sId, 'field' => 'ID', 'operator' => '<>');
            break;
    }
    $aData = $oSource->getSearchData();
    $iCurrentTime = time();
    $sResult = "";
    for ($i = 0; $i < count($aData); $i++) {
        $aData[$i]['uri'] = $oSource->getCurrentUrl('file', $aData[$i]['id'], $aData[$i]['uri']);
        $aData[$i]['date'] = _format_when($iCurrentTime - $aData[$i]['date']);
        $sImageFile = $aData[$i]['id'] . IMAGE_EXTENSION;
        $sThumbFile = $aData[$i]['id'] . THUMB_FILE_NAME . IMAGE_EXTENSION;
        if (!file_exists($sFilesPath . $sThumbFile)) {
            $sThumbFile = $sImageFile;
        }
        $sResult .= parseXml($aXmlTemplates['file'], $sThumbFile, $aData[$i]['size'], $aData[$i]['ownerName'], $aData[$i]['view'], $aData[$i]['voting_rate'], $aData[$i]['date'], $aData[$i]['title'], BX_DOL_URL_ROOT . $aData[$i]['uri']);
    }
    return $sResult;
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:43,代码来源:customFunctions.inc.php

示例5: genMessagesRows

 /**
  * Function will generate the messages rows ;
  *
  * @return         : Html presentation data ;
  */
 function genMessagesRows()
 {
     global $oSysTemplate;
     global $oFunctions;
     global $site;
     // init some needed variables ;
     $sOutputHtml = null;
     $sMessageBoxActions = null;
     $sMessagesTypesList = null;
     $sPerPageBlock = null;
     $aSortToglleElements = array('date_sort_toggle', 'subject_sort_toggle', 'type_sort_toggle', 'author_sort_toggle');
     $aMessageRows = array();
     // language keys ;
     $aLanguageKeys = array('author' => _t('_Author'), 'type' => _t('_Type'), 'subject' => _t('_Subject'), 'date' => _t('_Date'), 'new' => _t('_new'), 'contact' => _t('_Contact'), 'select' => _t('_Select'), 'all' => _t('_All'), 'none' => _t('_None'), 'read' => _t('_Read'), 'unread' => _t('_Unread'), 'delete' => _t('_Delete'), 'spam' => _t('_Report'), 'more' => _t('_More actions'), 'mark_read' => _t('_Mark as old'), 'mark_unread' => _t('_Mark as New'), 'restore' => _t('_Restore'), 'click_sort' => _t('_Click to sort'), 'recipient' => _t('_Recipient'));
     // get messages array ;
     $aMessages =& $this->getMessages();
     // generate list of messages types
     if (is_array($this->aRegisteredMessageTypes) and !empty($this->aRegisteredMessageTypes)) {
         foreach ($this->aRegisteredMessageTypes as $iKey => $sRegisteredType) {
             $sChecked = null;
             if (!empty($this->aReceivedMessagesTypes) and in_array($sRegisteredType, $this->aReceivedMessagesTypes)) {
                 $sChecked = ' checked="checked" ';
             }
             $aTemplateKeys = array('letters_type' => $sRegisteredType, 'letters_type_caption' => _t('_' . $sRegisteredType), 'checked' => $sChecked);
             $sMessagesTypesList .= $oSysTemplate->parseHtmlByName($this->aUsedTemplates['messages_types_list'], $aTemplateKeys);
         }
         unset($aTemplateKeys);
     }
     // processing all messages ;
     if (is_array($aMessages) and !empty($aMessages)) {
         // need for row devide ;
         $iIndex = 1;
         foreach ($aMessages as $iKey => $aItems) {
             // generate image and keyword for type of message ;
             $sTypeIcon = getTemplateIcon($this->sMessageIconPrefix . $aItems['Type'] . $this->sMessageIconExtension);
             $sTypeLang = _t('_' . $aItems['Type']);
             // get message's subject ;
             $sSubject = mb_strlen($aItems['Subject']) > $this->iMessageSubjectLength ? mb_substr($aItems['Subject'], 0, $this->iMessageSubjectLength) . '...' : $aItems['Subject'];
             // get message's description ;
             $sDescription = strip_tags($aItems['Text']);
             mb_strlen($sDescription) > $this->iMessageDescrLength ? $sDescription = mb_substr($sDescription, 0, $this->iMessageDescrLength) . '...' : null;
             // generate the `new` message's icon ;
             $sNewMessageImg = $aItems['New'] ? getTemplateIcon('new_message.png') : getTemplateIcon(null);
             // color devider ;
             $sFiledCss = !($iIndex % 2) ? 'filled' : 'not_filled';
             $aProfileInfo = $this->aMailBoxSettings['mailbox_mode'] != 'outbox' ? getProfileInfo($aItems['Sender']) : getProfileInfo($aItems['Recipient']);
             $sMemberIcon = $this->aMailBoxSettings['mailbox_mode'] != 'outbox' ? get_member_thumbnail($aItems['Sender'], 'left') : get_member_thumbnail($aItems['Recipient'], 'left');
             $sMemberLocation = $this->aMailBoxSettings['mailbox_mode'] != 'outbox' ? getProfileLink($aItems['Sender']) : getProfileLink($aItems['Recipient']);
             $sMemberNickName = getNickName($aProfileInfo['ID']);
             $sMemberAge = $aProfileInfo['DateOfBirth'] != "0000-00-00" ? _t("_y/o", age($aProfileInfo['DateOfBirth'])) : null;
             $sMemberCountry = $aProfileInfo['Country'];
             $sMemberFlag = $site['flags'] . strtolower($sMemberCountry) . $this->sMembersFlagExtension;
             $sMemberSexImg = $oFunctions->genSexIcon($aProfileInfo['Sex']);
             if ($sMemberCountry) {
                 $sMemberCountryFlag = '<img src="' . $sMemberFlag . '" alt="' . $sMemberCountry . '" />';
             }
             // generate the message status ;
             $sMessageStatus = $aItems['New'] ? 'unread' : 'read';
             $aMessageRows[] = array('message_id' => $aItems['ID'], 'message_status' => $sMessageStatus, 'message_owner' => $aItems['Sender'], 'message_link' => $aItems['ID'], 'message_page' => 'mail.php', 'member_icon' => $sMemberIcon, 'member_location' => $sMemberLocation, 'member_nickname' => $sMemberNickName, 'member_sex_img' => $sMemberSexImg, 'member_sex' => $aProfileInfo['Sex'], 'member_age' => $sMemberAge, 'member_flag' => $sMemberCountryFlag, 'member_country' => $sMemberCountry, 'message_type' => $sTypeLang, 'message_type_icon' => $sTypeIcon, 'message_subject' => $sSubject, 'bx_if:show_new' => array('condition' => $aItems['New'], 'content' => array()), 'message_descr' => $sDescription, 'message_new_img' => $sNewMessageImg, 'message_new' => $aLanguageKeys['new'], 'message_contact_url' => BX_DOL_URL_ROOT . "mail.php?mode=compose&recipient_id=" . $aProfileInfo['ID'], 'message_contact' => $aLanguageKeys['contact'], 'message_date' => $aItems['Date'], 'message_ago' => _format_when($aItems['DateUTS']), 'filled_class' => $sFiledCss);
             $iIndex++;
         }
     }
     // init sort toggle ellements ;
     switch ($this->aMailBoxSettings['sort_mode']) {
         case 'date':
             $aSortToglleElements['date_sort_toggle'] = 'toggle_up';
             break;
         case 'date_desc':
             $aSortToglleElements['date_sort_toggle'] = 'toggle_down';
             break;
         case 'subject':
             $aSortToglleElements['subject_sort_toggle'] = 'toggle_up';
             break;
         case 'subject_desc':
             $aSortToglleElements['subject_sort_toggle'] = 'toggle_down';
             break;
         case 'type':
             $aSortToglleElements['type_sort_toggle'] = 'toggle_up';
             break;
         case 'type_desc':
             $aSortToglleElements['type_sort_toggle'] = 'toggle_down';
             break;
         case 'author':
             $aSortToglleElements['author_sort_toggle'] = 'toggle_up';
             break;
         case 'author_desc':
             $aSortToglleElements['author_sort_toggle'] = 'toggle_down';
             break;
     }
     // generate the pagination ;
     $sRequest = BX_DOL_URL_ROOT . 'mail.php?';
     // need for additional parameters ;
     $aGetParams = array('mode', 'sorting', 'messages_types');
     if (is_array($aGetParams) and !empty($aGetParams)) {
         foreach ($aGetParams as $sValue) {
//.........这里部分代码省略.........
开发者ID:noormcs,项目名称:studoro,代码行数:101,代码来源:BxBaseMailBox.php

示例6: defineTimeInterval

/**
 * Convert timestamp to "ago" date format
 * @param $iTime date/time stamp in seconds
 * @param $bAutoDateConvert automatically convert dates to full date format instead of "ago" format for old dates (older than 14 days)
 * @param $bShort use short format for relative time
 * @return formatted date string
 */
function defineTimeInterval($iTime, $bAutoDateConvert = true, $bShort = false)
{
    $iTimeDiff = time() - (int) $iTime;
    if ($bAutoDateConvert && $iTimeDiff > 14 * 24 * 60 * 60) {
        // don't show "ago" dates for more than 14 days
        return getLocaleDate((int) $iTime);
    }
    return _format_when($iTimeDiff, $bShort);
}
开发者ID:blas-dmx,项目名称:dolphin.pro,代码行数:16,代码来源:utils.inc.php

示例7: PrintCommentSection

    /**
     * Generate Comments Section
     *
     * @param $iElementID - Post ID
     * @param $iOwnerID - Owner ID
     * @return HTML presentation of data
     */
    function PrintCommentSection($iElementID, $sCommentLbl = '')
    {
        global $prof;
        global $site;
        $sRetHtml = '';
        $sCommentsC = $sCommentLbl == '' ? _t('_comments') : $sCommentLbl;
        $sSbjN = _t('_Subject');
        $sPostedByC = _t('_Posted by');
        $sDateC = _t('_Date');
        $sLocationC = _t('_Location');
        $sAdminLocalAreaC = _t('_AdminArea');
        $sAdminC = _t('_Admin');
        $sSureC = _t("_Are you sure");
        $sPostCommentC = _t('_Post Comment');
        $sLeaveCommentC = _t('_LeaveComment');
        $sAddCommentC = _t('_Add comment');
        $sEditC = _t('_Edit');
        $sDeleteC = _t('_Delete');
        $sCommentFriendsOnlyC = _t('_commenting_this_blog_allowed_only_for_friends');
        $sReportC = _t('_Report');
        $sPostDataSQL = $this->SelectionObjectSQL($iElementID);
        $aPostData = db_arr($sPostDataSQL);
        $iOwnerID = $aPostData['OwnerID'];
        //$bFriend = is_friends( $this->iVisitorID, $aPostData['OwnerID'] );
        //$bOwner = ($this->iVisitorID==$aPostData['OwnerID']) ? true : false;
        $bCanPostComment = $this->GetPostNewCommentPermission($aPostData);
        $bCanPostCommentReport = $this->GetCommentReportPermission($aPostData);
        $sQuery = $this->SelectionCommentsObjectSQL($iElementID);
        $vSqlRes = db_res($sQuery);
        $sCommsHtml = '';
        while ($aSqlResStr = mysql_fetch_assoc($vSqlRes)) {
            $aCommentData = $this->FillCommentsData($aSqlResStr);
            $aProfileInfo = getProfileInfo($aCommentData['ProfID']);
            $sPostedBy = $aCommentData['ProfID'] == 0 ? $sAdminC : '<a href="' . getProfileLink($aCommentData['ProfID']) . '">' . $aProfileInfo['NickName'] . '</a>';
            $sCountryName = $aProfileInfo['Country'] == "" ? $sAdminLocalAreaC : _t('__' . $prof['countries'][$aProfileInfo['Country']]);
            $sCountryPic = $aProfileInfo['Country'] == '' ? '' : ' <img alt="' . $aProfileInfo['Country'] . '" src="' . ($site['flags'] . strtolower($aProfileInfo['Country'])) . '.gif"/>';
            $sUserIcon = get_member_icon($aCommentData['ProfID'], 'left', true);
            $aCommentData['Text'] = $aCommentData['Text'];
            $sTimeAgo = _format_when($aCommentData['Time']);
            $sMessageBR = $this->ActionPrepareForEdit($aCommentData['Text']);
            $sFullPermissions = $this->GetElementFullPermission($aPostData, $aCommentData);
            $sAdminActions = '';
            if ($sFullPermissions) {
                if ($this->iCType == 1) {
                    $sAdminActions = <<<EOF
<!-- <span class="comment_text_r"> -->
<div class="comment_actions">
\t<a href="{$this->sCurrBrowsedFile}" onclick="javascript: UpdateField('EditCommentID',{$aCommentData['ID']});UpdateField('EAdvID',{$iElementID}); UpdateFieldStyle('answer_form_to_1','block');UpdateFieldTiny('commentText','{$sMessageBR}'); return false;">{$sEditC}</a>|
\t<a href="{$_SERVER['PHP_SELF']}?ShowAdvertisementID={$aCommentData['ID']}" onclick="javascript: UpdateField('DeleteCommentID',{$aCommentData['ID']});UpdateField('DAdvID',{$iElementID});document.forms.command_delete_comment.submit(); return false;">{$sDeleteC}</a>
<!-- </span> -->
</div>
EOF;
                }
                if ($this->iCType == 2) {
                    $sAdminActions = <<<EOF
<span class="comment_text_r">
\t<a href="{$this->sCurrBrowsedFile}" onclick="javascript: UpdateField('EditCommentID',{$aCommentData['ID']});UpdateField('EPostID',{$iElementID});UpdateFieldStyle('answer_form_to_1','block');UpdateFieldTiny('commentText','{$sMessageBR}'); return false;">{$sEditC}</a>|
\t<a href="{$this->sCurrBrowsedFile}" onclick="javascript: UpdateField('DeleteCommentID',{$aCommentData['ID']});UpdateField('DPostID',{$iElementID});document.forms.command_delete_comment.submit(); return false;">{$sDeleteC}</a>
</span>
EOF;
                }
            }
            if ($bCanPostCommentReport) {
                if ($this->iCType == 1) {
                    $sReport = <<<EOF
<div class="comment_actions">
\t<a onclick="javascript: window.open( 'classifieds.php?commentID={$aCommentData['ID']}&clsID={$iElementID}&action=report', 'comment', 'width=500, height=380, menubar=no,status=no,resizable=yes,scrollbars=yes,toolbar=no,location=no' );return false;" href="#{$aCommentData['ID']}">{$sReportC}</a>
</div>
EOF;
                }
            }
            $sCommsHtml .= <<<EOF
<div class="comment_row">
\t{$sUserIcon}
\t{$sPostedBy} ({$sTimeAgo})<br />
\t{$aCommentData['Text']}<br />
\t{$sReport}<br />
\t{$sAdminActions}
\t<div class="clear_both"></div>
</div>
EOF;
        }
        $sPostNewComm = '';
        if ($bCanPostComment == true) {
            if ($this->iCType == 1) {
                $sPostNewComm = <<<EOF
<form action="{$this->sCurrBrowsedFile}" method="post" name="post_comment_adv_form">
\t<input type="hidden" name="CommAdvertisementID" value="{$iElementID}" />
\t<textarea name="message" id="postNewComm" rows="5" cols="30" class="classfiedsTextArea"></textarea>
\t<input id="postCommentAdv" name="postCommentAdv" type="submit" value="{$sPostCommentC}"/>
</form>
EOF;
            }
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:101,代码来源:BxDolComments.php

示例8: getPollBlock

 /**
 * Function will generate the pool block;
 *
 * @param : $aPollInfo (array) - contain some poll's information ;
                [ id_poll ]     - (integer) poll's Id;
                [ id_profile ]  - (integer) poll's owner Id;
                [ PollDate ]    - (string)  poll's date creation;
                [ sec ]         - (integer) poll's date creation in seconds;
 * @param : $bAjaxQuery (boolean) - if isset this param that script will use different template;
 */
 function getPollBlock(&$aPollInfo, $bAjaxQuery = false, $bViewMode = false, $bAdminMode = false)
 {
     if (!$this->oPrivacy->check('view', $aPollInfo['id_poll'], $this->aPollSettings['member_id'])) {
         return $this->getPrivatePollBlock($aPollInfo);
     }
     // ** init some needed variables ;
     $sPollActions = null;
     $aMemberInfo = array();
     // language keys ;
     $aLanguageKeys = array('results' => _t('_bx_poll_result'), 'delete' => _t('_bx_poll_delete'), 'edit' => _t('_bx_poll_edit'), 'active' => _t('_bx_poll_active'), 'sure' => _t('_Are you sure?'), 'by' => _t('_bx_poll_by'), 'poll' => _t('_bx_poll'), 'featured' => _t('_bx_poll_featured'), 'unfeatured' => _t('_bx_poll_unfeatured'), 'poll_approved' => _t('_bx_poll_approved'), 'poll_unapproved' => _t('_bx_poll_unapproved'));
     // **  generate the some of poll's information ;
     $sDateAdd = _format_when($aPollInfo['poll_ago']);
     // need to modify (move the top member's info to bottom)
     $aTemplateKeys = array('bx_if:start_tag' => array('condition' => !$bAjaxQuery, 'content' => array('uid' => $aPollInfo['id_poll'])), 'bx_if:manage_page' => array('condition' => $bAdminMode || in_array($this->aPollSettings['mode'], array('manage', 'pending')) && $this->aPollSettings['member_id'] && $this->aPollSettings['member_id'] == $aPollInfo['id_profile'], 'content' => array()), 'bx_if:end_tag' => array('condition' => !$bAjaxQuery, 'content' => array()), 'uid' => $aPollInfo['id_poll'], 'poll_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . '&action=show_poll_info&id=' . $aPollInfo['id_poll'], 'bx_if:show_link' => array('condition' => $aPollInfo['id_profile'], 'content' => array('link' => getProfileLink($aPollInfo['id_profile']), 'content' => getNickName($aPollInfo['id_profile']))), 'bx_if:show_text' => array('condition' => !$aPollInfo['id_profile'], 'content' => array('content' => _t('_Admin'))), 'date_add' => $sDateAdd, 'result' => $aLanguageKeys['results'], 'actions' => $sPollActions, 'by' => $aLanguageKeys['by'], 'bx_if:show_status' => array('condition' => $bAdminMode, 'content' => array('status' => $aPollInfo['poll_approval'] ? $aLanguageKeys['poll_approved'] : $aLanguageKeys['poll_unapproved'], 'featured' => $aPollInfo['poll_featured'] ? $aLanguageKeys['featured'] : $aLanguageKeys['unfeatured'])), 'bx_if:show_actions' => array('condition' => $bAdminMode, 'content' => array('url_edit' => $this->sPathToModule . '&action=my&mode=edit_poll&edit_poll_id=' . $aPollInfo['id_poll'])), 'pool_down_src' => $this->_oTemplate->getIconUrl('poll_down.png'), 'pool_up_src' => $this->_oTemplate->getIconUrl('poll_up.png'), 'spacer' => $this->_oTemplate->getIconUrl('spacer.gif'), 'back' => $aLanguageKeys['poll']);
     $sTemplateName = !$bViewMode ? $this->aUsedTemplates['poll_block'] : $this->aUsedTemplates['poll_view_block'];
     return $this->_oTemplate->parseHtmlByName($sTemplateName, $aTemplateKeys);
 }
开发者ID:Arvindvi,项目名称:dolphin,代码行数:27,代码来源:BxPollModule.php

示例9: getEvents

 function getEvents($aParams)
 {
     global $sHomeUrl;
     switch ($aParams['type']) {
         case 'id':
             $sWhereClause = "`id`='" . $aParams['object_id'] . "' ";
             $sLimitClause = 'LIMIT 1';
             break;
         case 'owner':
             $sWhereClause = "`owner_id`='" . $aParams['owner_id'] . "' " . (isset($aParams['filter']) ? $this->_getFilterAddon($aParams['owner_id'], $aParams['filter']) : '');
             $sOrderClause = isset($aParams['order']) ? ' ORDER BY `date` ' . strtoupper($aParams['order']) : '';
             $sLimitClause = isset($aParams['count']) ? ' LIMIT ' . $aParams['start'] . ', ' . $aParams['count'] : '';
             break;
     }
     $sSql = "SELECT \n                `id` AS `id`, \n                `owner_id` AS `owner_id`, \n                `object_id` AS `object_id`, \n                `type` AS `type`, \n                `action` AS `action`, \n                `content` AS `content`,\n                `title` AS `title`,\n                `description` AS `description`,\n                `date` AS `date`,\n                DATE_FORMAT(FROM_UNIXTIME(`date`), '" . $this->_oConfig->getDividerDateFormat() . "') AS `print_date`, \n                DAYOFYEAR(FROM_UNIXTIME(`date`)) AS `days`, \n                DAYOFYEAR(NOW()) AS `today`,\n                (UNIX_TIMESTAMP() - `date`) AS `ago`\n            FROM `" . $this->_sPrefix . "events`\n            WHERE " . $sWhereClause . $sOrderClause . $sLimitClause;
     $aEvents = array();
     $aEvent = $this->getFirstRow($sSql);
     while ($aEvent) {
         $aEvent['content'] = str_replace("[ray_url]", $sHomeUrl, $aEvent['content']);
         $aEvent['ago'] = _format_when($aEvent['ago']);
         $aEvents[] = $aEvent;
         $aEvent = $this->getNextRow();
     }
     return $aEvents;
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:25,代码来源:BxWallDb.php

示例10: ComposeResultStringAdv

    /**
     * Generate composed table element of Advertisement
     *
     * @param $aSqlResStrA	SQL result string of Advertisement
     * @return HTML presentation of data
     */
    function ComposeResultStringAdv($aSqlResStrA, $bVeryShortView = FALSE)
    {
        global $aPreValues;
        global $site;
        $sActivateC = _t('_Activate');
        $sDeleteC = _t('_Delete');
        $sEditC = _t('_Edit');
        $sSbjN = _t('_Subject');
        $sPostedByC = _t('_Posted by');
        $sDateC = _t('_Date');
        $sLocationC = _t('_Location');
        $sAdminLocalAreaC = _t('_AdminArea');
        $sAdminC = _t('_Admin');
        $sSureC = _t("_Are you sure");
        $sTimeAgo = _format_when($aSqlResStrA['sec']);
        $iID = $aSqlResStrA['ID'];
        $iIDProfile = $aSqlResStrA['IDProfile'];
        $sImageCode = $this->getBigImageCode($aSqlResStrA['Media'], $iID);
        $sDelAbil = '&nbsp;';
        if ($this->bAdminMode == false) {
            //$iMemberID = (int)$_COOKIE['memberID'];
            $iMemberID = $logged['member'] ? (int) $_COOKIE['memberID'] : 0;
            if (($this->bAdminMode == true or $iMemberID != 0) and $iIDProfile == $iMemberID) {
                //ability to delete Adv for owner
                $sDelAbil .= <<<EOF
<a href="{$this->sCurrBrowsedFile}" onclick="if (confirm('{$sSureC}')) { UpdateField('DeleteAdvertisementID',{$iID});document.forms.command_delete_advertisement.submit(); } return false;">{$sDeleteC}</a>
<a href="{$this->sCurrBrowsedFile}" onclick="UpdateField('EditAdvertisementID',{$iID}); document.forms.command_edit_advertisement.submit(); return false;">{$sEditC}</a>
EOF;
            }
        } elseif ($this->bAdminMode == true) {
            //ability to Activate/Delete/Edite adv
            $sActivateAbil = $aSqlResStrA['Status'] == 'active' ? '' : <<<EOF
<a href="{$this->sCurrBrowsedFile}" onclick="UpdateField('ActivateAdvertisementID',{$iID});document.forms.command_activate_advertisement.submit(); return false;">{$sActivateC}</a>&nbsp;&nbsp;
EOF;
            $sDelAbil = <<<EOF
<div class="tar">
\t{$sActivateAbil}
\t<a href="{$this->sCurrBrowsedFile}" onclick="if (confirm('{$sSureC}')) { UpdateField('DeleteAdvertisementID',{$iID});document.forms.command_delete_advertisement.submit(); } return false;">{$sDeleteC}</a>&nbsp;&nbsp;
\t<a href="{$this->sCurrBrowsedFile}" onclick="UpdateField('EditAdvertisementID',{$iID}); document.forms.command_edit_advertisement.submit(); return false;">{$sEditC}</a>
</div>
EOF;
        }
        $aProfileRes = $this->GetProfileData($iIDProfile);
        $sPostedBy = $iIDProfile == 0 ? $sAdminC : "<a href=\"" . getProfileLink($iIDProfile) . "\">{$aProfileRes['NickName']}</a>\n";
        $sCountryName = $aProfileRes['Country'] == "" ? $sAdminLocalAreaC : _t($aPreValues['Country'][$aProfileRes['Country']]['LKey']);
        $sCountryPic = $aProfileRes['Country'] == '' ? '' : ' <img alt="' . $aProfileRes['Country'] . '" src="' . ($site['flags'] . strtolower($aProfileRes['Country'])) . '.gif"/>';
        $sCustDetails = '';
        $sDetailsC = _t('_Details');
        if ($aSqlResStrA['CustomFieldValue1'] or $aSqlResStrA['CustomFieldValue2']) {
            $sCustDetails .= "{$sDetailsC}:";
            $sCustDetails .= $aSqlResStrA['CustomFieldValue1'] ? " <div class=\"clr3\">{$aSqlResStrA['Unit']} {$aSqlResStrA['CustomFieldValue1']}</div>" : '';
            $sCustDetails .= $aSqlResStrA['CustomFieldValue1'] && $aSqlResStrA['CustomFieldValue2'] ? ' - ' : '';
            $sCustDetails .= $aSqlResStrA['CustomFieldValue2'] ? " <div class=\"clr3\">{$aSqlResStrA['Unit']} {$aSqlResStrA['CustomFieldValue2']}</div>" : '';
        }
        //$sDataStyle=($bVeryShortView)?'':' style="margin-bottom:10px;"';
        $sDataStyleWidth = $bVeryShortView ? ' style="width:230px;"' : '';
        $sSubjectBlock = $bVeryShortView ? '' : <<<EOF
<div class="cls_res_info_p">
\t{$sPostedByC}: <div class="clr3">{$sPostedBy}</div>
</div>
EOF;
        $sPostedByBlock = $bVeryShortView ? '' : <<<EOF
<div class="cls_res_info_p">
\t{$sPostedByC}: <div class="clr3">{$sPostedBy}</div>
</div>
EOF;
        $sSubjectBlockValue = $aSqlResStrA['Subject'];
        //($bVeryShortView) ? mb_substr($aSqlResStrA['Subject'], 0, 15)."..." : $aSqlResStrA['Subject'];
        $sActionsBlock = $bVeryShortView ? '' : <<<EOF
<div class="cls_res_info_p">
\t{$sDelAbil}
</div>
EOF;
        $sDetailsBlock = $bVeryShortView ? '' : <<<EOF
<div class="cls_res_info_p">
\t{$sCustDetails}
</div>
EOF;
        //{$sDataStyle}
        $sGenUrl = $this->genUrl($iID, $aSqlResStrA['EntryUri']);
        //{$this -> sCurrBrowsedFile}?ShowAdvertisementID={$iID}
        $sCBStyle = $this->bAdminMode == true ? 'float:left' : '';
        $sRetHtml = <<<EOF
<div class="cls_result_row" style="{$sCBStyle}">
\t<div class="clear_both"></div>
\t<div class="thumbnail_block"  style="float: left;">
\t\t{$sImageCode}
\t</div>
\t<div class="cls_res_info_nowidth" {$sDataStyleWidth}>
\t\t<div class="cls_res_info_p">
\t\t\t<!-- {$sSbjN}: -->
\t\t\t<a class="actions" href="{$sGenUrl}">
\t\t\t\t{$sSubjectBlockValue}
\t\t\t</a>
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:101,代码来源:BxDolClassifieds.php

示例11: getEvents

 function getEvents($aParams)
 {
     global $sHomeUrl;
     $sWhereClause = $sOrderClause = $sLimitClause = "";
     if (isset($aParams['timeline']) && strpos($aParams['timeline'], BX_WALL_DIVIDER_TIMELINE) !== false) {
         list($iTLStart, $iTLEnd) = explode(BX_WALL_DIVIDER_TIMELINE, $aParams['timeline']);
         $iNowMorning = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
         $iNowEvening = mktime(23, 59, 59, date('m'), date('d'), date('Y'));
         $sWhereClause .= "AND `date`>='" . ($iNowMorning - 86400 * $iTLEnd) . "' AND `date`<='" . ($iNowEvening - 86400 * $iTLStart) . "'";
     }
     switch ($aParams['type']) {
         case 'id':
             $sWhereClause = "AND `te`.`id`='" . $aParams['object_id'] . "' ";
             $sLimitClause = "LIMIT 1";
             break;
         case 'owner':
             $aHidden = $this->_oConfig->getHandlersHidden(BX_WALL_VIEW_TIMELINE);
             $sWhereClause .= "AND `th`.`timeline`='1' AND `th`.`id` NOT IN ('" . implode("','", $aHidden) . "') ";
             if (!empty($aParams['owner_id'])) {
                 if (!is_array($aParams['owner_id'])) {
                     $sWhereClause .= "AND `te`.`owner_id`='" . $aParams['owner_id'] . "' ";
                 } else {
                     $sWhereClause .= "AND `te`.`owner_id` IN ('" . implode("','", $aParams['owner_id']) . "') ";
                 }
             }
             $sWhereClause .= isset($aParams['filter']) ? $this->_getFilterAddon($aParams['owner_id'], $aParams['filter']) : '';
             $sOrderClause = isset($aParams['order']) ? "ORDER BY `te`.`date` " . strtoupper($aParams['order']) : "";
             $sLimitClause = isset($aParams['count']) ? "LIMIT " . $aParams['start'] . ", " . $aParams['count'] : "";
             break;
         case 'last':
             $aHidden = $this->_oConfig->getHandlersHidden(BX_WALL_VIEW_TIMELINE);
             $sWhereClause .= "AND `th`.`timeline`='1' AND `th`.`id` NOT IN ('" . implode("','", $aHidden) . "') ";
             if (!empty($aParams['owner_id'])) {
                 if (!is_array($aParams['owner_id'])) {
                     $sWhereClause .= "AND `te`.`owner_id`='" . $aParams['owner_id'] . "' ";
                 } else {
                     $sWhereClause .= "AND `te`.`owner_id` IN ('" . implode("','", $aParams['owner_id']) . "') ";
                 }
             }
             $sWhereClause .= isset($aParams['filter']) ? $this->_getFilterAddon($aParams['owner_id'], $aParams['filter']) : '';
             $sOrderClause = "ORDER BY `te`.`date` ASC";
             $sLimitClause = "LIMIT 1";
             break;
         case BX_WALL_VIEW_OUTLINE:
             $aHidden = $this->_oConfig->getHandlersHidden(BX_WALL_VIEW_OUTLINE);
             $sWhereClause = "AND `th`.`outline`='1' AND `th`.`id` NOT IN ('" . implode("','", $aHidden) . "') ";
             $sWhereClause .= isset($aParams['filter']) ? $this->_getFilterAddon($aParams['owner_id'], $aParams['filter']) : '';
             $sOrderClause = isset($aParams['order']) ? "ORDER BY `te`.`date` " . strtoupper($aParams['order']) : "";
             $sLimitClause = isset($aParams['count']) ? "LIMIT " . $aParams['start'] . ", " . $aParams['count'] : "";
             break;
     }
     $sSql = "SELECT\n                `te`.`id` AS `id`,\n                `te`.`owner_id` AS `owner_id`,\n                `te`.`object_id` AS `object_id`,\n                `te`.`type` AS `type`,\n                `te`.`action` AS `action`,\n                `te`.`content` AS `content`,\n                `te`.`title` AS `title`,\n                `te`.`description` AS `description`,\n                `te`.`date` AS `date`,\n                DATE_FORMAT(FROM_UNIXTIME(`te`.`date`), '" . $this->_oConfig->getDividerDateFormat() . "') AS `print_date`,\n                DAYOFYEAR(FROM_UNIXTIME(`te`.`date`)) AS `days`,\n                DAYOFYEAR(NOW()) AS `today`,\n                (UNIX_TIMESTAMP() - `te`.`date`) AS `ago`,\n                ROUND((UNIX_TIMESTAMP() - `te`.`date`)/86400) AS `ago_days`\n            FROM `" . $this->_sPrefix . "events` AS `te`\n            LEFT JOIN `" . $this->_sPrefix . "handlers` AS `th` ON `te`.`type`=`th`.`alert_unit` AND `te`.`action`=`th`.`alert_action`\n            WHERE 1 " . $sWhereClause . " " . $sOrderClause . " " . $sLimitClause;
     $aEvents = array();
     $aEvent = $this->getFirstRow($sSql);
     while ($aEvent) {
         $iAgo = $aEvent['ago'];
         $aEvent['content'] = str_replace("[ray_url]", $sHomeUrl, $aEvent['content']);
         $aEvent['ago'] = _format_when($iAgo);
         $aEvents[] = $aEvent;
         $aEvent = $this->getNextRow();
     }
     return $aEvents;
 }
开发者ID:Arvindvi,项目名称:dolphin,代码行数:63,代码来源:BxWallDb.php

示例12: ActionPrintAdvertisement

    /**
     * Generate presentation Advertisement code with images and other
     *
     * @param $iID	ID of Advertisement
     * @return HTML presentation of data
     */
    function ActionPrintAdvertisement($iID)
    {
        global $site;
        global $aPreValues;
        $iAdvertisementID = (int) $iID;
        $sRetHtml = '';
        $sSiteUrl = BX_DOL_URL_ROOT;
        if ($this->bAdminMode && $iAdvertisementID > 0) {
            $iFeaturedStatus = $this->_oDb->getFeaturedStatus($iAdvertisementID);
            $iNewStatus = $iFeaturedStatus == 1 ? 0 : 1;
            if (bx_get('do') == 'cfs') {
                $this->_oDb->UpdateFeatureStatus($iAdvertisementID, $iNewStatus);
            }
        }
        $aSqlResStr = $this->_oDb->getAdInfo($iAdvertisementID);
        if ($aSqlResStr) {
            $iOwnerID = (int) $aSqlResStr['IDProfile'];
            $bPossibleToView = $this->oPrivacy->check('view', $iAdvertisementID, $this->_iVisitorID);
            if ($this->isAllowedView($iOwnerID, true) == false || $bPossibleToView == false) {
                return $this->_oTemplate->displayAccessDenied();
            }
            bx_import('BxDolViews');
            new BxDolViews('ads', $iAdvertisementID);
            $aNameRet = getProfileInfo($aSqlResStr['IDProfile']);
            $sCountryName = $aSqlResStr['Country'];
            $sCountryPic = $sCountryName == '' ? '' : ' <img alt="' . $sCountryName . '" src="' . ($site['flags'] . strtolower($sCountryName)) . '.gif"/>';
            $sCountryName = _t($aPreValues['Country'][$sCountryName]['LKey']);
            $sPostedByC = _t('_bx_ads_Posted_by');
            $sPhoneC = _t('_Phone');
            $sDetailsC = _t('_bx_ads_Details');
            $sUserOtherListC = _t('_bx_ads_Users_other_listing');
            $sActionsC = _t('_Actions');
            $sSureC = _t('_Are you sure?');
            $sMoreIcon = $this->_oTemplate->getIconUrl('more.png');
            $sPostedBy .= '<div class="cls_res_info">';
            $sPostedBy .= $sPostedByC . ': <span style="color:#333333;"><a href="' . getProfileLink($aNameRet['ID']) . '">' . $aNameRet['NickName'] . '</a></span>';
            $sPostedBy .= '</div>';
            if ($aNameRet['Phone'] != "") {
                $sPostedBy .= '<div class="cls_res_info">';
                $sPostedBy .= $sPhoneC . ": <div class=\"clr3\">{$aNameRet['Phone']}</div>";
                $sPostedBy .= '</div>';
            }
            $sTimeAgo = _format_when($aSqlResStr['sec']);
            $aTags = array();
            $aTagsLinks = array();
            $aTags = preg_split("/[;,]/", $aSqlResStr['Tags']);
            foreach ($aTags as $sTag) {
                $sSubLink = $this->bUseFriendlyLinks ? "ads/tag/" : $this->sHomeUrl . "classifieds_tags.php?tag=";
                $sTagS = htmlspecialchars(title2uri($sTag));
                $aTagsLinks[] = '<a href="' . "{$sSubLink}{$sTagS}" . '">' . $sTag . '</a>';
            }
            $sTags .= implode(", ", $aTagsLinks);
            $sMemberActionForms = '';
            if ($this->_iVisitorID > 0 && $this->_iVisitorID != $aNameRet['ID']) {
                //print Send PM button and other actions
                if (getParam('bx_ads_enable_paid') == 'on') {
                    $sMemberActionForms .= <<<EOF
<form action="{$this->sCurrBrowsedFile}" name="BuyNowForm" method="post">
\t<input type="hidden" name="BuyNow" value="BuyNow" />
\t<input type="hidden" name="IDAdv" value="{$iAdvertisementID}" />
\t<input type="hidden" name="IDSeller" value="{$aSqlResStr['IDProfile']}" />
</form>
EOF;
                }
                $sMemberActionForms .= <<<EOF
<form action="{$sSiteUrl}mail.php" name="post_pm" id="post_pm" method="get">
\t<input type="hidden" name="mode" value="compose" />
\t<input type="hidden" name="recipient_id" value="{$aSqlResStr['IDProfile']}" />
\t<input type="hidden" name="subject" value="{$aSqlResStr['Subject']}" />
</form>
EOF;
            }
            $sEntryUrl = $this->genUrl($iAdvertisementID, $aSqlResStr['EntryUri'], 'entry');
            $sMediaIDs = $this->_oDb->getMediaOfAd($iAdvertisementID);
            if ($sMediaIDs != '') {
                $aReadyMedia = explode(',', $sMediaIDs);
                $sPictureSectContent = $this->_blockPhoto($aReadyMedia, $iOwnerID);
            }
            $sPictureSect = $sPictureSectContent != '' ? DesignBoxContent(_t('_bx_ads_Ad_photos'), $sPictureSectContent, 1) : '';
            $this->sTAPhotosContent = $sPictureSectContent;
            bx_import('BxDolSubscription');
            $oSubscription = new BxDolSubscription();
            $aButton = $oSubscription->getButton($this->_iVisitorID, 'bx_' . $this->_oConfig->getUri(), '', $iAdvertisementID);
            $aActionKeys = array('visitor_id' => $this->_iVisitorID, 'owner_id' => $aNameRet['ID'], 'admin_mode' => "'" . $this->bAdminMode . "'", 'ads_id' => $iAdvertisementID, 'ads_status' => $aSqlResStr['Status'], 'ads_featured' => (int) $aSqlResStr['Featured'], 'sure_label' => $sSureC, 'ads_entry_url' => $sEntryUrl, 'only_menu' => 0, 'sbs_ads_title' => $aButton['title'], 'sbs_ads_script' => $aButton['script']);
            $sActionsTable = $GLOBALS['oFunctions']->genObjectsActions($aActionKeys, 'bx_ads', false);
            $sSubsAddon = $oSubscription->getData();
            $sActionsSectContent = $sSubsAddon . $sMemberActionForms . $sActionsTable;
            $sActionsSect = $this->_iVisitorID > 0 || $this->bAdminMode ? DesignBoxContent($sActionsC, $sActionsSectContent, 1) : '';
            $this->sTAActionsContent = $this->_iVisitorID > 0 || $this->bAdminMode ? $sActionsSectContent : '';
            require_once $this->_oConfig->getClassPath() . 'BxAdsCmts.php';
            $this->oCmtsView = new BxAdsCmts($this->_oConfig->getCommentSystemName(), $iAdvertisementID);
            $sCommentsSectContent = $this->oCmtsView->getExtraCss();
            $sCommentsSectContent .= $this->oCmtsView->getExtraJs();
            $sCommentsSectContent .= !$this->oCmtsView->isEnabled() ? '' : $this->oCmtsView->getCommentsFirst();
//.........这里部分代码省略.........
开发者ID:dalinhuang,项目名称:shopexts,代码行数:101,代码来源:BxAdsModule.php

示例13: getOwnerBlock

 /**
  * Function will generate information about the poll's onwer;
  *
  * @param  : $iPollOwner (integer) - poll's owner id;
  * @param  : $aPollInfo (array) - poll's information;
  * @return : (text) - Html presentation data;
  */
 function getOwnerBlock($iPollOwner, $aPollInfo)
 {
     $aMemberInfo = getProfileInfo($iPollOwner);
     $sThumbImg = get_member_thumbnail($aMemberInfo['ID'], 'none');
     $aTemplateKeys = array('author_thumb' => $sThumbImg, 'date' => getLocaleDate($aPollInfo['poll_date'], BX_DOL_LOCALE_DATE_SHORT), 'date_ago' => _format_when(time() - $aPollInfo['poll_date']), 'tags' => getLinkSet($aPollInfo['poll_tags'], $this->getModulePath() . '&action=tag&tag=', BX_DOL_TAGS_DIVIDER), 'fields' => null, 'author_username' => $aMemberInfo['NickName'], 'author_url' => getProfileLink($aMemberInfo['ID']), 'cats' => getLinkSet($aPollInfo['poll_categories'], $this->getModulePath() . '&action=category&category=', CATEGORIES_DIVIDER));
     $sOutpuCode = $this->_oTemplate->parseHtmlByName($this->aUsedTemplates['poll_owner'], $aTemplateKeys);
     return $sOutpuCode;
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:15,代码来源:BxPollModule.php

示例14: PageCodeLog

function PageCodeLog($sMode)
{
    switch ($sMode) {
        case 'dnsbl':
        case 'dnsbluri':
        case 'akismet':
        case 'stopforumspam':
            break;
        default:
            $sMode = 'dnsbl';
    }
    $iPage = isset($_GET['page']) && (int) $_GET['page'] > 0 ? (int) $_GET['page'] : 1;
    $iPerPage = 12;
    $iStart = ($iPage - 1) * $iPerPage;
    $aLog = $GLOBALS['MySQL']->getAll("SELECT SQL_CALC_FOUND_ROWS * FROM `sys_antispam_block_log` WHERE `type` = '{$sMode}' ORDER BY `added` DESC LIMIT {$iStart}, {$iPerPage}");
    $iCount = $GLOBALS['MySQL']->getOne("SELECT FOUND_ROWS()");
    foreach ($aLog as $k => $r) {
        $aLog[$k]['ip'] = long2ip($r['ip']);
        $aLog[$k]['member_url'] = $r['member_id'] ? getProfileLink($r['member_id']) : 'javascript:void(0);';
        $aLog[$k]['member_nickname'] = $r['member_id'] ? getNickName($r['member_id']) : _t('_Guest');
        $aLog[$k]['extra'] = bx_html_attribute($r['extra']);
        $aLog[$k]['ago'] = _format_when(time() - $r['added']);
    }
    $sPaginate = '';
    if ($iCount > $iPerPage) {
        $sUrlStart = BX_DOL_URL_ADMIN . 'antispam.php?action=log&type=' . $sMode;
        $oPaginate = new BxDolPaginate(array('page_url' => 'javascript:void(0);', 'count' => $iCount, 'per_page' => $iPerPage, 'page' => $iPage, 'on_change_page' => "getHtmlData('sys-adm-antispam-log', '{$sUrlStart}&page={page}');"));
        $sPaginate = $oPaginate->getSimplePaginate(false, -1, -1, false);
    }
    if (is_array($aLog) && !empty($aLog)) {
        return $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_log.html', array('bx_repeat:items' => $aLog, 'paginate' => $sPaginate));
    } else {
        return MsgBox(_t('_Empty'));
    }
}
开发者ID:noormcs,项目名称:studoro,代码行数:35,代码来源:antispam.php

示例15: PageSDatingShowInfo


//.........这里部分代码省略.........
EOF;
        $sImageSect = DesignBoxContent($sEventC . ' ' . $sPictureC, $sImageSectFDB, 1);
        /*$sImageSect = <<<EOF
        <div class="disignBoxFirst">
        	<div class="boxFirstHeader">
        		{$sEventC} {$sPictureC}
        	</div>
        	<div class="boxContent">
        		<div class="photoBlock">
        			{$sPicElement}
        		</div>
        		<div class="clear_both"></div>
        	</div>
        </div>
        EOF;*/
        $sActionsSectFDB = <<<EOF
{$sUsersActions}
{$sActions}
<div class="clear_both"></div>
EOF;
        $sActionsSect = DesignBoxContent($sActionsC, $sActionsSectFDB, 1);
        /*$sActionsSect = <<<EOF
        <div class="disignBoxFirst">
        	<div class="boxFirstHeader">
        		{$sActionsC}
        	</div>
        	<div class="boxContent">
        		{$sUsersActions}
        		{$sActions}
        		<div class="clear_both"></div>
        	</div>
        </div>
        EOF;*/
        $sEventsStart = _format_when($aEventData['sec']);
        $date_format_php = getParam('php_date_format');
        //$sDateTime = date( $date_format_php, strtotime( $aEventData['EventStart'] ) );
        $sDateTime = LocaledDataTime($aEventData['EventStart_UTS']);
        $sSubjectSectFDB = <<<EOF
<div class="cls_res_info">
\t{$sCountryC}: <div class="clr3">{$sCountryPic}</div>
</div>
<div class="cls_res_info">
\t{$sCityC}: <div class="clr3">{$sCity}</div>
</div>
<div class="cls_res_info">
\t{$sPlaceC}: <div class="clr3">{$sPlace}</div>
</div>
<div class="cls_res_info">
\t{$sDateC}: <div class="clr3">{$sDateTime} ({$sEventsStart})</div>
</div>
{$sAdminTicketsPart}
<div class="cls_res_info">
\t{$sPostedByC}: <div class="clr3">{$sPostedByHref}</div>
</div>
{$sAdminTicketsPart2}
<div class="clear_both"></div>
EOF;
        $sSubjectSect = DesignBoxContent($sTitle, $sSubjectSectFDB, 1);
        /*$sSubjectSect = <<<EOF
        <div class="disignBoxFirst">
        	<div class="boxFirstHeader">
        		{$sTitle}
        	</div>
        	<div class="boxContent">
        		<div class="cls_res_info">
        			{$sCountryC}: <div class="clr3">{$sCountryPic}</div>
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:67,代码来源:BxDolEvents.php


注:本文中的_format_when函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。