|
|
![]() |
|
|
Top | #21 |
|
OSNN Junior Addict
Joined: May 2005
Location: The Netherlands
Posts: 6
Reputation: 0
Power: 86 |
Originally Posted by Geffy
phew, Imagettftext works now! I got a reply from my webhost and all I had to do was put ./ infront of the fontname, so instead of:
$font = "arial.ttf"; this: $font = "./arial.ttf"; sheesh So if someone has similar problems and the host does not allow the GDFONTPATH command, this could be your solution (font still in the same path as the .php file)Oh and IE seems to like the imagettftext version better than the imagestring one too. |
|
|
|
|
|
Top | #22 |
|
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,949
Reputation: 4941
Power: 305 |
Originally Posted by NetRyder
Since my coding skills are non-existing, I'm going to try feedburner for now...
EDIT: I have HTML code for my sig, can I convert this somehow into a language I can display? |
|
|
|
|
|
Top | #23 |
|
Godlike!
Joined: February 2004
Location: Salisbury, Wiltshire, UK
Posts: 7,031
Blog Entries: 5
Reputation: 4137
Power: 213 |
Not sure if you're interested at all folks but PHP5 hs the SimpleXML module which means you can churn out an RSS parser in the following code:
Code:
<?
// SimpleXML parser for FreeBSD SA RSS Feed
$xml = simplexml_load_file('http://www.freebsd.org/security/advisories.rdf');
foreach ($xml->item as $item)
{
echo '<li><a class="advlink" href="' . $item->link .'">' . $item->title .'</a></li>';
}
?>
|
|
|
|
|
|
Top | #24 |
|
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,949
Reputation: 4941
Power: 305 |
Originally Posted by LordOfLA
lol, i'm so clueless
![]() I have another question. I'm going to setup a forum, which I want to RSS to the main page of my blog, and then from the blog RSS to my sig here Am I psycho? |
|
|
|
|
|
Top | #25 |
|
Godlike!
Joined: February 2004
Location: Salisbury, Wiltshire, UK
Posts: 7,031
Blog Entries: 5
Reputation: 4137
Power: 213 |
Originally Posted by kcnychief
Yes but thats a side effect of OSNN
|
|
|
|
|
|
Top | #26 |
|
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,949
Reputation: 4941
Power: 305 |
Originally Posted by LordOfLA
lol....
Any tips on where I'd get started? |
|
|
|
|
|
Top | #27 |
|
Godlike!
Joined: February 2004
Location: Salisbury, Wiltshire, UK
Posts: 7,031
Blog Entries: 5
Reputation: 4137
Power: 213 |
|
|
|
|
|
|
Top | #28 |
|
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,949
Reputation: 4941
Power: 305 |
Hey NetRyder,
When you used Feedburner, do you know how long it takes to update between the blog and the actual image? What I did, was I created the Feedburner image, copied the HTML into frontpage, and then on the "design" tab, I copied and pasted the actual picture into my sig. Will this work? |
|
|
|
|
|
Top | #29 |
|
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,949
Reputation: 4941
Power: 305 |
Feedburner is working good enough for what I need, thanks to all for their attempted help, and sorry for the dumb questions
|
|
|
|
|
|
Top | #30 |
|
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,949
Reputation: 4941
Power: 305 |
Shouldn't this be the only section I have to modify:
Code:
// variable definitions // Image Vars $image = "banner_468x60_var1_back.jpg"; // image dimensions 468x60px $font = "verdana.ttf"; $size = 7; $horiz = 185; $vert = 16; $maxlen= 60; // RDF Parsing Vars $url = "http://www.osnn.net/modules.php?modname=backend&action=rdf"; $temp = "temp.xml"; $store = 0; $count = 0; $maxent= 4; $array = array(); |
|
|
|
|
|
Top | #31 |
|
Electronica Addict
Joined: February 2002
Location: Santa Clara, CA
Posts: 10,574
Reputation: 2960
Power: 260 |
Seems like it.
|
|
|
|
|
|
Top | #32 |
|
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,949
Reputation: 4941
Power: 305 |
Not working for me though
![]() EDIT: Look at this: http://www.djrcs.com/sig/sig.php EDIT 2: Here is my full code, for reference: Code:
<?php // variable definitions // Image Vars $image = "sig.jpg"; // image dimensions 301x100px $font = "verdana.ttf"; $size = 7; $horiz = 185; $vert = 16; $maxlen= 60; // RDF Parsing Vars $url = "http://djrcs.com/blog/?feed=rss2"; $temp = "temp.xml"; $store = 0; $count = 0; $maxent= 4; $array = array(); // XML parsing functions function openTag($parser, $name, $attrs) { global $store; if ($name == "TITLE") { $store = 1; } else { $store = 0; } } function closeTag($parser, $name) { // w00p de doo } function charData($parser, $data) { global $store, $array; if ($store == 1 && $count <= $maxent) { $array[] = $data; $store = 0; $count++; } } function storeXML($filename, $string) { $string = ereg_replace('&', 'and', $string); $string = ereg_replace('&', 'and', $string); $fp = fopen($filename, "w") or die ("unable to open storage file for writing<br />\nif it exists then chmod {$filename} to 666"); $write = fwrite($fp, $string); fclose($fp); return $write; } // define the parser $parser = xml_parser_create(); xml_set_element_handler($parser, "openTag", "closeTag"); xml_set_character_data_handler($parser, "charData"); if (!(storeXML($temp, file_get_contents($url)))) { die ("Unable to store OSNN RDF Data"); } if (!($handle = fopen($temp, "r"))) { die ("Unable to open Temp store<br />\nif it exists then chmod {$temp} to 666"); } while ($data = fread($handle, filesize($temp))) { if (!xml_parse($parser, $data, feof($handle))) { die (xml_error_string(xml_get_error_code($parser))); } } xml_parser_free($parser); // make sure no strings are too long foreach ($array as $key => $value) { if (strlen($value) > $maxlen) { $array[$key] = substr($value, 0, 45) . ".."; } } reset($array); // Image Creation $imgData = getimagesize($image); if ($imgData[2] == 1) { header("Content-type: image/gif"); $im = ImageCreateFromGIF($image); } else { header("Content-type: image/jpeg"); $im = ImageCreateFromJPEG($image); } $textc = ImageColorAllocate($im,64,89,132); $black = ImageColorAllocate($im,0,0,0); ImageTTFText($im,$size,0,$horiz,$vert,$textc,$font,$array[1]); ImageTTFText($im,$size,0,$horiz,$vert+12,$textc,$font,$array[2]); ImageTTFText($im,$size,0,$horiz,$vert+24,$textc,$font,$array[3]); ImageTTFText($im,$size,0,$horiz,$vert+36,$textc,$font,$array[4]); if ($imgData[2] == 1) { ImageGIF($im); } else { ImageJPEG($im,'',100); } ImageDestroy($im); ?> |
|
|
|
|
|
Top | #33 |
|
OSNN Veteran Addict
Joined: March 2002
Location: United Kingdom
Posts: 7,805
Reputation: 1490
Power: 217 |
You need to have a copy of the Verdana true type font file in the same directory
you also need to have the directory writable by all or else create the temp.xml file and make that writable by your webserver (or all) |
|
|
|
|
|
Top | #34 |
|
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,949
Reputation: 4941
Power: 305 |
Originally Posted by Geffy
Thanks for the tips, would the second part be a chmod 677?
|
|
|
|
|
|
Top | #35 |
|
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,949
Reputation: 4941
Power: 305 |
Have changed the permissions and added the font, still no worky. Here's my error log:
Code:
[02-Mar-2006 22:00:48] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 96 [02-Mar-2006 22:00:48] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 97 [02-Mar-2006 22:00:48] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 98 [02-Mar-2006 22:00:48] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 99 [02-Mar-2006 22:06:49] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 96 [02-Mar-2006 22:06:49] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 97 [02-Mar-2006 22:06:49] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 98 [02-Mar-2006 22:06:49] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 99 [02-Mar-2006 22:06:52] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 96 [02-Mar-2006 22:06:52] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 97 [02-Mar-2006 22:06:52] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 98 [02-Mar-2006 22:06:52] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 99 [02-Mar-2006 22:06:54] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 96 [02-Mar-2006 22:06:54] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 97 [02-Mar-2006 22:06:54] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 98 [02-Mar-2006 22:06:54] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 99 [02-Mar-2006 22:06:58] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 96 [02-Mar-2006 22:06:58] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 97 [02-Mar-2006 22:06:58] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 98 [02-Mar-2006 22:06:58] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 99 [02-Mar-2006 22:08:48] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 96 [02-Mar-2006 22:08:48] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 97 [02-Mar-2006 22:08:48] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 98 [02-Mar-2006 22:08:48] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 99 [03-Mar-2006 05:00:21] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 96 [03-Mar-2006 05:00:21] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 97 [03-Mar-2006 05:00:21] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 98 [03-Mar-2006 05:00:21] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 99 [03-Mar-2006 07:09:28] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 96 [03-Mar-2006 07:09:28] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 97 [03-Mar-2006 07:09:28] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 98 [03-Mar-2006 07:09:28] PHP Warning: imagettftext() [<a href='function.imagettftext'>function.imagettftext</a>]: Could not find/open font in /home/djrcs/public_html/sig/sig.php on line 99 Code:
}
function storeXML($filename, $string) {
$string = ereg_replace('&', 'and', $string);
$string = ereg_replace('&', 'and', $string);
$fp = fopen($filename, "w") or die ("unable to open storage file for writing<br />\nif it exists then chmod {$filename} to 666");
$write = fwrite($fp, $string);
fclose($fp);
return $write;
}
|
|
|
|
|
|
Top | #36 |
|
OSNN Veteran Addict
Joined: March 2002
Location: United Kingdom
Posts: 7,805
Reputation: 1490
Power: 217 |
Is the font file chmod 644 at least? The webserver will need to be able to at least read it. Additionally for that section which you list the temp.xml file will need to be chmod 666 so that its readable and writable by the webserver
|
|
|
|
|
|
Top | #37 |
|
MS-DOS 2.0
Joined: February 2002
Location: Ásgarðr
Posts: 854
Reputation: 420
Power: 138 |
Yes, look at your permissions first. If that doesn't work, perhaps try an absolute path for the font file?
Melon |
|
|
|
|
|
Top | #38 |
|
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,949
Reputation: 4941
Power: 305 |
I had altered the permissions for the entire directory, but in the tree above. I was actually thinking while driving to work I may need to check the perms on each file. Will do tomorrow when I'm home again and update the thread, thx guys.
|
|
|
|
|
|
Top | #39 |
|
█▄█ ▀█▄ █
Joined: April 2005
Location: Massachusetts
Posts: 16,949
Reputation: 4941
Power: 305 |
Changed permissions, now I get this
![]() Code:
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@djrcs.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. |
|
|
|
|
|
Top | #40 |
|
OSNN Veteran Addict
Joined: March 2002
Location: United Kingdom
Posts: 7,805
Reputation: 1490
Power: 217 |
the php file should not cause an internal server error really, check you error log to see what apache thinks is wrong. Also you might want to check the status of your error documents, its looks like your error500 file isn't setup properly.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Signature image in Pictures help? | zapoqx | Graphic Design | 5 | December 21st, 2006 5:49am |
| Best RSS Feed | Bman | Green Room | 14 | September 12th, 2006 11:57pm |
| how do i add a rss feed to the feed viewer in vista | VenomXt | Windows Desktop Systems | 1 | June 15th, 2006 10:44pm |
| RSS Feed | sean.ferguson | Green Room | 1 | October 16th, 2004 10:02am |
| RSS feed for NTFS? | Leo154 | Web Design & Coding | 13 | May 21st, 2003 6:44pm |