当前位置: 首页>>代码示例>>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;未经允许,请勿转载。