Exemplo n.º 1
0
/**
* @desc Visualiza la postal
**/
function viewPostcard()
{
    global $tpl, $xoopsModule, $xoopsModuleConfig, $xoopsModuleConfig, $mc, $xoopsUser, $id;
    include_once XOOPS_ROOT_PATH . '/class/template.php';
    $tpl = new XoopsTpl();
    $mc =& $xoopsModuleConfig;
    if (!$xoopsUser) {
        redirect_header(XOOPS_URL . '/user.php#register', 1, _MS_GS_ERRUSR);
        die;
    }
    //Verificamos si la postal existe
    $post = new GSPostcard($id);
    if ($post->isNew()) {
        redirect_header(XOOPS_URL . '/modules/galleries/', 1, _MS_GS_ERRPOSTEXIST);
        die;
    }
    $img = new GSImage($post->image());
    if ($img->isNew()) {
        redirect_header(XOOPS_URL . '/modules/galleries/', 1, _MS_GS_ERRIMG);
        die;
    }
    $user = new GSUser($img->owner(), 1);
    $file = $user->filesPath() . '/' . $img->image();
    list($ancho, $alto) = getimagesize($file);
    $tpl->assign('gs_url', XOOPS_URL . '/modules/galleries');
    $tpl->assign('img', array('id' => $img->id(), 'width' => $ancho, 'height' => $alto, 'url' => $user->filesURL() . '/' . $img->image(), 'link' => $user->userURL() . 'img/' . $img->id() . '/'));
    $tpl->assign('title', $post->title());
    $tpl->assign('message', $post->message());
    $tpl->assign('lang_says', sprintf(_MS_GS_SAYS, $post->name()));
    $tpl->assign('xoops_pagetitle', sprintf(_MS_GS_PTITLE, $post->title()) . ' » ' . $mc['section_title']);
    $tpl->assign('lang_see', _MS_GS_SEE);
    $tpl->assign('user_link', $user->userURL() . 'browse/' . $img->id() . '/');
    $tpl->assign('lang_seeuser', _MS_GS_SEEUSER);
    $tpl->assign('preview', 0);
    RMTemplate::get()->add_xoops_style('postcard.css', 'galleries');
    //Actualizar datos de postal
    $post->setViewed(1);
    $post->save();
    echo $tpl->fetch("db:gs_postcard.html");
}
Exemplo n.º 2
0
/**
* @desc Visualiza la postal
**/
function viewPostcard()
{
    global $tpl, $xoopsModule, $xoopsModuleConfig, $xoopsModuleConfig, $mc, $xoopsUser, $id;
    include_once XOOPS_ROOT_PATH . '/class/template.php';
    $tpl = new XoopsTpl();
    $mc =& $xoopsModuleConfig;
    //Verificamos si la postal existe
    $post = new GSPostcard($id);
    if ($post->isNew()) {
        redirect_header(XOOPS_URL . '/modules/galleries/', 1, __('Specified E_Card does not exists!', 'galleries'));
        die;
    }
    $img = new GSImage($post->image());
    if ($img->isNew()) {
        redirect_header(XOOPS_URL . '/modules/galleries/', 1, __('Sorry, there are some problems with this e-card!', 'galleries'));
        die;
    }
    $user = new GSUser($img->owner(), 1);
    $file = $user->filesPath() . '/' . $img->image();
    list($ancho, $alto) = getimagesize($file);
    $tpl->assign('gs_url', XOOPS_URL . '/modules/galleries');
    $tpl->assign('img', array('id' => $img->id(), 'width' => $ancho, 'height' => $alto, 'url' => $user->filesURL() . '/' . $img->image(), 'link' => $user->userURL() . 'img/' . $img->id() . '/'));
    $tpl->assign('title', $post->title());
    $tpl->assign('message', $post->message());
    $tpl->assign('lang_says', sprintf(__('%s says:'), $post->name()));
    $tpl->assign('xoops_pagetitle', sprintf(__('%s, E-Card', 'galleries'), $post->title()) . ' » ' . $mc['section_title']);
    $tpl->assign('lang_see', __('View Picture', 'galleries'));
    $tpl->assign('user_link', $user->userURL() . 'browse/' . $img->id() . '/');
    $tpl->assign('lang_seeuser', __('View User Pictures', 'galleries'));
    $tpl->assign('preview', 0);
    RMTemplate::get()->add_xoops_style('postcard.css', 'galleries');
    //Actualizar datos de postal
    $post->setViewed(1);
    $post->save();
    echo $tpl->fetch("db:gs_postcard.html");
}