本文整理汇总了PHP中gpOutput::SelectText方法的典型用法代码示例。如果您正苦于以下问题:PHP gpOutput::SelectText方法的具体用法?PHP gpOutput::SelectText怎么用?PHP gpOutput::SelectText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gpOutput
的用法示例。
在下文中一共展示了gpOutput::SelectText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Check
function Check($passed)
{
$message = gpOutput::SelectText('Sorry, your answer to the verification challenge was incorrect. Please try again.');
if (empty($_POST['asm_1']) || empty($_POST['asm_2']) || empty($_POST['asm_3'])) {
message($message . ' (1)');
return false;
}
$operator_key = $_POST['asm_2'];
if (!isset($this->operators[$operator_key])) {
message($message . ' (2)');
return false;
}
switch ($operator_key) {
case 1:
$result = $_POST['asm_1'] + $_POST['asm_3'];
break;
case 2:
$result = $_POST['asm_1'] - $_POST['asm_3'];
break;
case 3:
$result = $_POST['asm_1'] / $_POST['asm_3'];
break;
case 4:
$result = $_POST['asm_1'] * $_POST['asm_3'];
break;
}
$compare = $_POST['asm_4'];
//message('result: '.$result.' vs submitted: '.$compare);
if ($compare != $result) {
message($message . ' (3)');
return false;
}
//message('passed');
return $passed;
}
示例2: ShowRecent
function ShowRecent()
{
global $langmessage;
$page->css_admin[] = '/include/css/addons.css';
//for hmargin css pre gpEasy 3.6
echo '<h2 class="hmargin">';
$label = gpOutput::SelectText('Blog');
echo common::Link('Special_Blog', $label);
echo ' » ';
echo common::Link('Admin_Blog', $langmessage['configuration']);
echo ' <span>|</span> ';
echo common::Link('Admin_BlogCategories', 'Categories');
echo ' <span>|</span> ';
echo gpOutput::SelectText('Comments');
echo '</h2>';
echo '<table style="width:100%" class="bordered">';
echo '<tr><th>';
echo 'Comment';
echo '</th><th>';
echo 'Time / Website';
echo '</th><th>';
echo 'Options';
echo '</th></tr>';
uasort($this->cache, array('SimpleBlogComments', 'Sort'));
foreach ($this->cache as $comment) {
$this->OutputComment($comment);
}
echo '</table>';
}
示例3: Heading
/**
* @param string $current
*/
function Heading($current)
{
global $langmessage;
$options = array('Admin_Blog' => 'Posts', 'Admin_BlogConfig' => $langmessage['configuration'], 'Admin_BlogCategories' => 'Categories', 'Admin_BlogComments' => gpOutput::SelectText('Comments'));
$links = array();
foreach ($options as $slug => $label) {
if ($slug == $current) {
$links[] = $label;
} else {
$links[] = common::Link($slug, $label);
}
}
echo common::Link('Admin_Blog', 'New Blog Post', 'cmd=new_form', ' class="gpsubmit" style="float:right"');
echo '<h2 class="hmargin">';
$label = gpOutput::SelectText('Blog');
echo common::Link('Special_Blog', $label);
echo ' » ';
echo implode('<span>|</span>', $links);
echo '</h2>';
}
示例4: Show
function Show($indexofparent)
{
global $addonRelativeCode;
if ($this->nav_style == 0) {
$next = gpOutput::SelectText('Next');
$back = gpOutput::SelectText('Previous');
} elseif ($this->nav_style == 1) {
$back = '<img src="' . $addonRelativeCode . '/img/arrow1-back.png' . '" />';
$next = '<img src="' . $addonRelativeCode . '/img/arrow1-next.png ' . '" />';
} elseif ($this->nav_style == 2) {
$back = '<img src="' . $addonRelativeCode . '/img/arrow2-back.png' . '" />';
$next = '<img src="' . $addonRelativeCode . '/img/arrow2-next.png ' . '" />';
} elseif ($this->nav_style == 3) {
$back = '<img src="' . $addonRelativeCode . '/img/arrow3-back.png' . '" />';
$next = '<img src="' . $addonRelativeCode . '/img/arrow3-next.png ' . '" />';
}
if ($this->nav_buttons == 1) {
$nav_style = "sides";
} else {
$nav_style = "";
}
echo '<p class="EC_nav_links' . $nav_style . '">';
if ($this->nav_parent) {
$pl = common::GetLabelIndex($indexofparent);
$pt = common::IndexToTitle($indexofparent);
echo '<a class="EC_home" href="' . common::GetUrl($pt) . '">' . $pl . '</a>';
echo ' ';
}
if ($this->PrevUrl) {
echo '<a class="EC_newer" href="' . $this->PrevUrl . '">' . $back . '</a>';
echo ' ';
}
if ($this->NextUrl) {
echo '<a class="EC_older" href="' . $this->NextUrl . '">' . $next . '</a>';
}
echo '</p>';
}
示例5: AbbrevContent
/**
* Abbreviate $content if a $limit greater than zero is given
*
*/
public function AbbrevContent($content, $post_index, $limit = 0)
{
if (!is_numeric($limit) || $limit == 0) {
return $content;
}
$content = strip_tags($content);
if (mb_strlen($content) < $limit) {
return $content;
}
$pos = mb_strpos($content, ' ', $limit - 5);
if ($pos > 0 && $limit + 20 > $pos) {
$limit = $pos;
}
$content = mb_substr($content, 0, $limit) . ' ... ';
$label = gpOutput::SelectText('Read More');
return $content . SimpleBlogCommon::PostLink($post_index, $label);
}
示例6: GenGadget
/**
* Regenerate the static content used to display the gadget
*
*/
static function GenGadget()
{
global $langmessage;
$posts = array();
$show_posts = SimpleBlogCommon::WhichPosts(0, SimpleBlogCommon::$data['gadget_entries']);
ob_start();
$label = gpOutput::SelectText('Blog');
if (!empty($label)) {
echo '<h3>';
echo common::Link('Special_Blog', $label);
echo '</h3>';
}
foreach ($show_posts as $post_index) {
$post = SimpleBlogCommon::GetPostContent($post_index);
if (!$post) {
continue;
}
$header = '<b class="simple_blog_title">';
$label = SimpleBlogCommon::Underscores($post['title']);
$header .= SimpleBlogCommon::PostLink($post_index, $label);
$header .= '</b>';
SimpleBlogCommon::BlogHead($header, $post_index, $post, true);
$content = strip_tags($post['content']);
if (SimpleBlogCommon::$data['gadget_abbrev'] > 6 && mb_strlen($content) > SimpleBlogCommon::$data['gadget_abbrev']) {
$cut = SimpleBlogCommon::$data['gadget_abbrev'];
$pos = mb_strpos($content, ' ', $cut - 5);
if ($pos > 0 && $cut + 20 > $pos) {
$cut = $pos;
}
$content = mb_substr($content, 0, $cut) . ' ... ';
$label = gpOutput::SelectText('Read More');
$content .= SimpleBlogCommon::PostLink($post_index, $label);
}
echo '<p class="simple_blog_abbrev">';
echo $content;
echo '</p>';
}
if (SimpleBlogCommon::$data['post_count'] > 3) {
$label = gpOutput::SelectText('More Blog Entries');
echo common::Link('Special_Blog', $label);
}
$gadget = ob_get_clean();
$gadgetFile = SimpleBlogCommon::$data_dir . '/gadget.php';
gpFiles::Save($gadgetFile, $gadget);
}
示例7: GetPostedComment
/**
* Get Posted Comment
*
*/
protected function GetPostedComment()
{
global $langmessage;
if (empty($_POST['name'])) {
$field = gpOutput::SelectText('Name');
message($langmessage['OOPS_REQUIRED'], $field);
return false;
}
if (empty($_POST['comment'])) {
$field = gpOutput::SelectText('Comment');
message($langmessage['OOPS_REQUIRED'], $field);
return false;
}
$comment = array();
$comment['name'] = htmlspecialchars($_POST['name']);
$comment['comment'] = nl2br(strip_tags($_POST['comment']));
$comment['time'] = time();
if (!empty($_POST['website']) && $_POST['website'] !== 'http://') {
$website = $_POST['website'];
if (mb_strpos($website, '://') === false) {
$website = false;
}
if ($website) {
$comment['website'] = $website;
}
}
return $comment;
}
示例8: __construct
function __construct()
{
global $langmessage, $addonRelativeCode, $addonFolderName, $page;
$this->Init();
$this->categories = SimpleBlogCommon::AStrToArray('categories');
$cmd = common::GetCommand();
switch ($cmd) {
//category commands
case 'save_categories':
$this->SaveCategories();
break;
case 'new_category':
$this->NewCategory();
return;
case 'save_new_category':
$this->SaveNewCategory();
break;
case 'delete_category':
$this->DeleteCategory();
break;
}
$page->css_admin[] = '/include/css/addons.css';
//for hmargin css pre gpEasy 3.6
$page->head_js[] = '/data/_addoncode/' . $addonFolderName . '/admin.js';
$label = gpOutput::SelectText('Blog');
echo '<h2 class="hmargin">';
echo common::Link('Special_Blog', $label);
echo ' » ';
echo common::Link('Admin_Blog', 'Configuration');
echo ' <span>|</span> ';
echo ' Categories ';
echo ' <span>|</span> ';
$comments = gpOutput::SelectText('Comments');
echo common::Link('Admin_BlogComments', $comments);
echo '</h2>';
// print all categories and settings
echo '<form name="categories" action="' . common::GetUrl('Admin_BlogCategories') . '" method="post">';
echo '<table class="bordered">';
echo '<tr><th> </th><th>Category</th><th>Number of Posts</th><th>Visible</th><th>Options</th></tr>';
echo '<tbody class="sortable_table">';
foreach ($this->categories as $catindex => $catname) {
echo '<tr><td style="vertical-align:middle">';
echo '<img src="' . $addonRelativeCode . '/grip.png" height="15" width="15" style="padding:2px;cursor:pointer;"/>';
echo '</td><td>';
echo '<input type="text" name="cattitle[' . $catindex . ']" value="' . $catname . '" class="gpinput" />';
echo '</td><td>';
$astr =& SimpleBlogCommon::$data['category_posts_' . $catindex];
echo substr_count($astr, '>');
echo '</td><td>';
$checked = '';
if (!SimpleBlogCommon::AStrValue('categories_hidden', $catindex)) {
$checked = ' checked="checked"';
}
echo ' <input type="checkbox" name="catvis[' . $catindex . ']"' . $checked . '/> ';
echo '</td><td>';
echo common::Link('Admin_BlogCategories', $langmessage['delete'], 'cmd=delete_category&index=' . $catindex, ' name="postlink" class="gpconfirm" title="Delete this Category?" ');
echo '</td></tr>';
}
echo '</tbody>';
echo '</table>';
echo '<p>';
echo '<input type="hidden" name="cmd" value="save_categories" />';
echo '<input type="submit" value="' . $langmessage['save_changes'] . '" class="gpsubmit"/>';
echo ' ';
echo common::Link('Admin_BlogCategories', 'Add New Category', 'cmd=new_category', ' name="gpabox" ');
echo '</p>';
echo '</form>';
// print all posts
/*
if( count($this->itlist) ){
echo '<h3 onclick="$(this).next(\'form\').toggle()" style="cursor:pointer">All Blog Posts</h3>';
echo '<form name="allposts" action="'.common::GetUrl('Admin_BlogCategories').'" method="post" style="display:none">';
echo '<table style="width:100%">';
foreach( $this->itlist as $postindex => $postdata ){
echo '<tr><td>'.$postdata['title'].' ';
echo common::Link('Special_Blog','»','id='.$postindex,'target="_blank"').'</td><td>';
echo '<select id="post'.$postindex.'" name="post'.$postindex.'[]" multiple="multiple" class="gpselect">';
foreach( $this->categories as $catindex => $catdata){
echo '<option value="'.$catindex.'" '.(isset($catdata[$postindex])? 'selected="selected"':'').'>'.$catdata['ct'].'</option>';
}
echo '</select>';
echo '</td></tr>';
}
echo '</table>';
echo '<input name="save_posts" type="submit" value="'.$langmessage['save'].'" class="gpsubmit" />';
echo '</form>';
}
*/
}
示例9: ReturnTextWorker
function ReturnTextWorker($key, $html, $query)
{
global $langmessage;
$result = '';
$wrap = gpOutput::ShowEditLink('Admin_Theme_Content');
if ($wrap) {
$title = htmlspecialchars(strip_tags($key));
if (strlen($title) > 20) {
$title = substr($title, 0, 20) . '...';
//javscript may shorten it as well
}
echo gpOutput::EditAreaLink($edit_index, 'Admin_Theme_Content', $langmessage['edit'], $query, ' title="' . $title . '" name="gpabox" ');
$result .= '<span class="editable_area" id="ExtraEditArea' . $edit_index . '">';
// class="edit_area" added by javascript
}
$text = gpOutput::SelectText($key);
$result .= str_replace('%s', $text, $html);
//in case there's more than one %s
if ($wrap) {
$result .= '</span>';
}
return $result;
}
示例10: ShowForm
function ShowForm()
{
global $page, $langmessage, $config;
$attr = '';
if ($this->sent) {
$attr = ' readonly="readonly" ';
}
$_GET += array('name' => '', 'email' => '', 'subject' => '', 'message' => '');
$_POST += array('name' => $_GET['name'], 'email' => $_GET['email'], 'subject' => $_GET['subject'], 'message' => $_GET['message']);
$require_email =& $config['require_email'];
echo '<form class="contactform" action="' . common::GetUrl($page->title) . '" method="post">';
//nonce fields
echo '<div style="display:none !important">';
echo '<input type="hidden" name="contact_nonce" value="' . htmlspecialchars(common::new_nonce('contact_post', true)) . '" />';
echo '<input type="text" name="contact_void" value="" />';
echo '</div>';
echo '<label for="contact_name"><span class="title">';
echo gpOutput::ReturnText('your_name');
echo '</span><input id="contact_name" class="input text" type="text" name="name" value="' . htmlspecialchars($_POST['name']) . '" ' . $attr . ' />';
echo '</label>';
echo '<label for="contact_email"><span class="title">';
echo gpOutput::ReturnText('your_email');
if (strpos($require_email, 'email') !== false) {
echo '*';
}
echo '</span><input id="contact_email" class="input text" type="text" name="email" value="' . htmlspecialchars($_POST['email']) . '" ' . $attr . '/>';
echo '</label>';
echo '<label for="contact_subject"><span class="title">';
echo gpOutput::ReturnText('subject');
if (strpos($require_email, 'none') === false) {
echo '*';
}
echo '</span><input id="contact_subject" class="input text" type="text" name="subject" value="' . htmlspecialchars($_POST['subject']) . '" ' . $attr . '/>';
echo '</label>';
echo '<label for="contact_message">';
echo gpOutput::ReturnText('message');
if (strpos($require_email, 'none') === false) {
echo '*';
}
echo '</label>';
echo '<textarea id="contact_message" name="message" ' . $attr . ' rows="10" cols="10">';
echo htmlspecialchars($_POST['message']);
echo '</textarea>';
gpPlugin::Action('contact_form_pre_captcha');
if (!$this->sent && gp_recaptcha::isActive()) {
echo '<div class="captchaForm">';
echo gpOutput::ReturnText('captcha');
gp_recaptcha::Form();
echo '</div>';
}
if ($this->sent) {
echo gpOutput::ReturnText('message_sent', '%s', 'message_sent');
} else {
echo '<input type="hidden" name="cmd" value="gp_send_message" />';
$key = 'send_message';
$text = gpOutput::SelectText($key);
if (gpOutput::ShowEditLink('Admin_Theme_Content')) {
$query = 'cmd=edittext&key=' . urlencode($key);
echo gpOutput::EditAreaLink($edit_index, 'Admin_Theme_Content', $langmessage['edit'], $query, ' title="' . $key . '" data-cmd="gpabox" ');
echo '<input type="submit" class="submit editable_area" id="ExtraEditArea' . $edit_index . '" name="aaa" value="' . $text . '" />';
} else {
echo '<input type="submit" class="submit" name="aaa" value="' . $text . '" />';
}
}
echo '</form>';
}
示例11: Config
/**
* Show the configuration form
*
*/
function Config()
{
global $langmessage, $addonFolderName, $gpversion;
$defaults = SimpleBlogCommon::Defaults();
$array =& SimpleBlogCommon::$data;
$label = gpOutput::SelectText('Blog');
$this->Heading('Admin_BlogConfig');
echo '<form class="renameform" action="' . common::GetUrl('Admin_BlogConfig') . '" method="post">';
echo '<table class="bordered full_width">';
echo '<tr><th>';
echo 'Option';
echo '</th><th>';
echo 'Value';
echo '</th><th>';
echo 'Default';
echo '</th></tr>';
$options = self::Options();
//Pretty Urls
echo '<tr><td>Urls</td><td>';
if (version_compare($gpversion, '4.0', '>=')) {
self::Radio('urls', $options['urls'], $array['urls']);
} else {
echo 'Available in gpEasy 4.0+';
}
echo '</td><td>';
echo $defaults['urls'];
echo '</td></tr>';
//Date Format
echo '<tr><td>';
echo 'Date Format';
//echo ' (<a href="http://php.net/manual/en/function.date.php" target="_blank">About</a>)';
echo ' (<a href="http://www.php.net/manual/en/function.strftime.php" target="_blank">About</a>)';
echo '</td><td>';
//echo '<input type="text" name="date_format" size="20" value="'.htmlspecialchars($array['date_format']).'" class="gpinput" />';
echo '<input type="text" name="strftime_format" value="' . htmlspecialchars($array['strftime_format']) . '" class="gpinput" />';
echo '</td><td>';
echo $defaults['strftime_format'];
echo '</td></tr>';
//Subtitle Separator
echo '<tr><td>';
echo 'Subtitle Separator';
echo '</td><td>';
echo '<input type="text" name="subtitle_separator" size="20" value="' . htmlspecialchars($array['subtitle_separator']) . '" class="gpinput" />';
echo '</td><td>';
echo htmlspecialchars($defaults['subtitle_separator']);
echo '</td></tr>';
//Entries Per Page
echo '<tr><td>Entries Per Page</td><td>';
echo '<input type="text" name="per_page" value="' . htmlspecialchars($array['per_page']) . '" class="gpinput" />';
echo '</td><td>';
echo $defaults['per_page'];
echo '</td></tr>';
//Entries Abbreviation Length
echo '<tr><td>';
echo 'Entries Abbreviation Length';
echo '</td><td>';
echo '<input type="text" name="post_abbrev" value="' . htmlspecialchars($array['post_abbrev']) . '" class="gpinput" />';
echo '</td><td>';
echo $defaults['post_abbrev'];
echo '</td></tr>';
//Image in Abbrevation
echo '<tr><td>';
echo 'Image in Abbrevation';
echo '</td><td>';
if ($array['abbrev_image']) {
echo '<input type="checkbox" name="abbrev_image" value="allow" checked="checked" />';
} else {
echo '<input type="checkbox" name="abbrev_image" value="allow" />';
}
echo '</td><td></td></tr>';
//Categories in Abbreviation
echo '<tr><td>';
echo 'Categories in Abbrevation';
echo '</td><td>';
if ($array['abbrev_cat']) {
echo '<input type="checkbox" name="abbrev_cat" value="allow" checked="checked" />';
} else {
echo '<input type="checkbox" name="abbrev_cat" value="allow" />';
}
echo '</td><td></td></tr>';
//Comments
echo '<tr><th colspan="3">';
echo 'Gadget';
echo '</th></tr>';
//Entries For Gadget
echo '<tr><td>';
echo 'Entries For Gadget';
echo '</td><td>';
echo '<input type="text" name="gadget_entries" value="' . htmlspecialchars($array['gadget_entries']) . '" class="gpinput" />';
echo '</td><td>';
echo $defaults['gadget_entries'];
echo '</td></tr>';
//Gadget Abbreviation Length
echo '<tr><td>';
echo 'Gadget Abbreviation Length';
echo '</td><td>';
//.........这里部分代码省略.........
示例12: BlogHead
/**
* Potential method for allowing users to format the header area of their blog
* However, this would make it more difficult for theme developers to design for the blog plugin
*
*/
function BlogHead($header, $post_index, $post, $cacheable = false)
{
//subtitle
$blog_info = '{empty_blog_piece}';
if (!empty($post['subtitle'])) {
$blog_info = '<span class="simple_blog_subtitle">';
$blog_info .= $post['subtitle'];
$blog_info .= '</span>';
}
//blog date
$blog_date = '<span class="simple_blog_date">';
$blog_date .= strftime(SimpleBlogCommon::$data['strftime_format'], $post['time']);
$blog_date .= '</span>';
//blog comments
$blog_comments = '{empty_blog_piece}';
$count = SimpleBlogCommon::AStrValue('comment_counts', $post_index);
if ($count > 0) {
$blog_comments = '<span class="simple_blog_comments">';
if ($cacheable) {
$blog_comments .= gpOutput::SelectText('Comments');
} else {
$blog_comments .= gpOutput::GetAddonText('Comments');
}
$blog_comments .= ': ' . $count;
$blog_comments .= '</span>';
}
// format content
$format = '{header} <div class="simple_blog_info"> {blog_info} {separator} {blog_date} {separator} {blog_comments} </div>';
$search = array('{header}', '{blog_info}', '{blog_date}', '{blog_comments}');
$replace = array($header, $blog_info, $blog_date, $blog_comments);
$result = str_replace($search, $replace, $format);
$reg = '#\\{empty_blog_piece\\}(\\s*)\\{separator\\}#';
$result = preg_replace($reg, '\\1', $result);
$reg = '#\\{separator\\}(\\s*){empty_blog_piece\\}#';
$result = preg_replace($reg, '\\1', $result);
echo str_replace('{separator}', SimpleBlogCommon::$data['subtitle_separator'], $result);
}
示例13: ShowPosts
/**
* Show all blog posts
*
*/
public function ShowPosts()
{
global $langmessage;
$this->Heading('Admin_Blog');
$post_ids = SimpleBlogCommon::AStrToArray('str_index');
$post_titles = SimpleBlogCommon::AStrToArray('titles');
$post_times = SimpleBlogCommon::AStrToArray('post_times');
$post_comments = SimpleBlogCommon::AStrToArray('comment_counts');
$post_drafts = SimpleBlogCommon::AStrToArray('drafts');
$total_posts = count($post_ids);
$per_page = 20;
$total_pages = ceil($total_posts / $per_page);
$offset = 0;
//offset
if (isset($_REQUEST['offset']) && ctype_digit($_REQUEST['offset']) && $_REQUEST['offset'] > 0) {
$offset = $_REQUEST['offset'];
}
$post_ids = array_slice($post_ids, $offset, $per_page);
//pagination links
echo '<div style="float:right;margin:20px 0;">';
echo '<span class="page_count">';
echo $offset + 1 . ' to ' . min($total_posts, $offset + $per_page) . ' of ' . $total_posts;
echo '</span>';
echo '<ul class="pagination">';
if ($total_posts > $per_page) {
for ($i = 0; $i < $total_pages; $i++) {
$_offset = $i * $per_page;
$class = '';
if ($_offset == $offset) {
$class = ' class="active"';
}
echo '<li ' . $class . '>' . common::Link('Admin_Blog', $i + 1, 'offset=' . $_offset) . '</li>';
}
}
echo '</ul>';
echo '</div>';
echo '<table class="bordered full_width striped">';
echo '<thead><tr><th></th><th>Posts (' . number_format($total_posts) . ')';
echo '</th><th>Publish Time</th><th>Comments</th>';
echo '<th>Options</th>';
echo '</tr></thead>';
echo '<tbody>';
foreach ($post_ids as $i => $post_id) {
//draft/pending
echo '<tr><td width="1%">';
if (isset($post_drafts[$post_id])) {
echo 'Draft';
} elseif ($post_times[$post_id] > time()) {
echo 'Pending';
}
//title
echo '</td><td>';
$title = $post_titles[$post_id];
echo SimpleBlogCommon::PostLink($post_id, $title);
//post time
echo '</td><td>';
if (isset($post_times[$post_id])) {
echo strftime(SimpleBlogCommon::$data['strftime_format'], $post_times[$post_id]);
}
//comments
echo '</td><td>';
echo '<span style="display:inline-block;min-width:30px">';
if (isset($post_comments[$post_id])) {
echo number_format($post_comments[$post_id]);
} else {
echo '0';
}
echo '</span>';
if (SimpleBlogCommon::$data['allow_comments']) {
$comments_closed = SimpleBlogCommon::AStrGet('comments_closed', $post_id);
$open = gpOutput::SelectText('Open');
$close = gpOutput::SelectText('Close');
if ($comments_closed) {
echo common::Link('Admin_Blog', $open, 'cmd=opencomments&id=' . $post_id, 'name="cnreq"');
echo ' ';
echo gpOutput::SelectText('Closed');
} else {
echo $open;
echo ' ';
echo common::Link('Admin_Blog', $close, 'cmd=closecomments&id=' . $post_id, 'name="cnreq"');
}
} else {
echo common::Link('Admin_BlogConfig', 'Disabled');
}
echo '</td><td>';
echo SimpleBlogCommon::PostLink($post_id, 'View Post');
echo ' ';
echo common::Link('Admin_Blog/' . $post_id, $langmessage['edit'], 'cmd=edit_post');
echo ' ';
echo common::Link('Admin_Blog', $langmessage['delete'], 'cmd=deleteentry&del_id=' . $post_id, array('class' => 'delete gpconfirm', 'data-cmd' => 'cnreq', 'title' => $langmessage['delete_confirm']));
echo '</td></tr>';
}
echo '</tbody>';
echo '</table>';
}
示例14: Config
/**
* Show the configuration form
*
*/
function Config()
{
global $langmessage, $addonFolderName;
$defaults = SimpleBlogCommon::Defaults();
$array =& $this->blogData;
$label = gpOutput::SelectText('Blog');
echo '<h2>';
echo common::Link('Special_Blog', $label);
echo ' » ';
echo $langmessage['configuration'];
echo '</h2>';
echo '<form class="renameform" action="' . common::GetUrl('Admin_Blog') . '" method="post">';
echo '<table style="width:100%" class="bordered">';
echo '<tr>';
echo '<th>';
echo 'Option';
echo '</th>';
echo '<th>';
echo 'Value';
echo '</th>';
echo '<th>';
echo 'Default';
echo '</th>';
echo '</tr>';
echo '<tr>';
echo '<td>Entries Per Page</td>';
echo '<td>';
echo '<input type="text" name="per_page" size="20" value="' . htmlspecialchars($array['per_page']) . '" class="gpinput" />';
echo '</td><td>';
echo $defaults['per_page'];
echo '</td></tr>';
echo '<tr>';
echo '<td>';
echo 'Entries Abbreviation Length';
echo '</td>';
echo '<td>';
echo '<input type="text" name="post_abbrev" size="20" value="' . htmlspecialchars($array['post_abbrev']) . '" class="gpinput" />';
echo '</td>';
echo '<td>';
echo $defaults['post_abbrev'];
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo 'Entries For Gadget';
echo '</td>';
echo '<td>';
echo '<input type="text" name="gadget_entries" size="20" value="' . htmlspecialchars($array['gadget_entries']) . '" class="gpinput" />';
echo '</td>';
echo '<td>';
echo $defaults['gadget_entries'];
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo 'Gadget Abbreviation Length';
echo '</td>';
echo '<td>';
echo '<input type="text" name="gadget_abbrev" size="20" value="' . htmlspecialchars($array['gadget_abbrev']) . '" class="gpinput" />';
echo '</td>';
echo '<td>';
echo $defaults['gadget_abbrev'];
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo 'Date Format';
//echo ' (<a href="http://php.net/manual/en/function.date.php" target="_blank">About</a>)';
echo ' (<a href="http://www.php.net/manual/en/function.strftime.php" target="_blank">About</a>)';
echo '</td>';
echo '<td>';
//echo '<input type="text" name="date_format" size="20" value="'.htmlspecialchars($array['date_format']).'" class="gpinput" />';
echo '<input type="text" name="strftime_format" size="20" value="' . htmlspecialchars($array['strftime_format']) . '" class="gpinput" />';
echo '</td>';
echo '<td>';
echo $defaults['strftime_format'];
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo 'Entries For Feed';
echo '</td>';
echo '<td>';
echo '<input type="text" name="feed_entries" size="20" value="' . htmlspecialchars($array['feed_entries']) . '" class="gpinput" />';
echo '</td>';
echo '<td>';
echo $defaults['feed_entries'];
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo 'Feed Abbreviation Length';
echo '</td>';
echo '<td>';
echo '<input type="text" name="feed_abbrev" size="20" value="' . htmlspecialchars($array['feed_abbrev']) . '" class="gpinput" />';
echo '</td>';
//.........这里部分代码省略.........
示例15: BlogHead
/**
* Potential method for allowing users to format the header area of their blog
* However, this would make it more difficult for theme developers to design for the blog plugin
*
*/
function BlogHead($header, $post_index, $post, $cacheable = false)
{
$blog_info = '{empty_blog_piece}';
if (!empty($post['subtitle'])) {
$blog_info = '<span class="simple_blog_subtitle">';
$blog_info .= $post['subtitle'];
$blog_info .= '</span>';
}
$blog_date = '<span class="simple_blog_date">';
$blog_date .= strftime($this->blogData['strftime_format'], $post['time']);
$blog_date .= '</span>';
$blog_comments = '{empty_blog_piece}';
if ($this->blogData['allow_comments'] && isset($this->blogData['post_info'][$post_index]) && isset($this->blogData['post_info'][$post_index]['comments'])) {
$blog_comments = '<span class="simple_blog_comments">';
if ($cacheable) {
$blog_comments .= gpOutput::SelectText('Comments');
} else {
$blog_comments .= gpOutput::GetAddonText('Comments');
}
$blog_comments .= ': ' . $this->blogData['post_info'][$post_index]['comments'];
$blog_comments .= '</span>';
}
$format = '{header} <div class="simple_blog_info"> {blog_info} {separator} {blog_date} {separator} {blog_comments} </div>';
$search = array('{header}', '{blog_info}', '{blog_date}', '{blog_comments}');
$replace = array($header, $blog_info, $blog_date, $blog_comments);
$result = str_replace($search, $replace, $format);
$reg = '#\\{empty_blog_piece\\}(\\s*)\\{separator\\}#';
$result = preg_replace($reg, '\\1', $result);
$reg = '#\\{separator\\}(\\s*){empty_blog_piece\\}#';
$result = preg_replace($reg, '\\1', $result);
echo str_replace('{separator}', $this->blogData['subtitle_separator'], $result);
}