[DONE] Banner image of the character

Added by vl about 6 years ago

A website that generate a banner image that players can add in their forum profile to display public information of his characters.

Something like this for example:


Replies (12)

RE: Banner image of the character - Added by nimetu about 6 years ago

this one needs lot of work (like xml templates with precreated backgrounds perhaps), but...

http://bmsite.net/api/banner.php?key=1224Z0Z1728C7C7

and different posibilities with civ/cult icons
http://bmsite.net/api/banner-test.php

PS! login/logout times does not seem to work, so 'Status: online' is fubar.

PPS! damn php does not do 64bit integers on 32bit platform (for guild icons). luckily mysql helped me out here.

RE: Banner image of the character - Added by vl about 6 years ago

Yeah!

For the login/logout it should work, don't forget that there s a 1h cache so it's hard to see changes.

I perhaps can add an API that display the state of a character.

Could be nice to display the shard name

RE: Banner image of the character - Added by vl about 6 years ago

What I did for php to manage 64b,

I used bcdiv and bcmod to get hi 32bit and lo 32bit number and then use these 2 number to extract things.

http://fr.php.net/manual/en/ref.bc.php

RE: Banner image of the character - Added by nimetu about 6 years ago

login/logout seems to be same and updated when player log's in.
waited 3 hours after i logged out with my char. after i logged back in, login/logout timers changed (same value for both)

i planned to add shard, but forgot hehe.

RE: Banner image of the character - Added by barbaros about 6 years ago

There is something wrong with the colors, i belive the logo should be red/white instead of red/blue.

http://atys.ryzom.com/guildicon/index.php?icon=576460719688958140

RE: Banner image of the character - Added by nimetu about 6 years ago

thanks, had small typo

RE: Banner image of the character - Added by nimetu about 6 years ago

this should be it... banner template that guilds can modify to their needs.
input is SimpleXML object, output is image handler. cache is external for both xml and image.

guild icons and title translations are included.

banner.tgz (454.3 kB)

RE: Banner image of the character - Added by nimetu about 6 years ago

err.. had a typo, updated php files

banner_php.zip (51.4 kB)

RE: [DONE] Banner image of the character - Added by vl about 6 years ago

I installed your banner generation Banner

RE: [DONE] Banner image of the character - Added by nimetu about 6 years ago

guild icon 310748248137005325 appears with white background.
if i change any color just a bit, then the white background disappears hehe.
probably that guild image is cached and it's affected.

banner with affected guild image is here
http://atys.ryzom.com/api/banner.php?ckey=cGAFB1RUBwtmAmcAVl8nJw11IA==

RE: [DONE] Banner image of the character - Added by kervala about 6 years ago

Something strange about this banner was no guild emblem was displayed today :( But after deleting the cached version, it displayed the image without alpha... That's really strange.

RE: [DONE] Banner image of the character - Added by nimetu about 6 years ago

if it has not yet coded, then http://forums.ryzom.com/showthread.php?t=34123
that post asks if banner can be set to 400px because restrictions in some forums.

this code will make it to shrink nicely (half from left, half from right) so that race background will not be affected too much.
minor modifications for banner.php also needed (like url param and cache file name changed per 'width')

--- ryzombanner.class.php       (revision 42)
+++ ryzombanner.class.php       (working copy)
@@ -56,7 +56,7 @@
         * xml - simpleXml object
         * lng - selected language
         */
-       function RyzomBanner($xml, $lng){
+       function RyzomBanner($xml, $lng, $width=500){
                // fix up paths
                $pwd=dirname(__FILE__).'/';
                $this->glPath=$pwd.$this->glPath;
@@ -64,6 +64,10 @@
                $this->fontPath=$pwd.$this->fontPath;

         $this->FONT=$this->fontPath.$this->FONT;
+
+               if(is_numeric($width) && $width>=300 && $width<=500){
+                       $this->BANNER_W=$width;
+               }

         //
                $this->xml = $xml;
@@ -199,7 +203,8 @@
                // banner background
                if(file_exists($this->bgPath.$this->raceBg)){
                        $im = imagecreatefrompng($this->bgPath.$this->raceBg);
-                       imagecopy($banner, $im, 0, 0, 0, 0, $this->BANNER_W, $this->BANNER_H);
+                       $im_w=imagesx($im); $copy_x=floor(abs($this->BANNER_W-$im_w)/2);
+                       imagecopy($banner, $im, 0, 0, $copy_x, 0, $this->BANNER_W, $this->BANNER_H);
                        imagedestroy($im);
                }

(1-12/12)