Exemplo n.º 1
0
             } else {
                 $url = $result["page_url"];
             }
             $next_page_url = ENTRADA_URL . "/community" . $community_details["community_url"] . ":" . $url;
         } else {
             $next_page_url = "#";
         }
         $smarty->assign("next_page_url", $next_page_url);
         $query = "\tSELECT a.*, b.`page_url` AS `nav_url`\n\t\t\t\t\t\t\t\t\tFROM `community_page_navigation` AS a\n\t\t\t\t\t\t\t\t\tLEFT JOIN `community_pages` AS b\n\t\t\t\t\t\t\t\t\tON a.`nav_page_id` = b.`cpage_id`\n\t\t\t\t\t\t\t\t\tWHERE a.`community_id` = " . $db->qstr($COMMUNITY_ID) . "\n\t\t\t\t\t\t\t\t\tAND a.`cpage_id` = " . $db->qstr($PAGE_ID) . "\n\t\t\t\t\t\t\t\t\tAND `nav_type` = 'previous'";
         $nav_result = $db->GetRow($query);
         if ($nav_result) {
             $show_left_nav = $nav_result["show_nav"];
         } else {
             $show_left_nav = 1;
         }
         $result = get_prev_community_page($COMMUNITY_ID, $PAGE_ID, $PARENT_ID, $PAGE_ORDER);
         if (($result || isset($nav_result["nav_url"]) && $nav_result["nav_url"]) && $show_left_nav) {
             if ($nav_result["nav_url"]) {
                 $url = $nav_result["nav_url"];
             } else {
                 $url = $result["page_url"];
             }
             $previous_page_url = ENTRADA_URL . "/community" . $community_details["community_url"] . ":" . $url;
         } else {
             $previous_page_url = "#";
         }
         $smarty->assign("previous_page_url", $previous_page_url);
     }
 }
 /**
  * Get a list of modules which are enabled.
Exemplo n.º 2
0
             }
         }
         if ($ERROR) {
             $STEP = 1;
         }
         break;
     case 1:
     default:
         if (!isset($PROCESSED["parent_id"])) {
             $PROCESSED["parent_id"] = 0;
             $query = "SELECT MAX(`page_order`) FROM `community_pages` WHERE `parent_id` = 0 AND `community_id` = " . $db->qstr($COMMUNITY_ID);
             $PROCESSED["page_order"] = $db->GetOne($query);
             $PROCESSED["page_order"] = (int) $PROCESSED["page_order"] + 1;
         }
         $default_next_page = get_next_community_page($COMMUNITY_ID, $PAGE_ID, $PROCESSED["parent_id"], $PROCESSED["page_order"]);
         $default_previous_page = get_prev_community_page($COMMUNITY_ID, $PAGE_ID, $PROCESSED["parent_id"], $PROCESSED["page_order"]);
         $PROCESSED = $result;
         if (isset($PAGE_TYPE) && $PAGE_TYPE != "") {
             $PROCESSED["page_type"] = $PAGE_TYPE;
         }
         break;
 }
 //Display Page
 switch ($STEP) {
     case 2:
         if ($NOTICE) {
             echo display_notice();
         }
         if ($SUCCESS) {
             echo display_success();
         }
Exemplo n.º 3
0
         $results = $db->GetAll($query);
         if ($results) {
             foreach ($results as $result) {
                 $PROCESSED["page_navigation"]["show_" . $result["nav_type"] . "_nav"] = $result["show_nav"];
                 if ($result["nav_type"] == "next") {
                     $nav_next_page_id = $result["nav_page_id"];
                 } elseif ($result["nav_type"] == "previous") {
                     $nav_previous_page_id = $result["nav_page_id"];
                 }
             }
         }
         if (isset($PAGE_TYPE) && $PAGE_TYPE != "") {
             $PROCESSED["page_type"] = $PAGE_TYPE;
         }
         $default_next_page = get_next_community_page($COMMUNITY_ID, $PAGE_ID, $page_details["parent_id"], $page_details["page_order"]);
         $default_previous_page = get_prev_community_page($COMMUNITY_ID, $PAGE_ID, $page_details["parent_id"], $page_details["page_order"]);
         break;
 }
 //Display Page
 switch ($STEP) {
     case 2:
         if ($NOTICE) {
             echo display_notice();
         }
         if ($SUCCESS) {
             echo display_success();
         }
         if ($ERROR) {
             echo display_error();
         }
         break;
     exit;
 }
 if (!isset($_POST["page_order"]) || !($page_order = (int) $_POST["page_order"])) {
     $query = "SELECT (MAX(`page_order`) + 1) FROM `community_pages`\n\t\t\t\t\tWHERE `community_id` = " . $db->qstr($COMMUNITY_ID) . "\n\t\t\t\t\tAND `parent_id` = " . $db->qstr($parent_id);
     $page_order = $db->GetOne($query);
 }
 switch ($nav_type) {
     case "prev_id":
     case "previous_id":
         $default_previous_page = get_prev_community_page($COMMUNITY_ID, $cpage_id, $parent_id, $page_order);
         echo $default_previous_page["cpage_id"];
         exit;
         break;
     case "prev":
     case "previous":
         $default_previous_page = get_prev_community_page($COMMUNITY_ID, $cpage_id, $parent_id, $page_order);
         echo communities_pages_inradio(0, 0, array("selected" => $default_previous_page["cpage_id"], "id" => "previous_page_list", "nav_type" => "previous", "parent_swap" => array("parent_id" => $parent_id, "page_id" => $cpage_id)));
         exit;
         break;
     case "next_id":
     default:
         $default_next_page = get_next_community_page($COMMUNITY_ID, $cpage_id, $parent_id, $page_order);
         echo $default_next_page["cpage_id"];
         exit;
         break;
     case "next":
     default:
         $default_next_page = get_next_community_page($COMMUNITY_ID, $cpage_id, $parent_id, $page_order);
         echo communities_pages_inradio(0, 0, array("selected" => $default_next_page["cpage_id"], "id" => "next_page_list", "nav_type" => "next", "parent_swap" => array("parent_id" => $parent_id, "page_id" => $cpage_id)));
         exit;
         break;