custom repacement tag call
custom repacement tag call
hello
you have created your own replacement tag!? i will start in the next days an add-on area at the docu site! so if you have one send it to me with an short discription. and i will publish it at the docu site. but please only send RT's wich will work as external solution in the frontend_render folder.
the e-mail adress you will find at the docu page (imprint)
you have created your own replacement tag!? i will start in the next days an add-on area at the docu site! so if you have one send it to me with an short discription. and i will publish it at the docu site. but please only send RT's wich will work as external solution in the frontend_render folder.
the e-mail adress you will find at the docu page (imprint)
add on section in the docu / add on section in der docu
hello
today i open the add on section! i will hope that i will get new tags in the future
http://www.phpwcms-docu.de/add_on_en.phtml
-------
hallo
heute habe ich die add on ecke auf der docuseite eröffnet. hoffe das der eine oder andere zum aufbau etwas dazu beiträgt!
http://www.phpwcms-docu.de/add_on_de.phtml
today i open the add on section! i will hope that i will get new tags in the future

http://www.phpwcms-docu.de/add_on_en.phtml
-------
hallo
heute habe ich die add on ecke auf der docuseite eröffnet. hoffe das der eine oder andere zum aufbau etwas dazu beiträgt!

http://www.phpwcms-docu.de/add_on_de.phtml
Re: add on section in the docu / add on section in der docu
In this page:Pappnase wrote:hello
today i open the add on section! i will hope that i will get new tags in the future
http://www.phpwcms-docu.de/add_on_en.phtml
-------
hallo
heute habe ich die add on ecke auf der docuseite eröffnet. hoffe das der eine oder andere zum aufbau etwas dazu beiträgt!
http://www.phpwcms-docu.de/add_on_de.phtml
http://www.phpwcms-docu.de/add_on_repla ... s_en.phtml
Not "Languagesettings"?To change the date language and format please check this link. Languagesettngs.
A Special thank to KUBENS who create this Tag for the docupage.
Tnx, Paul
Not frontend render
Hi Pappnase
It is not frontend_render implemented but is this what you're talking about?
http://www.phpwcms.de/forum/viewtopic.php?p=30787
Saludos
It is not frontend_render implemented but is this what you're talking about?
http://www.phpwcms.de/forum/viewtopic.php?p=30787
Saludos
1.3 out, testing, testing...
Sponsoring 4 phpwcms Blog and Usermanagement
Sponsoring 4 phpwcms Blog and Usermanagement
Re: Not frontend render
hello marcosKosse wrote:Hi Pappnase
It is not frontend_render implemented but is this what you're talking about?
http://www.phpwcms.de/forum/viewtopic.php?p=30787
Saludos
thansk for the link but as i say without source changes! and when you need to add something into frontfunc it's an source change

Good luck with it
Sorry Pappnase, I thought I might be a little too "anxious" by posting it, I edited the post and maybe in a near future I'll be able to do it the "proper" way...
Good luck with your issue, I think it is the good way to do it.
Good luck with your issue, I think it is the good way to do it.
1.3 out, testing, testing...
Sponsoring 4 phpwcms Blog and Usermanagement
Sponsoring 4 phpwcms Blog and Usermanagement
-
- Posts: 67
- Joined: Tue 22. Jun 2004, 19:54
- Contact:
hey guys, not being too familiar with PHP, I was wondering if someone can post an easy example to see what the file should look like. I have done a few replacement tags in front.func.inc but I have no Idea about how to format the stuff so it works from the frontend_render folder.
If someone could please post a frontend_render folder equivalent to the {image} tag, that would be greatly appreaciated, cause then i could see what the difference would be and I can port my tags over to this format.
My current replacement tags include:
Pop-Up Window Button : Iserts a booton that when clicked laches the link in a pop-up window.
Flash Embbeder: Inserts a flash file via replacement tag which allows for greater custimaztion
Mp3 Player: Inserts a flash based MP3 player which plays the mp3 file of your choice
FLV Loader: Inserts a movie player that streams flash video files.
Flash Based Image Viewer: It's a flash movie that loads any given flash files into itself. It preloads the file and and allows for additional stuff like watermarking without actually modifying the image file itself.
RSS Parser: grabs and parses articles from any rss url and iserts the the desired number of links onto the article. (I use this to showcase the latest articles from various websites.)
If someone could please post a frontend_render folder equivalent to the {image} tag, that would be greatly appreaciated, cause then i could see what the difference would be and I can port my tags over to this format.
My current replacement tags include:
Pop-Up Window Button : Iserts a booton that when clicked laches the link in a pop-up window.
Flash Embbeder: Inserts a flash file via replacement tag which allows for greater custimaztion
Mp3 Player: Inserts a flash based MP3 player which plays the mp3 file of your choice
FLV Loader: Inserts a movie player that streams flash video files.
Flash Based Image Viewer: It's a flash movie that loads any given flash files into itself. It preloads the file and and allows for additional stuff like watermarking without actually modifying the image file itself.
RSS Parser: grabs and parses articles from any rss url and iserts the the desired number of links onto the article. (I use this to showcase the latest articles from various websites.)
Ibis Fernandez
Cinestar Filmworks
http://flashfilmmaker.com
http://cinestarfilmworks.com
Author of Macromedia Flash Animation and Cartooning: A Creative Guide
Cinestar Filmworks
http://flashfilmmaker.com
http://cinestarfilmworks.com
Author of Macromedia Flash Animation and Cartooning: A Creative Guide
Hi Ibiz...you say you have them working already in front.func?
Should be relatively easy to port to frontend_render....similar syntax...sometimes need to buffer.
if you have some urls and want to post code for each I....(and I guess others) would be interested in taking a look
.....
btw, have always enjoyed your unique sites.
Should be relatively easy to port to frontend_render....similar syntax...sometimes need to buffer.
if you have some urls and want to post code for each I....(and I guess others) would be interested in taking a look

btw, have always enjoyed your unique sites.

-
- Posts: 67
- Joined: Tue 22. Jun 2004, 19:54
- Contact:
yes i have them working and some of them are already posted in the mods section. And yes Im sure the conversion will be fairly easy, which is why Im looking for someone to give me a sample of how they would go about convertingting the {image} tag... which I feel is the easiest, and that that way I can tell them appart from the front.func.inc version...
I really like the idea of providing these mods in this format cause I hate having to respond to every little silly thing... where does this go blah blah blah... and had I know this was available I would have done them this way the first time around.
Anywho thanks for the kind words and your offer to help.
One of the tags is as follows:
this one calls a file called flashctrl.swf and loads it along with the movie I wanted. The functionality is that it preloads the movie based on the users brodbad or low band speed and has a nifty VCR style controls... very useful for quickly adding tutorials and stuff I dont have to worry about creating preloaders, or navigation stuff, I just iupload my swf and emmbed it using the tag. The ctrol file does the rest.
I really like the idea of providing these mods in this format cause I hate having to respond to every little silly thing... where does this go blah blah blah... and had I know this was available I would have done them this way the first time around.
Anywho thanks for the kind words and your offer to help.
One of the tags is as follows:
Code: Select all
// FLASH Loader Replacement tag (Requires flashcntrl.swf to exist in include folder!)
$search[33] = '/\{FLASHLOADER:(.*),(.*?)x(.*?)\}/';
$replace[33] = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="$2" height="$3"><param name="movie" value="/include/flashcntrl.swf?movie=$1"><param name="quality" value="high"><embed src="/include/flashcntrl.swf?movie=$1" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="$2" height="$3"></embed></object>';
Ibis Fernandez
Cinestar Filmworks
http://flashfilmmaker.com
http://cinestarfilmworks.com
Author of Macromedia Flash Animation and Cartooning: A Creative Guide
Cinestar Filmworks
http://flashfilmmaker.com
http://cinestarfilmworks.com
Author of Macromedia Flash Animation and Cartooning: A Creative Guide
Hi Ibis
You could try someting like this (placing in frontend_render folder):
This version uses FlashVars which is the equivalent of the ?get syntax.
I remember reading somewher of a server-side php class that reads the swf header info and returns height, width, framerate, etc.....would be nice to incorporate this, so that you would not have to embed width and height params, other than if you wanted to override defaults...will go looking for this again.

UPDATE: found it:
http://www.phpclasses.org/browse/package/1653.html
SWF header parser
You could try someting like this (placing in frontend_render folder):
Code: Select all
Syntax:
{FLASHLOADER:mySwf.swf:width: height}
function embedFlashLoader($swf,$width,$height){
$embedString = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"";
$embedString .= " codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\"";
$embedString .= " width=\"".$width."\" height=\"".$height."\">";
$embedString .= " <param name=\"movie\" value=\"/include/flashcntrl.swf\">";
$embedString .= " <param name=\"quality\" value=\"high\">";
$embedString .= " <param name=\"FlashVars\" value=\"movie=".$swf."\">";
$embedString .= " <embed src=\"/include/flashcntrl.swf\" width=\"".$width."\" height=\"".$height."\"";
$embedString .= " quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"";
$embedString .= " type=\"application/x-shockwave-flash\" flashvars=\"movie=".$swf."\"></embed></object>";
return $embedString;
}
if(!( strpos($content["all"],'{FLASHLOADER:')===false ) ) {
$content["all"] = preg_replace('/\{FLASHLOADER:(.*?):(\d*):(\d*)\}/e','embedFlashLoader("$1","$2","$3");',$content["all"]);
}
I remember reading somewher of a server-side php class that reads the swf header info and returns height, width, framerate, etc.....would be nice to incorporate this, so that you would not have to embed width and height params, other than if you wanted to override defaults...will go looking for this again.

UPDATE: found it:
http://www.phpclasses.org/browse/package/1653.html
SWF header parser
This class is meant to parse the header of Shockwave Flash animation files (.swf) to extract metadata information like the width and height of animation, compression status and uncompressed size, frame rate and total number of frames.
This class parses Flash files using only PHP code, so no special extension is necessary.
Supports both, compressed and uncompressed SWF Flash movies
-
- Posts: 67
- Joined: Tue 22. Jun 2004, 19:54
- Contact:
excellent work man on both account, I'll give it a shot and post my final mods here or where ever they are most appropriate... go get som sleep right now though so you may not hear from me for a good 12 hours or so LOL.... 
I'll give it a shot as soon as i get rid of this damn pesky need for something as pointless as sleeping LOL.
Thanks!

I'll give it a shot as soon as i get rid of this damn pesky need for something as pointless as sleeping LOL.
Thanks!
Ibis Fernandez
Cinestar Filmworks
http://flashfilmmaker.com
http://cinestarfilmworks.com
Author of Macromedia Flash Animation and Cartooning: A Creative Guide
Cinestar Filmworks
http://flashfilmmaker.com
http://cinestarfilmworks.com
Author of Macromedia Flash Animation and Cartooning: A Creative Guide
OK...got an alternative version that does not require entering width and height dimensions. It uses the class as mentioned, which reads swf- header information in binary format. I tweaked the class a wee bit to return only width dnd height parameters. It does require you to place the class file in your flash directory and call it via:
include ("flash/swfheader_wcms.class.php");
Here is REP TAG code:
Here is code for swfheader_wcms.class.php, a wee bit long, but should be a copy and paste situation:
UPDATE: to get width and height do not use this class
- read further on in this thread - recommendation by OliG
leaving it here if other paramaters (for other scripts) need these to be extracted - jsw_nz
Hope this helps 
include ("flash/swfheader_wcms.class.php");
Here is REP TAG code:
Code: Select all
{SWFLOADER:fileName.swf}
// uses base.swf as assumed name for the base swf (change to suit)
function embedBaseLoader($loadExtSwf){
include ("flash/swfheader_wcms.class.php");
$swf = new swfheader();
$dimensions = $swf->getDimensions("flash/base.swf");
$dimensions_array = explode("|",$dimensions);
$width=$dimensions_array[0];
$height=$dimensions_array[1];
$embedString = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"";
$embedString .= " codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\"";
$embedString .= " width=\"".$width."\" height=\"".$height."\">";
$embedString .= " <param name=\"movie\" value=\"flash/base.swf\">";
$embedString .= " <param name=\"quality\" value=\"high\">";
$embedString .= " <param name=\"FlashVars\" value=\"movie=".$loadExtSwf."\">";
$embedString .= " <embed src=\"flash/base.swf\" width=\"".$width."\" height=\"".$height."\"";
$embedString .= " quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"";
$embedString .= " type=\"application/x-shockwave-flash\" flashvars=\"movie=".$loadExtSwf."\"></embed></object>";
return $embedString;
}
if(!( strpos($content["all"],'{SWFLOADER:')===false ) ) {
$content["all"] = preg_replace('/\{SWFLOADER:(.*?)\}/e','embedBaseLoader("$1");',$content["all"]);
}
?>
Here is code for swfheader_wcms.class.php, a wee bit long, but should be a copy and paste situation:
UPDATE: to get width and height do not use this class
- read further on in this thread - recommendation by OliG
leaving it here if other paramaters (for other scripts) need these to be extracted - jsw_nz
Code: Select all
<?PHP
//-----------------------------------------------------------------------------
// SWF HEADER - version 1.0
// Small utility class to determine basic data from a SWF file header
// Does not need any php-flash extension, based on raw binary data reading
//-----------------------------------------------------------------------------
// SWFHEADER CLASS - PHP SWF header parser
// Copyright (C) 2004 Carlos Falo Hervás
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//-----------------------------------------------------------------------------
class swfheader {
var $debug ; // Output DEBUG info
var $fname ; // SWF file analyzed
var $magic ; // Magic in a SWF file (FWS or CWS)
var $compressed ; // Flag to indicate a compressed file (CWS)
var $version ; // Flash version
var $size ; // Uncompressed file size (in bytes)
var $width ; // Flash movie native width
var $height ; // Flash movie native height
var $valid ; // Valid SWF file
var $fps ; // Flash movie native frame-rate
var $frames ; // Flash movie total frames
//---------------------------------------------------------------------------
// swfheader($debug) : Constructor, basically does nothing but initilize
// debug and data fields
//---------------------------------------------------------------------------
function swfheader($debug = false) {
$this->debug = false ;
$this->init() ;
}
//---------------------------------------------------------------------------
// init() : initialize the data fields to "empty" values
//---------------------------------------------------------------------------
function init() {
$this->valid = false ;
$this->fname = "" ;
$this->magic = "" ;
$this->compressed = false ;
$this->version = 0 ;
$this->width = 0 ;
$this->height = 0 ;
$this->size = 0 ;
$this->frames = 0 ;
$this->fps[] = Array() ;
}
//---------------------------------------------------------------------------
// loadswf($filename) : loads $filename and stores data from it's header
//---------------------------------------------------------------------------
function getDimensions($filename) {
$this->fname = $filename ;
$fp = @fopen($filename,"rb") ;
if ($fp) {
$this->magic = fread($fp,3) ;
if ($this->magic!="FWS" && $this->magic!="CWS") {
$this->valid = 0 ;
} else {
// Compression
if (substr($this->magic,0,1)=="C") $this->compressed = true ;
else $this->compressed = false ;
// version
$this->version = ord(fread($fp,1)) ;
// Size
$lg = 0 ;
// 4 LSB-MSB
for ($i=0;$i<4;$i++) {
$t = ord(fread($fp,1)) ;
$lg += ($t<<(8*$i)) ;
}
$this->size = $lg ;
// RECT... we will "simulate" a stream from now on... read remaining file
$buffer = fread($fp,$this->size) ;
if ($this->compressed) {
// First decompress GZ stream
$buffer = gzuncompress($buffer,$this->size) ;
}
$b = ord(substr($buffer,0,1)) ;
$buffer = substr($buffer,1) ;
$cbyte = $b ;
$bits = $b>>3 ;
$cval = "" ;
// Current byte
$cbyte &= 7 ;
$cbyte<<= 5 ;
// Current bit (first byte starts off already shifted)
$cbit = 2 ;
// Must get all 4 values in the RECT
for ($vals=0;$vals<4;$vals++) {
$bitcount = 0 ;
while ($bitcount<$bits) {
if ($cbyte&128) {
$cval .= "1" ;
} else {
$cval.="0" ;
}
$cbyte<<=1 ;
$cbyte &= 255 ;
$cbit-- ;
$bitcount++ ;
// We will be needing a new byte if we run out of bits
if ($cbit<0) {
$cbyte = ord(substr($buffer,0,1)) ;
$buffer = substr($buffer,1) ;
$cbit = 7 ;
}
}
// O.k. full value stored... calculate
$c = 1 ;
$val = 0 ;
// Reverse string to allow for SUM(2^n*$atom)
$tval = strrev($cval) ;
for ($n=0;$n<strlen($tval);$n++) {
$atom = substr($tval,$n,1) ;
if ($atom=="1") $val+=$c ;
// 2^n
$c*=2 ;
}
// TWIPS to PIXELS
$val/=20 ;
switch ($vals) {
case 0:
// tmp value
$this->width = $val ;
break ;
case 1:
$this->width = $val - $this->width ;
break ;
case 2:
// tmp value
$this->height = $val ;
break ;
case 3:
$this->height = $val - $this->height ;
break ;
}
$cval = "" ;
}
// Frame rate
$this->fps = Array() ;
for ($i=0;$i<2;$i++) {
$t = ord(substr($buffer,0,1)) ;
$buffer = substr($buffer,1) ;
$this->fps[] = $t ;
}
// Frames
$this->frames = 0 ;
for ($i=0;$i<2;$i++) {
$t = ord(substr($buffer,0,1)) ;
$buffer = substr($buffer,1) ;
$this->frames += ($t<<(8*$i)) ;
}
fclose($fp) ;
$this->valid = 1 ;
}
} else {
$this->valid = 0 ;
}
if ($this->valid) {
$this_width = $this->width;
$this_height = $this->height;
$swf_dimensions=$this->width."|".$this->height;
return $swf_dimensions;
}
}
}
?>

Last edited by jsw_nz on Mon 1. Aug 2005, 02:15, edited 3 times in total.