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

Source for file index.php

Documentation is available at index.php

  1. <?php
  2. /**
  3. * <b>About Section</b><br />
  4. * The about section lists the mission statement, minitries, and main contacts.
  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.3
  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. require_once $SERVER_DIRECTORY.$INCLUDE_PATH.$CONTACT_INCLUDE;
  25.  
  26. $db = new Database();
  27. $db_about = $db->GetClass('about');
  28. $db_multimedia = $db->GetClass('multimedia');
  29. $db_contact = $db->GetClass('contact');
  30. $data =& $db_about->GetAllMinistries();
  31. $smarty = UtilSmarty::createSmarty();
  32.  
  33. $id = ""; $con = ""; $pagesubtitle = ""; $value = "";
  34. if(getenv("QUERY_STRING")) {
  35. if(isset( $HTTP_GET_VARS['id'])) { $id = $HTTP_GET_VARS['id']; }
  36. if(isset( $HTTP_GET_VARS['contact'])) { $con = $HTTP_GET_VARS['contact']; }
  37. if($id != null && $con != "yes") { $value =& $db_about->GetMinistryData($id); $pagesubtitle = $value->Title; }
  38. if($id != null && $con == "yes") { $value =& $db_contact->GetContactData($id);
  39. $full_name = "";
  40. if($value->ShowMainTitle) { $full_name .= $value->Title; }
  41. if($value->ShowMainFirstName) { $full_name .= " ".$value->First; }
  42. if($value->Middle != null) { $full_name .= " ".$value->Middle; }
  43. if($value->ShowMainLastName) { $full_name .= " ".$value->Last; }
  44. $pagesubtitle = $full_name;
  45. }
  46. }
  47. require_once $HTTP_DOCUMENT_ROOT.$INCLUDE_PATH.$HEADER.
  48. "?pagetitle=".str_replace(" ","%20",htmlentities($S_ABOUT))."&pagesubtitle=".str_replace(" ","%20",htmlentities($pagesubtitle)).
  49. "&pagedesc=".str_replace(" ","%20",htmlentities($CHURCH_NAME." ".$S_DESC_ABOUT));
  50. $sidesections = array();
  51. $sidesection = array();
  52. $sidesection['Title'] = $S_MINISTRY;
  53. $sidesection['Links'] = array();
  54. foreach ($data as $value) {
  55. $sidesection['Links'][] = array(
  56. 'LinkPath' => $GLOBALS['HTTP_DOCUMENT_ROOT'].$GLOBALS['MINISTRY_DIR'].
  57. $GLOBALS['MINISTRY_FILE']."?id=".$value->ID,
  58. 'LinkText' => $value->Title);
  59. }
  60. $sidesections[] = $sidesection;
  61. $con_inc = new Contact();
  62. $sidesections[] = $con_inc->conSmallHeader("min");
  63. $smarty->assign('sidesections',$sidesections);
  64. $smarty->assign('textsections',array(array('Title'=>$S_OFFICE,'Text'=>$CONTACT_INFO)));
  65. $smarty->assign('icondescriptions',
  66. array(array('src' => $HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$PDF_IMG,
  67. 'alt' => 'PDF', 'desc' => 'PDF')));
  68. $data =& $db_about->GetAllMinistries();
  69. if($data != null) {
  70. if(getenv("QUERY_STRING")) {
  71. if($id != null && $con != "yes") {
  72. $value =& $db_about->GetMinistryData($id);
  73. $tblarr = array();
  74. $tblclass = "tbl-listing";
  75. $tblheader = "<h2>".$value->Title."</h2>";
  76. $tbltdclass = array("tbl-listing-title-lined","tbl-listing-item-lined");
  77. array_push($tblarr,array($S_DESC,stripslashes($value->Description)));
  78. if($value->Services != null) {
  79. array_push($tblarr,array($S_SERVICES,stripslashes($value->Services)));
  80. }
  81. if($value->Notes != null) {
  82. array_push($tblarr,array($S_NOTES,stripslashes($value->Notes)));
  83. }
  84. array_push($tblarr,array($S_CONTACT,"<a href=\"".$GLOBALS['HTTP_DOCUMENT_ROOT'].
  85. $GLOBALS['CONTACT_FORM']."?id=".$value->CID."\">".
  86. UtilFiles::createImageText($value->CID,'contact')."</a>"));
  87. $smarty->assign('printtable',UtilHtml::createTable($tblarr,$tblheader,$tblclass,"","",$tbltdclass));
  88. }
  89. if($id != null && $con == "yes") {
  90. $smarty->assign('printtable',$con_inc->ContactData($id));
  91. }
  92.  
  93. }
  94. else {
  95. $smarty->assign('introstatements',array(
  96. array('Title'=>$S_ABOUT." ".$CHURCH_NAME,
  97. 'Text'=>$ABOUT_CHURCH),
  98. array('Title'=>$S_MISSION,
  99. 'Text'=>$MISSION_STATEMENT)));
  100. }
  101. }
  102. else { $smarty->assign('notice',$N_MINISTRY_NONE); }
  103. $smarty->assign('bottomnote',$S_FREE_PDF.
  104. '<a href="http://www.adobe.com/products/acrobat/readstep2.html">Adobe</a>.');
  105. UtilSmarty::displaySectionPage($smarty);
  106. ?>
  107. <?php require_once $SERVER_DIRECTORY.$INCLUDE_PATH.$FOOTER; ?>

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