paristemi
[ class tree: paristemi ] [ index: paristemi ] [ all elements ]

Source for file resources.php

Documentation is available at resources.php

  1. <?php
  2. /**
  3. * <b>Resources</b><br />
  4. * The resources section shows all of the suggested website links by category.
  5. * @author Kristen O'Brien <kristen_paristemi-com>
  6. * @copyright Copyright 2004, Kristen O'Brien
  7. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  8. * @link http://www.paristemi.com Paristemi Main Site
  9. * @package paristemi
  10. * @subpackage paristemi_business_logic
  11. * @since Build 0.4
  12. * @version Build 0.7
  13. * @filesource
  14. */
  15. /**
  16. * Include the constants file and all of the files in the include list
  17. */
  18. if(ltrim(dirname($_SERVER['SCRIPT_FILENAME'])) == "" || !file_exists($_SERVER['DOCUMENT_ROOT']."/constants.php")) {
  19. if(!file_exists("../constants.php")) { require_once("../public_html/constants.php"); }
  20. else { require_once("../constants.php"); }
  21. }
  22. else { require_once($_SERVER['DOCUMENT_ROOT']."/constants.php"); }
  23. foreach($INCLUDE_LIST as $includefile) { require_once $includefile; }
  24. $db = new Database();
  25. $db_main = $db->GetClass('main');
  26. $smarty = UtilSmarty::createSmarty();
  27.  
  28. $cat="";
  29. if($HTTP_GET_VARS) {
  30. if(isset($HTTP_GET_VARS['category'])) {$cat = $HTTP_GET_VARS['category'];}
  31. }
  32. if($cat != "") { $pagesubtitle = $cat; }
  33. else { $pagesubtitle = ""; }
  34. require_once $HTTP_DOCUMENT_ROOT.$INCLUDE_PATH.$HEADER.
  35. "?pagetitle=".str_replace(" ","%20",htmlentities($S_RESOURCES)).
  36. "&pagesubtitle=".str_replace(" ","%20",htmlentities(stripslashes($pagesubtitle))).
  37. "&pagedesc=".str_replace(" ","%20",htmlentities($CHURCH_NAME." ".$S_DESC_RESOURCES));
  38.  
  39. $sidesection = array('Title'=>$S_RESOURCES,'Links'=>array());
  40. $categories = $db_main->GetResourceCategories();
  41. foreach($categories as $category) {
  42. $sidesection['Links'][] = array('LinkPath'=>$HTTP_DOCUMENT_ROOT.
  43. $RESOURCE_FILE."?category=".$category,'LinkText'=>$category);
  44. }
  45. $smarty->assign('sidesections',array($sidesection));
  46. if($HTTP_GET_VARS) {
  47. $resources = $db_main->GetResourcesByCategory($cat);
  48. $smarty->assign('heading',$cat);
  49. $listelements = array();
  50. foreach($resources as $resource) {
  51. $listelements[] = array('LinkPath'=>$resource->Link,'Title'=>$resource->Title,
  52. 'SubText'=>$resource->Description);
  53. }
  54. $smarty->assign('listelements',$listelements);
  55. }
  56. else {
  57. $smarty->assign('introstatements',array(array('Title'=>$S_RESOURCES,'Text'=>$RESOURCE_INTRO)));
  58. }
  59. UtilSmarty::displaySectionPage($smarty);
  60. ?>
  61. <?php require_once $SERVER_DIRECTORY.$INCLUDE_PATH.$FOOTER; ?>

Documentation generated on Mon, 10 May 2004 12:10:53 -0700 by phpDocumentor 1.3.0RC3