Recent Topics

1 Mar 30, 2005 05:04    

Does anyone know how to make "drop shadows" on the entry titles. What I am looking for is something similair to what this blog has:

http://gandolf.glamdring.org:81/wp/

Thanks!

W. Hill

2 Mar 30, 2005 06:44

thats a plugin for wordpress however ... I was doing that for a while on my b2evo blog, and thought I had posted about it on my blog (apparantly I didnt). Im also unsuccessfully looking for the file-- it was VERY easy to do, and if I reme correctly I only needed one file. If and when i locate them, ill post back

In the meantime, if no-one else helps you google ...(thinking).. well heres a start

http://www.alistapart.com/articles/dynatext/
http://www.mezzoblue.com/tests/revised-image-replacement/

ill try to find that file

----

OK, I found the files ....

Here is what I was doing ...

inside your skins _main.php where the text title of the post would be...

I had, instead:


<h3 class="storytitle">
<a href="<?php $Item->permalink() ?>" rel="bookmark" title="<?php echo T_('Permanent link to full entry') ?>"><img alt="<?php $Item->title(); ?>" src="/heads/itB.php?letters=<?php $Item->title(); ?>" /></a></h3>


Notice that I am calling a php file (/heads/itB.php) and that it's being supplied the title of the post.

the contents of that php file (itB.php) is :


<?php
if(!preg_match("/village-idiot\.org/",getenv("HTTP_REFERER"))){
print "Access denied.";
exit;
}
$text = urldecode(urldecode($letters));
$text = str_replace('.png', '', $text);
/*$text = .$text;*/
$im = imagecreate(500, 30);
$fontsize = 16;
$int_angle = 0;
$x_shift = 2;
$y_shift = 20;
$bgcolor = imagecolorallocate($im, 255, 255, 255);
$shadow =imagecolorallocate($im, 51, 0, 0);
$textcol = imagecolorallocate($im, 0, 30, 102);
$font = "georgia.ttf";

imagettftext($im, $fontsize, $int_angle, $x_shift, $y_shift, $shadow, $font, $text);
imagettftext($im, $fontsize, $int_angle, $x_shift-1, $y_shift-1, $textcol, $font, $text);
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
?>

The second line will need to be changed to match your domain, I added that so that other sites couldnt call the script remotely

the font is declared toward the bottom, notice I was using Georgia. The font will need to go into the same directory as the php file, IF you dont change any pathes.

the imagettftext variables are all explained here:
http://www.php.net/imagettftext

thats all you need, the shadowing is done with the script, and btw, that example page looks like crap (to me) I hope yours looks better :)

have fun!

3 Mar 30, 2005 08:29

i take that back .. actually that page looks pretty good in FF. something musta been hosed in my IE (apologies )

4 Mar 30, 2005 13:00

Thanks for the reply...

I will try to work on it this evening. Hopefully it will be as easy as it looks. :D

W. Hill


Form is loading...