本文整理汇总了PHP中EasyBlogHelper::getDefaultSAIds方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::getDefaultSAIds方法的具体用法?PHP EasyBlogHelper::getDefaultSAIds怎么用?PHP EasyBlogHelper::getDefaultSAIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::getDefaultSAIds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
// @rule: Test for user access if on 1.6 and above
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
if (!JFactory::getUser()->authorise('easyblog.manage.setting', 'com_easyblog')) {
JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
JFactory::getApplication()->close();
}
}
//initialise variables
$document = JFactory::getDocument();
$user = JFactory::getUser();
$config = EasyBlogHelper::getConfig();
$jconfig = JFactory::getConfig();
$dstOptions = array();
$iteration = -12;
for ($i = 0; $i <= 24; $i++) {
$dstOptions[] = JHTML::_('select.option', $iteration, $iteration);
$iteration++;
}
$dstList = JHTML::_('select.genericlist', $dstOptions, 'main_dstoffset', 'class="inputbox" size="1"', 'value', 'text', $config->get('main_dstoffset', 0));
//check if jomcomment installed.
$jcInstalled = false;
if (file_exists(JPATH_ROOT . '/administrator/components/com_jomcomment/config.jomcomment.php')) {
$jcInstalled = true;
}
//check if jcomments installed.
$jcommentInstalled = false;
$jCommentFile = JPATH_ROOT . '/components/com_jcomments/jcomments.php';
if (JFile::exists($jCommentFile)) {
$jcommentInstalled = true;
}
//check if rscomments installed.
$rscommentInstalled = false;
$rsCommentFile = JPATH_ROOT . '/components/com_rscomments/rscomments.php';
if (JFile::exists($rsCommentFile)) {
$rscommentInstalled = true;
}
// @task: Check if easydiscuss plugin is installed and enabled.
$easydiscuss = JPluginHelper::isEnabled('content', 'easydiscuss');
$komento = JPluginHelper::isEnabled('content', 'komento');
$defaultSAId = EasyBlogHelper::getDefaultSAIds();
$joomlaVersion = EasyBlogHelper::getJoomlaVersion();
$socialButtonsOrder = $this->getSocialButtonOrder();
$this->assignRef('jConfig', $jconfig);
$this->assignRef('config', $config);
$this->assignRef('dstList', $dstList);
$this->assignRef('jcInstalled', $jcInstalled);
$this->assignRef('easydiscuss', $easydiscuss);
$this->assignRef('komento', $komento);
$this->assignRef('jcommentInstalled', $jcommentInstalled);
$this->assignRef('rscommentInstalled', $rscommentInstalled);
$this->assignRef('defaultSAId', $defaultSAId);
$this->assignRef('joomlaversion', $joomlaVersion);
$this->assignRef('socialButtonsOrder', $socialButtonsOrder);
parent::display($tpl);
}
示例2:
echo JText::_('COM_EASYBLOG_MIGRATOR_BLOGGERXML_IMPORT_AS');
?>
<i data-html="true" data-placement="top" data-title="<?php
echo JText::_('COM_EASYBLOG_MIGRATOR_BLOGGERXML_IMPORT_AS');
?>
"
data-content="<?php
echo JText::_('COM_EASYBLOG_MIGRATOR_BLOGGERXML_IMPORT_AS_DESC');
?>
" data-eb-provide="popover" class="fa fa-question-circle pull-right"></i>
</label>
<div class="col-md-7">
<input type="text" name="authorid" class="form-control" value="<?php
echo EasyBlogHelper::getDefaultSAIds();
?>
" data-author-id />
</div>
</div>
<div class="form-group">
<label for="page_title" class="col-md-5">
<?php
echo JText::_('COM_EASYBLOG_MIGRATOR_BLOGGERXML_IMPORT_INTO_CATEGORY');
?>
<i data-html="true" data-placement="top" data-title="<?php
echo JText::_('COM_EASYBLOG_MIGRATOR_BLOGGERXML_IMPORT_INTO_CATEGORY');
?>
"
示例3: _migrateWPXML
function _migrateWPXML($fileName, $authorId)
{
$db = EasyBlogHelper::db();
$jSession = JFactory::getSession();
$ejax = new EJax();
$migrateStat = $jSession->get('EBLOG_MIGRATOR_JOOMLA_STAT', '', 'EASYBLOG');
if (empty($migrateStat)) {
$migrateStat = new stdClass();
$migrateStat->blog = 0;
$migrateStat->category = 0;
$migrateStat->user = array();
}
$posts = $this->getXMLPostData($fileName);
if (!isset($posts->post_id)) {
$this->clearXMLData($fileName);
//at here, we check whether there are any records processed. if yes,
//show the statistic.
$ejax->append('progress-status6', JText::_('COM_EASYBLOG_MIGRATOR_FINISHED'));
$ejax->script("divSrolltoBottomWordPressXML();");
//update statistic
$stat = '========================================== <br />';
$stat .= JText::_('COM_EASYBLOG_MIGRATOR_TOTAL_BLOGS') . ': ' . $migrateStat->blog . '<br />';
$statUser = $migrateStat->user;
if (!empty($statUser)) {
$stat .= '<br />';
$stat .= 'Total user\'s contribution: ' . count($statUser) . '<br />';
foreach ($statUser as $eachUser) {
$stat .= JText::_('COM_EASYBLOG_MIGRATOR_TOTAL_BLOG_USER') . ' \'' . $eachUser->name . '\': ' . $eachUser->blogcount . '<br />';
}
}
$stat .= '<br />==========================================';
$ejax->assign('stat-status6', $stat);
$ejax->script("\$( '#migrator-submit6' ).html('" . JText::_('COM_EASYBLOG_MIGRATOR_MIGRATION_COMPLETED') . "');");
$ejax->script("\$( '#migrator-submit6' ).attr('disabled' , '');");
$ejax->script("\$( '#icon-wait6' ).css( 'display' , 'none' );");
$ejax->send();
}
$data = $posts->data;
$contentId = $data['post_id'];
$data['comments'] = $posts->comments;
if (empty($contentId)) {
$this->clearXMLData($fileName, true);
$ejax->script("ejax.load('migrators','_migrateWPXML','{$fileName}','{$authorId}');");
$ejax->send();
}
$query = 'SELECT content_id FROM `#__easyblog_migrate_content` AS b';
$query .= ' WHERE b.`content_id` = ' . $db->Quote($contentId);
$query .= ' and `component` = ' . $db->Quote('xml_wordpress');
$query .= ' and `filename` = ' . $db->Quote($fileName);
$db->setQuery($query);
$row = $db->loadResult();
if (is_null($row)) {
// step 1 : create categery if not exist in eblog_categories
// step 2 : create user if not exists in eblog_users - create user through profile jtable load method.
$date = EB::date();
$blogObj = new stdClass();
$adminId = empty($authorId) ? EasyBlogHelper::getDefaultSAIds() : $authorId;
//default
$blogObj->category_id = 1;
//assume 1 is the uncategorized id.
$wpCat = '';
$wpTag = array();
if (!empty($data['terms'])) {
foreach ($data['terms'] as $term) {
if ($term['domain'] == 'category' && empty($wpCat)) {
$wpCat = new stdClass();
$wpCat->title = $term['name'];
$wpCat->alias = $term['slug'];
} else {
if ($term['domain'] == 'post_tag') {
$tmpTag = new stdClass();
$tmpTag->title = $term['name'];
$tmpTag->alias = $term['slug'];
$wpTag[] = $tmpTag;
}
}
}
}
if (isset($wpCat->title)) {
$eCat = $this->_isEblogCategoryExists($wpCat);
if ($eCat === false) {
$eCat = $this->_createEblogCategory($wpCat);
}
$blogObj->category_id = $eCat;
}
//load user profile
$profile = EB::user($adminId);
$blog = EB::table('Blog');
//assigning blog data
$blogObj->created_by = $profile->id;
$blogObj->created = !empty($data['post_date_gmt']) ? $data['post_date_gmt'] : $date->toMySQL();
$blogObj->modified = $date->toMySQL();
$blogObj->title = $data['post_title'];
$blogObj->permalink = empty($data['post_name']) ? EasyBlogHelper::getPermalink($data['post_title']) : $data['post_name'];
// Migrate caption
$pattern2 = '/\\[caption.*caption="(.*)"\\]/iU';
$data['post_content'] = preg_replace($pattern2, '<div class="caption">$1</div>', $data['post_content']);
$data['post_content'] = str_ireplace('[/caption]', '<br />', $data['post_content']);
// process attachments.
// $attachments = $this->getXMLAttachmentData( $fileName, $contentId);
//.........这里部分代码省略.........