1
Guys, Something has changed in XOOPS 2.4.2 compared to 2.3.3 to cause a problem with files linked to SmartSection 2.13 articles. See
this page on my site as an example. As you can see, the first linked file is fubar; it displays normally on my 2.3.3 test site on the same server. The template (smartsection_item.html) code that displays the linked files is this:
<{foreach item=file from=$item.files}>
<tr>
<td valign="middle" class="odd" align="left">
<a href="<{$xoops_url}>/modules/smartsection/visit.php?fileid=<{$file.fileid}>" target="_blank"><img src="<{$smartsection_url}>images/icon/file.gif" title="<{$lang_download_file}>" alt="<{$lang_download_file}>"/> <b><{$file.name}>b>a>
<div><{$file.description}>div >
<td valign="middle" class="odd" align="center"><{$file.datesub}>td>
<td valign="middle" class="odd" align="center"><{$file.hits}>td>
tr>
<{/foreach}>
visit.php, the file references above is:
/**
* $Id: visit.php,v 1.2 2005/08/29 17:17:37 malanciault Exp $
* Module: SmartSection
* Author: marcan
* Licence: GNU
*/
include_once "header.php";
$fileid = isset($_GET['fileid']) ? intval($_GET['fileid']) : 0;
// Creating the item object for the selected item
$fileObj = $smartsection_file_handler->get($fileid);
$fileObj->updateCounter();
if (!preg_match("/^ed2k*:///i", $fileObj->getFileUrl())) {
Header("Location: " . $fileObj->getFileUrl());
}
echo "Refresh" content="0; URL=".$myts->oopsHtmlSpecialChars($fileObj->getFileUrl())."">";
exit();
?>
The php code (from item.php) is this, I think:
// Creating the files object associated with this item
$filesObj = $itemObj->getFiles();
$files = array();
$embeded_files = array();
foreach($filesObj as $fileObj)
{
if ($fileObj->mimetype() == 'application/x-shockwave-flash') {
$file['content'] = $fileObj->displayFlash();
if (strpos($item['maintext'], '[flash-' . $fileObj->getVar('fileid') . ']')) {
$item['maintext'] = str_replace('[flash-' . $fileObj->getVar('fileid') . ']', $file['content'], $item['maintext']);
} else {
$embeded_files[] = $file;
}
unset($file);
} else {
$file['fileid'] = $fileObj->fileid();
$file['name'] = $fileObj->name();
$file['description'] = $fileObj->description();
$file['name'] = $fileObj->name();
$file['type'] = $fileObj->mimetype();
$file['datesub'] = $fileObj->datesub();
$file['hits'] = $fileObj->counter();
$files[] = $file;
unset($file);
}
}
$item['files'] = $files;
$item['embeded_files'] = $embeded_files;
And before anyone asks, the database is correct; the files are referenced as they should be and adding a new file to the article causes the fubar one to display correctly. Ideas?