MyBB Community Forums

Full Version: Html + Php Template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello I have a small problem with my self written Php Level Script.


This is the Html in the postbit_classic template:
<img class="star" src="http://code-star.at/forum/stars_img.php?id={$post['uid']}" alt="" title=""></img>

I want thamy php file should be displayed in the title ofthe image as a tooltip.
Here is the php file:
<?php

$id=$_GET['id'];
$gesamt = 9000;

include("connect.php");

$query=mysql_query("SELECT Exp FROM mybb_users WHERE uid=".mysql_real_escape_string($id));
$array = mysql_fetch_array($query);

$prozent= ($array / $gesamt)*100;

echo "Level: ".round($prozent, 2)."%";
?>

I hope somebody can help me

Can somebody help me ?
Push for help
You cannot insert PHP into the file through the templates.

You need to do so through the core files like index.php and forumdisplay.php
You cannot output text within an image. What exactly is it you're trying to achieve with this?
I want that this text Level: round... Will be displayed in the tooltip of the image
Push for help
I see what you are trying to do, but Euan T. gave you the answer, in a sense.

If you want to display it, then you must use php's inbuilt functions with gd. You must have gd enabled on your server.

http://www.thesitewizard.com/php/create-image.sht
I want the title= like on this example

<img class="staricon" title="*Level: 8, 24%" alt="" src="http://www.elitepvpers.com/forum/images/staricons/star8.gif"></img>