Classification_Types); if (empty($types)) return ''; $typecase = ''; foreach ($types as $key=>$type) $typecase .= "WHEN c.type = '$type' THEN $key "; $sql = "SELECT c.*, " ." CASE $typecase ELSE 9 END AS typseq " ." FROM #__downloads_classify AS c " ." INNER JOIN #__downloads_file_classify AS fc ON c.id = fc.classify_id " ." WHERE c.published != 0 AND c.hidden = 0 AND fc.file_id = $id ORDER BY typseq, c.name"; $items = remositoryRepository::doSQLget($sql, 'remositoryClassification'); foreach ($items as $item) $typelist[$item->type][] = $item; $mainHTML = ''; if (isset($typelist)) foreach ($typelist as $type=>$classlist) $mainHTML .= $this->relatedDocsType ($type, $classlist); if ($mainHTML) return <<RELATED DOCUMENTS

This report falls under the following categories. Click on a link below to explore similar documents.

$mainHTML
RELATED_DOCS; } protected function relatedDocsType ($type, $items) { if (0 == count($items)) return ''; foreach ($items as $item) $links[] = $this->repository->RemositoryFunctionURL('classify', $item->id).htmlspecialchars($item->name).''; $itemlist = implode (', ', $links); return << $type: $itemlist TYPE_HTML; } protected function showComment (&$legend, &$comment) { echo "\n\t\t\t
$legend
"; $legend = ''; if ($this->tabcnt == 0) $class = 'remositorylight'; else $class='remositorydark'; echo "\n\t\t\t
$comment->name $comment->date $comment->comment
"; $this->tabcnt = ($this->tabcnt+1) % 2; } protected function commentBox ($file) { $action = $this->repository->RemositoryBasicFunctionURL('fileinfo',$file->id); echo "
"; echo "\n\t\t\t
"._DOWN_YOUR_COMM; echo '

'._DOWN_MAX_COMM.'

'; echo '
'; echo ""; echo "\n\t\t\t"; echo "\n\t\t\t"; echo "\n\t\t\t
"; } protected function immediateDisplay ($file, $displaynow) { $interface = remositoryInterface::getInstance(); if (2 == $displaynow) { $link = $this->repository->RemositoryRawFunctionURL('fileinfo', $file->id).'&displaynow=1'; $link = $interface->sefRelToAbs($link); $linktext = _DOWN_DISPLAY_NOW; $linkimage = $this->repository->RemositoryImageURL('monitor-info.png',48,48); echo << $linkimage $linktext DISPLAY_LINK; } else { $downlink = $interface->getCfg('live_site').'/'.$this->repository->RemositoryRawFunctionURL('download',$file->id); echo << getCfg('live_site')."/components/com_remository/xspf_player/xspf_player_slim.swf?song_url=$link&autoload=true&autoplay=true&song_title=".urlencode($title); ?> is_video(); $is_audio = $file->is_audio(); $av_no_download = (($is_video AND !$this->repository->Video_Download) OR ($is_audio AND !$this->repository->Audio_Download)) ? true : false; $file->setMetaData(); $thumbnails = new remositoryThumbnails($file); $this->pathwayHTML($file->getContainer()); $file->showCMSPathway(); $forbidden = $file->downloadForbidden($this->remUser, $message); if ($forbidden) { if (!$this->repository->See_Files_no_download) { echo $message; return; } $autodown = 0; $displaynow = 0; } $downloadstuff = $file->filetitle.' '; $usersubmitstuff = ''; if ($file->updatePermitted($this->remUser)) { $usersubmitstuff .= "\n\t\t\t

"; $usersubmitstuff .= $this->repository->RemositoryFunctionURL('userupdate',$file->id); $usersubmitstuff .= $this->repository->RemositoryImageURL('edit.gif',32,32); $usersubmitstuff .= _DOWN_UPDATE_SUB.'

'; } if ($file->deletePermitted($this->remUser)) { $deletestuff = "\n\t\t\t

"; $deletestuff .= $this->repository->RemositoryFunctionURL('userdelete',$file->id); $deletequery = _DOWN_DELETE_SURE; $deletestuff = str_replace('repository->RemositoryImageURL('edit.gif',32,32); $deletestuff .= _DOWN_DEL_SUB_BUTTON.'

'; $usersubmitstuff .= $deletestuff; } $thumbupdatestuff = ''; if ($this->repository->Max_Thumbnails) { if ($file->updatePermitted($this->remUser)) { $thumbupdatestuff .= "\n\t\t\t

"; $thumbupdatestuff .= $this->repository->RemositoryFunctionURL('thumbupdate',$file->id); $thumbupdatestuff .= $this->repository->RemositoryImageURL('edit.gif',32,32); $thumbupdatestuff .= _DOWN_UPDATE_THUMBNAILS.'

'; } } $thumbimages = $thumbnails->displayAllThumbnails(); echo "\n\t
"; $this->showDownloadAccount($file); $syndstyle = (remositoryRepository::GetParam($_GET, 'syndstyle', '') == 'yes'); if (!$forbidden AND $file->isAffordable($this->remUser)) { echo "\n"; ?> window.onload=download; '; if ($autodown AND $syndstyle) { echo '

In Firefox you can drag and drop the "Download" link to the "Install HTTP URL" box above, in IE you have to right click on "Download" and use "Copy shortcut" and paste into the box above, then click the "Upload URL & Install" button

'; } if (!$av_no_download OR !$autodown) { $downloadstuff .= $file->downloadLink($autodown); $downloadstuff .= $this->repository->RemositoryImageURL('download_trans.gif'); $downloadstuff .= ' '.((!$autodown AND ($is_video OR $is_audio)) ? _DOWN_PLAY : _DOWNLOAD).''; } } else $downloadstuff .= $forbidden ? $message : $this->repository->RemositoryImageURL('download_trans.gif')._DOWN_TOO_FEW_CREDITS; echo "\n\t\t

$downloadstuff

"; $thankyou = ($is_audio OR $is_video) ? _DOWN_PLAY_THANK_YOU : _DOWN_THANK_YOU; if ($autodown) { echo '

'.$thankyou.htmlspecialchars($file->filetitle).'

'; if (!$syndstyle) { if ($is_video) $avhtml = $interface->triggerMambots('remositoryVideoPlayer', array($file->basicDownloadLink($autodown), $file->filetitle)); elseif ($is_audio) $avhtml = $interface->triggerMambots('remositoryAudioPlayer', array($file->basicDownloadLink($autodown), $file->filetitle)); if (!empty($avhtml)) echo $avhtml[0]; else echo '

'._DOWN_WAIT_OR_CLICK.'

'; } if ($file->download_text) $dltext = $file->download_text; else $dltext = $this->repository->download_text; echo << {$this->translateDefinitions($dltext)}
DOWNLOAD_TEXT; } if ($thumbupdatestuff OR $thumbimages OR $usersubmitstuff) { echo "\n\t\t
"; echo "\n\t\t\t
"; if ($thumbimages) echo "\n\t\t\t

"._DOWN_THUMBNAILS."

"; if ($thumbupdatestuff) echo $thumbupdatestuff; if ($usersubmitstuff) echo $usersubmitstuff; echo '
'; echo "$thumbimages"; echo "\n\t\t"; echo "\n\t\t
"; } echo "\n\t\t
"; if ($this->remUser->isAdmin()) $this->fileOutputBox(_DOWN_PUB, ($file->published ? _YES : _NO)); if ($file->description) $this->fileOutputBox(_DOWN_DESC, $file->description, false); /* if (($file->licenseagree==0) AND ($file->license<>'')) $this->fileOutputBox (_DOWN_LICENSE, $file->license); if ($file->submitdate<>'') $this->fileOutputBox (_DOWN_SUB_DATE, date ($this->repository->Date_Format, $this->controller->revertFullTimeStamp($file->submitdate))); if ($file->submittedby<>'') { $submitter = new remositoryUser($file->submittedby,null); $subnames = $submitter->fullname().' ('.$submitter->name.')'; if ($this->remUser->isLogged() AND $this->repository->Profile_URI) { $uri = sprintf($this->repository->Profile_URI, $this->remUser->id); $uri = remositoryInterface::getInstance()->sefRelToAbs($uri); $subnames = ''.$subnames.''; } $this->fileOutputBox (_DOWN_SUB_BY, $subnames); } if ($file->filedate<>'') $this->fileOutputBox (_DOWN_FILE_DATE, date($this->repository->Date_Format,$this->controller->revertFullTimeStamp($file->filedate))); if ($file->fileauthor<>'') $this->fileOutputBox (_DOWN_FILE_AUTHOR, $file->fileauthor); if ($file->fileversion<>'') $this->fileOutputBox (_DOWN_FILE_VER, $file->fileversion); if ($file->filesize<>'') $this->fileOutputBox (_DOWN_FILE_SIZE, $file->filesize); if ($file->filetype<>'') $this->fileOutputBox (_DOWN_FILE_TYPE, $file->filetype); if ($file->filehomepage<>'') $this->URLDisplay (_DOWN_FILE_HOMEPAGE, $file->filehomepage); $this->fileOutputBox (_DOWN_DOWNLOADS, $file->downloads); */ $this->showFileDetails ($file, $this->remUser, 'D'); if ($this->repository->Allow_Votes) $this->voteDisplay($file, true); // The following block of code provides the comment facility // If you want to replace it with Jom Comment, remove this block and replace it with: // $interface = remositoryInterface::getInstance(); // include_once($interface->getCfg('absolute_path').'/mambots/content/jom_comment_bot.php'); // echo jomcomment($file->id, "com_remository"); // End of code block // For Joomla 1.5+ replace the name "mambots" by "plugins" in the code above if ($this->repository->Allow_Comments) { $commentsdb = remositoryComment::getComments($file->id); if ($commentsdb){ $this->tabcnt = 1; $legend = _DOWN_COMMENTS; foreach ($commentsdb as $comment) $this->showComment($legend, $comment); } else { $legend = $this->remUser->isLogged() ? _DOWN_FIRST_COMMENT : _DOWN_FIRST_COMMENT_NL; $this->fileOutputBox('', ''.$legend.''); } if ($this->remUser->isLogged()) $this->commentBox($file); // include_once('components/com_reviews/reviews.class.php'); // include_once('components/com_reviews/reviews.html.php'); // echo HTML_reviews::listItemCommentsHTML('com_remository',$file->id); // echo HTML_reviews::solicitCommentHTML('com_remository', $file->id, "&func=fileinfo&id=$file->id"); } // End of code for Remository comment facility echo "\n\t
"; $related = $this->relatedDocs($file->id); if ($related) echo << $related RELATED; echo "\n\t"; echo "\n\t"; if ($file->plaintext) { echo "\n\t\t
"; highlight_string($file->getPlainText()); echo "\n\t\t
"; } if (!$forbidden AND $displaynow) $this->immediateDisplay($file, $displaynow); echo "\n\t\t
"; } protected function show_smalldesc ($file) { // Suppress small description regardless of customization, since full description is shown } protected function show_vote_value ($file, $terminate=true) { // Suppress read only version of vote display, regardless of customization // since this is handled in a different way here } protected function show_submittedby ($file) { // Override common version for detailed information page, may link to profile if ($file->submittedby) { $submitter = remositoryUser::getUser($file->submittedby); $subnames = $submitter->fullname().' ('.$submitter->name.')'; if ($file->submittedby AND $this->repository->Profile_URI) { $uri = sprintf($this->repository->Profile_URI, $file->submittedby); $uri = remositoryInterface::getInstance()->sefRelToAbs($uri); $subnames = ''.$subnames.''; } $this->fileOutputBox (_DOWN_SUB_BY, $subnames); } } protected function showDownloadAccount ($file) { $downthis = sprintf(_DOWN_THIS_FILE_TODAY, $this->remUser->downloadCount($file->id), $this->remUser->maxDownloadsOneFile()); $downall = sprintf(_DOWN_ALL_FILES_TODAY, $this->remUser->totalDown(), $this->remUser->maxDownloadsAllFiles()); $saycredit = _REMOSITORY_USE_CREDITS ? sprintf(_DOWN_YOUR_CREDITS, $this->remUser->creditsAvailable()) : ''; echo << $downthis
$downall
{$this->showDownloadCredits($saycredit)} DOWNLOAD_ACCOUNT; } protected function showDownloadCredits ($credit) { if (_REMOSITORY_USE_CREDITS) return << $credit SHOW_CREDITS; } }