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

Source for file index.php

Documentation is available at index.php

  1. <?php
  2. /**
  3. * <b>Multimedia</b><br />
  4. * The multimedia section shows all of the information and downloading of multimedia.
  5. * There are two types of multimedia, Audio and Video.<br />
  6. * Audio Views available are:
  7. * - Specific Category
  8. * - All Hard Questions
  9. * - New Audio
  10. * Audio has transcripts that are displayed in HTML and PDF.<br />
  11. * This section is searchable (audio only).<br />
  12. * This section links to the contact form to submit a hard question.
  13. * @author Kristen O'Brien <kristen_paristemi-com>
  14. * @copyright Copyright 2004, Kristen O'Brien
  15. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  16. * @link http://www.paristemi.com Paristemi Main Site
  17. * @package paristemi
  18. * @subpackage paristemi_business_logic
  19. * @since Build 0.3
  20. * @version Build 0.7
  21. * @filesource
  22. */
  23. /**
  24. * Include the constants file and all of the files in the include list
  25. */
  26. if(ltrim(dirname($_SERVER['SCRIPT_FILENAME'])) == "" || !file_exists($_SERVER['DOCUMENT_ROOT']."/constants.php")) {
  27. if(!file_exists("../constants.php")) { require_once("../public_html/constants.php"); }
  28. else { require_once("../constants.php"); }
  29. }
  30. else { require_once($_SERVER['DOCUMENT_ROOT']."/constants.php"); }
  31. foreach($INCLUDE_LIST as $includefile) { require_once $includefile; }
  32. $db = new Database();
  33. $db_multimedia = $db->GetClass('multimedia');
  34. $smarty = UtilSmarty::createSmarty();
  35. $id="";$type="";$listtype="";$cat="";$trans="";$lbegin=0;$scount=0;$dlpdf="";$transcript="";
  36. $searchterm="";$stitle="";$sdesc="";$stopic="";$scntflg=false;$searchflg=false;
  37. if(getenv("QUERY_STRING")) {
  38. if(isset($HTTP_GET_VARS['id'])) {$id = $HTTP_GET_VARS['id'];}
  39. if(isset($HTTP_GET_VARS['type'])) {$type = $HTTP_GET_VARS['type'];}
  40. if(isset($HTTP_GET_VARS['listtype'])) {$listtype = $HTTP_GET_VARS['listtype'];}
  41. if(isset($HTTP_GET_VARS['cat'])) {$cat = $HTTP_GET_VARS['cat'];$listtype='cat';}
  42. if(isset($HTTP_GET_VARS['trans'])) { $trans = $HTTP_GET_VARS['trans']; }
  43. if(isset($HTTP_GET_VARS['SearchTerm'])) {$searchterm = $HTTP_GET_VARS['SearchTerm'];$searchflg=true;}
  44. if(isset($HTTP_GET_VARS['Title'])) {$stitle = $HTTP_GET_VARS['Title'];}
  45. if(isset($HTTP_GET_VARS['Description'])) {$sdesc = $HTTP_GET_VARS['Description'];}
  46. if(isset($HTTP_GET_VARS['Category'])) {$scategory = $HTTP_GET_VARS['Category'];}
  47. if(isset($HTTP_GET_VARS['Transcript'])) { $transcript = $HTTP_GET_VARS['Transcript'];}
  48. if(isset($HTTP_GET_VARS['dlpdf'])) { $dlpdf = $HTTP_GET_VARS['dlpdf'];}
  49. if(isset($HTTP_GET_VARS['lbegin'])) {$lbegin = $HTTP_GET_VARS['lbegin'];}
  50. if(isset($HTTP_GET_VARS['scount'])) {$scount = $HTTP_GET_VARS['scount'];$scntflg=true;}
  51. }
  52. if($dlpdf == "yes" && $id != null && $type == "audio") {
  53. $value =& $db_multimedia->GetMultimediaAudioItem($id); $pdflink="";
  54. if($value->ALinkStream) {
  55. $pdflink .= "<a href=\"".$value->ALinkStream."\">".$S_LISTEN."</a>"; }
  56. if($value->ALinkDownload) {
  57. $pdflink .= "&nbsp; <a href=\"".$value->ALinkDownload."\">".$S_DOWNLOAD;
  58. $pdflink .= "(".UtilFiles::GetFilesize($value->ALinkDownload).")</a>";
  59. }
  60. if($pdflink != null) { $pdflink = "\r\n".$pdflink; }
  61. $text =& UtilBible::ParseVerses($value->Transcript);
  62. UtilFiles::CreatePDF($value->Title,$text,$value->Description.$pdflink,
  63. $HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE."?id=".$value->ID.'&amp;type=audio');
  64. }
  65. if($type != "") {
  66. $pagesubtitle = ucwords(strtolower($type));
  67. if($cat != "") { $pagesubtitle .= " - ".str_replace("_"," ",$cat); }
  68. else if($listtype == 'hq') { $pagesubtitle .= " - ".$S_HARD_QUESTIONS; }
  69. else if($listtype == 'new') { $pagesubtitle .= " - ".$S_NEW; }
  70. else if($listtype == 'all') { $pagesubtitle .= " - ".$S_ALL; }
  71. else if($id != "") {
  72. if($type == "audio") { $value =& $db_multimedia->GetMultimediaAudioItem($id); }
  73. else if($type == "video") { $value =& $db_multimedia->GetMultimediaVideoItem($id); }
  74. $pagesubtitle .= " - ".$value->Title;
  75. }
  76. }
  77. else if($searchterm != "") { $pagesubtitle = $S_SEARCH." - ".ucwords(strtolower($searchterm)); }
  78. else { $pagesubtitle = $S_RECENTLY_ADDED; }
  79. require_once $HTTP_DOCUMENT_ROOT.$INCLUDE_PATH.$HEADER.
  80. "?pagetitle=".str_replace(" ","%20",htmlentities($S_MULTIMEDIA)).
  81. "&pagesubtitle=".str_replace(" ","%20",htmlentities(stripslashes($pagesubtitle))).
  82. "&pagedesc=".str_replace(" ","%20",htmlentities($CHURCH_NAME." ".$S_DESC_MULTIMEDIA));
  83. $data = $db_multimedia->GetMultimediaAudioCategories();
  84. $sidesections = array();
  85. if($data != null) {
  86. $sidesection = array();
  87. $sidesection['Links'] = array();
  88. $sidesection['Title'] = $S_AUDIO;
  89. foreach ($data as $value) {
  90. $sidesection['Links'][] = array('LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.
  91. $MULTIMEDIA_FILE."?type=audio&amp;cat=".
  92. str_replace(" ", "_", $value),'LinkText'=>$value);
  93. }
  94. $sidesection['Links'][] = array('LinkPath'=>"",'LinkText'=>"break");
  95. if($MULTIMEIDA_NUM_NEW != 0) {
  96. $sidesection['Links'][] = array('LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.
  97. $MULTIMEDIA_FILE."?type=audio&amp;listtype=new",
  98. 'LinkText'=>$S_NEW." ".$S_AUDIO);
  99. }
  100. if($db_multimedia->GetHardQuestionsCount() != 0) {
  101. $sidesection['Links'][] = array('LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.
  102. $MULTIMEDIA_FILE."?type=audio&amp;listtype=hq",
  103. 'LinkText'=>$S_ALL." ".$S_HARD_QUESTIONS);
  104. }
  105. if($SHOW_ASK_HARD_QUESTION) {
  106. $sidesection['Links'][] = array('LinkPath'=>$HTTP_DOCUMENT_ROOT.$FEEDBACK_FILE.
  107. "?feedbackname=Hard%20Questions",
  108. 'LinkText'=>$S_ASK_HQ);
  109. }
  110. $sidesections[] = $sidesection;
  111. }
  112. $vdata = $db_multimedia->GetMultimediaVideoCategories();
  113. if($vdata != null) {
  114. $sidesection = array();
  115. $sidesection['Links'] = array();
  116. $sidesection['Title'] = $S_VIDEO;
  117. foreach ($vdata as $value) {
  118. $sidesection['Links'][] = array('LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.
  119. $MULTIMEDIA_FILE."?type=video&amp;cat=".
  120. str_replace(" ", "", $value),'LinkText'=>$value);
  121. }
  122. $sidesections[] = $sidesection;
  123. }
  124. $smarty->assign('sidesections',$sidesections);
  125. $icondescriptions = array();
  126. if($data != null) {
  127. $icondescriptions[] = array('src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$MULTIMEDIA_AUDIO_IMG,
  128. 'alt'=>$S_AUDIO." ".$S_STREAMING,'desc'=>$S_AUDIO." (".$S_STREAMING.")");
  129. $icondescriptions[] = array('src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$MULTIMEDIA_AUDIO_IMG_DL,
  130. 'alt'=>$S_AUDIO." ".$S_DOWNLOAD,'desc'=>$S_AUDIO." (".$S_DOWNLOAD.")");
  131. $icondescriptions[] = array('src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$MULTIMEDIA_TRANS_IMG,
  132. 'alt'=>$S_TRANSCRIPT,'desc'=>$S_TRANSCRIPT);
  133. }
  134. if($SHOW_PDF_DL) {
  135. $icondescriptions[] = array('src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$PDF_IMG,
  136. 'alt'=>"PDF",'desc'=>'PDF '.$S_TRANSCRIPT);
  137. }
  138. if($vdata != null) {
  139. $icondescriptions[] = array('src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$MULTIMEDIA_VIDEO_IMG,
  140. 'alt'=>$S_VIDEO,'desc'=>$S_VIDEO);
  141. }
  142. $smarty->assign('icondescriptions',$icondescriptions);
  143. $smarty->assign('searchformname','audiosearch');
  144. $smarty->assign('searchformfile',$MULTIMEDIA_FILE);
  145. $smarty->assign('hiddensearchinputs',array(array('name'=>'type','value'=>'audio')));
  146. $smarty->assign('searchconstraints',array(
  147. array('name'=>'Title','title'=>$S_TITLE),
  148. array('name'=>'Description','title'=>$S_DESC),
  149. array('name'=>'Category','title'=>$S_CATEGORY),
  150. array('name'=>'Transcript','title'=>$S_TRANSCRIPT)));
  151. $smarty->assign('searchsubmittitle',$S_AUDIO." ".$S_SEARCH);
  152. if(getenv("QUERY_STRING")) {
  153. if($type == "audio") {
  154. if($searchflg) {
  155. if($searchterm == "") {
  156. $finalresults =& $db_multimedia->GetMultimediaAudioByLimit($LISTING_LIMIT,$lbegin);
  157. $scount = count($db_multimedia->GetMultimediaAudio());
  158. $sterm = "";
  159. }
  160. else {
  161. $sterm = $searchterm;
  162. $atype = array();
  163. if($sdesc != null) { $atype[] = "description"; }
  164. if($stitle != null) { $atype[] = "title"; }
  165. if($scategory != null) { $atype[] = "category"; }
  166. if($transcript != null) { $atype[] = "transcript"; }
  167. $finalresults =& $db_multimedia->SearchAudioType($searchterm,$atype,$LISTING_LIMIT,$lbegin);
  168. if(!$scntflg) {$scount = $db_multimedia->SearchAudioCount($searchterm,$atype);}
  169. }
  170. if($finalresults != null) { $listtype = 'search'; }
  171. else {
  172. $smarty->assign('heading',$S_SEARCH." ".$S_RESULTS);
  173. $smarty->assign('notice',$N_SEARCH_MULTIMEDIA_NONE);
  174. }
  175. }
  176. if($id != null) {
  177. $value =& $db_multimedia->GetMultimediaAudioItem($id);
  178. $tblheader = "<h2>".$value->Title."</h2>";
  179. $tblarr = array();
  180. $tblclass = "tbl-listing";
  181. $tbltdclass = array("tbl-listing-title","tbl-listing-item");
  182. if($value->ALinkStream) {
  183. $tblheader .= "<a href=\"".$value->ALinkStream."\">";
  184. $tblheader .= "<img border=\"0\" align=\"middle\" src=\"".$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$MULTIMEDIA_AUDIO_IMG;
  185. $tblheader .= "\" alt=\"Audio Stream\" border=\"0\" \></a>";
  186. $tblheader .= "&nbsp; <a href=\"".$value->ALinkStream."\">".$S_LISTEN."</a>";
  187. }
  188. if($value->ALinkDownload) {
  189. $tblheader .= " &nbsp; | &nbsp; <a href=\"".$value->ALinkDownload."\">".$S_DOWNLOAD;
  190. $tblheader .= " <span class=\"filesize\">";
  191. $tblheader .= "(".UtilFiles::GetFilesize($value->ALinkDownload).")</span></a>";
  192. }
  193. if($trans != "") {
  194. $tbltdclass = array("tbl-listing-item");
  195. array_push($tblarr,array(nl2br($value->Transcript)));
  196. }
  197. else {
  198. array_push($tblarr,array($S_CATEGORY,$value->Category));
  199. if ($value->Description != null) {
  200. array_push($tblarr,array($S_DESC,stripslashes($value->Description)));
  201. }
  202. if ($value->BookReference != "" && $value->StartVerse != "" && $value->StopVerse != ""
  203. && $value->BookReference != "No Reference"
  204. && $value->StartVerse != 0 && $value->StopVerse != 0) {
  205. $reference = $value->BookReference." ".trim($value->StartVerse);
  206. if(trim($value->StartVerse) != trim($value->StopVerse)) {
  207. $reference .= "-".trim($value->StopVerse); }
  208. array_push($tblarr,array($S_BIBLE_REFERENCE,UtilBible::DisplayVerseLink($reference)));
  209. }
  210. if($value->Transcript != null) {
  211. $transtext = '<a href="'.$HTTP_DOCUMENT_ROOT.
  212. $MULTIMEDIA_DIR.$MULTIMEDIA_FILE.'?id='.$value->ID.
  213. '&amp;trans=yes&amp;type=audio">'.$S_VIEW.' '.$S_TRANSCRIPT.'</a>';
  214. $pdftext = "";
  215. if($SHOW_PDF_DL) {
  216. $pdftext = '<a href="'.$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE.
  217. "?id=".$value->ID."&amp;type=audio&amp;dlpdf=yes\">".$S_DOWNLOAD." ".$S_TRANSCRIPT." [PDF]</a>";
  218. }
  219. array_push($tblarr,array($S_TRANSCRIPT,$transtext.'&nbsp;&nbsp;&nbsp;'.$pdftext));
  220. }
  221. }
  222. $smarty->assign('printtable',UtilHtml::createTable($tblarr,$tblheader,$tblclass,"","",$tbltdclass));
  223. }
  224. else if($listtype != null) {
  225. $newdata =& $db_multimedia->GetMultimediaAudioRecent($MULTIMEIDA_NUM_NEW);
  226. $newarr = array();
  227. foreach($newdata as $newid) { $newarr[$newid->ID] = $newid->ID; }
  228. $slinktext = "";
  229. switch($listtype) {
  230. case 'search' : $data = $finalresults;
  231. $headertitle = $S_SEARCH." ".$S_RESULTS;
  232. $scount = $scount;
  233. $linktext = "&amp;SearchTerm=".$sterm."&amp;Title=".
  234. $stitle."&amp;Category=".$scategory."&amp;Description=".$sdesc;
  235. break;
  236. case 'all' : $data = $db_multimedia->GetMultimediaAudioByLimit($LISTING_LIMIT,$lbegin);
  237. $headertitle = $S_ALL." ".$S_AUDIO." ".$S_MULTIMEDIA;
  238. $scount = $db_multimedia->GetAllAudioCount();
  239. $linktext = "&amp;listtype=all&amp;type=audio";
  240. break;
  241. case 'new' : $data = $newdata;
  242. $headertitle = $S_NEW." ".$S_AUDIO." ".$S_MULTIMEDIA;
  243. $scount = count($data);
  244. $linktext = "&amp;listtype=new&amp;type=audio";
  245. break;
  246. case 'hq' : $data = $db_multimedia->GetAllHardQuestions($lbegin,$LISTING_LIMIT);
  247. $headertitle = $S_ALL." ".$S_HARD_QUESTIONS;
  248. $linktext = "&amp;listtype=hq&amp;type=audio";
  249. $scount = $db_multimedia->GetHardQuestionsCount();
  250. break;
  251. case 'cat' : $data = $db_multimedia->GetMultimediaAudioCategory($cat);
  252. $headertitle = $data[0]->Category;
  253. $scount = count($data);
  254. $linktext = "&amp;cat=".$cat."&amp;type=audio";
  255. break;
  256. }
  257. $smarty->assign('heading',$headertitle." (".$scount." ".$S_TOTAL.")");
  258. $listelements = array();
  259. foreach ($data as $value) {
  260. $imageicons = array();
  261. $filesize = "";
  262. $newtext = "";
  263. if($value->ALinkStream) {
  264. $imageicons[] = array('Link'=>$value->ALinkStream,
  265. 'src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$MULTIMEDIA_AUDIO_IMG,'alt'=>$value->Title);
  266. }
  267. if($value->ALinkDownload) {
  268. $imageicons[] = array('Link'=>$value->ALinkDownload,
  269. 'src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$MULTIMEDIA_AUDIO_IMG_DL,'alt'=>$value->Title);
  270. }
  271. if($value->Transcript != "") {
  272. $imageicons[] = array('Link'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE.
  273. "?id=".$value->ID."&amp;type=audio&amp;trans=yes",
  274. 'src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$MULTIMEDIA_TRANS_IMG,'alt'=>$S_TRANSCRIPT);
  275. if($SHOW_PDF_DL) {
  276. $imageicons[] = array('Link'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE.
  277. "?id=".$value->ID."&amp;type=audio&amp;dlpdf=yes",
  278. 'src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$PDF_IMG,'alt'=>"PDF");
  279. }
  280. }
  281. if($SHOW_FILESIZE_IN_LIST && $value->ALinkDownload) {
  282. $filesize .= "<span class=\"filesize\">";
  283. $filesize .= " (".UtilFiles::GetFilesize($value->ALinkDownload).")";
  284. $filesize .= "</span>";
  285. }
  286. if(isset($newarr[$value->ID])) { $newtext = "&nbsp;&nbsp;&nbsp;[".$S_NEW."]"; }
  287. $listelements[] = array('LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE."?type=audio&amp;id=".$value->ID,
  288. 'Title'=>$value->Title,'ImageIcons'=>$imageicons,'SubTitle'=>$filesize." ".$newtext);
  289. }
  290. $smarty->assign('listelements',$listelements);
  291. $bottomlinks = array();
  292. if($scount >= $lbegin-$LISTING_LIMIT && $lbegin-$LISTING_LIMIT >= 0) {
  293. $bottomlinks[] = array(
  294. 'LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE."?"."lbegin=".
  295. ($lbegin-$LISTING_LIMIT)."&amp;scount=".$scount.$linktext,
  296. 'LinkText'=>"<< ".$S_PREVIOUS." ".$LISTING_LIMIT." ".$S_RESULTS);
  297. }
  298. if($lbegin+$LISTING_LIMIT < $scount) {
  299. if($scount-($lbegin+$LISTING_LIMIT) < $LISTING_LIMIT) {
  300. $linktext = $S_NEXT." ".($scount-($lbegin+$LISTING_LIMIT))." ".$S_RESULTS." >>";
  301. }
  302. else { $linktext = $S_NEXT." ".$LISTING_LIMIT." ".$S_RESULTS." >>"; }
  303. $bottomlinks[] = array(
  304. 'LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE."?"."lbegin=".
  305. ($lbegin+$LISTING_LIMIT).$linktext."&amp;scount=".$scount,
  306. 'LinkText'=>$linktext);
  307. }
  308. $smarty->assign('bottomlinks',$bottomlinks);
  309. }
  310. }
  311. else if($type == "video") {
  312. if($listtype != null) {
  313. switch($listtype) {
  314. case 'all' : $data = $db_multimedia->GetMultimediaVideo();
  315. $headertitle = $S_ALL." ".$S_VIDEO." ".$S_MULTIMEDIA;
  316. break;
  317. case 'cat' : $data = $db_multimedia->GetMultimediaVideoCategory($cat);
  318. $headertitle = $data[0]->Category;
  319. break;
  320. }
  321. $smarty->assign('heading',$headertitle." (".count($data)." ".$S_TOTAL.")");
  322. $listelements = array();
  323. foreach ($data as $value) {
  324. $listelements[] = array(
  325. 'LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE."?type=video&amp;id=".$value->ID,
  326. 'Title'=>$value->Title,
  327. 'ImageIcons'=>array(array(
  328. 'LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE."?type=video&amp;id=".$value->ID,
  329. 'src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$MULTIMEDIA_VIDEO_IMG,
  330. 'alt'=>$value->Title)));
  331. }
  332. $smarty->assign('listelements',$listelements);
  333. }
  334. else if($id != null) {
  335. $value =& $db_multimedia->GetMultimediaVideoItem($id);
  336. $tblarr = array();
  337. $tblclass = "tbl-listing";
  338. $tbltdclass = array("tbl-listing-title","tbl-listing-item");
  339. $tblheader = "<h2>".$value->Title."&nbsp; <img border=\"0\" align=".
  340. "\"middle\" src=\"".$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.
  341. $MULTIMEDIA_VIDEO_IMG."\" alt=\"".$S_VIDEO."\" border=\"0\" \>"."</h2>";
  342. array_push($tblarr,array($S_CATEGORY,$value->Category));
  343. if($value->Links != null) {
  344. foreach($value->Links as $linkkey => $linkvalue) {
  345. $filesize = UtilFiles::GetFilesize($linkvalue);
  346. $filesizebytes = UtilFiles::GetFilesize($linkvalue,1);
  347. $linkstring = "<a href=\"".$linkvalue."\">".$S_WATCH."</a>&nbsp; ".
  348. " <span class=\"filesize\">"."(".$filesize.")".
  349. "<br />[".$S_DOWNLOAD." ".$S_TIME.": ".round(round($filesizebytes/$MODEM_TRANSFER_RATE)/60).
  350. " ".$S_MIN.", ".$S_MODEM.".&nbsp; ".round(round($filesizebytes/$BROADBAND_TRANSFER_RATE)/60).
  351. " ".$S_MIN.", ".$S_BROADBAND."]</span>";
  352. array_push($tblarr,array($linkkey,$linkstring));
  353. }
  354. }
  355. if ($value->Description != null) {
  356. array_push($tblarr,array($S_DESC,stripslashes($value->Description)));
  357. }
  358. if ($value->Notes != null) {
  359. array_push($tblarr,array($S_NOTES,stripslashes($value->Notes)));
  360. }
  361. $smarty->assign('printtable',UtilHtml::createTable($tblarr,$tblheader,$tblclass,"","",$tbltdclass));
  362. }
  363. }
  364. }
  365. else {
  366. $data = $db_multimedia->GetMultimediaAudioRecent($NUM_FILES_SHOW_MAIN);
  367. $vdata = $db_multimedia->GetMultimediaVideoRecent($NUM_FILES_SHOW_MAIN);
  368. if($data == null && $vdata == null) {
  369. $smarty->assign('heading',$S_MULTIMEDIA);
  370. $smarty->assign('notice',$N_MULTIMEDIA_NONE);
  371. }
  372. else {
  373. $listelementsarr = array();
  374. $bottomlinks = array();
  375. if($data != null) {
  376. $listsection = array();
  377. $listsection['heading'] = count($data).$MULTIMEDIA_AUDIO_HEADING;
  378. $listsection['List'] = array();
  379. foreach ($data as $value) {
  380. $imageicons = array();
  381. if($value->ALinkStream) {
  382. $imageicons[] = array('Link'=>$value->ALinkStream,
  383. 'src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$MULTIMEDIA_AUDIO_IMG,'alt'=>$value->Title);
  384. }
  385. if($value->ALinkDownload) {
  386. $imageicons[] = array('Link'=>$value->ALinkDownload,
  387. 'src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$MULTIMEDIA_AUDIO_IMG_DL,'alt'=>$value->Title);
  388. }
  389. $listsection['List'][] = array(
  390. 'LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE."?type=audio&amp;id=".$value->ID,
  391. 'Title'=>$value->Title,'ImageIcons'=>$imageicons);
  392. }
  393. $listelementsarr[] = $listsection;
  394. $bottomlinks[] = array('LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE.
  395. "?listtype=all&amp;type=audio",
  396. 'LinkText'=>$S_ALL." ".$S_AUDIO." ".$S_FILES);
  397. }
  398. if($vdata != null) {
  399. $listsection = array();
  400. $listsection['heading'] = count($vdata).$MULTIMEDIA_VIDEO_HEADING;
  401. $listsection['List'] = array();
  402. foreach ($vdata as $value) {
  403. $listsection['List'][] = array(
  404. 'LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE."?type=video&amp;id=".$value->ID,
  405. 'Title'=>$value->Title,
  406. 'ImageIcons'=>array(array(
  407. 'Link'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE."?type=video&amp;id=".$value->ID,
  408. 'src'=>$HTTP_DOCUMENT_ROOT.$IMAGE_PATH.$MULTIMEDIA_VIDEO_IMG,
  409. 'alt'=>$value->Title)));
  410. }
  411. $listelementsarr[] = $listsection;
  412. $bottomlinks[] = array('LinkPath'=>$HTTP_DOCUMENT_ROOT.$MULTIMEDIA_DIR.$MULTIMEDIA_FILE.
  413. "?listtype=all&amp;type=video",
  414. 'LinkText'=>$S_ALL." ".$S_VIDEO." ".$S_FILES);
  415. }
  416. $smarty->assign('listelementsarr',$listelementsarr);
  417. }
  418. }
  419. $smarty->assign('bottomnote',$S_NOTE_MULTIMEDIA);
  420. UtilSmarty::displaySectionPage($smarty);
  421. ?>
  422. <?php require_once $SERVER_DIRECTORY.$INCLUDE_PATH.$FOOTER; ?>

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