# project_logo[]

- Thread: https://externals.io/message/15233
- Original archive: https://news-web.php.net/php.internals/15233
- Started by D.Walsh on 2005-02-28T22:52:54+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #15233 — D.Walsh — 2005-02-28T22:52:54+00:00

URL: https://externals.io/message/15233#15233

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

---

## #15234 — Johannes Schlueter — 2005-02-28T23:14:35+00:00

URL: https://externals.io/message/15233#15234 · In reply to: #15233

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

---

## #15235 — D.Walsh — 2005-02-28T23:20:50+00:00

URL: https://externals.io/message/15233#15235 · In reply to: #15233

> 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
