當前位置: 首頁>>代碼示例>>PHP>>正文


PHP freelancer::GetPrjRecps方法代碼示例

本文整理匯總了PHP中freelancer::GetPrjRecps方法的典型用法代碼示例。如果您正苦於以下問題:PHP freelancer::GetPrjRecps方法的具體用法?PHP freelancer::GetPrjRecps怎麽用?PHP freelancer::GetPrjRecps使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在freelancer的用法示例。


在下文中一共展示了freelancer::GetPrjRecps方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/profiler.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/freelancer.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/mem_storage.php";
//------------------------------------------------------------------------------
$results = array();
$profiler = new profiler();
//------------------------------------------------------------------------------
$page = 0;
$page_size = 200;
$cnt = 0;
$ms = new MemStorage('newsletter_freelancer');
$ms->clear();
//------------------------------------------------------------------------------
$profiler->start('fill_frl_mem');
//------------------------------------------------------------------------------
while ($users = freelancer::GetPrjRecps($error, ++$page, $page_size)) {
    //@todo: fill more more for testing
    for ($i = 0; $i < 1; $i++) {
        $to_storage = array();
        foreach ($users as $user) {
            $to_storage[$user['uid'] . '-' . $i] = $user;
            $cnt++;
        }
        $ms->addData($to_storage);
        unset($to_storage);
    }
}
//------------------------------------------------------------------------------
$profiler->stop('fill_frl_mem');
//------------------------------------------------------------------------------
$results['Total cnt'] = $cnt;
開發者ID:Nikitian,項目名稱:fl-ru-damp,代碼行數:31,代碼來源:test_write.php

示例2: NewProj

    /**
     * @todo НЕ ИСПОЛЬЗУЕТСЯ
     *
     * @deprecated since 0026073
     * 
     * Рассылка о новых проектах. Вызывается раз в день из hourly.php
     *
     * @param array $uids - массив идентификаторов пользователей, которым уже отправленя новая рассылка (см. NewProjForMissingMoreThan24h)
     *
     * @return int количество получивших рассылку
     */
    public function NewProj($uids)
    {
        $projects = projects::GetNewProjects($error, true, 600, 50);
        $groups = professions::GetAllGroupsLite(true);
        $page = 0;
        $count = 0;
        if (empty($projects)) {
            return 0;
        }
        $this->subject = 'Новые проекты на FL.ru';
        $message = '<p>
Данное письмо отправлено почтовым роботом сервера FL.ru и не требует ответа.
</p>
<p>
На сайте <a href="' . $GLOBALS['host'] . $this->_addUrlParams('f') . '">' . $GLOBALS['host'] . '</a> опубликованы новые Проекты
</p>
%MESSAGE%
<p>
Если вы хотите оперативно получать информацию об опубликованных на FL.ru проектах, 
скачайте и установите бесплатное приложение-информер <a href="' . $GLOBALS['host'] . '/promo/freetray/' . $this->_addUrlParams('f') . '">Free-tray</a>. 
</p>';
        $this->message = $this->GetHtml('%USER_NAME%', $message, array('header' => 'default', 'footer' => 'default'), array('target_footer' => true));
        $this->recipient = '';
        $massId = $this->send('text/html');
        foreach ($projects as $i => $prj) {
            $url = $GLOBALS['host'] . getFriendlyURL('project', $projects[$i]['id']);
            $projects[$i]['html'] = array('post_date' => date('d.m.y', strtotimeEx($prj['post_date'])), 'name' => $prj['name'] ? reformat($prj['name'], 100, 0, 1) : '', 'descr' => reformat($prj['descr'], 100, 0, 1), 'url' => "<a href='{$url}{$this->_addUrlParams('f')}'>{$url}</a>");
        }
        while ($users = freelancer::GetPrjRecps($error, ++$page, 50, $uids)) {
            $this->recipient = array();
            foreach ($users as $user) {
                if (empty($user['mailer'])) {
                    continue;
                }
                $subj = array();
                foreach ($groups as $group) {
                    if (freelancer::isSubmited($user['mailer_str'], array(array('category_id' => $group['id'])))) {
                        $subj[$group['id']] = $group['name'];
                    }
                }
                $lastKind = 0;
                $message = '';
                foreach ($projects as $prj) {
                    if (!freelancer::isSubmited($user['mailer_str'], $prj['specs'])) {
                        continue;
                    }
                    if ($lastKind != $prj['kind']) {
                        $kindName = '';
                        switch ($prj['kind']) {
                            case 1:
                                $kindName = 'Попроектно';
                                break;
                            case 2:
                                $kindName = 'Конкурсы';
                                break;
                            case 3:
                                $kindName = 'На зарплату';
                                break;
                            case 4:
                                $kindName = 'В офис';
                                break;
                            case 7:
                                $kindName = 'Конкурсы';
                                break;
                        }
                        $message .= "\n";
                        $message .= "<div>-----------------------------------------------------------------------------------</div>\n";
                        $message .= "<div>{$kindName}</div>\n";
                        $message .= "<div>-----------------------------------------------------------------------------------</div>\n";
                        $lastKind = $prj['kind'];
                    }
                    $message .= "\n<div>&nbsp;</div><div>-----</div>\n";
                    $message .= "<div>{$prj['html']['post_date']}</div>\n";
                    $message .= "<div>{$prj['html']['name']}</div>\n";
                    $message .= "<div>-----</div>\n";
                    $message .= "<div>{$prj['html']['descr']}</div>\n";
                    $message .= "<div>{$prj['html']['url']}</div>\n";
                    $message .= "<div>-----------------------------------</div>\n";
                }
                if (empty($message)) {
                    continue;
                }
                $message = '<div>(' . implode('/', $subj) . ')</div><div>&nbsp;</div>' . $message;
                if (!$user['unsubscribe_key']) {
                    $user['unsubscribe_key'] = users::GetUnsubscribeKey($user['login']);
                }
                $this->recipient[] = array('email' => $user['uname'] . ' ' . $user['usurname'] . ' [' . $user['login'] . '] <' . $user['email'] . '>', 'extra' => array('USER_NAME' => $user['uname'], 'USER_SURNAME' => $user['usurname'], 'USER_LOGIN' => $user['login'], 'MESSAGE' => $message, 'UNSUBSCRIBE_KEY' => $user['unsubscribe_key']));
                ++$count;
            }
//.........這裏部分代碼省略.........
開發者ID:kapai69,項目名稱:fl-ru-damp,代碼行數:101,代碼來源:smail.php


注:本文中的freelancer::GetPrjRecps方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。