$db->setFetchMode(MDB2_FETCHMODE_ASSOC); function showPaper($code) { global $smarty; $article = new Lesen_paper($code); if (is_null($article)) { die("wrong paper code"); } foreach (array("authors", "tutors") as $name) { foreach ($article->{"_" . $name} as $val) { ${$name}[] = new Lesen_person((int) $val); } } $smarty->assign(array('paper' => $article, 'authors' => $authors, 'tutors' => $tutors, 'comments' => lesen_getComment($code))); $smarty->assign('body', $smarty->fetch('paper.tpl')); } function addComment() { if (ereg("[A-Za-z0-9]", $_POST['name']) && ereg("[A-Za-z0-9]", $_POST['body'])) { lesen_saveComment($_POST['name'], $_POST['email'], $_POST['url'], $_POST['body'], $_GET['code'], 0); } else { return false; } } if (isset($_POST)) { addComment(); } if (isset($_GET['code'])) { showPaper($_GET['code']); } $smarty->display('page.tpl');
break; case 'paper': indexPaper(); break; case 'course': indexCourse(); break; case 'keyword': indexKeyword($_GET['lang'], $_GET['keycode']); break; default: break; } } if (isset($_GET['paper'])) { showPaper($_GET['paper']); } else { if (isset($_GET['person'])) { showPerson($_GET['person']); } } $smarty->display('page.tpl'); // /* Initialization routine */ // //$db = initdb($cfg['database']); // $db; // $smarty = new Smarty(); // $smarty->debugging = true; // $smarty->assign('head_title','Proyectos - Ingeniería Informática UCSP'); // $nav = array('Proyectos' => array('Home' => 'index.php'), // 'Índices' => array('Por autor' => 'index.php?index=author', // 'Por título' => 'index.php?index=paper',