if (!empty($_SESSION["{$mydirname}_uri4return"])) { redirect_header($_SESSION["{$mydirname}_uri4return"], 2, $ratemessage); unset($_SESSION["{$mydirname}_uri4return"]); } else { redirect_header("index.php", 2, $ratemessage); } exit; } else { $xoopsOption['template_main'] = "myalbum{$mydirnumber}_ratephoto.html"; include XOOPS_ROOT_PATH . "/header.php"; // store the referer if (!empty($_SERVER['HTTP_REFERER'])) { $_SESSION["{$mydirname}_uri4return"] = $_SERVER['HTTP_REFERER']; } $rs = $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.ext, l.res_x, l.res_y, l.status, l.date, l.hits, l.rating, l.votes, l.comments, l.submitter, t.description FROM {$table_photos} l LEFT JOIN {$table_text} t ON l.lid=t.lid WHERE l.lid='{$lid}' AND l.status>0"); if ($rs == false || $xoopsDB->getRowsNum($rs) <= 0) { redirect_header("index.php", 2, _ALBM_NOMATCH); exit; } $fetched_result_array = $xoopsDB->fetchArray($rs); $xoopsTpl->assign('photo', myalbum_get_array_for_photo_assign($fetched_result_array)); include 'include/assign_globals.php'; $xoopsTpl->assign($myalbum_assign_globals); $xoopsTpl->assign('lang_voteonce', _ALBM_VOTEONCE); $xoopsTpl->assign('lang_ratingscale', _ALBM_RATINGSCALE); $xoopsTpl->assign('lang_beobjective', _ALBM_BEOBJECTIVE); $xoopsTpl->assign('lang_donotvote', _ALBM_DONOTVOTE); $xoopsTpl->assign('lang_rateit', _ALBM_RATEIT); $xoopsTpl->assign('lang_cancel', _CANCEL); include XOOPS_ROOT_PATH . "/footer.php"; }
// Editing Display include XOOPS_ROOT_PATH . "/header.php"; OpenTable(); myalbum_header(); include_once "../../class/xoopsformloader.php"; include_once "../../include/xoopscodes.php"; // Get the record $result = $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.ext, l.res_x, l.res_y, l.status, l.date, l.hits, l.rating, l.votes, l.comments, l.submitter, t.description FROM {$table_photos} l LEFT JOIN {$table_text} t ON l.lid=t.lid WHERE l.lid={$lid}"); $photo = $xoopsDB->fetchArray($result); // Preview if (!empty($_POST['preview'])) { $photo['description'] = $myts->stripSlashesGPC($_POST["desc_text"]); $photo['title'] = $myts->stripSlashesGPC($_POST["title"]); } // Display $photo_for_tpl = myalbum_get_array_for_photo_assign($photo); $tpl = new XoopsTpl(); include 'include/assign_globals.php'; $tpl->assign($myalbum_assign_globals); $tpl->assign('photo', $photo_for_tpl); echo "<table class='outer' style='width:100%;'>"; $tpl->display("db:{$mydirname}_photo_in_list.html"); echo "</table>\n"; // Show the form $form = new XoopsThemeForm(_ALBM_PHOTOEDITUPLOAD, "uploadphoto", "editphoto.php?lid={$lid}"); $form->setExtra("enctype='multipart/form-data'"); $title_text = new XoopsFormText(_ALBM_PHOTOTITLE, "title", 50, 255, $myts->makeTboxData4Edit($photo['title'])); $cat_select = new XoopsFormSelect('', "cid", $photo['cid']); $tree = $cattree->getChildTreeArray(0, "title"); foreach ($tree as $leaf) { $leaf['prefix'] = substr($leaf['prefix'], 0, -1);
include XOOPS_ROOT_PATH . "/header.php"; if ($global_perms & GPERM_INSERTABLE) { $xoopsTpl->assign('lang_add_photo', _ALBM_ADDPHOTO); } $xoopsTpl->assign('lang_album_main', _ALBM_MAIN); include 'include/assign_globals.php'; $xoopsTpl->assign($myalbum_assign_globals); // update hit count $xoopsDB->queryF("UPDATE {$table_photos} SET hits=hits+1 WHERE lid='{$lid}' AND status>0"); $prs = $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.ext, l.res_x, l.res_y, l.status, l.date, l.hits, l.rating, l.votes, l.comments, l.submitter, t.description FROM {$table_photos} l LEFT JOIN {$table_text} t ON l.lid=t.lid WHERE l.lid={$lid} AND status>0"); $p = $xoopsDB->fetchArray($prs); if ($p == false) { redirect_header($mod_url . '/', 3, _ALBM_NOMATCH); exit; } $photo = myalbum_get_array_for_photo_assign($p); // <title></title> $xoopsTpl->assign('xoops_pagetitle', $photo['title']); // Middle size calculation $photo['width_height'] = ''; list($max_w, $max_h) = explode('x', $myalbum_middlepixel); if (!empty($max_w) && !empty($p['res_x'])) { if (empty($max_h)) { $max_h = $max_w; } if ($max_h / $max_w > $p['res_y'] / $p['res_x']) { if ($p['res_x'] > $max_w) { $photo['width_height'] = "width='{$max_w}'"; } } else { if ($p['res_y'] > $max_h) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; $nav = new XoopsPageNav($photo_num_total, $num, $pos, 'pos', "num={$num}"); $nav_html = $nav->renderNav(10); $last = $pos + $num; if ($last > $photo_num_total) { $last = $photo_num_total; } $photonavinfo = sprintf(_ALBM_AM_PHOTONAVINFO, $pos + 1, $last, $photo_num_total); $xoopsTpl->assign('photonavdisp', true); $xoopsTpl->assign('photonav', $nav_html); $xoopsTpl->assign('photonavinfo', $photonavinfo); } else { $xoopsTpl->assign('photonavdisp', false); } // Assign Latest Photos $prs = $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.ext, l.res_x, l.res_y, l.status, l.date, l.hits, l.rating, l.votes, l.comments, l.submitter, t.description,c.title AS cat_title FROM {$table_photos} l USE INDEX (date) INNER JOIN {$table_text} t ON l.lid=t.lid LEFT JOIN {$table_cat} c ON l.cid=c.cid WHERE l.status>0 ORDER BY date DESC", $num, $pos); if (!$prs) { $prs = $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.ext, l.res_x, l.res_y, l.status, l.date, l.hits, l.rating, l.votes, l.comments, l.submitter, t.description,c.title AS cat_title FROM {$table_photos} l INNER JOIN {$table_text} t ON l.lid=t.lid LEFT JOIN {$table_cat} c ON l.cid=c.cid WHERE l.status>0 ORDER BY date DESC", $num, $pos); } while ($fetched_result_array = $xoopsDB->fetchArray($prs)) { $xoopsTpl->append('photos', myalbum_get_array_for_photo_assign($fetched_result_array, true)); } // モジュールID // added by naao $module_handler =& xoops_gethandler('module'); $this_module =& $module_handler->getByDirname($mydirname); $mid = $this_module->getVar('mid'); // モジュールconfig // added by naao $config_handler =& xoops_gethandler("config"); $mod_config = $config_handler->getConfigsByCat(0, $mid); $xoopsTpl->assign("moduleConfig", $mod_config); include XOOPS_ROOT_PATH . "/footer.php";