Emblem integration on Website

Rikter

New member
Messages
10
Points
0
Age
38
Github
Rikter87
Emulator
Other
I'm asking for help to any webdeveloper, as I'm not used to that side of programming.

I'm trying to show a given emblem on a test site, passing the emblem_data field from sql database.

I tried to "isolate" code from Flux for function to show the emblem, but failed. Is there someone that can suggest me a clean code for that?

Thanks :3

 
No idea if this will work.

<?phpecho '<img src="data:image/jpeg;base64,'.base64_encode($emblem_data).'">';?>
Can't test it at the moment as I'm not at a computer atm. But basically the value stored in MySQL is a binary / BLOB of the image.
 
Or you can use GD library's imagecreatefrombmpstring() function.

 
Last edited by a moderator:
I managed to make it work with imagecreatefrombmpstring() fetched from FluxCP, but I've got the problem that it worked on a standalone page, but didn't work when integrating in another page. I think that's due to that function using imagepng to get the image, that requires the declaration in header for the content image/png. I'll try to use the same function, but show the image wit the code you gave me, as testing it with that code alone returns the string but can't elaborate it as image, thanks
default_smile.png


 
Try programming it so that it grabs the image from the URL directly:

<img src='url/of/your/logo/creator.php?logo=id'>

 
That's an idea that I didn't think off, I'll try it as soon as I'll be at home, thanks
default_biggrin.png


 
That's an idea that I didn't think off, I'll try it as soon as I'll be at home, thanks
default_biggrin.png
Why don't you try the FluxCP's module for that?

modules/guild contains emblem.php, while index.php outputs it.

 
'cause I have my own coded website thanks to Yommy, and I prefer that over Flux
default_tongue.png


Anyway, I managed to make it works!

For anyone who may need to know how, I used the imagecreatefrombmpstring() function with call for it on the same php page, and recalled that page with "<img src='url/of/your/logo/creator.php?logo=id'>" as suggested by Jabote
default_smile.png


Thanks everyone for the help ^^

 
Back
Top