 |
Account Login
|
 |
 |
Latest Articles
|
 |
 |
IRC Channel
|
 |
 |
Associates
|
 |
 |
Associates
|
 |
|
 |
 |
|
 |
03-26-2008, 01:51 PM
|
#1 (permalink)
|
|
The Acquainted
Join Date: Feb 2008
Posts: 107
Thanks: 3
|
İmage Create with multi lines ?
PHP Code:
<?php
header("Content-type: image/png");
$yaziyaz = "Alexa: 3,493,231";
$yaziyaz1 = "Pagerank: 3";
$string = $yaziyaz;
$string1 = $yaziyaz1;
$im = imagecreatefrompng("resim.png");
$orange = imagecolorallocate($im, 94, 94, 94);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
$px1 = (imagesx($im) - 11 * strlen($string1)) / 2;
imagestring($im, 2, $px, 2, $string, $orange);
imagestring($im, 2, $px1, 13, $string1, $orange);
imagepng($im);
imagedestroy($im);
?>
But if the $yaziyaz is short, it seems bad. The script is here
http://www.forumistan.net/7tepe/resim.php
How can I fix the problem ?
Last edited by CΛSTΞX : 03-26-2008 at 02:50 PM.
|
|
|
03-26-2008, 07:09 PM
|
#2 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
But if the $yaziyaz is short
What do you mean by this?
__________________
VillageIdiot can have my babbies ;d
|
|
|
|
03-26-2008, 07:19 PM
|
#3 (permalink)
|
|
The Acquainted
Join Date: Feb 2008
Posts: 119
Thanks: 17
|
what is the problem with this? Looks fine for me.
|
|
|
|
03-26-2008, 09:34 PM
|
#4 (permalink)
|
|
The Acquainted
Join Date: Feb 2008
Posts: 107
Thanks: 3
|
I mean, I want to make it like this:
Alexa: 3,493
Pagerank: 3
But it seems like:
---- Alexa: 3,493
Pagerank: 3
|
|
|
03-26-2008, 10:59 PM
|
#5 (permalink)
|
|
The Addict
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
|
Cant you just have
PHP Code:
imagestring($im, 2, 10, 2, $string, $orange); imagestring($im, 2, 10, 13, $string1, $orange);
Because the X cords are different because of the length of the string and how you have worked them out. Would be easier to put a number?
|
|
|
03-27-2008, 01:18 AM
|
#6 (permalink)
|
|
The Acquainted
Join Date: Feb 2008
Posts: 107
Thanks: 3
|
Thanks a lot Rendair...
|
|
|
03-27-2008, 01:34 PM
|
#8 (permalink)
|
|
The Addict
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
|
Yes it is very easy to do this.
PHP Code:
<a href="http://www.forumistan.net/"><img src="http://www.forumistan.net/7tepe/olus.php?site=www.bodrumlife.com"></a>
All you need to do to show GD images is link to the actual PHP file and it will work 
|
|
|
03-27-2008, 08:58 PM
|
#9 (permalink)
|
|
The Acquainted
Join Date: Feb 2008
Posts: 107
Thanks: 3
|
Yes I can do it. But I want to hyperlink it in the php file.
I mean, if you open http://www.forumistan.net/7tepe/olus...bodrumlife.com , the image which shown in the page should be also hyperlinked. So when you use
<img src="http://www.forumistan.net/7tepe/olus.php?site=www.bodrumlife" \> it is also hyperlinked...
It is like this (try to hover it, it is hyperlinked)

|
|
|
03-27-2008, 09:48 PM
|
#10 (permalink)
|
|
The Acquainted
Join Date: Feb 2008
Posts: 119
Thanks: 17
|
it is impossible to hiperlink it in the php file....
You can only make it using html, or javascript.
What you really get from that php file is an image, and an image can't be a link by itself.
|
|
|
|
03-27-2008, 10:34 PM
|
#11 (permalink)
|
|
The Acquainted
Join Date: Feb 2008
Posts: 107
Thanks: 3
|
Well, I dont think that it is impossible.
I tried
<?php
echo "<a href=http://www.forumistan.net>";
header("Content-type: image/png");
$yaziyaz = "Alexa: 3,493,231";
$yaziyaz1 = "Pagerank: 3";
$string = $yaziyaz;
$string1 = $yaziyaz1;
$im = imagecreatefrompng("resim.png");
$orange = imagecolorallocate($im, 94, 94, 94);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
$px1 = (imagesx($im) - 11 * strlen($string1)) / 2;
imagestring($im, 2, $px, 2, $string, $orange);
imagestring($im, 2, $px1, 13, $string1, $orange);
imagepng($im);
imagedestroy($im);
echo "</a>";
?>
But when I do it, it gives some 'headers already sent
problems. Is there someone who know how to do it successfully ?
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|