コード例 #1
0
ファイル: article.php プロジェクト: severnaya99/Sg-2010
     if (file_exists($maintextfile) && false !== ($fp = fopen($maintextfile, 'r'))) {
         $articletag['maintext'] = fread($fp, filesize($maintextfile));
         fclose($fp);
     }
 }
 // Setup URL link for article
 $articletag['urllink'] = '&nbsp';
 if ($article->url && !$article->urlname) {
     $articletag['urllink'] = "<a href='http://" . $article->url() . "' target='_blank'>Url Link: " . $article->url() . "</a><br />";
 } elseif ($article->urlname) {
     $articletag['urllink'] = "<a href='http://" . $article->url() . "' target='_blank'>Url Link: " . $article->urlname() . "</a><br />";
 }
 //Downloads links
 $workdir = XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'];
 $articletag['downloadlink'] = "<table width='100%' cellspacing = 0 cellpadding = '2'>";
 if ($article->getFilesCount() > 0) {
     foreach ($article->files as $file) {
         if (checkAccess($file->groupid)) {
             $filename = $file->getFileRealName();
             $mimetype = new mimetype();
             $mimeshow = $mimetype->getType(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $filename);
             $icon = get_icon($workdir . "/" . $filename);
             if (is_file(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $filename)) {
                 $size = Prettysize(filesize(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $filename));
             } else {
                 $size = '0';
             }
             if (empty($size)) {
                 $size = '0';
             }
             $accessnot = '';