Jump to content

rate topic statues image code help me


matrikation

Recommended Posts

hello

 

i am using invision power board v 2.2.1 i want to add statues image for topic rates like this :

 

46412492ex0.th.jpg

 

so i already made this code below but when i lanuch it for example :

 

http://localhost/f/rate.php?id=3

i see blank page no pic for display i don't know why

<?php
if ($_GET['id'] == "rating_tid") {
header("content-type: image/png");


$db_host = "localhost";
$db_user = "root";
$db_pass = "654321";
$db_name = "1";
$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db ($db_name) or die ("Cannot connect to database");

$result = mysql_fetch_assoc("SELECT `rating_tid`, `rating_value` FROM ibf_topic_ratings");

$rating = $result['rating_value'];



$image = @imagecreatefrompng("rate.png");
$black = imagecolorallocate($image, 0, 0, 0);
// Res $Img, rgb red, rgb green, rgb blue. Let's do white too.
$white = imagecolorallocate($image, 255, 255, 255);


@imagestring($image, 2, 185, 41, "Rating", $black);
@imagestring($image, 1, 154, 55,  $rating , $black);


imagepng($image);
// let's destroy it now. DIE!
imagedestroy($image);
// Finally, close mySql.
mysql_close();
} 
?>

 

i worry about this code :

 

<?php
if ($_GET['id'] == "rating_tid") {
header("content-type: image/png");

 

i think there would be specify some rows from dataebase in code like

 

if(mysql_num_rows($result)==1)
		{
		$name=mysql_result($result, 0, 0);

 

anyone can help me i will be glad

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.