예제 #1
0
<?php

RequestHandler::$responseMode = 'csv';
RequestHandler::respond('projects', array('data' => array_map(function ($Project) {
    preg_match('/^\\s*[^*#]\\s*\\w.*/m', $Project->README, $matches);
    return array('name' => $Project->Title, 'description' => trim($matches[0]), 'link_url' => $Project->UsersUrl, 'code_url' => $Project->DevelopersUrl, 'type' => '', 'categories' => implode(', ', array_map(function ($Tag) {
        return $Tag->UnprefixedTitle;
    }, array_filter($Project->Tags, function ($Tag) {
        return $Tag->Prefix == 'topic';
    }))));
}, Laddr\Project::getAll())));
예제 #2
0
파일: home.php 프로젝트: Sun-Wukong/laddr
    $nextMeetup = array_shift($meetups);
} elseif (!empty($_GET['force_current'])) {
    $currentMeetup = $nextMeetup;
}
if ($currentMeetup) {
    $currentMeetup['checkins'] = Laddr\MemberCheckin::getAllForMeetupByProject($currentMeetup['id']);
}
$pageData['currentMeetup'] = $currentMeetup;
$pageData['nextMeetup'] = $nextMeetup;
$pageData['futureMeetups'] = $meetups;
// projects
$pageData['projectsTotal'] = Laddr\Project::getCount();
$pageData['projectsTags']['byTech'] = TagItem::getTagsSummary(array('tagConditions' => array('Handle LIKE "tech.%"'), 'itemConditions' => array('ContextClass' => Laddr\Project::getStaticRootClass())));
$pageData['projectsTags']['byTopic'] = TagItem::getTagsSummary(array('tagConditions' => array('Handle LIKE "topic.%"'), 'itemConditions' => array('ContextClass' => Laddr\Project::getStaticRootClass())));
$pageData['projectsTags']['byEvent'] = TagItem::getTagsSummary(array('tagConditions' => array('Handle LIKE "event.%"'), 'itemConditions' => array('ContextClass' => Laddr\Project::getStaticRootClass())));
$pageData['projectsStages'] = Laddr\Project::getStagesSummary();
// members
$pageData['membersTotal'] = Emergence\People\Person::getCount();
$pageData['membersTags']['byTech'] = TagItem::getTagsSummary(array('tagConditions' => array('Handle LIKE "tech.%"'), 'itemConditions' => array('ContextClass' => Emergence\People\Person::getStaticRootClass())));
$pageData['membersTags']['byTopic'] = TagItem::getTagsSummary(array('tagConditions' => array('Handle LIKE "topic.%"'), 'itemConditions' => array('ContextClass' => Emergence\People\Person::getStaticRootClass())));
// build activity stream
if (!($pageData['activity'] = Cache::fetch('home-activity'))) {
    $existingTables = \DB::allValues('table_name', 'SELECT table_name FROM information_schema.TABLES WHERE TABLE_SCHEMA = SCHEMA()');
    $activityQueries = [];
    if (in_array(Emergence\CMS\AbstractContent::$tableName, $existingTables)) {
        $activityQueries[] = sprintf('SELECT' . '  ID, Class, Published AS Timestamp' . ' FROM `%s`' . ' WHERE' . '  Class = "%s" AND' . '  Visibility = "Public" AND' . '  Status = "Published" AND' . '  (Published IS NULL OR Published <= CURRENT_TIMESTAMP)', Emergence\CMS\AbstractContent::$tableName, DB::escape(Emergence\CMS\BlogPost::class));
    }
    if (in_array(Laddr\ProjectUpdate::$tableName, $existingTables)) {
        $activityQueries[] = sprintf('SELECT ID, Class, Created AS Timestamp FROM `%s`', Laddr\ProjectUpdate::$tableName);
    }
    if (in_array(Laddr\ProjectBuzz::$tableName, $existingTables)) {
예제 #3
0
<?php

Laddr\Project::$stageDescriptions = ['Commenting' => _('Initial status for project, it\'s an idea people are commenting on'), 'Bootstrapping' => _('People and resources are being recruited to start'), 'Prototyping' => _('Something is being built'), 'Testing' => _('Something has been built and some people are using it'), 'Maintaining' => _('The project is publicly accessible, useable, and responding to ongoing feedback'), 'Drifting' => _('The project is still usable but not being actively maintained'), 'Hibernating' => _('The project is not currently usable or maintained')];