本文整理汇总了PHP中fetch_phrase_group函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_phrase_group函数的具体用法?PHP fetch_phrase_group怎么用?PHP fetch_phrase_group使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fetch_phrase_group函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: createDefaultContent
/**
* Creates a new, empty content item to add to a node.
*
* @param vBCms_DM_Node $nodedm - The DM of the node that the content is being created for
* @return int | false - The id of the new content or false if not applicable
*/
public function createDefaultContent(vBCms_DM_Node $nodedm)
{
global $vbphrase;
require_once DIR . '/includes/functions_databuild.php';
fetch_phrase_group('cpcms');
vB::$vbulletin->input->clean_array_gpc('r', array(
'nodeid' => vB_Input::TYPE_UINT,
'parentnode' => vB_Input::TYPE_UINT,
'parentid' => vB_Input::TYPE_UINT,
'pagecontent' => vB_Input::TYPE_STR,
));
//We should have a nodeid, but a parentnode is even better.
($hook = vBulletinHook::fetch_hook($this->content_start_hook)) ? eval($hook) : false;
if ($this->parent_node)
{
$parentnode = $this->parent_node;
}
else if (vB::$vbulletin->GPC_exists['parentnode'] AND intval(vB::$vbulletin->GPC['parentnode'] ))
{
$parentnode = vB::$vbulletin->GPC['parentnode'];
}
else if (vB::$vbulletin->GPC_exists['parentid'] AND intval(vB::$vbulletin->GPC['parentid'] ))
{
$parentnode = vB::$vbulletin->GPC['parentid'];
}
else if (vB::$vbulletin->GPC_exists['nodeid'] AND intval(vB::$vbulletin->GPC['nodeid'] )
and $record = vB::$vbulletin->db->query_first("SELECT contenttypeid, nodeid, parentnode FROM " .
TABLE_PREFIX . "cms_node where nodeid = " . vB::$vbulletin->GPC['nodeid'] ))
{
$parentnode = vB_Types::instance()->getContentTypeID("vBCms_Section") == $record['contenttypeid'] ?
$record['nodeid'] : $record['parentnode'];
}
else
{
throw (new vB_Exception_Content('No valid parent node'));
}
$contenttypeid = vB_Types::instance()->getContentTypeID($this->package . '_' . $this->class);
//Verify Permissions
if (!vBCMS_Permissions::canUseHtml($parentnode, $contenttypeid, vB::$vbulletin->userinfo['userid']))
{
throw (new vB_Exception_AccessDenied());
}
$this->config = array('pagetext' => $vbphrase['php_goes_here_desc'],
'previewtext' => $vbphrase['php_preview_goes_here_desc']);
$nodedm->set('config', $this->config);
$nodedm->set('contenttypeid', $contenttypeid);
$nodedm->set('parentnode', $parentnode);
$nodedm->set('publicpreview', 1);
$nodedm->set('comments_enabled', 1);
$title = new vB_Phrase('vbcms', 'new_php_eval_page');
$nodedm->set('description', $title);
$nodedm->set('title', $title);
if (!($contentid = $nodedm->save()))
{
throw (new vB_Exception_Content('Failed to create default content for contenttype ' . get_class($this)));
}
($hook = vBulletinHook::fetch_hook($this->content_end_hook)) ? eval($hook) : false;
//at this point we have saved the data. We need to get the content id, which isn't easily available.
if ($record = vB::$vbulletin->db->query_first("SELECT contentid FROM " . TABLE_PREFIX . "cms_node WHERE nodeid = $contentid"))
{
$nodedm->set('contentid', $record['contentid']);
}
return $contentid;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:78,代码来源:phpeval.php
示例2: getConfigEditorView
public function getConfigEditorView()
{
require_once DIR . '/includes/functions_databuild.php' ;
fetch_phrase_group('posting');
global $show;
require_once DIR . '/includes/functions_editor.php' ;
require_once(DIR . '/includes/functions_file.php');
$config = $this->getConfig();
$attachmentoption = '';
$attachcount = 0;
$posthash = 0;
$poststarttime = 0;
$postattach = 0;
$contenttypeid = 0;
$attachinfo = fetch_attachmentinfo($posthash, $poststarttime, $contenttypeid);
$view->editorid = construct_edit_toolbar($pagetext, 0, 'blog_entry',1, 1, true,'fe', '', false);
$templater = vB_Template::create('vbcms_comments_editor');
$templater->register('attachmentoption', $attachmentoption);
$templater->register('checked', $checked);
$templater->register('disablesmiliesoption', $disablesmiliesoption);
$templater->register('editorid', $view->editorid);
$templater->register('messagearea', $messagearea);
$tag_delimiters = addslashes_js(vB::$vbulletin->options['tagdelimiter']);
$templater->register('tag_delimiters', $tag_delimiters);
$content = $templater->render();
return $GLOBALS['messagearea'];
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:34,代码来源:comments.php
示例3:
{
print_cp_redirect("misc.php?" . $vbulletin->session->vars['sessionurl'] . "do=removeorphanposts&pp=" . $vbulletin->GPC['perpage'] . "&startat=$finishat");
echo "<p><a href=\"misc.php?" . $vbulletin->session->vars['sessionurl'] . "do=removeorphanposts&pp=" . $vbulletin->GPC['perpage'] . "&startat=$finishat\">" . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
}
else
{
define('CP_REDIRECT', 'misc.php');
print_stop_message('deleted_orphan_posts_successfully');
}
}
// ###################### Anonymous Survey Code #######################
if ($_REQUEST['do'] == 'survey')
{
// first we'd like extra phrase groups from the cphome
fetch_phrase_group('cphome');
/*
All the functions are prefixed with @ to supress errors, this allows us to get feedback from hosts which have almost everything
useful disabled
*/
// What operating system is the webserver running
$os = @php_uname('s');
// Using 32bit or 64bit
$architecture = @php_uname('m');//php_uname('r') . ' ' . php_uname('v') . ' ' . //;
// Webserver Signature
$web_server = $_SERVER['SERVER_SOFTWARE'];
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:misc.php
示例4: get_article_comments
function get_article_comments($article, $associated_thread_id, $userinfo, &$pageno, &$perpage, &$total)
{
require_once DIR . '/includes/functions_misc.php';
require_once DIR . '/includes/functions.php';
require_once DIR . '/includes/functions_databuild.php';
require_once DIR . '/includes/functions_bigthree.php';
$posts_out = array();
fetch_phrase_group('posting');
$threadinfo = verify_id('thread', $associated_thread_id, 0, 1);
$foruminfo = verify_id('forum', $threadinfo['forumid'], 0, 1);
//First let's see if we have forum/thread view permissions. If not,
// we're done
if (!($permissions = can_view_thread($article->getNodeId(), $userinfo))) {
return array();
}
$forumperms = fetch_permissions($threadinfo['forumid']);
//Normally this thread will be wide open, so let's get the list first
// without checking. We'll verify each post anyway.
//get our results
$results = get_comments($permissions, $associated_thread_id);
$record_count = count($results);
if (!$results or !count($results)) {
return array();
}
//we accept the parameter "last" for pageno.
if ($pageno == FR_LAST_POST) {
$pageno = intval(($record_count + $perpage - 1) / $perpage);
$first = ($pageno - 1) * $perpage;
} else {
$pageno = max(1, intval($pageno));
$first = $perpage * ($pageno - 1);
}
//Let's trim off the results we need.
//This also tells us if we should show the "next" button.
$post_array = array_slice($results, $first, $perpage, true);
if (!$post_array) {
return array();
}
$firstpostid = false;
$displayed_dateline = 0;
if (vB::$vbulletin->options['threadmarking'] and vB::$vbulletin->userinfo['userid']) {
$threadview = max($threadinfo['threadread'], $threadinfo['forumread'], TIMENOW - vB::$vbulletin->options['markinglimit'] * 86400);
} else {
$threadview = intval(fetch_bbarray_cookie('thread_lastview', $thread['threadid']));
if (!$threadview) {
$threadview = vB::$vbulletin->userinfo['lastvisit'];
}
}
require_once DIR . '/includes/functions_user.php';
$show['inlinemod'] = false;
$postids = array();
$postids = ' post.postid in (' . implode(', ', $post_array) . ')';
$posts = vB::$vbulletin->db->query_read($sql = "\n\tSELECT\n\tpost.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,\n\t user.*, userfield.*, usertextfield.*,\n\t " . iif($forum['allowicons'], 'icon.title as icontitle, icon.iconpath,') . "\n\t " . iif(vB::$vbulletin->options['avatarenabled'], 'avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width AS avwidth,customavatar.height AS avheight,') . "\n\t " . ((can_moderate($thread['forumid'], 'canmoderateposts') or can_moderate($thread['forumid'], 'candeleteposts')) ? 'spamlog.postid AS spamlog_postid,' : '') . "\n\t " . iif($deljoin, 'deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason,') . "\n\t editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline,\n\t editlog.reason AS edit_reason, editlog.hashistory,\n\t postparsed.pagetext_html, postparsed.hasimages,\n\t sigparsed.signatureparsed, sigparsed.hasimages AS sighasimages,\n\t sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight,\n\t IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid,\n\t customprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline, customprofilepic.width AS ppwidth, customprofilepic.height AS ppheight\n\t " . iif(!($permissions['genericpermissions'] & vB::$vbulletin->bf_ugp_genericpermissions['canseehiddencustomfields']), vB::$vbulletin->profilefield['hidden']) . "\n\t {$hook_query_fields}\n\t FROM " . TABLE_PREFIX . "post AS post\n\t LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = post.userid)\n\t LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid)\n\t LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid = user.userid)\n\t " . iif($forum['allowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = post.iconid)") . "\n\t " . iif(vB::$vbulletin->options['avatarenabled'], "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)") . "\n\t " . ((can_moderate($thread['forumid'], 'canmoderateposts') or can_moderate($thread['forumid'], 'candeleteposts')) ? "LEFT JOIN " . TABLE_PREFIX . "spamlog AS spamlog ON(spamlog.postid = post.postid)" : '') . "\n\t {$deljoin}\n\t LEFT JOIN " . TABLE_PREFIX . "editlog AS editlog ON(editlog.postid = post.postid)\n\t LEFT JOIN " . TABLE_PREFIX . "postparsed AS postparsed ON(postparsed.postid = post.postid AND postparsed.styleid = " . intval(STYLEID) . " AND postparsed.languageid = " . intval(LANGUAGEID) . ")\n\t LEFT JOIN " . TABLE_PREFIX . "sigparsed AS sigparsed ON(sigparsed.userid = user.userid AND sigparsed.styleid = " . intval(STYLEID) . " AND sigparsed.languageid = " . intval(LANGUAGEID) . ")\n\t LEFT JOIN " . TABLE_PREFIX . "sigpic AS sigpic ON(sigpic.userid = post.userid)\n\t LEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid)\n\t {$hook_query_joins}\n\t WHERE {$postids}\n\t ORDER BY post.dateline\n\t ");
if (!($forumperms & vB::$vbulletin->bf_ugp_forumpermissions['canseethumbnails']) and !($forumperms & vB::$vbulletin->bf_ugp_forumpermissions['cangetattachment'])) {
vB::$vbulletin->options['attachthumbs'] = 0;
}
if (!($forumperms & vB::$vbulletin->bf_ugp_forumpermissions['cangetattachment'])) {
vB::$vbulletin->options['viewattachedimages'] = 0;
}
$postcount = count($postid_array);
$counter = 0;
$postbits = '';
vB::$vbulletin->noheader = true;
while ($post = vB::$vbulletin->db->fetch_array($posts)) {
if (!$privileges['can_moderate_forums']) {
if ($privileges['is_coventry'] or $post['visible'] == 2) {
continue;
}
}
// post/thread is deleted by moderator and we don't have permission to see it
if (!($post['visible'] or $privileges['can_moderate_posts'])) {
continue;
}
if (!intval($post['userid'])) {
$post['avatarid'] = false;
} else {
if (!$post['hascustomavatar']) {
if ($post['profilepic']) {
$post['hascustomavatar'] = 1;
$post['avatarid'] = true;
$post['avatarpath'] = "./image.php?u=" . $post['userid'] . "&dateline=" . $post['profilepicdateline'] . "&type=profile";
$post['avwidth'] = $post['ppwidth'];
$post['avheight'] = $post['ppheight'];
} else {
$post['hascustomavatar'] = 1;
$post['avatarid'] = true;
// explicity setting avatarurl to allow guests comments to show unknown avatar
$post['avatarurl'] = $post['avatarpath'] = vB_Template_Runtime::fetchStyleVar('imgdir_misc') . '/unknown.gif';
$post['avwidth'] = 60;
$post['avheight'] = 60;
}
}
}
if ($tachyuser = in_coventry($post['userid']) and !can_moderate($thread['forumid'])) {
continue;
}
if ($post['visible'] == 1 and !$tachyuser) {
++$counter;
if ($postorder) {
$post['postcount'] = --$postcount;
//.........这里部分代码省略.........
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:cms.php
示例5: getConfigView
/**
* Returns the config view for the widget.
*
* @return vBCms_View_Widget - The view result
*/
public function getConfigView()
{
$this->assertWidget();
global $vbphrase;
require_once DIR . '/includes/functions_databuild.php';
fetch_phrase_group('vbcms');
vB::$vbulletin->input->clean_array_gpc('r', array(
'do' => vB_Input::TYPE_STR,
'days' => vB_Input::TYPE_UINT,
'item_id' => vB_Input::TYPE_UINT,
'count' => vB_Input::TYPE_UINT,
'rb_type' => vB_Input::TYPE_UINT,
'template_name' => vB_Input::TYPE_STR,
'contenttypeid' => vB_Input::TYPE_ARRAY
));
$view = new vB_View_AJAXHTML('cms_widget_config');
$view->title = new vB_Phrase('vbcms', 'configuring_widget_x', $this->widget->getTitle());
$config = $this->widget->getConfig();
if ((vB::$vbulletin->GPC['do'] == 'config') AND $this->verifyPostId())
{
if (vB::$vbulletin->GPC_exists['days'])
{
$config['days'] = vB::$vbulletin->GPC['days'];
}
if (vB::$vbulletin->GPC_exists['count'])
{
$config['count'] = vB::$vbulletin->GPC['count'];
}
if (vB::$vbulletin->GPC_exists['template_name'])
{
$config['template_name'] = vB::$vbulletin->GPC['template_name'];
}
if ( vB::$vbulletin->GPC_exists['rb_type'] AND intval(vB::$vbulletin->GPC['rb_type']))
{
$config['contenttypeid'] = vB::$vbulletin->GPC['rb_type'];
vB::$vbulletin->input->clean_array_gpc('p', array(
'template_' . vB::$vbulletin->GPC['rb_type'] => vB_Input::TYPE_STR));
$config['template'] =
(vB::$vbulletin->GPC_exists['template_' . vB::$vbulletin->GPC['rb_type']] ?
vB::$vbulletin->GPC['template_' . vB::$vbulletin->GPC['rb_type']] :
'vbcms_searchresult_' . vB_Types::instance()->getPackageClass(vB::$vbulletin->GPC['rb_type']) );
}
else
{
$config['contenttypeid'] = vB_Types::instance()->getContentTypeID('vBForum_Post');
$config[ 'template'] = 'vbcms_searchresult_post';
}
$widgetdm = $this->widget->getDM();
$widgetdm->set('config', $config);
if ($this->content)
{
$widgetdm->setConfigNode($this->content->getNodeId());
}
$widgetdm->save();
//clear the cache
vB_Cache::instance()->event('widget_config_' . $this->widget->getId());
vB_Cache::instance()->cleanNow();
if (!$widgetdm->hasErrors())
{
if ($this->content)
{
$segments = array('node' => $this->content->getNodeURLSegment(),
'action' => vB_Router::getUserAction('vBCms_Controller_Content', 'EditPage'));
$view->setUrl(vB_View_AJAXHTML::URL_FINISHED, vBCms_Route_Content::getURL($segments));
}
$view->setStatus(vB_View_AJAXHTML::STATUS_FINISHED, new vB_Phrase('vbcms', 'configuration_saved'));
}
else
{
if (vB::$vbulletin->debug)
{
$view->addErrors($widgetdm->getErrors());
}
// only send a message
$view->setStatus(vB_View_AJAXHTML::STATUS_MESSAGE, new vB_Phrase('vbcms', 'configuration_failed'));
}
}
else
{
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:myfriends.php
示例6: getInlineEditBodyView
public function getInlineEditBodyView()
{
global $vbphrase;
require_once DIR . '/includes/functions_databuild.php';
require_once DIR . '/includes/functions.php';
fetch_phrase_group('cpcms');
$this->editing = true;
//confirm that the user has edit rights
if (!$this->content->canEdit() AND !($this->getUserId() == vB::$vbulletin->userinfo['userid'])
AND !$this->content->canPublish())
{
return $vb_phrase['no_edit_permissions'];
}
vB::$vbulletin->input->clean_array_gpc('r', array(
'postid' => vB_Input::TYPE_UINT,
'blogcommentid' => vB_Input::TYPE_UINT,
'do' => vB_Input::TYPE_STR,
'blogid' => TYPE_UINT
));
if ($_REQUEST['do'] == 'delete')
{
$dm = $this->content->getDM();
$dm->delete();
$this->cleanContentCache();
return $vbphrase['article_deleted'];
}
if ($_REQUEST['do'] == 'apply' OR $_REQUEST['do'] == 'update')
{
$this->SaveData($view);
}
require_once DIR . '/packages/vbcms/contentmanager.php';
// Load the content item
if (!$this->loadContent($this->getViewInfoFlags(self::VIEW_PAGE)))
{
throw (new vB_Exception_404());
}
global $show;
$show['img_bbcode'] = true;
// Get smiliecache and bbcodecache
vB::$vbulletin->datastore->fetch(array('smiliecache','bbcodecache'));
// Create view
$view = $this->createView('inline', self::VIEW_PAGE);
// Add the content to the view
$view = $this->populateViewContent($view, self::VIEW_PAGE, false);
$pagetext = $this->content->getPageText();
// Get postings phrasegroup
// need posting group
require_once DIR . '/includes/functions_databuild.php';
fetch_phrase_group('posting');
// Build editor
global $messagearea;
require_once DIR . '/includes/functions_file.php';
require_once DIR . '/includes/functions_editor.php';
require_once(DIR . '/packages/vbattach/attach.php');
$view->formid = "cms_content_data";
$view->can_edit = $this->content->canEdit();
if ($this->content->canEdit())
{
$attach = new vB_Attach_Display_Content(vB::$vbulletin, 'vBCms_Article');
//this will set a number of its parameters if they are not already set.
$posthash = null;
$poststarttime = null;
$postattach = array();
$attachcount = 0;
$values = "values[f]=" . $this->content->getNodeId() ;
$attachmentoption = $attach->fetch_edit_attachments($posthash, $poststarttime, $postattach, $this->content->getNodeId(), $values, '', $attachcount);
$attachinfo = fetch_attachmentinfo($posthash, $poststarttime, $this->getContentTypeId(), array('f' => $this->content->getNodeId()));
$view->editorid = construct_edit_toolbar(
$pagetext,
false,
new vBCms_Editor_Override(vB::$vbulletin),
true,
true,
true,
'cms_article',
'',
$attachinfo
);
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:article.php
示例7: getNodePanel
function getNodePanel($divId)
{
global $vbulletin;
global $vbphrase;
global $phrasegroups;
global $sect_js_varname;
fetch_phrase_group('cpcms');
$result = "\n<div id=\"{$divId}\" style=\"position: absolute;\n\tdisplay: none;\twidth:600px;height:380px;background-color:white; text-align:" . vB_Template_Runtime::fetchStyleVar('left') . ";\n\toverflow: auto;" . vB_Template_Runtime::fetchStyleVar('left') . ":100px;top:100px; border:1px solid #000;clear:both;padding:0px 0px 0px 0px;\">\n\t<div class=\"tcat\" style=\"border:0;height:12px;top:0px;" . vB_Template_Runtime::fetchStyleVar('left') . ":0px;width:580px;position:relative;\" >\n\t\t<span style=\"" . vB_Template_Runtime::fetchStyleVar('left') . ":0px;top:0px;position:relative;text-align:" . vB_Template_Runtime::fetchStyleVar('left') . ";font-size:120%;width:50%;float:" . vB_Template_Runtime::fetchStyleVar('left') . ";\"><strong>" . $vbphrase['section_navigator'] . "</strong>\n\t\t</span>\n\t\t<div style=\"" . vB_Template_Runtime::fetchStyleVar('left') . ":400px;border:0;top:-20px;text-align:" . vB_Template_Runtime::fetchStyleVar('right') . ";padding:0px 10px 0px 0px;\">\n\t\t\t<input type=\"button\" id=\"button_selectsection_close\" value=\"" . $vbphrase['close'] . "\"\n\t\t\tonclick=\"document.getElementById('{$divId}').style.display='none'\" />\n\t\t</div>\n\t</div>\n\t<div class=\"picker_overlay\" style=\"border:0;height:343px;width:100%;top:0px;padding:0;\n\t\toverflow:auto;position:relative;display:block;\">\n\t\t<div class=\"tcat\" style=\"border:0;position:relative;" . vB_Template_Runtime::fetchStyleVar('left') . ":0px;width:561px;padding:0;\n\t\t\tfont-size:14px;font-weight:bold;padding:2px;color:black;float:" . vB_Template_Runtime::fetchStyleVar('left') . ";padding:10px;\n\t\t\tborder-style:solid;border-width:1px 1px 0 1px;border-color:#000000;\">" . $vbphrase['choose_a_section'] . "\n\t\t</div>\n\t\t<div style=\"border:0;padding-" . vB_Template_Runtime::fetchStyleVar('left') . ":5px\">\n\t";
$result .= getSectionList();
$result .= "\n\t</div>\n\t</div>\n</div>\n";
return $result;
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:12,代码来源:cms_permissions.php
示例8: getCalendar
public static function getCalendar($year, $month)
{
require_once DIR . '/includes/functions_databuild.php';
fetch_phrase_group('vbcms');
global $vbphrase;
// Create view
$view = new vB_View('vbcms_widget_calendar_table');
if (!$year OR !$month)
{
$today = getdate(TIMENOW);
$year = $today['year'];
$month = $today['mon'];
}
//Let's get the text representation of the month.
$view->textmonth = $vbphrase[strtolower(date('F', gmmktime(1, 1, 1, $month, 15, $year)))];
$view->weeks = self::getPublished($year, $month);
$view->year = $year;
$view->month = $month;
$prevyear = ($month == 1 ? $year - 1 : $year);
$prevmonth = ($month == 1 ? 12 : $month - 1);
$nextyear = ($month == 12 ? $year + 1 : $year);
$nextmonth = ($month == 12 ? 1 : $month + 1);
//Get the links to next and previous months
$view->prev_month_link = vB::$vbulletin->options['bburl'] . "/ajax.php?do=calwidget&month=$prevmonth&year=$prevyear" ;
$view->next_month_link = vB::$vbulletin->options['bburl'] . "/ajax.php?do=calwidget&month=$nextmonth&year=$nextyear";
return $view;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:32,代码来源:calendar.php
示例9: getConfigView
/**
* Returns the config view for the widget.
*
* @return vBCms_View_Widget - The view result
*/
public function getConfigView($widget = false)
{
global $vbphrase;
$this->assertWidget();
require_once DIR . '/includes/functions_databuild.php';
fetch_phrase_group('cpcms');
vB::$vbulletin->input->clean_array_gpc('r', array(
'do' => vB_Input::TYPE_STR,
'template_name' => vB_Input::TYPE_STR,
'menu_type' => vB_Input::TYPE_INT,
'show_all_tree_elements_threshold' => vB_Input::TYPE_INT
));
$view = new vB_View_AJAXHTML('cms_widget_config');
$view->title = new vB_Phrase('vbcms', 'configuring_widget_x', $this->widget->getTitle());
$config = $this->widget->getConfig();
$widgetdm = $this->widget->getDM();
if ((vB::$vbulletin->GPC['do'] == 'config') AND $this->verifyPostId())
{
if (vB::$vbulletin->GPC_exists['template_name'])
{
$config['template_name'] = vB::$vbulletin->GPC['template_name'];
}
if (vB::$vbulletin->GPC_exists['menu_type'])
{
$config['menu_type'] = (vB::$vbulletin->GPC['menu_type'] == 2 ? 2 : 1);
}
if (vB::$vbulletin->GPC_exists['show_all_tree_elements_threshold'])
{
$config['show_all_tree_elements_threshold'] = vB::$vbulletin->GPC['show_all_tree_elements_threshold'];
}
if ($this->content)
{
$widgetdm->setConfigNode($this->content->getNodeId());
}
$widgetdm->set('config', $config);
$widgetdm->save();
if (!$widgetdm->hasErrors())
{
if ($this->content)
{
$segments = array('node' => $this->content->getNodeURLSegment(),
'action' => vB_Router::getUserAction('vBCms_Controller_Content', 'EditPage'));
$view->setUrl(vB_View_AJAXHTML::URL_FINISHED, vBCms_Route_Content::getURL($segments));
}
$view->setStatus(vB_View_AJAXHTML::STATUS_FINISHED, new vB_Phrase('vbcms', 'configuration_saved'));
}
else
{
if (vB::$vbulletin->debug)
{
$view->addErrors($widgetdm->getErrors());
}
// only send a message
$view->setStatus(vB_View_AJAXHTML::STATUS_MESSAGE, new vB_Phrase('vbcms', 'configuration_failed'));
}
}
if (!isset($config['template_name']) OR ($config['template_name'] == '') )
{
$config['template_name'] = 'vbcms_widget_sectionnavext_page';
}
// add the config content
$configview = $this->createView('config');
$configview->template_name = $config['template_name'];
$configview->one_selected = (intval($config['menu_type']) != 2 ? 'selected="selected"' : '');
$configview->two_selected = (intval($config['menu_type']) == 2 ? 'selected="selected"' : '');
$configview->show_all_tree_elements_threshold = $config['show_all_tree_elements_threshold'];
// item id to ensure form is submitted to us
$this->addPostId($configview);
$view->setContent($configview);
// send the view
$view->setStatus(vB_View_AJAXHTML::STATUS_VIEW, new vB_Phrase('vbcms', 'configuring_widget'));
return $view; }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:93,代码来源:sectionnavext.php
示例10: listSections
public static function listSections($page, $per_page = 10)
{
global $vbphrase;
global $vbulletin;
require_once DIR . '/includes/functions_databuild.php';
fetch_phrase_group('cpcms');
$sectionid = ( ($vbulletin->GPC_exists['sectionid'] AND intval($vbulletin->GPC['sectionid']))?
$vbulletin->GPC['sectionid'] : false);
$sections = self::getSection($sectionid);
if ($record_count = count($sections))
{
$sections = array_slice($sections, ($page-1) * $per_page, $per_page, true);
$parent = $vbulletin->db->query_first($sql = "SELECT info.title FROM " .
TABLE_PREFIX . "cms_node AS node INNER JOIN " . TABLE_PREFIX .
"cms_nodeinfo AS info ON info.nodeid = node.nodeid
WHERE " .
( $sectionid ?
" node.nodeid = " . $sectionid : " node.nodeid IS NULL" ));
$i = 1;
$result = print_form_header('cms_content_admin', '', false, true, 'cms_data', '100%', '_self',
true, 'post', 0, false);
$result .= "<input type=\"hidden\" id=\"sectionid\" value=\"" .
( $sectionid ? $sectionid :'') . "\" name=\"sectionid\"/>
<input type=\"hidden\" name=\"sentfrom\" id=\"section\" value=\"section\"/>
<input type=\"hidden\" name=\"id\" id=\"id\" value=\"0\"/>";
$result .= self::getSectionHeaders($sectionid) . "<br />\n";
$result .= "<tr class=\"tcat\">
<td class=\"feature_management_header\" style=\"padding:5px;float:" . vB_Template_Runtime::fetchStyleVar('left') . ";\"><div style=\"float:" . vB_Template_Runtime::fetchStyleVar('left') . "\">
" . $vbphrase['you_are_managing'] . " " . $vbphrase['section'] . ": <span class=\"section_name\">" . $parent['title'] .
($vbulletin->GPC_exists['sectionid'] ? '' : '(' . $vbphrase['all_sections'] .')') . "</span>
<input type=\"button\" onclick=\"showNodeWindow('filter_section')\" value=\"" . $vbphrase['navigate_to_section'] ."\">
"
. "
</div>
</td>
</tr>";
$result.= "<tr><td>\n";
$result .= "<div style=\"overflow:auto;margin: auto;\">
<table class=\"tborder\" cellpadding=\"4\" border=\"0\" width=\"100%\" align=\"center\">\n";
$bgclass = fetch_row_bgclass();
$result .= "<tr align=\"center\" class=\"thead\">\n";
$result .= "<td class=\"thead\" width=\"20\">#</td>
<td class=\"thead\" align=\"" . vB_Template_Runtime::fetchStyleVar('left') . "\" width=\"400\"><a href=\"cms_content_admin.php?do=sort&sentfrom=section&sortby=config4.value\" target=\"_self\">" . $vbphrase['title'] . "</a></td>
<td class=\"thead\"><a href=\"cms_content_admin.php?do=sort&sentfrom=section&sortby=setpublish\">" . $vbphrase['published'] . "</a></td>
<td class=\"thead\">" . $vbphrase['content_layout'] . "</td>
<td class=\"thead\"><a href=\"cms_content_admin.php?do=sort&sentfrom=section&sortby=auto_displayorder\" target=\"_self\">" . $vbphrase['display_order'] . "</a></td>
<td class=\"thead\" width=\"50\">" . $vbphrase['records_per_page'] . "</td>
<td class=\"thead\">" . $vbphrase['subsections'] . "</td>
<td class=\"thead\">" . $vbphrase['content'] . "</td>
<td class=\"thead\">" . $vbphrase['viewcount'] . "</td>".
/* <td class=\"thead\">" . $vbphrase['layout'] . "</td>
<td class=\"thead\">" . $vbphrase['style'] . "</td> */
" </tr>";
$sequence = 0;
foreach($sections as $key => $section)
{
$sequence++;
$first_selected_parent_row_class = "";
$change_display_order_buttons = "";
$section_name_prefix = ((vB_Template_Runtime::fetchStyleVar('textdirection') == 'ltr') ?
'>' : '>');
if ($sequence == 1 AND $page == 1)
{
$first_selected_parent_row_class = " class=\"selected_parent_row\"";
$section_name_prefix = "";
}
// for sub-sections, display up or down arrows to change the display order
else
{
$change_display_order_buttons = "<div style=\"float:" . vB_Template_Runtime::fetchStyleVar('left') . "; width:32px;\">";
// dont display up arrow if its already first section in list
if ($sequence > 2 AND isset($sections[$key-1]))
{
$change_display_order_buttons .= "<a style=\"float:" . vB_Template_Runtime::fetchStyleVar('left') . ";\" href=\"javascript:swapSections(".$section['nodeid'].", ".$sections[$key-1]['nodeid'].")\"><img src=\"" . self::getImagePath('imgdir_cms') . "/arrow_up.png\" style=\"border-style:none\" /></a>";
}
// dont display down arrow is its already last section in list
if ($sequence < count($sections) AND isset($sections[$key+1]))
{
$change_display_order_buttons .= "<a style=\"float:right;\" href=\"javascript:swapSections(".$section['nodeid'].", ".$sections[$key+1]['nodeid'].")\"><img src=\"" . self::getImagePath('imgdir_cms') . "/arrow_down.png\" style=\"border-style:none\" /></a>";
}
$change_display_order_buttons .= "</div>";
}
$bgclass = fetch_row_bgclass();
$result .= "<tr" . $first_selected_parent_row_class . " align=\"center\">\n <input type=\"hidden\" name=\"ids[]\" value=\"" .
$section['nodeid'] . "\" />\n";
$result .= " <td class=\"$bgclass\" style=\"font-size:80%;\">$sequence</td>\n";
$result .= " <td align=\"" . vB_Template_Runtime::fetchStyleVar('left') . "\" class=\"$bgclass\" style=\"font-size:80%;width:400px;\"><div class=\"sectionTitleWrapper\" style=\"width:400px;\">
" . $change_display_order_buttons . $section_name_prefix . "<a href=\"./cms_content_admin.php?do=filter§ionid=" . $section['nodeid'] . "&contenttypeid=" .
vb_Types::instance()->getContentTypeID("vBCms_Section") .
"\" target=\"_self\" >" . htmlspecialchars_uni($section['title']) . "</a>
<div style=\"float:" . vB_Template_Runtime::fetchStyleVar('right') . "\">
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:contentmanager.php
示例11: getConfigView
/**
* Returns the config view for the widget.
*
* @return vBCms_View_Widget - The view result
*/
public function getConfigView()
{
global $vbphrase;
$this->assertWidget();
require_once DIR . '/includes/functions_databuild.php';
fetch_phrase_group('contenttypes');
vB::$vbulletin->input->clean_array_gpc('r', array(
'do' => vB_Input::TYPE_STR,
'days' => vB_Input::TYPE_UINT,
'count' => vB_Input::TYPE_UINT,
'rb_type' => vB_Input::TYPE_UINT,
'username' => vB_Input::TYPE_STR,
'friends' => vB_Input::TYPE_BOOL,
'childforums' => vB_Input::TYPE_BOOL,
'keywords' => vB_Input::TYPE_STR,
'template_name' => vB_Input::TYPE_STR,
'contenttypeid' => vB_Input::TYPE_UINT,
'group_text' => vB_Input::TYPE_STR,
'forumchoice' => vB_Input::TYPE_ARRAY,
'cat' => vB_Input::TYPE_ARRAY,
'prefixchoice' => vB_Input::TYPE_ARRAY,
'srch_tag_text' => vB_Input::TYPE_STR
));
$view = new vB_View_AJAXHTML('cms_widget_config');
$view->title = new vB_Phrase('vbcms', 'configuring_widget_x', $this->widget->getTitle());
$config = $this->widget->getConfig();
if ((vB::$vbulletin->GPC['do'] == 'config') AND $this->verifyPostId())
{
if (vB::$vbulletin->GPC_exists['days'])
{
$config['days'] = vB::$vbulletin->GPC['days'];
}
if (vB::$vbulletin->GPC_exists['template_name'])
{
$config['template_name'] = vB::$vbulletin->GPC['template_name'];
}
if (vB::$vbulletin->GPC_exists['count'])
{
$config['count'] = vB::$vbulletin->GPC['count'];
}
$config['username'] = vB::$vbulletin->GPC_exists['username']?
convert_urlencoded_unicode(vB::$vbulletin->GPC['username']) : null;
$config['friends'] = vB::$vbulletin->GPC_exists['friends'];
$config['childforums'] = vB::$vbulletin->GPC_exists['childforums'];
$config['keywords'] = convert_urlencoded_unicode(vB::$vbulletin->GPC['keywords']);
//the contenttype array gets special handling.
$type_info = array() ;
if ( vB::$vbulletin->GPC_exists['rb_type'] AND intval(vB::$vbulletin->GPC['rb_type']))
{
$config['contenttypeid'] = vB::$vbulletin->GPC['rb_type'];
vB::$vbulletin->input->clean_array_gpc('p', array(
'template_' . vB::$vbulletin->GPC['rb_type'] => vB_Input::TYPE_STR));
$config['template'] =
(vB::$vbulletin->GPC_exists['template_' . vB::$vbulletin->GPC['rb_type']] ?
vB::$vbulletin->GPC['template_' . vB::$vbulletin->GPC['rb_type']] :
'vbcms_searchresult_' . vB_Types::instance()->getPackageClass(vB::$vbulletin->GPC['rb_type']) );
}
else
{
$config['contenttypeid'] = vB_Types::instance()->getContentTypeID('vBForum_Post');
$config[ 'template'] = 'vbcms_searchresult_post';
}
$config['group'] = vB::$vbulletin->GPC_exists['group_text']?
convert_urlencoded_unicode(vB::$vbulletin->GPC['group_text']) : null;
$config['forumchoice'] = vB::$vbulletin->GPC_exists['forumchoice']?
vB::$vbulletin->GPC['forumchoice'] : null;
$config['cat'] = vB::$vbulletin->GPC_exists['cat']?
vB::$vbulletin->GPC['cat'] : null;
$config['prefixchoice'] = vB::$vbulletin->GPC_exists['prefixchoice']?
vB::$vbulletin->GPC['prefixchoice'] : null;
$config['tag'] = vB::$vbulletin->GPC_exists['srch_tag_text']?
convert_urlencoded_unicode(vB::$vbulletin->GPC['srch_tag_text']) : null;
$widgetdm = $this->widget->getDM();
$widgetdm->set('config', $config);
if ($this->content)
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:searchwidget.php
示例12: getNewBlogs
private static function getNewBlogs($user)
{
global $vbulletin;
global $vbphrase;
if (! file_exists(DIR . '/packages/vbblog/search/searchcontroller/newblogentry.php')
or ! (vB_Search_Core::get_instance()->get_cansearch('vBBlog', 'BlogEntry') ))
{
return;
}
include_once DIR . '/packages/vbblog/search/searchcontroller/newblogentry.php' ;
require_once DIR . '/vb/search/core.php' ;
require_once DIR . '/vb/search/criteria.php' ;
require_once DIR . '/includes/functions_databuild.php' ;
//We can use the existing new structures to create this feed. We don't
// have to, we could do a direct sql query. But this structure is tested
// and we know it handles permissions properly.
//First we need a criteria object
fetch_phrase_group('vbcms');
$criteria = vB_Search_Core::get_instance()->create_criteria(vB_Search_Core::SEARCH_NEW);
//Set the count, which may have been passed to us.
$max_count = 10;
if ($vbulletin->GPC_exists['count'] AND intval($vbulletin->GPC['count'])
and intval($vbulletin->GPC['count']) < 21)
{
$max_count = intval($vbulletin->GPC['count']);
}
//Do we get a user? If so, limit the query.
if ($vbulletin->GPC_exists['userid'] AND intval($vbulletin->GPC['userid']))
{
$criteria->add_userid_filter($vbulletin->GPC['userid'], true);
}
else if ($vbulletin->GPC_exists['searchuser'])
{
$criteria->add_user_filter($vbulletin->GPC['searchuser'], true);
}
//and set the date limit
if ($vbulletin->GPC_exists['days'] AND intval($vbulletin->GPC['days'] ))
{
$datelimit = TIMENOW - ( intval($vbulletin->GPC['days']) * 86400);
}
else
{
$datelimit = TIMENOW - ( 3 * 86400);
}
$criteria->add_newitem_filter($datelimit, null, null);
$search_controller = new vBBlog_Search_SearchController_NewBlogEntry;
$results = vB_Search_Results::create_from_cache($user, $criteria, $search_controller);
if (! $results = vB_Search_Results::create_from_cache($user, $criteria, $search_controller))
{
$results = vB_Search_Results::create_from_criteria($user, $criteria, $search_controller);
}
$page = $results->get_page(1, $max_count, 1);
$headers = array(
'title' => $vbulletin->options['hometitle'] ,
'link' => $vbulletin->options['bburl'],
'description' => construct_phrase($vbphrase['recent_blogs_from_x'], $vbulletin->options['hometitle']) ,
'language' => 'en-us',
'updated' => date('Y-m-d\TH:i:s', TIMENOW),
'lastBuildDate' => date('Y-m-d\TH:i:s', TIMENOW)
);
$items= array();
if (count($page))
{
$parser = new vBCms_BBCode_HTML(vB::$vbulletin, vBCms_BBCode_HTML::fetchCmsTags());
foreach ($page as $result)
{
if ($blog = $result->get_record())
{
$items[] = array(
'title' => $blog['title'],
'summary' => $parser->get_preview($blog['pagetext'], 800),
'link' => $vbulletin->options['bburl'] . '/blog.php?blogid='
. $blog['blogid'],
'author' => '[email protected]' . $blog['username']);
}
}
}
return self::makeXml($headers, null, $items);
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:84,代码来源:rssfeed.php
示例13: getEditBar
/** Creates the publish editor across the top of the edit section
*
* @return mixed
*
****/
public function getEditBar($submit_url, $view_url, $formid, $action = 'edit', $candelete = true)
{
global $vbphrase;
if ($this->canEdit() OR $this->canPublish())
{
require_once DIR . '/includes/functions_databuild.php';
fetch_phrase_group('cpcms');
fetch_phrase_group('contenttypes');
$new_view = new vB_View('vbcms_content_edit_editbar');
$new_view->submit_url = $submit_url;
$new_view->view_url = $view_url;
$new_view->formid = $formid;
$new_view->header_phrase = $header_phrase;
$new_view->adding = construct_phrase($vbphrase['addoredit_x'], $vbphrase[$action], $vbphrase[strtolower('contenttype_' . $this->package . '_' . $this->class)]);
$new_view->confirm_message = $vbphrase['delete_page_confirmation_message'];
$new_view->candelete = $candelete;
$new_view->is_section = ($this->contenttypeid == vb_Types::instance()->getContentTypeID("vBCms_Section"));
return $new_view;
}
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:29,代码来源:content.php
示例14: getConfigView
//.........这里部分代码省略.........
}
if (vB::$vbulletin->GPC_exists['detail_template'])
{
$config['detail_template'] = vB::$vbulletin->GPC['detail_template'];
}
if (vB::$vbulletin->GPC_exists['ids'])
{
$ids = array_unique(explode(',', vB::$vbulletin->GPC['ids']));
$cleaned = array();
foreach ($ids as $id)
{
if (intval($id) )
{
$cleaned[] = intval($id);
}
}
$ids = implode(',', $cleaned);
$config['ids'] = $ids ;
}
if (vB::$vbulletin->GPC_exists['forumchoice'])
{
$config['forumchoice'] = vB::$vbulletin->GPC['forumchoice'];
}
$config['childforums'] = vB::$vbulletin->GPC_exists['childforums'];
$widgetdm = $this->widget->getDM();
$widgetdm->set('config', $config);
if ($this->content)
{
$widgetdm->setConfigNode($this->content->getNodeId());
}
$widgetdm->save();
//clear the cache for this widget
vB_Cache::instance()->event('poll_widget_' . $this->widget->getId());
if (!$widgetdm->hasErrors())
{
if ($this->content)
{
$segments = array('node' => $this->content->getNodeURLSegment(),
'action' => vB_Router::getUserAction('vBCms_Controller_Content', 'EditPage'));
$view->setUrl(vB_View_AJAXHTML::URL_FINISHED, vBCms_Route_Content::getURL($segments));
}
$view->setStatus(vB_View_AJAXHTML::STATUS_FINISHED, new vB_Phrase('vbcms', 'configuration_saved'));
}
else
{
if (vB::$vbulletin->debug)
{
$view->addErrors($widgetdm->getErrors());
}
// only send a message
$view->setStatus(vB_View_AJAXHTML::STATUS_MESSAGE, new vB_Phrase('vbcms', 'configuration_failed'));
}
}
else
{
$configview = $this->createView('config');
require_once DIR . '/includes/functions_databuild.php';
fetch_phrase_group('search');
if (!isset($config['template_name']) OR ($config['template_name'] == '') )
{
$config['template_name'] = 'vbcms_widget_poll_page';
}
if (!isset($config['detail_template']) OR ($config['detail_template'] == '') )
{
$config['detail_template'] = 'vbcms_widget_poll_resultdetail';
}
// add the config content
$configview->template_name = $config['template_name'];
$configview->detail_template = $config['detail_temp
|
请发表评论