I'm trying to add a logo and URL to the info of my project,
unfortunately, I can't seem to find all of the API info to make it
work.
I've generated a project_logo.h file using the logos.h file as a
footprint (tested it by replacing the zend_logo data with my data so I
know it's valid and works)
defined my PROJECT_LOGO_GUID and added my function:
PHP_FUNCTION(project_logo_guid)
{
if (ZEND_NUM_ARGS() != 0) {
WRONG_PARAM_COUNT;
}
RETURN_STRINGL(PROJECT_LOGO_GUID, sizeof(PROJECT_LOGO_GUID)-1, 1);
}
/* }}} */
created my
PHP_FUNCTION(project_info) {
PUTS("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
"DTD/xhtml1-transitional.dtd">\n");
PUTS("<html>");
PUTS("<head>\n");
php_info_print_style(TSRMLS_C);
PUTS("<title>project_info()</title>");
PUTS("</head>\n");
PUTS("<body><div class="center">\n");
php_info_print_box_start(1);
PUTS("<a href=\"http://www.project.net/\"><img border=\"0\" src=\"");
if (SG(request_info).request_uri) {
PUTS(SG(request_info).request_uri);
}
PUTS("?="PROJECT_LOGO_GUID"\" alt=\"project logo\" /></a>\n");
php_printf("<h1 class=\"p\">PROJECT Version %s</h1>\n",
PHP_PROJECT_VERSION_STRING);
php_info_print_box_end();
}
What additional code am I missing?
-- Dale
Hi Dale,
D . Walsh wrote:
I'm trying to add a logo and URL to the info of my project,
unfortunately, I can't seem to find all of the API info to make it
work.
[...]
What additional code am I missing?
You need to register your guid so PHP knows that the given parameter is an
image ID. For registering it you can use the php_register_info_logo()
function http://lxr.php.net/source/php-src/main/php_logos.c#36
You could also use PECL_Gen which afaik supports adding Logos :-)
johannes
Johannes Schlüter Mayflower GmbH / ThinkPHP
http://thinkphp.de http://blog.thinkphp.de
I'm trying to add a logo and URL to the info of my project,
unfortunately, I can't seem to find all of the API info to make it
work.I've generated a project_logo.h file using the logos.h file as a
footprint (tested it by replacing the zend_logo data with my data so I
know it's valid and works)defined my PROJECT_LOGO_GUID and added my function:
PHP_FUNCTION(project_logo_guid)
{
if (ZEND_NUM_ARGS() != 0) {
WRONG_PARAM_COUNT;
}RETURN_STRINGL(PROJECT_LOGO_GUID, sizeof(PROJECT_LOGO_GUID)-1, 1);
}
/* }}} */created my
PHP_FUNCTION(project_info) {
PUTS("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n");
PUTS("<html>");
PUTS("<head>\n");
php_info_print_style(TSRMLS_C);
PUTS("<title>project_info()</title>");
PUTS("</head>\n");
PUTS("<body><div class="center">\n");php_info_print_box_start(1);
PUTS("<a href="http://www.project.net/"><img border="0"
src="");
if (SG(request_info).request_uri) {
PUTS(SG(request_info).request_uri);
}
PUTS("?="PROJECT_LOGO_GUID"" alt="project logo" /></a>\n");
php_printf("<h1 class="p">PROJECT Version %s</h1>\n",
PHP_PROJECT_VERSION_STRING);
php_info_print_box_end();}
What additional code am I missing?
-- Dale
I added the following entry to 'PHP_MINIT_FUNCTION(project)' and it
displays the logo now:
php_register_info_logo(PROJECT_LOGO_GUID , "image/gif", project_logo
, sizeof(project_logo));
is there anything I need to do in 'PHP_MSHUTDOWN_FUNCTION(project)'
-- Dale