function linkedPages() { foreach ($_REQUEST as $k => $v) { ${$k} = $v; } if (count($ids) <= 0) { redirectMsg("pages.php?cat={$cat}&page={$page}", __('Select at least a cetegory to edit', 'qpages'), 1); die; } $db = XoopsDatabaseFactory::getDatabaseConnection(); $sql = "SELECT * FROM " . $db->prefix("qpages_pages") . " WHERE id_page IN ("; $sql .= implode(',', $ids) . ')'; $result = $db->query($sql); while ($row = $db->fetchArray($result)) { $page = new QPPage(); $page->assignVars($row); $page->setType(!$page->type()); $page->update(); } redirectMsg("pages.php?cat={$cat}&page={$page}", __('Database updated successfully!', 'qpages'), 0); }
$ok = false; foreach ($xoopsUser->getGroups() as $k) { if ($ok) { continue; } if (in_array($k, $page->getGroups())) { $ok = true; } } if (!$ok && !$xoopsUser->isAdmin()) { redirect_header(QP_URL, 2, _MS_QP_NOALLOWED); die; } } } if ($page->type()) { header('location: ' . $page->url()); die; } $catego = new QPCategory($page->getCategory()); require 'header.php'; // Asignamos datos de la categoría $tpl->assign('qpcategory', array('id' => $catego->getID(), 'name' => $catego->getName(), 'nameid' => $catego->getFriendName())); $idp = 0; # ID de la categoria padre $rutas = array(); $path = explode('/', $catego->getPath()); $tbl = $db->prefix("qpages_categos"); foreach ($path as $k) { if ($k == '') { continue;