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

Source for file help.php

Documentation is available at help.php

  1. <?php
  2. /**
  3. * <b>Help System</b><br />
  4. * The help system provides for frequently asked questions, site map, and site search.
  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.5
  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. $cat="";$sitemap="";
  28. if($HTTP_GET_VARS) {
  29. if(isset($HTTP_GET_VARS['category'])) {$cat = $HTTP_GET_VARS['category'];}
  30. if(isset($HTTP_GET_VARS['sitemap'])) {$sitemap = $HTTP_GET_VARS['sitemap'];}
  31. }
  32. if($cat != "") { $pagesubtitle = $cat; }
  33. else if($sitemap != "") { $pagesubtitle = $S_SITE_MAP; }
  34. else { $pagesubtitle = ""; }
  35. require_once $HTTP_DOCUMENT_ROOT.$INCLUDE_PATH.$HEADER.
  36. "?pagetitle=".str_replace(" ","%20",htmlentities($S_HELP_SYSTEM)).
  37. "&pagesubtitle=".str_replace(" ","%20",htmlentities(stripslashes($pagesubtitle))).
  38. "&pagedesc=".str_replace(" ","%20",htmlentities($CHURCH_NAME." ".$S_DESC_HELP));
  39. $sidesections = array();
  40. $links = array();
  41. $categories = $db_main->GetFAQCategories();
  42. foreach($categories as $category) {
  43. $links[] = array('LinkPath'=>$HTTP_DOCUMENT_ROOT.
  44. $HELP_FILE."?category=".$category,'LinkText'=>$category);
  45. }
  46. $sidesections[] = array('Title'=>$S_HOW_TO."...",'Links'=>$links);
  47. $sidesections[] = array('Title'=>$S_SITE_TOOLS,'Links'=>
  48. array(array('LinkPath'=>$HTTP_DOCUMENT_ROOT.$HELP_FILE."?sitemap=yes",
  49. 'LinkText'=>$S_SITE_MAP."</a></p>")));
  50. $smarty->assign('sidesections',$sidesections);
  51. if($SHOW_GOOGLE_SEARCH) {
  52. $smarty->assign('searchtemplate',$SMARTY_TPL_SEARCH_BOX);
  53. UtilSmarty::setupSearchVars($smarty);
  54. $smarty->assign('searchboxsize',"25");
  55. $smarty->assign('showsitesearch',"yes"); }
  56. if($HTTP_GET_VARS) {
  57. if($cat != "") {
  58. $faqs = $db_main->GetFAQsByCategory($cat);
  59. $smarty->assign('heading',$cat);
  60. $listelements = array();
  61. foreach($faqs as $faq) {
  62. $linktext = "";
  63. if($faq->Links != "") {
  64. $links = explode(',',$faq->Links);
  65. $linktext .= $S_LINK_S." ".$S_TO." ".$S_VIEW.": ";
  66. $firstflg=1;
  67. foreach($links as $pagelink) {
  68. if(!$firstflg) { $linktext .= "&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;";
  69. $linktext .= "&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;";
  70. $linktext .= "&nbsp; &nbsp; &nbsp; &nbsp; "; }
  71. $linktext .= "<a href=\"".$pagelink."\">".wordwrap($pagelink,60,"<br />",1)."</a><br />";
  72. $firstflg=0;
  73. }
  74. }
  75. $listelements[] = array('Title'=>$faq->Title,'SubText'=>$faq->Text."<br />".$linktext);
  76. }
  77. $smarty->assign('listelements',$listelements);
  78. $smarty->assign('boldlisttitle',"yes");
  79. }
  80. else if($sitemap == "yes") {
  81. $smarty->assign('heading',$S_SITE_MAP);
  82. $text = "";
  83. $text .= '<a href="'.$HTTP_DOCUMENT_ROOT.'">'.$S_MAIN_SITE.'</a><br /><br />';
  84. $text .= $S_MAIN_SECTIONS."<br />";
  85. if($SHOW_MINISTRY) { $text .= '<ul><li /><a href="'.$HTTP_DOCUMENT_ROOT.$MINISTRY_DIR.$MINISTRY_FILE.'">'.$S_ABOUT.'</a></ul>'; }
  86. if($SHOW_CALENDAR) { $text .= '<ul><li /><a href="'.$HTTP_DOCUMENT_ROOT.$CALENDAR_PATH.'">'.$S_CALENDAR.'</a>';
  87. $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$CALENDAR_PATH.$MONTH_CAL_FILE.'">'.$S_MONTH." ".$S_CALENDAR.'</a>';
  88. $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$CALENDAR_PATH.$WEEK_CAL_FILE.'">'.$S_WEEK." ".$S_CALENDAR.'</a>';
  89. $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$CALENDAR_PATH.$DAY_CAL_FILE.'">'.$S_DAY." ".$S_CALENDAR.'</a></ul>'; }
  90. if($SHOW_CONTACT) { $text .= '<ul><li /><a href="'.$HTTP_DOCUMENT_ROOT.$CONTACT_DIR.$CONTACT_FILE.'">'.$S_CONTACT.'</a></ul>'; }
  91. if($SHOW_STUDIES) { $text .= '<ul><li /><a href="'.$HTTP_DOCUMENT_ROOT.$STUDIES_DIR.$STUDIES_FILE.'">'.$S_EVENTS.'</a></ul>'; }
  92. if($SHOW_MUSIC) { $text .= '<ul><li /><a href="'.$HTTP_DOCUMENT_ROOT.$MUSIC_DIR.$MUSIC_FILE.'">'.$S_WORSHIP_MUSIC.'</a></ul>'; }
  93. if($SHOW_MESSAGES) { $text .= '<ul><li /><a href="'.$HTTP_DOCUMENT_ROOT.$MESSAGES_DIR.$MESSAGES_FILE.'">'.$S_AUDIO_MESSAGES.'</a></ul>'; }
  94. if($SHOW_PICTURES) { $text .= '<ul><li /><a href="'.$HTTP_DOCUMENT_ROOT.$PICTURE_DIR.$PICTURE_FILE.'">'.$S_PICTURES.'</a></ul>'; }
  95. if($SHOW_MULTIMEDIA) { $text .= '<ul><li /><a href="'.$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE.'">'.$S_MULTIMEDIA.'</a></ul>'; }
  96. if($SHOW_PRAYER) { $text .= '<ul><li /><a href="'.$HTTP_DOCUMENT_ROOT.$PRAYER_DIR.$PRAYER_FILE.'">'.$S_PRAYER_REQUESTS.'</a></ul>'; }
  97. $text .= "<br />Other Sections<br /><ul>";
  98. if($SHOW_BIBLE_TRIVIA) { $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$BIBLE_TRIVIA_FILE.'">'.$S_BIBLE_TRIVIA.'</a>'; }
  99. if($SHOW_FEEDBACK) { $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$FEEDBACK_FILE.'">'.$S_CONTACT." ".$S_US.'</a>'; }
  100. if($SHOW_DEVOTIONAL) { $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$DEVOTIONAL_FILE.'">'.$S_DEVOTIONALS.'</a>'; }
  101. if($SHOW_GOSPEL_SECTION) { $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$MEDIA_PATH.$GOSPEL_FILE.'">'.$GOSPEL_TITLE.'</a>'; }
  102. if($SHOW_HELP_SYSTEM) { $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$HELP_FILE.'">'.$S_HELP.'</a>'; }
  103. if($SHOW_LIBRARY) { $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$LIBRARY_DIR.$LIBRARY_FILE.'">'.$S_LIBRARY." ".$S_CATALOG.'</a>'; }
  104. if($SHOW_MAILING_LIST) { $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$MAILING_LIST_DIR.$MAILING_LIST_FILE.'">'.$S_MAILING_LISTS.'</a>'; }
  105. if($SHOW_GOSPEL_SECTION) { $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$NEW_BELIEVER_FILE.'">'.$S_NEW_BELIEVER." ".$S_RESOURCES.'</a>'; }
  106. if($SHOW_RESOURCES) { $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$RESOURCE_FILE.'">'.$S_RESOURCES.'</a>'; }
  107. if($SHOW_SUPPORT) { $text .= '<li /><a href="'.$HTTP_DOCUMENT_ROOT.$SUPPORT_FILE.'">'.$S_SUPPORT." ".$S_US.'</a>'; }
  108.  
  109. $text .= "</ul>";
  110. $text .= "<br /><br />";
  111. $smarty->assign('text',$text);
  112. }
  113. }
  114. else {
  115. $smarty->assign('introstatements',array(array('Title'=>$S_HELP_SYSTEM,'Text'=>$HELP_INTRO)));
  116. }
  117. UtilSmarty::displaySectionPage($smarty);
  118. ?>
  119. <?php require_once $SERVER_DIRECTORY.$INCLUDE_PATH.$FOOTER; ?>

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