本文整理汇总了PHP中template_simple函数的典型用法代码示例。如果您正苦于以下问题:PHP template_simple函数的具体用法?PHP template_simple怎么用?PHP template_simple使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了template_simple函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sitefaq_virtual_add_faq
function sitefaq_virtual_add_faq(&$obj)
{
return template_simple('<a href="{site/prefix}/index/cms-add-form?collection=sitefaq_question&question={filter urlencode}{question}&answer={answer}{end filter}">
<img src="{site/prefix}/inc/app/sitefaq/pix/add.gif" border="0"
alt="{intl Add to live FAQs}"
title="{intl Add to live FAQs}" /></a>', $obj);
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:7,代码来源:Filters.php
示例2: onSubmit
function onSubmit($vals)
{
// 1. prepare vals for insertion
if ($vals['contact_url'] == 'http://') {
$vals['contact_url'] = '';
}
if ($vals['loc_map'] == 'http://') {
$vals['loc_map'] = '';
}
$vals['details'] = nl2br(wordwrap(htmlentities_compat($vals['details']), 70, "\n", true));
if (!$vals['public'] || empty($vals['public'])) {
$vals['public'] = 'no';
}
if (!$vals['media'] || empty($vals['media'])) {
$vals['media'] = 'no';
}
if (!empty($vals['loc_addr2'])) {
$vals['loc_address'] .= "\n" . $vals['loc_addr2'];
}
$data = array('title' => $vals['title'], 'date' => $vals['date'], 'until_date' => $vals['end_date'], 'time' => $vals['time'], 'until_time' => $vals['end_time'], 'category' => $vals['category'], 'audience' => $vals['audience'], 'details' => $vals['details'], 'contact' => $vals['contact'], 'contact_email' => $vals['contact_email'], 'contact_phone' => $vals['contact_phone'], 'contact_url' => $vals['contact_url'], 'loc_name' => $vals['loc_name'], 'loc_address' => $vals['loc_address'], 'loc_city' => $vals['loc_city'], 'loc_province' => $vals['loc_province'], 'loc_country' => $vals['loc_country'], 'sponsor' => $vals['sponsor'], 'rsvp' => $vals['rsvp'], 'public' => $vals['public'], 'media' => $vals['media'], 'sitellite_status' => 'draft', 'sitellite_access' => 'public');
if (session_valid()) {
$data['sitellite_owner'] = session_username();
$data['sitellite_team'] = session_team();
}
// 2. submit event as 'draft'
loader_import('cms.Versioning.Rex');
$rex = new Rex('siteevent_event');
$res = $rex->create($data, 'Event submission.');
$vals['id'] = $res;
// 3. email notification
@mail(appconf('submissions'), 'Event Submission Notice', template_simple('submission_email.spt', $vals));
// 4. thank you screen
page_title(intl_get('Thank You!'));
echo template_simple('submissions.spt');
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:35,代码来源:index.php
示例3: onSubmit
function onSubmit($vals)
{
global $cgi;
if ($vals['submit_buttons'] == 'Cancel') {
header('Location: ' . $vals['refer']);
exit;
}
loader_import('cms.Versioning.Rex');
$rex = new Rex('siteblog_post');
$id = $cgi->_key;
$subject = $vals['subject'];
$author = $vals['author'];
$status = $vals['status'];
$category = $vals['category'];
$created = $vals['created'];
$body = $vals['body'];
$data = array('subject' => $subject, 'author' => $author, 'status' => $status, 'category' => $category, 'created' => $created, 'body' => $body);
if (!empty($id)) {
if (!$data['created']) {
unset($data['created']);
}
$method = $rex->determineAction($id);
$rex->{$method}($id, $data);
} else {
if (!$data['created']) {
$data['created'] = date('Y-m-d H:i:s');
}
$id = $rex->create($data);
}
session_set('sitellite_alert', intl_get('Your item has been saved.'));
// view post
if (!empty($vals['_return'])) {
header('Location: ' . $vals['_return']);
} else {
header('Location: ' . site_prefix() . '/index/siteblog-post-action/id.' . $id . '/title.' . siteblog_filter_link_title($subject));
}
// ping blog directories via pingomatic.com
$host = 'rpc.pingomatic.com';
$path = '';
$out = template_simple('ping.spt', $obj);
$len = strlen($out);
$req = 'POST /' . $path . " HTTP/1.0\r\n";
$req .= 'User-Agent: Sitellite ' . SITELLITE_VERSION . "/SiteBlog\r\n";
$req .= 'Host: ' . $host . "\r\n";
$req .= "Content-Type: text/xml\r\n";
$req .= 'Content-Length: ' . $len . "\r\n\r\n";
$req .= $out . "\r\n";
if ($ph = @fsockopen($host, 80)) {
@fputs($ph, $req);
//echo '<pre>';
//echo htmlentities ($req);
while (!@feof($ph)) {
$res = @fgets($ph, 128);
//echo htmlentities ($res);
}
@fclose($ph);
}
exit;
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:59,代码来源:index.php
示例4: onSubmit
function onSubmit($vals)
{
$i = $vals['ifname'];
unset($vals['ifname']);
unset($vals['submit_button']);
echo template_simple('link_return.spt', array('ifname' => $i, 'vals' => $vals));
exit;
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:8,代码来源:index.php
示例5: sitepresenter_virtual_run
function sitepresenter_virtual_run($row)
{
return template_simple('<a href="{site/prefix}/index/sitepresenter-presentation-action?id={id}" target="_blank"><img
src="{site/prefix}/inc/app/sitepresenter/pix/run.gif" alt="{intl Run}" title="{intl Run}" border="0" /></a>
<a href="{site/prefix}/index/sitepresenter-slides-action?id={id}"><img
src="{site/prefix}/inc/app/sitepresenter/pix/slides.gif" alt="{intl Edit Slides}" title="{intl Edit Slides}" border="0" /></a>', $row);
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:8,代码来源:Filters.php
示例6: cms_alert
/**
* Shows a notice (e.g., "Item deleted.") if one is set.
*/
function cms_alert()
{
if (!cms_is_alert()) {
return '';
}
$notice = session_get('sitellite_alert');
session_set('sitellite_alert', null);
return template_simple('alert.spt', array('msg' => $notice));
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:12,代码来源:Alert.php
示例7: onSubmit
function onSubmit($vals)
{
loader_import('news.Comment');
$c = new NewsComment();
$vals['ts'] = date('Y-m-d H:i:s');
unset($vals['submit_button']);
$c->modify($vals['id'], $vals);
page_title(intl_get('Comment Updated'));
echo template_simple('comment_updated.spt', $vals);
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:10,代码来源:index.php
示例8: onSubmit
function onSubmit($vals)
{
loader_import('sitepoll.Comment');
$c = new SitepollComment();
$vals['ts'] = date('Y-m-d H:i:s');
unset($vals['submit_button']);
$c->add($vals);
$ce = appconf('comments_email');
if ($ce) {
@mail($ce, intl_get('Poll Comment Notice'), template_simple('comment_email.spt', $vals), 'From: ' . 'sitepoll@' . site_domain());
}
page_title(intl_get('Comment Added'));
echo template_simple('comment_added.spt', $vals);
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:14,代码来源:index.php
示例9: onSubmit
function onSubmit($vals)
{
loader_import('siteforum.Post');
loader_import('siteforum.Filters');
loader_import('siteforum.Topic');
$p = new SiteForum_Post();
if (!$p->modify($vals['id'], array('subject' => $vals['subject'], 'body' => $vals['body']))) {
page_title(intl_get('Database Error'));
echo '<p>' . intl_get('An error occurred. Please try again later.') . '</p>';
echo '<p>' . intl_get('Error Message') . ': ' . $p->error . '</p>';
return;
}
$post = $p->get($vals['id']);
page_title(intl_get('Post Updated'));
echo template_simple('post_updated.spt', $post);
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:16,代码来源:index.php
示例10: onSubmit
function onSubmit($vals)
{
$vals['public'] = $vals['public'] ? 'yes' : 'no';
if ($vals['website'] == 'http://') {
$vals['website'] = '';
}
// 1. update sitellite_user
$res = session_user_edit(session_username(), array('firstname' => $vals['firstname'], 'lastname' => $vals['lastname'], 'company' => $vals['company'], 'website' => $vals['website'], 'country' => $vals['country'], 'province' => $vals['province'], 'email' => $vals['email'], 'expires' => date('Y-m-d H:i:s', time() + 3600), 'public' => $vals['public'], 'profile' => $vals['profile'], 'sig' => $vals['sig'], 'modified' => date('Y-m-d H:i:s')));
if (!$res) {
page_title('Unknown Error');
echo '<p>' . intl_get('An error occurred while updating your account. Please try again later.') . '</p>';
return;
}
// 2. respond
page_title(intl_get('Preferences Saved'));
echo template_simple('<p>Your account information been updated. <a href="{site/prefix}/index/sitemember-app">{intl Click here to continue.}</a></p>');
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:17,代码来源:index.php
示例11: onSubmit
function onSubmit($vals)
{
if ($this->parameters['save'] == 'yes') {
// save to sitellite_form_submission table
$parts = explode(' ', $vals['name']);
$first = array_shift($parts);
$last = join(' ', $parts);
db_execute('insert into sitellite_form_submission values (null, ?, now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', 1, 'Contact Form', $_SERVER['REMOTE_ADDR'], null, null, null, $first, $last, $vals['from'], null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, $vals['message']);
}
if (!@mail($this->parameters['email'], '[' . site_domain() . '] ' . intl_get('Contact Form'), template_simple('util_contact_email.spt', $vals), 'From: ' . $vals['name'] . ' <' . $vals['from'] . '>')) {
page_title(intl_get('An Error Occurred'));
echo '<p>' . intl_get('Our apologies, your message failed to be sent. Please try again later.') . '</p>';
return;
}
page_title(intl_get('Thank You'));
echo template_simple('util_contact_thanks.spt');
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:17,代码来源:index.php
示例12: onSubmit
function onSubmit($vals)
{
// 1. add author if necessary
if (!db_shift('select * from sitellite_news_author where name = ?', $vals['author'])) {
db_execute('insert into sitellite_news_author (name) values (?)', $vals['author']);
}
// 2. submit story as 'draft'
loader_import('cms.Versioning.Rex');
$rex = new Rex('sitellite_news');
$res = $rex->create(array('title' => $vals['title'], 'author' => $vals['author'], 'category' => $vals['category'], 'summary' => $vals['summary'], 'body' => $vals['body'], 'date' => date('Y-m-d'), 'sitellite_status' => 'draft', 'sitellite_access' => 'public'), 'Story submission.');
$vals['id'] = $res;
// 3. email notification
@mail(appconf('submissions'), 'News Submission Notice', template_simple('submission_email.spt', $vals));
// 4. thank you screen
page_title(intl_get('Thank You!'));
echo template_simple('submissions.spt');
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:17,代码来源:index.php
示例13: onSubmit
function onSubmit($vals)
{
// your handler code goes here
chdir('inc/html');
$out = shell_exec('../app/devtools/bin/tpl.sh ' . escapeshellarg($vals['setname']));
chdir('../..');
if (trim($out) == 'Your template set is ready, sir.') {
chdir('inc/html');
shell_exec('umask 0000; chmod -R 0777 ' . escapeshellarg($vals['setname']));
chdir('../..');
page_title(intl_get('Template Set Created'));
echo template_simple('tpl_created.spt', $vals);
} else {
page_title(intl_get('An Error Occurred'));
echo template_simple('error.spt', array('msg' => $out));
}
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:17,代码来源:index.php
示例14: SitewikiEditForm
function SitewikiEditForm()
{
parent::MailForm(__FILE__);
$level = 0;
if (session_valid()) {
$level++;
}
if (session_admin()) {
$level++;
}
global $cgi;
$res = db_fetch('select * from sitewiki_page where id = ?', $cgi->page);
if (!$res) {
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="window.location.href = \'' . site_prefix() . '/index/sitewiki-edit-form?page=' . $cgi->page . '&unlock=1&ret=' . urlencode($_SERVER['HTTP_REFERER']) . '\'; return false"';
if ($level >= appconf('default_edit_level')) {
$this->new_page = true;
} else {
echo template_simple('not_visible.spt');
$this->editable = false;
return;
}
$this->widgets['view_level']->setValue(appconf('default_view_level'));
$this->widgets['edit_level']->setValue(appconf('default_edit_level'));
} else {
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="window.location.href = \'' . site_prefix() . '/index/sitewiki-edit-form?page=' . $cgi->page . '&unlock=1\'; return false"';
if ($level < $res->edit_level) {
echo template_simple('not_visible.spt');
$this->editable = false;
return;
} else {
$this->widgets['body']->setValue($res->body);
$this->widgets['view_level']->setValue($res->view_level);
$this->widgets['edit_level']->setValue($res->edit_level);
}
}
if (!appconf('security_test')) {
unset($this->widgets['security_test']);
}
if (!session_valid()) {
unset($this->widgets['files']);
unset($this->widgets['file_1']);
unset($this->widgets['file_2']);
unset($this->widgets['file_3']);
}
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:45,代码来源:index.php
示例15: onSubmit
function onSubmit($vals)
{
$vals['public'] = $vals['public'] ? 'yes' : 'no';
if ($vals['website'] == 'http://') {
$vals['website'] = '';
}
$session_id = session_make_pending_key();
$vals['verify'] = str_replace('PENDING:', '', $session_id);
// 1. insert into sitellite_user
$res = db_execute('
insert into sitellite_user
(username, password, firstname, lastname, company, website, country, province, email, session_id, role, team)
values
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $vals['user_id'], better_crypt($vals['password']), $vals['firstname'], $vals['lastname'], $vals['company'], $vals['website'], $vals['country'], $vals['province'], $vals['email'], $session_id, 'member', 'core');
if (!$res) {
page_title('Unknown Error');
echo '<p>An error occurred while creating your account. Please try again later.</p>';
echo '<p>Error Message: ' . db_error() . '</p>';
return;
}
// 2. insert into org_profile
/*db_execute (
'insert into org_profile
(user_id, public, about, sig)
values
(?, ?, ?, ?)',
$vals['user_id'],
$vals['public'],
$vals['about'],
$vals['sig']
);*/
// 3. email confirmation
@mail($vals['email'], 'Membership Confirmation', template_simple('member_confirmation.spt', $vals), 'From: ' . appconf('email'));
// 4. log them in
//global $cgi, $session;
//$cgi->username = $cgi->user_id;
//$session->username = $cgi->user_id;
//$session->password = $cgi->password;
//$session->start ();
// 5. respond
page_title(intl_get('Welcome') . ' ' . $vals['firstname'] . ' ' . $vals['lastname']);
echo '<p>Your account has been created. An email has also been sent to your address containing information necessary to activate your account.</p>';
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:43,代码来源:index.php
示例16: sitestreamer_flash
function sitestreamer_flash($file, $width, $height, $fg = '0x444444', $bg = '0xAAAAAA')
{
static $num = 0;
$num++;
if (@file_exists('inc/app/sitestreamer/lib/swfobject.js')) {
$image = str_replace('.flv', '.jpg', $file);
if (!@file_exists('inc/data' . $image)) {
$image = '';
}
page_add_script(site_prefix() . '/inc/app/sitestreamer/lib/swfobject.js');
return template_simple('<p align="center" class="sitestreamer-video" id="sitestreamer-video{num}"><a href="http://www.macromedia.com/go/getflashplayer">You need the Flash Player to watch this video.</a></p>
<script type="text/javascript">
var swfobj{num} = new SWFObject ("{site/prefix}/inc/app/sitestreamer/lib/player.swf", "sitestreamer-video", "{width}", "{height}", "9", "{bg}");
swfobj{num}.addParam ("allowfullscreen","true");
swfobj{num}.addParam ("flashvars", "file={site/prefix}/index/cms-filesystem-action{file}{if not empty (obj[image])}&image={site/prefix}/index/cms-filesystem-action{image}{end if}");
swfobj{num}.write ("sitestreamer-video{num}");
</script>', array('file' => $file, 'image' => $image, 'width' => $width, 'height' => $height, 'fg' => $fg, 'bg' => $bg, 'num' => $num));
}
sitestreamer_flvheader();
$height += 40;
return template_simple("<p align='center' class='sitestreamer-video'><object width='{width}' height='{height}' id='flvPlayer'>\r\n <param name='allowFullScreen' value='true'>\r\n <param name='movie' value='{site/prefix}/inc/app/sitestreamer/lib/player.swf?movie={site/prefix}/index/cms-filesystem-action{file}&fgcolor={fg}&bgcolor={bg}&volume=70'>\r\n <embed src='{site/prefix}/inc/app/sitestreamer/lib/player.swf?movie={site/prefix}/index/cms-filesystem-action{file}&fgcolor={fg}&bgcolor={bg}&volume=70' width='{width}' height='{height}' allowFullScreen='true' type='application/x-shockwave-flash'>\r\n</object></p>", array('file' => $file, 'width' => $width, 'height' => $height, 'fg' => $fg, 'bg' => $bg));
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:22,代码来源:flash.php
示例17: onSubmit
function onSubmit($vals)
{
// 1. insert into sitefaq_submission table
if ($vals['url'] == 'http://') {
$vals['url'] = '';
}
$member_id = session_username();
if (!$member_id) {
$member_id = '';
}
if (!$vals['name']) {
$vals['name'] = '';
}
if (!$vals['age']) {
$vals['age'] = '';
}
if (!$vals['url']) {
$vals['url'] = '';
}
db_execute('insert into sitefaq_submission
(id, question, answer, ts, assigned_to, email, member_id, ip, name, age, url, sitellite_status, sitellite_access, sitellite_owner, sitellite_team)
values
(null, ?, "", now(), "", ?, ?, ?, ?, ?, ?, "draft", "private", "", "none")', $vals['question'], $vals['email'], $member_id, $_SERVER['REMOTE_ADDR'], $vals['name'], $vals['age'], $vals['url']);
// 2. email all admins
$admin_roles = session_admin_roles();
$emails = db_shift_array('select distinct email from sitellite_user
where role in("' . join('", "', $admin_roles) . '")');
foreach ($emails as $email) {
@mail($email, intl_get('FAQ Submission Notice'), template_simple('email_notice.spt', $vals), 'From: faq@' . str_replace('www.', '', site_domain()));
}
// 4. if the user provided an email address, send a thank you
if (!empty($vals['email'])) {
@mail($vals['email'], intl_get('FAQ Submission Received'), template_simple('email_thank_you.spt', $vals), 'From: faq@' . str_replace('www.', '', site_domain()));
}
// 3. output a thank you
page_title(intl_get('Thank You'));
echo template_simple('thank_you.spt', $vals);
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:38,代码来源:index.php
示例18: switch
}
switch ($event->recurring) {
case 'yearly':
$event->recur = intl_get('Yearly');
break;
case 'monthly':
$event->recur = intl_get('Monthly');
break;
case 'weekly':
$days = array(intl_get('Sundays'), intl_get('Mondays'), intl_get('Tuesdays'), intl_get('Wednesdays'), intl_get('Thursdays'), intl_get('Fridays'), intl_get('Saturdays'));
list($y, $m, $d) = explode('-', $event->_date);
$event->recur = $days[date('w', mktime(5, 0, 0, $m, $d, $y))];
break;
case 'daily':
case 'no':
default:
if ($event->recurring == 'daily' || $event->until_date != '0000-00-00') {
$event->recur = intl_get('Daily');
} else {
$event->recur = false;
}
break;
}
if (appconf('google_maps') && !empty($event->loc_address) && empty($event->loc_map)) {
$event->loc_google = sprintf('<a href="http://local.google.com/maps?q=%s, %s, %s, %s" target="_blank">%s</a>', $event->loc_address, $event->loc_city, $event->loc_province, $event->loc_country, intl_get('Map'));
} else {
$event->loc_google = false;
}
page_title(appconf('siteevent_title'));
echo template_simple('details.spt', $event);
开发者ID:vojtajina,项目名称:sitellite,代码行数:30,代码来源:index.php
示例19: session_get_user
<?php
$info = session_get_user($parameters['user']);
if (!$info) {
page_title(intl_get('Viewing User'));
echo '<p>' . intl_get('Error') . ': ' . intl_get('User not found.') . '</p>';
}
if (empty($info->lastname)) {
$name = $info->username;
} else {
$name = $info->lastname . ', ' . $info->firstname;
}
page_title(intl_get('Viewing User') . ': ' . $name);
echo template_simple('user/view.spt', $info);
//info ($info);
开发者ID:vojtajina,项目名称:sitellite,代码行数:15,代码来源:index.php
示例20: display
/**
* Returns the display HTML for this widget. The optional
* parameter determines whether or not to automatically display the widget
* nicely, or whether to simply return the widget (for use in a template).
*
* @access public
* @param boolean $generate_html
* @return string
*
*/
function display($generate_html = 0)
{
$n = 0;
$this->widgets = array();
foreach ($this->form->widgets as $k => $w) {
if ($w->type == 'tab') {
$n++;
$this->form->widgets[$k]->num = $n;
} elseif ($n > 0) {
switch ($w->type) {
case 'textarea':
$this->widgets[] = array('name' => $w->name, 'tabnum' => $n - 1, 'on' => 'document.getElementById (\'' . $w->name . '\').style.overflow = \'auto\';', 'off' => 'document.getElementById (\'' . $w->name . '\').style.overflow = \'hidden\';');
break;
case 'keywords':
case 'select':
case 'selector':
case 'position':
case 'template':
case 'multiple':
case 'team':
case 'access':
case 'status':
$this->widgets[] = array('name' => $w->name, 'tabnum' => $n - 1, 'on' => 'document.getElementById (\'' . $w->name . '\').style.display = \'inline\';', 'off' => 'document.getElementById (\'' . $w->name . '\').style.display = \'none\';');
break;
case 'xed':
$this->widgets[] = array('name' => $w->name, 'tabnum' => $n - 1, 'on' => 'xed_mode (\'' . $w->name . '\', \'on\');', 'off' => 'xed_mode (\'' . $w->name . '\', \'off\');');
break;
}
}
}
$this->tab_count = $n - 2;
//info ($this->widgets);
if ($this->num == 1) {
// first
return template_simple($this->template, $this);
} elseif ($this->num == $n) {
// last
return template_simple($this->template_end, $this);
}
return template_simple($this->template_middle, $this);
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:51,代码来源:Tab.php
注:本文中的template_simple函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论