View previous topic :: View next topic |
Author |
Message |
Joseph
Joined: 28 Oct 2002 Posts: 27 Location: Waterloo, Canada
|
Posted: Wed Jan 01, 2003 12:11 pm Post subject: Random Quotation Generator |
|
|
This isn't a complex hack, but I thought I'd post if for those of you who aren't experienced enough, or are too lazy to do it yourself It simply shows a random quote in your template.
Take a look at http://joseph.hyrum.net on the left near the top left to see what I mean.
You can get the file at http://joseph.hyrum.net/b2quotes.php.txt
Cheers. |
|
Back to top |
|
 |
Joseph
Joined: 28 Oct 2002 Posts: 27 Location: Waterloo, Canada
|
|
Back to top |
|
 |
xytx
Joined: 24 May 2003 Posts: 48
|
Posted: Sat May 31, 2003 3:22 pm Post subject: |
|
|
looks like a really nice, i'm gonna download it and try it! but can it be somewhere besides the left side? bottom of your blog maybe? |
|
Back to top |
|
 |
alison
Joined: 20 May 2003 Posts: 38 Location: Madison, WI
|
Posted: Sat May 31, 2003 10:57 pm Post subject: |
|
|
Thanks! You rock.
Sorry for being dopey and just leaving a comment asking you to update this, but that me: dopey.
-a |
|
Back to top |
|
 |
grumm3t
Joined: 31 May 2003 Posts: 4
|
Posted: Thu Jun 05, 2003 12:32 am Post subject: |
|
|
You can also do this really simply with a MySQL database, using the query as such:
$query = "SELECT * FROM b2quotes ORDER BY RAND() LIMIT 1";
$sql = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($sql);
echo '"'.stripslashes($row['quote']).'" -- '.stripslashes($row['name']);
that last line works if your quote column is 'quote' and the sayer column is 'name'. |
|
Back to top |
|
 |
anportiale
Joined: 22 Jul 2003 Posts: 6 Location: Pennsylvania
|
Posted: Wed Jul 23, 2003 3:05 pm Post subject: Thanks :) |
|
|
I was surprised to see this on here mainly because I have looked at your website numerous times now haha. I am just begining to work on my blog and I have been looking at random ones for inspiration, and I must say I like yours a lot.
Thanks very much for the code... sure beats me writing it hahaha.  |
|
Back to top |
|
 |
Mizkie
Joined: 19 Mar 2003 Posts: 51 Location: Bloomington, IN
|
Posted: Wed Jul 23, 2003 7:18 pm Post subject: |
|
|
that's nice... Now I just wish I had some quotes to use. _________________ Mick
HSS = High School Sucks |
|
Back to top |
|
 |
XianghuaALPHA
Joined: 05 Aug 2003 Posts: 79 Location: Tulsa, OK
|
Posted: Wed Aug 20, 2003 8:01 pm Post subject: |
|
|
Hah. I was sooo at your site for the Book listing hack demonstration and went "damn I need a good reliable hack for this whole random quote generation thing - something b2 friendly because I suxor at php still - and would need something simple" - all these pages pulling up to me trying to find via a search to get a hack for a _targetBlank hack btw - and BAM - this is the next browser window I have open...
Your tut. looks to = too good. I think I shall [try to] use this and hopefully can make it through this one haha - thanks! _________________ [ [ - - There can be only 2 or 3 - - ]]
You know what. On a quite board - you end up talking to yourself alot....
Friends don't let friends play Tekken™ |
|
Back to top |
|
 |
|