Пример #1
0
 function getWhoAndWhen($users = array())
 {
     $smartModuleConfig =& ss_getModuleConfig();
     $posterName = ss_getLinkedUnameFromId($this->uid(), $smartModuleConfig['userealname'], $users);
     $postdate = $this->datesub();
     return sprintf(_MD_SS_POSTEDBY, $posterName, $postdate);
 }
Пример #2
0
function ss_getAdminLinks($itemid = 0)
{
    // include language file
    global $xoopsConfig;
    $filePath = XOOPS_ROOT_PATH . "/modules/smartsection/language/" . $xoopsConfig['language'] . "/main.php";
    if (file_exists($filePath)) {
        include_once XOOPS_ROOT_PATH . "/modules/smartsection/language/" . $xoopsConfig['language'] . "/main.php";
    } else {
        include_once XOOPS_ROOT_PATH . "/modules/smartsection/language/english/main.php";
    }
    global $xoopsUser, $xoopsDB;
    $smartModule =& ss_getModuleInfo();
    $smartConfig =& ss_getModuleConfig();
    $adminLinks = '';
    $modulePath = XOOPS_URL . "/modules/" . $smartModule->dirname() . "/";
    if ($xoopsUser && $xoopsUser->isAdmin($smartModule->getVar('mid'))) {
        // Edit button
        $adminLinks .= "<a href='" . $modulePath . "admin/item.php?op=mod&itemid=" . $itemid . "'><img src='" . $modulePath . "images/links/edit.gif'" . " title='" . _MD_SS_EDIT . "' alt='" . _MD_SS_EDIT . "'/></a>";
        $adminLinks .= " ";
        // Delete button
        $adminLinks .= "<a href='" . $modulePath . "admin/item.php?op=del&itemid=" . $itemid . "'><img src='" . $modulePath . "images/links/delete.gif'" . " title='" . _MD_SS_DELETE . "' alt='" . _MD_SS_DELETE . "'/></a>";
        $adminLinks .= " ";
    }
    // Print button
    $adminLinks .= "<a href='" . $modulePath . "print.php?itemid=" . $itemid . "' target='_blank'><img src='" . $modulePath . "images/links/print.gif' title='" . _MD_SS_PRINT . "' alt='" . _MD_SS_PRINT . "'/></a>";
    $adminLinks .= " ";
    // Email button
    $maillink = 'mailto:?subject=' . sprintf(_MD_SS_INTITEM, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_MD_SS_INTITEMFOUND, $xoopsConfig['sitename']) . ':  ' . $modulePath . '/item.php?itemid=' . $itemid;
    $adminLinks .= "<a href='" . $maillink . "'><img src='" . $modulePath . "images/links/friend.gif' title='" . _MD_SS_MAIL . "' alt='" . _MD_SS_MAIL . "'/></a>";
    $adminLinks .= " ";
    if ($smartConfig['allowupload']) {
        // Add a file button
        $adminLinks .= "<a href='" . $modulePath . "addfile.php?itemid=" . $itemid . "'><img src='" . $modulePath . "images/icon/file.gif' title='" . _MD_SS_ADD_FILE . "' alt='" . _MD_SS_ADD_FILE . "'/></a>";
        $adminLinks .= " ";
    }
    return $adminLinks;
}
Пример #3
0
    define("SMARTSECTION_DIRNAME", 'smartsection');
}
if (!defined("SMARTSECTION_URL")) {
    define("SMARTSECTION_URL", XOOPS_URL . '/modules/' . SMARTSECTION_DIRNAME . '/');
}
if (!defined("SMARTSECTION_ROOT_PATH")) {
    define("SMARTSECTION_ROOT_PATH", XOOPS_ROOT_PATH . '/modules/' . SMARTSECTION_DIRNAME . '/');
}
if (!defined("SMARTSECTION_IMAGES_URL")) {
    define("SMARTSECTION_IMAGES_URL", SMARTSECTION_URL . '/images/');
}
include_once SMARTSECTION_ROOT_PATH . "include/functions.php";
include_once SMARTSECTION_ROOT_PATH . "class/keyhighlighter.class.php";
// Creating the SmartModule object
$smartModule =& ss_getModuleInfo();
$myts = MyTextSanitizer::getInstance();
$smartsection_moduleName = $myts->displayTarea($smartModule->getVar('name'));
// Creating the SmartModule config Object
$smartConfig =& ss_getModuleConfig();
include_once SMARTSECTION_ROOT_PATH . "class/permission.php";
include_once SMARTSECTION_ROOT_PATH . "class/category.php";
include_once SMARTSECTION_ROOT_PATH . "class/item.php";
include_once SMARTSECTION_ROOT_PATH . "class/file.php";
// Creating the item handler object
$smartsection_item_handler =& xoops_getmodulehandler('item', SMARTSECTION_DIRNAME);
// Creating the category handler object
$smartsection_category_handler =& xoops_getmodulehandler('category', SMARTSECTION_DIRNAME);
// Creating the permission handler object
$smartsection_permission_handler =& xoops_getmodulehandler('permission', SMARTSECTION_DIRNAME);
// Creating the file handler object
$smartsection_file_handler =& xoops_getmodulehandler('file', SMARTSECTION_DIRNAME);