Page 2 of 2
Posted: Sun 31. Jul 2005, 03:34
by jsw_nz
ADDENDUM
With regards to the class file, it can be saved to the frontend_init folder as well - either works, although I prefer the include method)
Posted: Sun 31. Jul 2005, 05:17
by Ibis Fernandez
i knew there was a reason why i just wanted to see the code for the simple image tag LOL. All of the suddent it turned into a bunch gibberish to me LOL...
looks good though I'm gonna try and decifer it. and post a zip with all the files together.
Im wondering if modifying that php class file is all that nesessary, maybe it could come in handy for later mods as well.
Yes i agree, I preffer having that sort of stuff in the includes folder as well.
Posted: Sun 31. Jul 2005, 06:24
by jsw_nz
Kind of agree with you...the full class might be beneficial...returns plenty of stuff that might be helpful for filemanager itself. Filesize, compression, version, valid swf, etc....in principle should be able to create a userfriendly tag for clients {FLASH:TITLE_SUBTITLE} or {FLASH:IMAGE} of {FLASH:string}which would do all the rest in embedding object/embed tags for articles....tinkering with the thought

Posted: Sun 31. Jul 2005, 07:17
by Oliver Georgi
do not use the external class - PHP has build-in function returning size of SWF file:
http://www.php.net/manual/function.getimagesize.php
Oliver
Posted: Sun 31. Jul 2005, 08:48
by Ibis Fernandez
I know about that one Oliver but it seems to work only in certain server setups for swf. Provably not much of an issue though cause that was about two years ago, so maybe works its more standardized now... still the class may be useful for some other stuff, either way thanks for bringing it to my attention... I do agree with oliver on this particular instance. Since its just the size we need this built-in function alone should cover it.
(most of my mods involve some kind of flash based functionality so that class file may still come in hady for other stuff LOL)
Posted: Sun 31. Jul 2005, 12:29
by Oliver Georgi
you need GD2 to have SWF working without any problems - and yes only width...
Oliver
Posted: Sun 31. Jul 2005, 14:00
by jsw_nz
Thanks for that tip Oliver..to my embarrassment, I was completely unaware the php is up to speed with regards to reading swf's width and height. So yes, Ibis, the code can be simplified consideralbly, using:
$size = getimagesize($mySwf);
returns this array:
Array ( [0] => 460 [1] => 120 [2] => 13 [3] => width="460" height="120" [mime] => application/x-shockwave-flash )
so basically info can be accessed by
$size [0] returns width
$size [1] returns height
Oliver, while I have your attention, I wanted to ask the status of the multimedia content part in dev releases. Have yet to get swf's (and wmv's) to properly work. Can upload, but they cannot be inserted.
And word on this?
Thanks

Posted: Sun 31. Jul 2005, 19:39
by Oliver Georgi
yes right - there is a bug I have never seen...
...see the comment "// fixed line..."
update file
cnt9.takeval.inc.php
Code: Select all
<?php
/*************************************************************************************
Copyright notice
(c) 2002-2005 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
This script is part of PHPWCMS. The PHPWCMS web content management system is
free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
A copy is found in the textfile GPL.txt and important notices to the license
from the author is found in LICENSE.txt distributed with these scripts.
This script is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
This copyright notice MUST APPEAR in all copies of the script!
*************************************************************************************/
// Content Type Multimedia
$content["media"] = explode(":", $row["acontent_media"]);
$content["media_type"] = isset($content["media"][0]) ? intval($content["media"][0]) : 0;
$content["media_player"] = isset($content["media"][1]) ? intval($content["media"][1]) : 0;
$content["media_src"] = isset($content["media"][5]) ? intval($content["media"][5]) : 0;
$content["media_pos"] = isset($content["media"][2]) ? intval($content["media"][2]) : 0;
$content["media_control"] = isset($content["media"][7]) ? intval($content["media"][7]) : 0;
$content["media_auto"] = isset($content["media"][8]) ? intval($content["media"][8]) : 0;
$content["media_width"] = isset($content["media"][3]) ? $content["media"][3] : '';
$content["media_height"] = isset($content["media"][4]) ? $content["media"][4] : '';
if($content["media_src"]) {
$content["media_id"] = "";
$content["media_name"] = "";
$content["media_extern"]= isset($content["media"][6]) ? base64_decode($content["media"][6]) : '';
} else {
$content['temp_media'] = explode(":", !empty($content["media"][6]) ? base64_decode($content["media"][6]) : ':');
$content["media_id"] = $content['temp_media'][0];
// fixed line - false var was used here
$content["media_name"] = isset($content['temp_media'][1]) ? $content['temp_media'][1] : '';
$content["media_extern"] = "";
}
?>
This should solve all problems for internal media
Oliver
Posted: Mon 1. Aug 2005, 02:08
by jsw_nz
Hi Oliver,
I did plugin the new corrected line for:
cnt9.takeval.inc.php
line 41 was
Code: Select all
$content["media_name"] = isset($content['temp_media'][0]) ? $content['temp_media'][0] : '';
now is:
Code: Select all
$content["media_name"] = isset($content['temp_media'][1]) ? $content['temp_media'][1] : '';
Still experiencing the same problems....basically I can upload swf (gets the swc suffix), but in pop-up filemanger browser window, when I click on swf directory the right panel still says: media files > no file
Still no sure what to make of it.....
Posted: Mon 1. Aug 2005, 06:57
by Oliver Georgi
check CVS - I have fixed that or see:
http://www.phpwcms.org/phpwcms_pre1.2.5-DEV.zip
There is a new value in conf.inc.php where you can edit allowed multimedia file types.
Oliver
Posted: Mon 1. Aug 2005, 07:29
by jsw_nz
all best

Posted: Mon 1. Aug 2005, 07:51
by jsw_nz
Hi Oliver...big thanks on the multimedia content part...now fixed in !.2.5
works like a charm....
got a question/observation regarding the import of swf's.
Any chance the getfilesize("$mySwf.swf) could return default sizes of swf on internal imports?
This way client would not be confused about these parameters...
They upload and insert, without any fuss about dimensions....
an ideal solution might include quering the end-users input..if dimensions are delibeately set in dialogue.....then they would "override" the defaults, else if left blank.....then defaults would be used....
BTW:
thanks for your tip on how php now supports reading swf 'width' and 'height'

Posted: Mon 1. Aug 2005, 11:01
by Oliver Georgi
ah yes, good idea.
Oliver