note 49129 added to function.imagecreatefromstring
| From: | broumbroum84 at hotmail dot com | Date: | Mon, 17 Jan 2005 17:39:29 +0000 |
| Subject: | note 49129 added to function.imagecreatefromstring | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-83508@lists.php.net to get a copy of this message | ||
for use with my SQL class (si mysql_connect() notes further)</PRE>
if(!isset($modules_imageSQL)) {
$modules_imageSQL = 1;
include("php_SQL.class.inc.php");
include("php_image.class.inc.php");
// wrapper class
class ImageSQL extends Image{
var $sql;
function ImageSQL(&$sql,$id=-1) {
$this->Image(NULL);
$this->sql =& $sql;
if($id > -1) {
$this->id = $id;
$this->loadFromSQL($this->sql,$this->id);
}
}
// inherited function loadFromBinary($string,$nom="image");
// inherited function saveToSQL($sql)
// wrapper afficherFormatee()
/*!
@function display
@abstract (description)
@discussion (description)
@param #param 'f'|'h' f for HTML <TABLE> formatted display;
'h' for HTML <IMG> target unformatted;
#options '-nodesc'||'-stdout' -nodesc to avoid description displaying; -stdout
to standard output (simili to print function)
@result HTML string, to be printed. Warning: -stdout option prints DIRECTLY on method call!
*/
function display ($param = 'f',$options="") {
$_options=array();
$mode = 0;
$desc = TRUE;
// options evals
if($active = TRUE)
$_options["-nodesc"] = "stristr(\$options,\"-nodesc\");";
define("OPTION_NODESC",$_options["-nodesc"]);
if($active = TRUE)
$_options["-stdout"] = "stristr(\$options,\"-stdout\");";
define("OPTION_STDOUT",$_options["-stdout"]);
// PARAMS
if($param == 'f') {
$mode = 0;
$desc = TRUE;
}
else if ($param == 'h') {
if(isset($this->file))
return $this->afficher(2);
else if(isset($this->img))
return $this->afficher();
}
// OPTIONS
else if(eval(OPTION_NODESC)) {
$desc = FALSE;
}
else if(eval(OPTION_STDOUT)) {
$mode = 1;
}
else { // param inconnu E_ERROR thrown
trigger_error("Paramètre passé à image->afficher() inconnu!", E_NOTICE);
}
return $this->afficherFormatee($mode,$desc);
}
}
}
</PRE> ;)
----
Manual Page -- http://www.php.net/manual/en/function.imagecreatefromstring.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49129
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49129&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49129&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49129&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49129&report=yes&reason=useless+example
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49129&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49129&report=yes
Search -- http://master.php.net/manage/user-notes.php