ok, it's not as simple as 1 would think.. but i have managed to get it to upload and display swf images.
there are some issues with it tho, once you have uploaded the swf file, you can then select the file in the select list on the form.. but the image will not display in the admin page.. although if you have selected the correct file from the drop down list, then it will show on the link to us page..
i haven't quite figured out yet how to make 'onchange='showImgSelected()' show an swf file yet.
other than the above issue, it works ok..
there's a BUT tho..
because wf-channel uses XOOPS core class uploader & xoopslists.php then you need to edit 2 of the XOOPS core files.. 1 edit is to remove the @getimagesize check for .swf extensions, otherwise an error: 'Suspicious image upload refused' is displayed. the other edit is to allow function getImgListAsArray() to list .swf extensions in the dropdown box.
now to the edits >
open xoops_root/class/uploader.php
find:
$ext = strtolower( substr( strrchr( $this->savedDestination , '.' ) , 1 ) ) ;
if( in_array( $ext , $this->imageExtensions ) ) {
$info = @getimagesize( $this->savedDestination ) ;
if( $info === false || $this->imageExtensions[ (int)$info[2] ] != $ext ) {
$this->setErrors( 'Suspicious image upload refused' );
@unlink( $this->savedDestination );
return false;
}
}
@chmod($this->savedDestination, $chmod);
return true;
replace with
$ext = strtolower( substr( strrchr( $this->savedDestination , '.' ) , 1 ) ) ;
if($ext !== "swf") {
if( in_array( $ext , $this->imageExtensions ) ) {
$info = @getimagesize( $this->savedDestination ) ;
if( $info === false || $this->imageExtensions[ (int)$info[2] ] != $ext ) {
$this->setErrors( 'Suspicious image upload refused' );
@unlink( $this->savedDestination );
return false;
}
}
}
@chmod($this->savedDestination, $chmod);
return true;
save & close
open xoops_root/class/xoopslists.php
find
function getImgListAsArray($dirname, $prefix="")
{
$filelist = array();
if ($handle = opendir($dirname)) {
while (false !== ($file = readdir($handle))) {
if ( preg_match("/(.gif|.jpg|.png)$/i", $file) ) {
$file = $prefix.$file;
$filelist[$file] = $file;
}
}
closedir($handle);
asort($filelist);
reset($filelist);
}
return $filelist;
}
replace with
function getImgListAsArray($dirname, $prefix="")
{
$filelist = array();
if ($handle = opendir($dirname)) {
while (false !== ($file = readdir($handle))) {
if ( preg_match("/(.gif|.jpg|.png|.swf)$/i", $file) ) {
$file = $prefix.$file;
$filelist[$file] = $file;
}
}
closedir($handle);
asort($filelist);
reset($filelist);
}
return $filelist;
}
save & close.
open wfchannel/index.php
find:
$linktous['banner'] = ($banner == "blank.png" || !$banner) ? '' : $myts->htmlSpecialChars($banner);
replace with
$ext = ltrim(strrchr($banner, '.'), '.');
if ($ext != 'swf')
{
$linktous['is_swf'] = 0;
$linktous['banner'] = ($banner == "blank.png" || !$banner) ? '' : $myts->htmlSpecialChars($banner);
}
else
{
$linktous['is_swf'] = 1;
$linktous['banner'] = $myts->htmlSpecialChars($banner);
}
save & close
open wfchannel/admin/upload.php
find:
$allowed_mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png');
replace with
$allowed_mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'application/x-shockwave-flash');
save & close
open wfchannel/templates/wfchannel_linktous.html
find:
<{if $linktous.banner }>
<p><div align= "left" class = "itemHead"><b><{$lang_displaybanner}>b>div>p>
<p><div align= "left"><b><{$lang_bannerexample}>b>div>
<div><img src='<{$xoops_url}>/<{$linktous.path}>/<{$linktous.banner}>' name='image' id='image' alt='<{$linktous.sitename}>' />div>p>
<div align= "left"><{$lang_displayscript}>div>
<textarea name='lienbt' cols='70' rows='4' wrap='VIRTUAL'><a href='<{$xoops_url}>' target='_blank'><img src='<{$xoops_url}>/<{$linktous.path}>/<{$linktous.banner}>' alt='<{$linktous.sitename}>'>a>textarea>
<{/if}>
replace with
<{if $linktous.banner && $linktous.is_swf == 0}>
<p><div align= "left" class = "itemHead"><b><{$lang_displaybanner}>b>div>p>
<p><div align= "left"><b><{$lang_bannerexample}>b>div>
<div><img src='<{$xoops_url}>/<{$linktous.path}>/<{$linktous.banner}>' name='image' id='image' alt='<{$linktous.sitename}>' />div>p>
<div align= "left"><{$lang_displayscript}>div>
<textarea name='lienbt' cols='70' rows='4' wrap='VIRTUAL'><a href='<{$xoops_url}>' target='_blank'><img src='<{$xoops_url}>/<{$linktous.path}>/<{$linktous.banner}>' alt='<{$linktous.sitename}>'>a>textarea>
<{elseif $linktous.banner && $linktous.is_swf == 1}>
<p><div align= "left" class = "itemHead"><b><{$lang_displaybanner}>b>div>p>
<p><div align= "left"><b><{$lang_bannerexample}>b>div>
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id=index width="468" height="60" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,65,0">
<param name="movie" value="<{$xoops_url}>/<{$linktous.path}>/<{$linktous.banner}>" />
<param name="quality" value="high" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="bgcolor" value="#ffffff" />
<embed src="<{$xoops_url}>/<{$linktous.path}>/<{$linktous.banner}>" width="468" height="60" bgcolor="#f7f187" quality="high" loop="true" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer" />
object>
div>p>
<p><div align= "left"><{$lang_displayscript}>div>
<div><textarea name='lienbt' cols='70' rows='4' wrap='VIRTUAL'><a href='<{$xoops_url}>' target='_blank'><img src='<{$xoops_url}>/<{$linktous.path}>/<{$linktous.banner}>' alt='<{$linktous.sitename}>'>a>textarea>div>p>
<{/if}>
save & close
goto XOOPS modules admin and update the wfchannel module. then clear templates_c folder.
now goto wfchannel admin and then upload settings.. now go through the process of uploading your image file.. then goto the link settings page.. scroll down to the banner section and select the swf file you just uploaded from the list.. (ignore the problem of the swf not displaying when you select it)
once done, you should now be able to see the new swf banner on the link to us page.