Closed (duplicate)
Project:
Inline
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Oct 2005 at 04:13 UTC
Updated:
11 Aug 2009 at 18:52 UTC
Jump to comment: Most recent file
Comments
Comment #1
jo1ene commentedI second this.
Comment #2
mimetic commentedI really don't know how to add this, but I've added SWF support and left/right to the inline module. It's a little bit crude and certainly could be improved, but it seems to work. It would be quite easy to keep going and add in mpg or mov or mp3. Mp3 might be the next mod, since I need to play those, too.
I've attached my version of inline. Here the changes:
- function inline_nodeapi, line 84 ( if (preg_match_all("/\[(inline|file|attachment).... )
- line 88, $dimensions = $match[4][$key];
- line 92, $notattachment = ($mytype == "inline" | $mytype == "swf");
- line 94, $replace = theme('inline_html', $inline_file[0], $inline_file[1], $titl, $notattachment, $align, $dimensions);
then function theme_inline_html is changed quite a bit to accomodate left/right, as well as the SWF.
Perhaps someone with known-how will add these changes into the module? It's beyond me how to manage the collaboration parts.
Comment #3
mimetic commentedRats! I forgot to mention...you have to comment OUT the following in includes/file.inc, so that the upload module allows you to upload .swf files. (Thanks to someone on this forum for that clue!). The code is around line 157 in my installation:
if (((substr($file->filemime, 0, 5) == 'text/' || strpos($file->filemime, 'javascript')) && (substr($file->filename, -4) != '.txt')) || preg_match('/\.(php|pl|py|cgi|asp)$/i', $file->filename)) {
$file->filemime = 'text/plain';
rename($file->filepath, $file->filepath .'.txt');
$file->filepath .= '.txt';
$file->filename .= '.txt';
}
Put /* and */ around this code, so PHP ignores it!
David (dgross@mimetic.com)
Comment #4
sun^^ you do not want to comment this function in
common.inc. For production sites, especially sites with open user registration and/or role access to file uploads, you really do not want to comment this out. If you did it, you'll be probably safe if you'll uncomment this function immediately.You might alter
common.incto allow for .swf-file uploads by extending(substr($file->filename, -4) != '.txt')with
(substr($file->filename, -4) != '.swf' && substr($file->filename, -4) != '.txt')in the if statement.
Considering the feature request itself it might be best to integrate pluggable extensions. Extensions would consist of own/special output logic for special media formats and would be placed into a subdirectory of the inline module.
The first two extensions would be document/attachment and image. Both providing separate theming functions and maybe additional logic.
In conjunction with a new inline filter code it maybe should also be possible to change the processing extension by passing a special filter parameter.
Comment #5
sunhttp://drupal.org/node/47543 has been marked as duplicate of this issue.
Comment #6
sunMarking this issue dependent on http://drupal.org/node/80170
Comment #7
sunActually, a duplicate of #80170: Inline API. Other modules that provide other means of dealing with various media can implement hook_inline().