Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mambax7 committed Feb 8, 2019
2 parents 4efd2ec + 78b1e01 commit fd85f10
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
6 changes: 3 additions & 3 deletions admin/import/news.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@

while (false !== (list($cid, $pid, $cat_title, $art_count) = $GLOBALS['xoopsDB']->fetchRow($result))) {
$cat_title = $myts->displayTarea($cat_title);
$cat_cbox_options[$cid] = '$cat_title ($art_count)';
$cat_cbox_options[$cid] = "$cat_title ($art_count)";
}

$cat_label = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('<br>', $cat_cbox_options));
$cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC);
$form->addElement($cat_label);

// Publisher parent category
$mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix($module->getVar('dirname', 'n') . '_categories'), 'categoryid', 'parentid');
$mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix($helper->getModule()->getVar('dirname', 'n') . '_categories'), 'categoryid', 'parentid');
ob_start();
$mytree->makeMySelBox('name', 'weight', $preset_id = 0, $none = 1, $sel_name = 'parent_category');

Expand Down Expand Up @@ -159,7 +159,7 @@
$itemObj->setVar('title', $arrArticle['title']);
$itemObj->setVar('uid', $arrArticle['uid']);
$itemObj->setVar('summary', $arrArticle['hometext']);
$itemObj->setVar('body', $arrArticle['bodytext']);
$itemObj->setVar('body', $arrArticle['bodytext'] == '' ? $arrArticle['hometext'] : $arrArticle['bodytext']); /* use hometext if no bodytext is available */
$itemObj->setVar('counter', $arrArticle['counter']);
$itemObj->setVar('datesub', $arrArticle['created']);
$itemObj->setVar('dohtml', !$arrArticle['nohtml']);
Expand Down
20 changes: 11 additions & 9 deletions backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
header('Content-Type:text/xml; charset=' . _CHARSET);
$tpl = new \XoopsTpl();
$tpl->caching = 2;
$tpl->xoops_setCacheTime(0);
//$tpl->xoops_setCacheTime(0);
$tpl->cache_lifetime = 0;
$myts = \MyTextSanitizer::getInstance();
if (!$tpl->is_cached('db:publisher_rss.tpl')) {
// xoops_load('XoopsLocal');
Expand All @@ -54,13 +55,13 @@
$channel_category = $myts->formatForML($channel_category);
}
$tpl->assign('channel_charset', _CHARSET);
$tpl->assign('channel_title', htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES));
$tpl->assign('channel_link', PUBLISHER_URL);
$tpl->assign('channel_desc', htmlspecialchars($GLOBALS['xoopsConfig']['slogan'], ENT_QUOTES));
$tpl->assign('channel_title', htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES | ENT_HTML5));
$tpl->assign('channel_link', htmlspecialchars(PUBLISHER_URL, ENT_QUOTES | ENT_HTML5));
$tpl->assign('channel_desc', htmlspecialchars($GLOBALS['xoopsConfig']['slogan'], ENT_QUOTES | ENT_HTML5));
//mb $tpl->assign('channel_lastbuild', XoopsLocal::formatTimestamp(time(), 'rss'));
$tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
$tpl->assign('channel_webmaster', $GLOBALS['xoopsConfig']['adminmail']);
$tpl->assign('channel_editor', $GLOBALS['xoopsConfig']['adminmail']);
$tpl->assign('channel_webmaster', $GLOBALS['xoopsConfig']['adminmail'] . "( " . htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES | ENT_HTML5) . " )" );
$tpl->assign('channel_editor', $GLOBALS['xoopsConfig']['adminmail'] . "( " . htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES | ENT_HTML5) . " )" );

if (-1 != $categoryid) {
$channel_category .= ' > ' . $categoryObj->name();
Expand All @@ -79,19 +80,20 @@
$dimention[1] = $dimention[1] * $width / $dimention[0];
$height = ($dimention[1] > 140) ? $dimention[1] * $dimention[0] / 140 : $dimention[1];
}
$height = round($height, 0, PHP_ROUND_HALF_UP);
$tpl->assign('image_width', $width);
$tpl->assign('image_height', $height);
$sarray = $helper->getHandler('Item')->getAllPublished(10, 0, $categoryid);
if (!empty($sarray) && is_array($sarray)) {
$count = $sarray;
foreach ($sarray as $item) {
$tpl->append('items', [
'title' => htmlspecialchars($item->getTitle(), ENT_QUOTES),
'link' => $item->getItemUrl(),
'title' => htmlspecialchars($item->getTitle(), ENT_QUOTES | ENT_HTML5),
'link' => htmlspecialchars($item->getItemUrl(), ENT_QUOTES | ENT_HTML5),
'guid' => $item->getItemUrl(),
//mb 'pubdate' => XoopsLocal::formatTimestamp($item->getVar('datesub'), 'rss'),
'pubdate' => formatTimestamp($item->getVar('datesub'), 'rss'),
'description' => htmlspecialchars($item->getBlockSummary(300, true), ENT_QUOTES),
'description' => htmlspecialchars($item->getBlockSummary(300, true), ENT_QUOTES | ENT_HTML5)
]);
}
// unset($item);
Expand Down
2 changes: 1 addition & 1 deletion class/MimetypesUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ public static function search()
echo "<div id='pagenav'>" . $nav->renderNav() . '</div>';
}
Publisher\Utility::closeCollapsableBar('mimesearchtable', 'mimesearchicon');
// require_once __DIR__ . '/admin_footer.php';
// require_once dirname(__DIR__) . '/admin/admin_footer.php';
xoops_cp_footer();
}

Expand Down
6 changes: 3 additions & 3 deletions templates/publisher_rss.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<rss version="2.0">
<channel>
<title><{$channel_title}></title>
<link><{$channel_link}>
<link><{$channel_link}></link>
<description><{$channel_desc}></description>
<lastBuildDate><{$channel_lastbuild}></lastBuildDate>
<docs>http://backend.userland.com/rss/</docs>
Expand All @@ -15,15 +15,15 @@
<image>
<title><{$channel_title}></title>
<url><{$image_url}></url>
<link><{$channel_link}>
<link><{$channel_link}></link>
<width><{$image_width}></width>
<height><{$image_height}></height>
</image>
<{/if}>
<{foreach item=item from=$items}>
<item>
<title><{$item.title}></title>
<link><{$item.link}>
<link><{$item.link}></link>
<description><{$item.description}></description>
<pubDate><{$item.pubdate}></pubDate>
<guid><{$item.guid}></guid>
Expand Down

0 comments on commit fd85f10

Please sign in to comment.