Jump to content
  • 0
Sign in to follow this  
Rikter

Emblem integration on Website

Question

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

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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 :)

Share this post


Link to post
Share on other sites
  • 0

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

 

Why don't you try the FluxCP's module for that?

 

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

Share this post


Link to post
Share on other sites
  • 0

'cause I have my own coded website thanks to Yommy, and I prefer that over Flux :P

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 :)

Thanks everyone for the help ^^

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.