view2.php30000664000076400007640000001212511222573344013416 0ustar ahsanchezahsanchez-86400 // generalized version of cmd[]-c // - fields and operators specifed // - unlimited number of conditions // - all default conditions from view definition are // completely redefined by the specified ones //optionaly set[] // setings to modify view behavior (can be combined with cmd) // set[23]=listlen-20 // set[23]=mlx-EN-FR-DE // - sets maximal number of viewed items in view 23 to 20 // - there can be more settings (future) - comma separated //optionaly als[] // user alias - see slice.php3 for more details // for more info see AA FAQ: http://apc-aa.sourceforge.net/faq/index.shtml#219 ini_set('display_errors', 1); /** * Handle with PHP magic quotes - quote the variables if quoting is set off * @param mixed $value the variable or array to quote (add slashes) * @return mixed the quoted variables (with added slashes) */ function AddslashesDeep($value) { return is_array($value) ? array_map('AddslashesDeep', $value) : addslashes($value); } if (!get_magic_quotes_gpc()) { // Overrides GPC variables foreach ($_GET as $k => $v) { $kk = AddslashesDeep($v); } foreach ($_POST as $k => $v) { $kk = AddslashesDeep($v); } foreach ($_COOKIE as $k => $v) { $kk = AddslashesDeep($v); } } require_once "./include/config.php3"; require_once AA_INC_PATH."easy_scroller.php3"; require_once AA_INC_PATH."util.php3"; require_once AA_INC_PATH."item.php3"; require_once AA_INC_PATH."view.php3"; require_once AA_INC_PATH."discussion.php3"; require_once AA_INC_PATH."pagecache.php3"; require_once AA_INC_PATH."searchlib.php3"; require_once "misc/paginator/src/Paginated.php"; require_once "misc/paginator/src/DoubleBarLayout.php"; $encap = true; // just for calling extsessi.php require_once AA_INC_PATH."locsess.php3"; // DB_AA object definition add_vars(); // it must be here as we are using functions like GetCategoryGroup() where // we still use // global $db; $db = new DB_AA; $db2 = new DB_AA; if (is_numeric($time_limit)) { @set_time_limit((int)$time_limit); } if ($debug) huhl("Starting view"); // Need to be able to set content-type for RSS, cannot do it in the view // because the cache wont reflect this if ($contenttype) { header("Content-type: $contenttype"); } $view_param = ParseViewParameters(); if ($convertfrom) { $view_param['convertfrom'] = $convertfrom; } if ($convertto) { $view_param['convertto'] = $convertto; } $nocache=1; //poner a 1 para evitar la caché $vista = GetView($view_param); // se ejecuta para carga el objeto $items mas abajo. $names=$items; //$items es una variable global #Añadir #global $items; $items[] = $CurItem->get_item(); #en la linea 714 del archivo itemview.php3 //$page = $_GET['page']; #se desactiva porque $_GET no tiene sentido en SSI //constructor takes three parameters //1. array to be paged //2. number of results per page (optional parameter. Default is 10) //3. the current page (optional parameter. Default is 1) $pagedResults = new Paginated($names, 3, $page); while($row = $pagedResults->fetchPagedRow()) { //when $row is false loop terminates print $row; } //important to set the strategy to be used before a call to fetchPagedNavigation $pagedResults->setLayout(new DoubleBarLayout()); echo $pagedResults->fetchPagedNavigation(); ?>