Ejemplo n.º 1
0
function list_photos($csn = "", $uid = "")
{
    global $xoopsModuleConfig, $xoopsTpl, $tadgallery;
    if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/fancybox.php")) {
        redirect_header("index.php", 3, _MA_NEED_TADTOOLS);
    }
    include_once XOOPS_ROOT_PATH . "/modules/tadtools/fancybox.php";
    if ($csn) {
        $tadgallery->set_orderby("photo_sort");
        $tadgallery->set_view_csn($csn);
        $tadgallery->set_only_thumb($xoopsModuleConfig['only_thumb']);
        $cate = $tadgallery->get_tad_gallery_cate($csn);
        $xoopsTpl->assign("cate", $cate);
        $upload_powers = $tadgallery->chk_cate_power("upload");
        if ($upload_powers) {
            include_once XOOPS_ROOT_PATH . "/modules/tadtools/jeditable.php";
            $file = "save.php";
            $jeditable = new jeditable();
            $jeditable->setTextAreaCol("#content", $file, '90%', '100px', "{'csn':{$csn},'op' : 'save'}", _MD_TADGAL_EDIT_CATE_CONTENT);
            $jeditable_set = $jeditable->render();
            $xoopsTpl->assign("jeditable_set", $jeditable_set);
        }
    } else {
        $tadgallery->set_orderby("rand");
        $tadgallery->set_limit($xoopsModuleConfig['thumbnail_number']);
    }
    $tadgallery->get_photos();
    $tadgallery->get_albums();
    $cate_fancybox = new fancybox('.editbtn');
    $cate_fancybox_code = $cate_fancybox->render(false);
    $xoopsTpl->assign('cate_fancybox_code', $cate_fancybox_code);
    if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/colorbox.php")) {
        redirect_header("index.php", 3, _MA_NEED_TADTOOLS);
    }
    include_once XOOPS_ROOT_PATH . "/modules/tadtools/colorbox.php";
    $colorbox = new colorbox('.Photo');
    $colorbox_code = $colorbox->render(false);
    $xoopsTpl->assign('colorbox_code', $colorbox_code);
    $xoopsTpl->assign('only_thumb', $xoopsModuleConfig['only_thumb']);
}