2 village_idiot Jan 24, 2005 03:59

Was your inspiration my signature ?
I tried yours yesterday and it worked. (offcourse ;))
It's just not a beautifull font, so, I'll stick to this animated signature I think.
yes, it was :)
Im toying with how i might mess with the font too.. just to see if i can do it
edit : very simple, took me 5 mins .. example : http://www.village-idiot.org/stat-thingy/newestpost1.php
now just need find the right font, I like that one but one font size smaller doesnt look as nice, and with longer posts, this size wont work.
a person could go ape-shit with this lemme tell ya :P
My animated signatures gets it's data from the atom.php file.
Is there some data in it, that you can use yourself, so you don't have to tweek in the edit_action.php file ?
dont know -- I'll betcha though that all feedreader does is parse the feed they get for your web site. Writing a script to parse a feed is a lot tougher than the 4 lines of extra code that go into what I did.
As far as fonts go, why dont you have a look at this font at Kottke .org!
http://www.kottke.org/plus/type/silkscreen/index.html
Its free, small and easy to read
Cheers gacjezv
I actually have that font already, but thanks :)
Ive fixed up something else that I thought would be nice -- i now have image rotation, so rather than just one color, you can have as many as you like. The fixed up code for this will be in the next post I make about it on my site. i think I might code in a little if/else so that my text colors change as needed now too -- it can match my site more that way :) <-- done and very easy too
--
if you wanted to go small text wise, like topangas, you would definitely want to use a pixel font-- i love pixel fonts :) the only trouble with pixel fonts is that they dont scale well, in fact theyre really only good at 8px. 8px rendered using php doesnt really look (to me) like 8 pixels in photoshop when Ive used them (p-fonts) for other things. It would take a little screwing around to get the needed font size but Im sure it could be done, and look nice when finished.
I got two pretty cool trackbacks from my coming up with this, pretty cool B)
Hey, can you tell I have insomnia - have spent the last couple of hours giving this a go... you can see the result in my sig!
Had a few problems - wasn't quite clear about where everything went and such like (ie which paths to use - particularly the one to my posts... then it dawned on me that I needed to post a new article to get it to create the file...) but I was like a girl obsessed - and finally cracked it 8|
:lol:
Anyway thanks for this - I like it!!! Now I just have to come up with a selection of graphics so I can try out the random backgrounds...
Oh and it gave me an opportunity to do my very first trackback B)
i saw :) thankyou! and im glad you like !!
(yours is a good size, i might change mine)
I have a few questions...
I have looked at your site, and done what it says... Works
I read some of the posts after that, on this thread.
How do I change the font?
Is there a way to WRAP the text?
Mine looks okay, but you fint changes look cool...
Ioo wrote:
I have a few questions...
I have looked at your site, and done what it says... Works
I read some of the posts after that, on this thread.
How do I change the font?
Is there a way to WRAP the text?
Mine looks okay, but you fint changes look cool...
the font size is set inside the file ...
imagettftext($im, 9, 0, 60, 21, $treecolor, $font, $text);
the '9' in the above snippit is the font size, and I havent found or read of a way to wrap text using the file no. You could wrap text before you wrote to the temp file though but it would take a bit of work. Im using a basic arial font, i think, which accomodates longer post titles well, so I havent had to do that (yet).
hope that helps!
I don't have a line like that...
I took the code off your site as is (Changing the URL;s)
SO I have..
<?php
Header("Content-type: image/png");
Header("Expires: Mon, 1, 1999 05:00:00 GMT");
Header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
Header("Cache-Control: no-store, no-cache, must-revalidate");
Header("Cache-Control: post-check=0, pre-check=0", false);
Header("Pragma: no-cache");
//***************
$u = $_GET['u'];
$foo2 = file('http://www.bushsamerica.com/admin/myposts');
$foo = join('', $foo2);
foreach($foo2 as $line_num => $line) {
$ineedline = $line_num;
}
$im = imagecreatefrompng("sig.png");
$mycolor = imagecolorclosest($im, 238, 0, 51);
imagestring($im, 3, 90, 10, "Latest Post:", $mycolor);
imagestring($im, 3, 90, 20, "$foo", $mycolor);
Imagepng($im,'',90);
ImageDestroy($im);
?>
Do you have an UPDATED code info...
I got it to work as is, but the font is just not right...
Thanks[/img]
their are atleast 3 versions on my site .. with minor changes in each..
your font is too small or too big??
you prolly want to grab the one that lets you use your choice of fonts :)
<?php
Header("Content-type: image/png");
Header("Expires: Mon, 1, 1999 05:00:00 GMT");
Header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
Header("Cache-Control: no-store, no-cache, must-revalidate");
Header("Cache-Control: post-check=0, pre-check=0", false);
Header("Pragma: no-cache");
//***************
$u = $_GET['u'];
$foo2 = file('http://www.yourdomain.com/path-to/myposts');
$foo = join('', $foo2);
foreach($foo2 as $line_num => $line) {
$ineedline = $line_num;
}
$im = imagecreatefrompng("sig.png");
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$text = 'Headline news:';
$font = 'FONT.TTF'; //Upload your font
imagettftext($im, 11, 0, 65, 22, $black, $font, $text);
imagettftext($im, 11, 0, 65, 43, $black, $font, $foo);
Imagepng($im,'',90);
ImageDestroy($im);
?>
nice how that smilie showed up, sigh, check the code on my site @ http://www.village-idiot.org/archives/2005/01/24/improved-dynamic-signature/
edit: disabled the smiles since they hosed up the code
(You can check the "Disable Smilies" before you post BTW)
I got the code,,, and ALL I get is
The image ?http://www.bushsamerica.com/banner/banner.php? cannot be displayed, because it contains errors.
:| I am not sure
Here is the code
<?php
Header("Content-type: image/png");
Header("Expires: Mon, 1, 1999 05:00:00 GMT");
Header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
Header("Cache-Control: no-store, no-cache, must-revalidate");
Header("Cache-Control: post-check=0, pre-check=0", false);
Header("Pragma: no-cache");
//***************
$u = $_GET['u'];
$foo2 = file('http://www.bushsamerica.com/admin/myposts');
$foo = join('', $foo2);
foreach($foo2 as $line_num => $line) {
$ineedline = $line_num;
}
$im = imagecreatefrompng("sig.png");
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$text = 'Headline news:';
$font = 'pala.ttf'; //Upload your font
imagettftext($im, 11, 0, 65, 22, $black, $font, $text);
imagettftext($im, 11, 0, 65, 43, $black, $font, $foo);
Imagepng($im,'',90);
ImageDestroy($im);
?>
Your thanks... If you tire of this, I understand, the other works well, and I am going to take you up on your advice on your blod and google some things as well. (See mom, I can read)
http://www.bushsamerica.com/banner/banner.php
I see an image.. :) and thanks on the disbale smilies reminder, I forgot about that :)
That is your original code, not the new stuff you posted...
wheres the new one?
http://www.bushsamerica.com/banner/banner2.php
but it is prompting to DL and so on... not sure what to do...
oke..
is there a file called an error_log in the same dir as that? /banner/error_log?
Okay, I think I am doing something wrong here. This is what I get: http://the-fragile.org/posts/mypost.php
This is how I have my "myposts.php" setup:
<?php
Header("Content-type: image/png");
Header("Expires: Mon, 1, 1999 05:00:00 GMT");
Header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
Header("Cache-Control: no-store, no-cache, must-revalidate");
Header("Cache-Control: post-check=0, pre-check=0", false);
Header("Pragma: no-cache");
//***************
$u = $_GET['u'];
$foo2 = file('http://www.the-fragile.org/blogs/admin/myposts');
$foo = join('', $foo2);
foreach($foo2 as $line_num => $line) {
$ineedline = $line_num;
}
$im = imagecreatefrompng("sig.png");
$mycolor = imagecolorclosest($im, 0, 0, 0);
imagestring($im, 3, 70, 15, "Latest Post:", $mycolor);
imagestring($im, 3, 70, 30, "$foo", $mycolor);
Imagepng($im,'',90);
ImageDestroy($im);
?>
And here is the code I inserted in the edit_actions.php:
{ // We do all the pinging now!
$blogparams = get_blogparams_by_ID( $blog );
// trackback
trackbacks( $post_trackbacks, $content, $post_title, $post_ID);
// pingback
pingback( $post_pingback, $content, $post_title, $post_url, $post_ID, $blogparams);
pingb2evonet($blogparams, $post_ID, $post_title);
pingWeblogs($blogparams);
pingBlogs($blogparams);
pingTechnorati($blogparams);
$fp = fopen("myposts","w");
$str = $post_title ;
fwrite ($fp,$str);
fclose($fp);
azel,
I cant tell EXACTLY what its inserting into the temp text file, then into the image.. but it looks like raw html? Check that file and let me know? Also, what version of b2evo? it looks to me like you did everything correctly..
Weirdly enough, it's inserting the admin login screen! I'm using version 0.9.0.11.
Hrm, now it says the image cannot be displayed because it contains errors.
i could be mistaken but i believe that "..image counldnt be displayed" .. gets accompanied with a standard php error_log, if so you might find some clue in it..
I can send anyone that needs them my own b2evo files (with the file edits) if they would like to diff them against their own.. There isnt alot of room for messups though (not a whole lot of editing), so I cant imagine anyone would need them -- but Im more than willing. If so, just drop me a pm, with an email, and I'll send em along.
Okay I think what I am having trouble understanding is in the "myposts.php" file, am I supposed to put
$foo2 = file('http://www.yourdomain.com/path-to/myposts');
exactly like that, only with my domain? Because I don't understand if I am supposed to link to my edit_actions file or what.
$foo2 = file('http://www.yourdomain.com/path-to/myposts');
thats the path to the temporary file that is written to when you create a new post
that temporary file should contain the title of your latest post, and will be overwritten when you do another post.
:)
Ohhh okay...sorry for the dumb questions. ;x
Edit: It works now, yay!
thats ok, better that you ask and it works than not ask and we both wonder why!!
Argh, another dumb question, this time regarding the .htaccess file. If I understand this correctly, I put the .htaccess in my root directory. And then I only need that one line in the .htaccess file?
yes :)
Ahh, I must not be able to use .htaccess then, because using it gives me an internal server error for my whole site. Darnit.
it shouldnt ...
something like this...
Redirect permanent /newestpost.png http://www.village-idiot.org/stat-thingy/newestpost.php
should not affect your entire site, under any circumstances
if you have cpanel access, i would go in and check the error in the error log, see exactly what it says.
Stupid, stupid me, I forgot to CHMOD the .htaccess as 755. ;x
It works, thanks so much, whoo. <3
http://the-fragile.org/newestpost.png
Just testing above.
every village needs an idiot to teach the rest.
i still can't figure how to change font color, oh well, after two hours i'm satisfied with what i've got.
are you using the last bit of code changes, meistercobbman?
Okay...why all of a sudden would it stop working? Edit: Maybe it was my server last night, because it works again today. Sorry for that. :/
i dont know :?:
I LOVE this hack, but I think I noticed a small bug.
I often write blog entries with pictures, and sometimes I'll write them, save them as draft, and then add the pictures later on and publish them.
When I write a blog entry from scratch and publish it immediately, it puts the title in "myposts" just like it's supposed to. However, when I change the status of a Draft entry to Published, it doesn't put the title in "myposts".
Is this normal? Is there any way to fix this?
Nevermind, I figured it out.
In in the case 'editpost' section, find:
else
{ // We'll ping now
pingb2evonet( $blogparams, $post_ID, $post_title );
pingWeblogs( $blogparams );
pingBlogs( $blogparams );
pingTechnorati( $blogparams );
And add:
$fp = fopen("myposts","w"); $str = $post_title ; fwrite ($fp,$str); fclose($fp);
This will let your dynamic signature work when you're switching from Draft to Published.
Quick question... Is there any way to add a second line with the $post_date variable in it?
I tried, but my php-fu is weak.
yeah you could do that; I cant tell you exactly HOW to do it today though -- someone else might though :)
If it hasnt bene answered by this Friday, ILL post back with the answer for ya (my work hours take precedence over most other things, unfortunately)
Not a problem. :) I remember work...
I do believe I saw the second line in my siggy..
try this, back up the file and then edit admin/edit_actions.php
$fp = fopen("myposts","w");
$str = $post_title;
$str2 = $post_date; <-- check to make sure thats the right variable before using it
fwrite($fp, $str."\n".$str2);
fclose($fp);
Just a heads up too, that the one line of code in admin/edit_actions.php is actually multiple commands seperated by ;s and check to make sure that that $post_date variable is correct also.
Well, the variable is right... But the fwrite isn't quite there...
what is it writing, if anything? Im at work, so I wont be able to do much more before I get home.
Looks like my current .sig on here..
Saying Goodbye...vt2006-06-27 13:48:15
The title and date/time are right, but instead of a newline, it's converting to "vt".
oke, i can prolly fix that when i get home from work. :)
Ive checked this at home and that code works for writing the 2 lines, so you have either messed up the copy and paste or ...??
For instance, I am testing with :
$fp = fopen("myposts","w");
$str = $post_title;
$str2 = $now;
fwrite($fp, $str."\n".$str2);
fclose($fp);
That outputs 2 lines to my writable file:
123
2006-06-28 02:17:43
You can actually see it in my current signature :)
$now is variable you prolly dont have, and $post_date isnt pretty, so rather than rebuilding the date, I would just do this:
$str2 = date("m/d/y");
---
Final product:
$fp = fopen("myposts","w");
$str = $post_title;
$str2 = date("m/d/y");
fwrite($fp, $str."\n".$str2);
fclose($fp);
I will go doublecheck to see that that works.....
works perfectly, Actual output:
post and date
06/28/06
If you look closely the date is hanging off the image in my signature
the vt in your writable file, is it just a normal looking vt, or is it subscript or anything? because it doesnt look "normal" in your image.
I think thats "vertical tab" maybe? check to make sure you didnt typo a v for an n?
No typo, and it looks like a superscript vt.
I'm thinking it may be on the server end. Gonna check it out in a minute when I make my next post...
Nope, still doing it. :(
ok, well we can try another way, breaking up the 2 lines.. ill post that way when i get home from work tonight :)
have you tried this:
$fp = fopen("myposts","w");
$str2 = $post_title;
$str = date("m/d/y");
fwrite($fp, $str."\n");
fwrite ($fp,$str2);
fclose($fp);
im guessing the above wont work for you if the other didnt, but its worth a try. And dont be confused by my changing the str/str2 variables, it was just easier in my paste.
OR ....
maybe this:
$str = date("m/d/y");
$newestpost="$str."\n".$post_title";
fwrite ($fp,$newestpost);
fclose($fp);
A while ago i did a script where if the text exceeds a certain size, make it 2 lines, and if it is still to large add a '...' or ' ...' apropriatly, i can post it if it might be of use.
my first suggestion to cuddle's question is the documented solution via php.net to use fwrite with 2 lines of text. It functions correctly and as expected on my host's box, so I know it works. My last post prior to this one includes derivitive ways that ive provided in the hopes one of those might work. If you can provide anything different for cuddles that might work, feel free, however due to the fact that \n is being interpreted incorrectly, I am guessing its a box issue and not a script issue.
Nope, neither of those worked... I spoke with my host's tech support, and it IS an issue on the box. Good news is, they're working on it.
How can I separate the blogs? If I have different users with different blogs. I would like user 1 have a file of his choice and user 2 a file of his choise. Is it possible. Ad also how did Topanga put in the subscribe function in the sig.
Thanks for a great script :)
permalink for the code is at http://www.village-idiot.org/archives/2005/01/22/dynamic-signature/