Skip to content

Commit

Permalink
Merge pull request #3 from bleekk/master
Browse files Browse the repository at this point in the history
fixed different bugs
  • Loading branch information
mambax7 authored May 6, 2017
2 parents 077b44b + 57cd843 commit 06b1149
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
5 changes: 3 additions & 2 deletions author_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
$author_name = XoopsUserUtility::getUnameFromId($uid, $publisher->getConfig('format_realname'), true);
$xoopsTpl->assign('author_name_with_link', $author_name);
$xoopsTpl->assign('user_avatarurl', XOOPS_URL . '/uploads/' . $thisuser->getVar('user_avatar'));
$xoopsLocal = new XoopsLocal();
//$xoopsLocal = new XoopsLocal();
$categories = array();
if ($count > 0) {
foreach ($items as $item) {
Expand All @@ -81,7 +81,8 @@
'hits' => $item->counter(),
'link' => $item->getItemLink(),
'published' => $item->getDatesub(_SHORTDATESTRING),
'rating' => $xoopsLocal->number_format((float)$item->rating())
//'rating' => $xoopsLocal->number_format((float)$item->rating())
'rating' => $item->rating()
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion include/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
//$img_dir = $GLOBALS['xoopsModuleConfig']['uploaddir'];

//define($capsDirName . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . constant($capsDirName . '_DIRNAME')); // WITHOUT Trailing slash
define($capsDirName . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . constant($capsDirName . '_DIRNAME')); // WITHOUT Trailing slash
defined($capsDirName . '_UPLOAD_PATH') or define($capsDirName . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . constant($capsDirName . '_DIRNAME')); // WITHOUT Trailing slash

//Configurator
return array(
Expand Down
22 changes: 13 additions & 9 deletions include/oninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,20 @@ function xoops_module_install_publisher(XoopsModule $xoopsModule)
xoops_loadLanguage('modinfo', $moduleDirName);

// $moduleDirName = $xoopsModule->getVar('dirname');
include_once $GLOBALS['xoops']->path('modules/' . $moduleDirName . '/include/config.php');

foreach (array_keys($uploadFolders) as $i) {
PublisherUtility::createFolder($uploadFolders[$i]);
$configurator = include_once $GLOBALS['xoops']->path('modules/' . $moduleDirName . '/include/config.php');

if (count($configurator['uploadFolders']) > 0) {
foreach (array_keys($configurator['uploadFolders']) as $i) {
PublisherUtility::createFolder($configurator['uploadFolders'][$i]);
}
}

$file = PUBLISHER_ROOT_PATH . '/assets/images/blank.png';
foreach (array_keys($blankFiles) as $i) {
$dest = $blankFiles[$i] . '/blank.png';
PublisherUtility::copyFile($file, $dest);

if (count($configurator['blankFiles']) > 0) {
$file = PUBLISHER_ROOT_PATH . '/assets/images/blank.png';
foreach (array_keys($configurator['blankFiles']) as $i) {
$dest = $configurator['blankFiles'][$i] . '/blank.png';
PublisherUtility::copyFile($file, $dest);
}
}

return true;
Expand Down

0 comments on commit 06b1149

Please sign in to comment.