|
|
|||||||
| About Us | Register | FAQ | Members List | Calendar | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#2 (permalink) |
|
Registered User
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2002
Location: St Andrews, Scotland
Posts: 1,575
|
Re: ngemus quote script
You can find quotes easy if you ask Google.
__________________
OS: Arch Linux w/ Kernel 2.6.23.8 + GNOME 2.20.1 - CPU: Intel Pentium M 1.5GHz - Memory: 1280MB DDR PC2700 - Browser: Mozilla Firefox 2.0.0.10 |
|
|
|
|
|
#3 (permalink) |
|
Registered User
![]() ![]() ![]() ![]() ![]() Join Date: Oct 2001
Location: Ohio
Posts: 1,970
|
Re: ngemus quote script
I would like a copy of the too. I was keeping a txt file of the really good ones, but my comp took a crap last week and I had to format without able to back anything up. But at least they're back on the main page.
__________________
Athlon64 3400+ @10.5x250MHz, 2.625GHz | DFI NF3 250GB 2x512 Corsair pc3200 | BFG FX6800 OC 128MB | X-Fi XtremeGamer |
|
|
|
|
|
#5 (permalink) |
|
Registered User
![]() Join Date: Jul 2003
Location: Los Angeles
Posts: 53
|
Re: ngemus quote script
I would hope they are stored in the database, for speed... and, you can probably find a great list if you just copy one of them and shuck it into Google with "s around it. Maybe add "quotes" to the query... you'll find a lot, I'm sure.
-[Unknown] |
|
|
|
|
|
#6 (permalink) |
|
Registered User
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2002
Location: St Andrews, Scotland
Posts: 1,575
|
Re: ngemus quote script
Actually, in this situation using a database would not give speed increase since you are only reading the data and not querying the data.
For quotes: http://www.brainyquotes.com/
__________________
OS: Arch Linux w/ Kernel 2.6.23.8 + GNOME 2.20.1 - CPU: Intel Pentium M 1.5GHz - Memory: 1280MB DDR PC2700 - Browser: Mozilla Firefox 2.0.0.10 |
|
|
|
|
|
#8 (permalink) | |
|
Registered User
![]() Join Date: Jul 2003
Location: Los Angeles
Posts: 53
|
Re: Re: ngemus quote script
Quote:
File based method: PHP Code:
Database method: PHP Code:
Full files and eval'd data are faster as flat files, however. -[Unknown] |
|
|
|
|
|
|
#9 (permalink) |
|
Registered User
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2002
Location: St Andrews, Scotland
Posts: 1,575
|
Re: ngemus quote script
But if you store them in seperate files:
Code:
$number = int(rand(9)) + 1; open(FILE, "<$number.txt"); print while <FILE>; close FILE;
__________________
OS: Arch Linux w/ Kernel 2.6.23.8 + GNOME 2.20.1 - CPU: Intel Pentium M 1.5GHz - Memory: 1280MB DDR PC2700 - Browser: Mozilla Firefox 2.0.0.10 |
|
|
|
|
|
#10 (permalink) | |
|
Registered User
![]() Join Date: Jul 2003
Location: Los Angeles
Posts: 53
|
Re: Re: ngemus quote script
Quote:
-[Unknown] |
|
|
|
|
|
|
#11 (permalink) |
|
Registered User
![]() ![]() ![]() ![]() Join Date: Jan 2003
Location: England, drinking tea.
Posts: 547
|
Re: ngemus quote script
unless they have a section in the admin panel then inputing them into a database would be a load of crap and even with that you'd have to put them in one at a time so unless they have no life then there is no scence to that methot, a txt file although slower would be alot easier to update and make the initial file for and thus they still have a life.
besides since you mainly build a site for the 56K user (which is what most people use, although some may question this) it wouldn't make anysort of noticable difference to the speed .
|
|
|
|
|
|
#12 (permalink) | |
|
Registered User
![]() Join Date: Jul 2003
Location: Los Angeles
Posts: 53
|
Re: Re: ngemus quote script
Quote:
It would not be that difficult, you just parse the stupid text file into a few inserts (read in the lines and output every 500 or so as inserts.) and then chug it in top the database. Just because you use phpMyAdmin and prefer to insert manually for some reason doesn't mean everyone does.... how do you think this forum works? Some fool inserts every post as it's made? It can easily be done - admin interface or not - and it's faster... so there's no reason to limit yourself. Sorry, I was a bit sarcastic - I've had a bad day so far... didn't mean anything by it. -[Unknown] |
|
|
|
|
|
|
#13 (permalink) |
|
Registered User
![]() ![]() ![]() ![]() Join Date: Jan 2003
Location: England, drinking tea.
Posts: 547
|
Re: ngemus quote script
>>
Sorry, I was a bit sarcastic - I've had a bad day so far... didn't mean anything by it. hey no problem at least your willing to argue your point, i also think its nice that you think bobbi and the others don't have lives and would rather enter hundreds of quotes all day ![]() personally since i have 8 months to do 2 years worth of work (i'm a last year GCSE studient )i'd love to know how bobbi and the staff have time to even moderate the forums let alone spend a couple of hours a week updating the quotes. hehe i had a bad day as well and its only 8 in the morning
|
|
|
|
|
|
#14 (permalink) | |
|
Registered User
![]() Join Date: Jul 2003
Location: Los Angeles
Posts: 53
|
Re: ngemus quote script
Quote:
. Moderating a forum is hard - I should know, I'm an administrator on like 5 of them.And... are the quotes ever updated? Anyhow... to show some proof, you could just parse the file like so: (I'm not a fan of obfusication, so I'll give PHP not Perl :P.) (note that this is rough, it's not like I'm planning to package and distribute this :P.) PHP Code:
# Get the ID of a quote for editing or something. SELECT quote_id FROM quotes WHERE quote LIKE '%Einstein%'; # Change something in all quotes. UPDATE quotes SET quote = REPLACE(quote, 'Einstein', 'Onemug'); So... I don't see how this is harder to work with... the SQL query aspect only seems to make it easier than the clunky "search and replace" tools of text editors. -[Unknown] |
|
|
|
|
|
|
#15 (permalink) |
|
Registered User
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2002
Location: St Andrews, Scotland
Posts: 1,575
|
Re: ngemus quote script
What's wrong with Perl? It is easy to read.
__________________
OS: Arch Linux w/ Kernel 2.6.23.8 + GNOME 2.20.1 - CPU: Intel Pentium M 1.5GHz - Memory: 1280MB DDR PC2700 - Browser: Mozilla Firefox 2.0.0.10 |
|
|
|
|
|
#18 (permalink) | |
|
Registered User
![]() Join Date: Jul 2003
Location: Los Angeles
Posts: 53
|
Re: Re: ngemus quote script
Quote:
Sorry, I was meaning to help. Got on a side arguement... didn't mean to "push you out of the way" so to speak... That's how you'd do it though - it's tough at first (for everyone, me, you, Bill Gates, etc.) but that's only more reason to go ahead and do it.. -[Unknown] |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|