Re: Show currently playing song in signature/some talk about music & sigs
I'm not compiling PHP5 unless I need it.
I'm using something else
You are not logged in. Please login or register.
PunBB Forums → General discussion → Show currently playing song in signature/some talk about music & sigs
I'm not compiling PHP5 unless I need it.
I'm using something else
I wish it could put in the ú when needed instead of a .
I'm not compiling PHP5 unless I need it.
I'm using something else
i don't understand, you don't need php5 do you?
I have like php 4.3.* and the code that was given to me gave me the "call to an undifined function" error
You'd need GD support to make the image, it doesn't require PHP5.
since i am awesome, i also have a now playing bit, i might make it 50/50 with random quotes or whatever if i can be bothered, btw sorry to everyone who doesn't use a light coloured theme i bet it looks pretty dodgy on them
Connor, I've been noticing your sig and also the one Jansson uses on punres.
Is this a php file that generates a png on the fly?
yeh, i know i should probably cache it but yeh its generated on the fly, and as soon as i made it Jansson stole my idea
if i was less lazy i'd probably make it more interesting, but atm the only randomness is the colour of the stats
Maybe make the background transparent? Oh, and is the font Trechbuchet MS?
well i dunno what GD does with transparency and IE certainly doesn't like alpha transparency (which would be amazing if i could use it)
and no the font is called LondonBetween its just a nice clean looking font that looks ok small
I think Tahoma looks okay at 8px, as long as it's antialiased if used by GD and some other programs.
i wanted something that other people didn't have (but not too crazy)
i've just improved mine slightly, it says now playing if the song appeared in the last 10 min and Last Played if its older
Now I'm thinking of putting the quotes in a DB and having the script choose a random one each time.
I'm personally for a minimal effect, which is why I use a tiny test script that shows the last 3 (two currently...I'll change that sometime this weekend...It used to be ten.) songs played.
scottywz- Wow...That sig is getting bigger every time I see it.
Now I'm thinking of putting the quotes in a DB and having the script choose a random one each time.
Instead of that, I have the quotes assigned to variables. Is there any way that PHP can use a random variable (out of, let's say, $q1 and $q2)?
use $q[1] $q[2] etc then do $q[rand(1,10)] replace the 10 with the number of quotes
Thanks. Now, if only I can get it to quit displaying as a 7 x 8 white box sometimes.
Well, sometimes, it does that. I don't know why.
scottywz you should look at making your signature cache itself, its REALLY slow for me, rather annoying since it loads about 3 min after the rest of the page and makes everything move
Will be done in ~1 minute.
Edit: Done. Also added another quote.
To get a random quote without looking at my signature, go:
Random Quote
Random Quote (no title)
All Quotes (see below)
or All Quotes (no title) (see below)
In the query string, you can put in ?action=all_quotes and it will dump all the quotes. One problem: It does the same thing as ?action=random_quote which I have that way because, with variables $q[1], $q[2], etc., I want to display all those variables (they contain ^the quotes), but I don't know how. How do I get it to do that?
The code I have now is:
<?php
/* A Huge Comment */
/* Start App */
$nlt = "\n";
/* Define quotes */
/***********************************************************/
/* (Use ".$nlt at the end of each string except the last.) */
/* Quote 1 */
$q1t1 = "\"You know I was thinking hype could really help you, Harold. You're hyper now, so just".$nlt;
$q1t2 = "back off one letter, and you're there.\" - Red, The Red Green Show";
$q[1] = $q1t1.$q1t2;
/* Quote 2 */
$q2t1 = "\"It's the Possom Lodge Word Game. You know everybody dreams about a two-week vacation".$nlt;
$q2t2 = "in Hawaii. Well, now you can do more than just dream about it! Ha-ha! Now, you can sit".$nlt;
$q2t3 = "down and plan it out on your brand new pad of paper!\" - Harold, The Red Green Show";
$q[2] = $q2t1.$q2t2.$q2t3;
/* Quote 3 */
$q3t1 = "\"Can you hear me? Am I talking?\" - Red, The Red Green Show".$nlt;
$q3t2 = "(After shooting holes inside his Possum van with the doors shut.)";
$q[3] = $q3t1.$q3t2;
/* Quote 4 */
$q4t1 = "\"BOBBY, EAT YOUR CHICKEN!\" - Peggy, King of the Hill".$nlt;
$q4t2 = "(After being angry at someone else.)";
$q[4] = $q4t1.$q4t2;
/* Quote 5 */
$q5t1 = "Red: \"... This week, we got some good news, got some bad news.\"".$nlt;
$q5t2 = "Harold: \"What's the bad news?\"".$nlt;
$q5t3 = "Red: \"Meet my nephew, Harold. And, now, the good news....\"".$nlt;
$q5t4 = "- Dialog from \"The Group Photo Project\", The Red Green Show";
$q[5] = $q5t1.$q5t2.$q5t3.$q5t4;
/* End Define Quotes */
$st = $q[rand(1,5)].$nlnt; // The number after the comma should be replaced the number of quotes defined above
/* Don't mod past here unless you know the risks. */
$action = isset($_GET['action']);
if (!$action) {
$action = "";
}
else {
$action = $_GET['action'];
}
$title = isset($_GET['html_title']);
if (!$title) {
$title = "";
}
else {
$title = $_GET['html_title'];
}
/* If $title == 'yes' or undefined */
if ($action == 'random_quote' && !$title) {
header("Expires: Thu, 04 Jul 1776 00:00:00 GMT"); //
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
header("Cache-Control: no-store, no-cache, must-revalidate"); // We don't want it cached. And, yes, the Declaration of Independence was signed on a Thursday.
header("Cache-Control: post-check=0, pre-check=0", false); //
header("Pragma: no-cache"); //
echo '<title>Random Quote</title>'."\n\n".'<pre>'.$st.'</pre>'; // Where's the quote?
}
else if ($action == 'all_quotes' && !$title) {
header("Expires: Thu, 04 Jul 1776 00:00:00 GMT"); //
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
header("Cache-Control: no-store, no-cache, must-revalidate"); // We don't want it cached. And, yes, the Declaration of Independence was signed on a Thursday.
header("Cache-Control: post-check=0, pre-check=0", false); //
header("Pragma: no-cache"); //
echo '<title>All Quotes</title>'."\n\n".'<pre>'.$st.'</pre>'; // Where's the quote? // The All Quotes feature is not available yet.
}
else if ($action == 'random_quote' && $title == 'yes') {
header("Expires: Thu, 04 Jul 1776 00:00:00 GMT"); //
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
header("Cache-Control: no-store, no-cache, must-revalidate"); // We don't want it cached. And, yes, the Declaration of Independence was signed on a Thursday.
header("Cache-Control: post-check=0, pre-check=0", false); //
header("Pragma: no-cache"); //
echo '<title>Random Quote</title>'."\n\n".'<pre>'.$st.'</pre>'; // Where's the quote?
}
else if ($action == 'all_quotes' && $title == 'yes') {
header("Expires: Thu, 04 Jul 1776 00:00:00 GMT"); //
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
header("Cache-Control: no-store, no-cache, must-revalidate"); // We don't want it cached. And, yes, the Declaration of Independence was signed on a Thursday.
header("Cache-Control: post-check=0, pre-check=0", false); //
header("Pragma: no-cache"); //
echo '<title>All Quotes</title>'."\n\n".'<pre>'.$st.'</pre>'; // Where's the quote? // The All Quotes feature is not available yet.
}
/* If $title == 'no' */
else if ($action == 'random_quote' && $title == 'no') {
header("Expires: Thu, 04 Jul 1776 00:00:00 GMT"); //
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
header("Cache-Control: no-store, no-cache, must-revalidate"); // We don't want it cached. And, yes, the Declaration of Independence was signed on a Thursday.
header("Cache-Control: post-check=0, pre-check=0", false); //
header("Pragma: no-cache"); //
echo '<pre>'.$st.'</pre>'; // Where's the quote?
}
else if ($action == 'all_quotes' && $title == 'no') {
header("Expires: Thu, 04 Jul 1776 00:00:00 GMT"); //
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
header("Cache-Control: no-store, no-cache, must-revalidate"); // We don't want it cached. And, yes, the Declaration of Independence was signed on a Thursday.
header("Cache-Control: post-check=0, pre-check=0", false); //
header("Pragma: no-cache"); //
echo '<pre>'.$st.'</pre>'; // Where's the quote? // The All Quotes feature is not available yet.
}
/* End App */
?>
where /* A Huge Comment */ is, well, a huge comment.
Also html_title can be in the query string, but is optional. If it's not there or set to yes it will add an HTML <title> </title> to the output. If it's set to no it won't.
I'm still getting the wierd square.
Funny. Do you ever get something like
Red: "... This week, we got some good news, got some bad news."
Harold: "What's the bad news?"
Red: "Meet my nephew, Harold. And, now, the good news...."
- Dialog from "The Group Photo Project", The Red Green Show: (Updated every 15 seconds) Currently listening to this song / Last song listened to was:
Solas - Pastures of Plenty
PunBB Forums → General discussion → Show currently playing song in signature/some talk about music & sigs
Powered by PunBB, supported by Informer Technologies, Inc.