本文整理汇总了PHP中RSSFeed::BuildFeed方法的典型用法代码示例。如果您正苦于以下问题:PHP RSSFeed::BuildFeed方法的具体用法?PHP RSSFeed::BuildFeed怎么用?PHP RSSFeed::BuildFeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSSFeed
的用法示例。
在下文中一共展示了RSSFeed::BuildFeed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updatePIREPFeed
/**
* PIREPData::updatePIREPFeed()
*
* @return
*/
public static function updatePIREPFeed()
{
# Load PIREP into RSS feed
$reports = PIREPData::findPIREPS(array(), 10);
# Empty the rss file if there are no pireps
if (!$reports) {
return false;
}
$rss = new RSSFeed('Latest Pilot Reports', SITE_URL, 'The latest pilot reports');
foreach ($reports as $report) {
$rss->AddItem('Report #' . $report->pirepid . ' - ' . $report->depicao . ' to ' . $report->arricao, SITE_URL . '/admin/index.php?admin=viewpending', '', 'Filed by ' . PilotData::getPilotCode($report->code, $report->pilotid) . " ({$report->firstname} {$report->lastname})");
}
$rss->BuildFeed(LIB_PATH . '/rss/latestpireps.rss');
}
示例2: ProcessRegistration
/**
* Registration::ProcessRegistration()
*
* @return
*/
protected function ProcessRegistration()
{
// Yes, there was an error
if (!$this->VerifyData()) {
$this->ShowForm();
return;
}
$data = array('firstname' => $this->post->firstname, 'lastname' => $this->post->lastname, 'email' => $this->post->email, 'password' => $this->post->password1, 'code' => $this->post->code, 'location' => $this->post->location, 'hub' => $this->post->hub, 'confirm' => false);
if (CodonEvent::Dispatch('registration_precomplete', 'Registration', $_POST) == false) {
return false;
}
$ret = RegistrationData::CheckUserEmail($data['email']);
if ($ret) {
$this->set('error', Lang::gs('email.inuse'));
$this->render('registration_error.tpl');
return false;
}
$val = RegistrationData::AddUser($data);
if ($val == false) {
$this->set('error', RegistrationData::$error);
$this->render('registration_error.tpl');
return;
} else {
$pilotid = RegistrationData::$pilotid;
/* Automatically confirm them if that option is set */
if (Config::Get('PILOT_AUTO_CONFIRM') == true) {
PilotData::AcceptPilot($pilotid);
RanksData::CalculatePilotRanks();
$pilot = PilotData::getPilotData($pilotid);
$this->set('pilot', $pilot);
$this->render('registration_autoconfirm.tpl');
} else {
/* Otherwise, wait until an admin confirms the registration */
RegistrationData::SendEmailConfirm($email, $firstname, $lastname);
$this->render('registration_sentconfirmation.tpl');
}
}
CodonEvent::Dispatch('registration_complete', 'Registration', $_POST);
// Registration email/show user is waiting for confirmation
$sub = 'A user has registered';
$message = "The user {$data['firstname']} {$data['lastname']} ({$data['email']}) has registered, and is awaiting confirmation.";
$email = Config::Get('EMAIL_NEW_REGISTRATION');
if (empty($email)) {
$email = ADMIN_EMAIL;
}
Util::SendEmail($email, $sub, $message);
// Send email to user
$this->set('firstname', $data['firstname']);
$this->set('lastname', $data['lastname']);
$this->set('userinfo', $data);
$message = Template::Get('email_registered.tpl', true);
Util::SendEmail($data['email'], 'Registration at ' . SITE_NAME, $message);
$rss = new RSSFeed('Latest Pilot Registrations', SITE_URL, 'The latest pilot registrations');
$pilot_list = PilotData::GetLatestPilots();
foreach ($pilot_list as $pilot) {
$rss->AddItem('Pilot ' . PilotData::GetPilotCode($pilot->code, $pilot->pilotid) . ' (' . $pilot->firstname . ' ' . $pilot->lastname . ')', SITE_URL . '/admin/index.php?admin=pendingpilots', '', '');
}
$rss->BuildFeed(LIB_PATH . '/rss/latestpilots.rss');
}