UBB.Dev
Posted By: Idle [6.3.x] [beta] Random Quotes - 05/26/2002 7:09 AM
Mod Name: Random Quotes

Description: Displays random quotes on the forum summary page.
Can be enabled/disabled from the UBBâ„¢ Control Panel.
Quotes can be edited from the Control Panel.
JCTemplates supported.

By: Idle
Email: [email protected]
Date: May 26th, 2002
Version: 2.0

Requirements: 6.3.0 Beta Release 1 or newer.
Compatability: 6.3.x or newer.
Tested On: 6.3.0 Beta Release 1 and 6.3.0

Files Modified: ubb_forum_summary.cgi, cp.cgi, cp_lib.cgi, vars_wordlets_cp.cgi, cp_common.pl, public_forum_summary.pl

New Files: cp_quotes.cgi, cp_vars_idle.pl, cp_view_quotes.pl, cp_edit_quotes.pl, vars_idle.cgi (additional three quote files)

Download: ZIP File or MultiHack v2.0

Updates: v1.1 -
Instead of using a hardcoded filelist array, it now retrieves a list of files in the quotes directory.
With this method, adding/removing new quote files is much easier.
All you have to do is either delete a file from your NonCGI/quotes directory, or upload a new one (make sure the format is always "thequote|author").


v2.0 -
Major code changes. Two bugs spotted and fixed. New features include:
  • All files with extensions .cgi and .txt will be read within the quotes directory

Existing users will need to re-hack the following files:
ubb_lib_2.cgi - remove previous changes for this mod
ubb_forum_summary.cgi - redo step two for this file
cp.cgi - refer to instructions
Posted By: Lord Dexter Re: [6.3.x] [beta] Random Quotes - 05/26/2002 9:01 AM
Your doing great with these hacks Idle. Good job. smile

BTW, It's Zip, not a text file. wink
Posted By: ADWOFF Re: [6.3.x] [beta] Random Quotes - 05/26/2002 9:10 AM
Is there a demo of this somewhere? I'd love to see it in action.
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 05/26/2002 9:52 AM
Thank you, Lord Dexter!
I've done all kinds of things for my UBB... but never thought of publicizing my modifications until recently.
Beside... most of them aren't "documented", and I thought it'd be good to keep notes which turned out to be full-blown UBB mods. laugh

ADWOFF: You can see it on my UBB 6.3 test board .

Currently I'm working on a better CP interface, allowing administrators to view and edit the quote data files.
Might add an option to even create new ones and delete existing ones. laugh
Posted By: Lord Dexter Re: [6.3.x] [beta] Random Quotes - 05/26/2002 12:43 PM
I'm getting an error going to your test board.
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 05/26/2002 12:50 PM
I'd try again since I've been playing around with it all night long and probably generated a whole bunch of errors. :rolleyes:

But, it's working fine now, and I'll leave it alone for awhile. wink
Posted By: Variables Re: [6.3.x] [beta] Random Quotes - 05/26/2002 2:12 PM
It's generating a software error in cp.cgi
Posted By: Variables Re: [6.3.x] [beta] Random Quotes - 05/26/2002 6:15 PM
I've found an external cgi script that displays random quotes from a text file. All you have to do is put a line of javascript in the public_summary.pl and you have endless random quotes. If you want info on this, let me know. wink
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 05/26/2002 8:22 PM
quote:
Originally posted by Variables:
It's generating a software error in cp.cgi

Could you be a little more specific, and tell me the exact error?
Posted By: Zackary Re: [6.3.x] [beta] Random Quotes - 05/27/2002 12:14 AM
quote:
Originally posted by Idle:
quote:
Originally posted by Variables:
It's generating a software error in cp.cgi

Could you be a little more specific, and tell me the exact error?
Here's the error on your test board:

quote:
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

Can't open perl script "D:Inetpubwwwrootadvubbultimatebb.cgi": No such file or directory

Hope that helps,

~Z
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 05/27/2002 1:33 AM
Oh... silly, little Idle!
Hahahaha, I posted incomplete URL. :rolleyes:

Try this instead. smile
Posted By: Lord Dexter Re: [6.3.x] [beta] Random Quotes - 05/27/2002 9:03 AM
Cannot Find Server...
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 05/27/2002 9:29 AM
Sorry, was re-installing Windows.
It's up again. smile
Posted By: Lord Dexter Re: [6.3.x] [beta] Random Quotes - 05/27/2002 11:39 AM
It finally worked, good to see this hack in action. smile
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 05/27/2002 11:55 AM
Yeah.
Although the method posted by Variables above would be much easier, I like the idea of being able to modify the quotes from the UBB Control Panel.
Then I can let my moderators do the chores! laugh
Posted By: JonNJapan Re: [6.3.x] [beta] Random Quotes - 05/27/2002 12:01 PM
Cool! I like it. Would there be a possibility of making a multihack file for this?

~Jon
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 05/27/2002 10:03 PM
Yeah, that should be possible. I'll have a look in a few when I've had my first cup of coffee. smile

Edit: Done! laugh
Posted By: Syntax Re: [6.3.x] [beta] Random Quotes - 05/29/2002 3:18 PM
If you like the quotes to be displayed into a table (like thinking clock, recent visitors) change the following (adjusted step 10 in MH):

Cant display code due to installed code filter
Grab the code
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 05/29/2002 10:06 PM
Nice!
Posted By: AllenAyres Re: [6.3.x] [beta] Random Quotes - 05/29/2002 10:47 PM
Nice one idle... I've been needing to replace the javascript one that broke on my site months ago smile
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 05/29/2002 11:20 PM
Yeah, isn't it wonderful what 20 gallons of coffee and no rest can do? laugh
Posted By: Eaglecrew Re: [6.3.x] [beta] Random Quotes - 05/29/2002 11:23 PM
Very nice! Thought I had probs with those window error messages until I checked the txt quotes though!!! wink laugh
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 05/30/2002 1:37 AM
Well... it happened to me one late night after hours of coding in Perl. :rolleyes:

The quotes in "pc.txt", I collected most of them from annoyances.com, by the way.
Posted By: lazyeugene Re: [6.3.x] [beta] Random Quotes - 05/30/2002 11:04 AM
The test for safety.
Posted By: lazyeugene Re: [6.3.x] [beta] Random Quotes - 05/30/2002 11:08 AM
The test for safety2.
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 05/30/2002 11:48 AM
Eh?
Posted By: ADWOFF Re: [6.3.x] [beta] Random Quotes - 06/03/2002 8:24 AM
I'll have to play with this later on.

I installed using Idle's Multihack, but nothing showed up--even after clearing the cache.

So I installed Syntax's code for step 10.

In the regular template, the area for the quote appeared, but no quote.

In the JCTemplate, I received a syntax error.

My brain is a fog right now, so I'll look at it later on ... is there something I'm missing in the CP for the quotes to appear?

I turned it on; I went to where you could add/revise the quotes.

No quotes appear. frown
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 06/03/2002 9:26 AM
*censored* MultiHack!@#

Sorry, I'll have a look at it soon (maybe 2 cups of coffee from now).

I don't think you missed anything, rather that I've screwed up somewhere in the MultiHack thing.
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 06/03/2002 10:04 AM
I think it's been fixed.

Noticed some errors in the instructions for modifying JCTemplates, and vars_idle.cgi should be uploaded to your Variables directory, of course (I wrote to the CGI directory).

If MultiHack isn't creating directories properly, well...

create a new directory in your NonCGI directory named "quotes", and upload the included .txt files to that directory (moti- pc- and research_def.txt).

Hope that solves your problem. smile
Posted By: Laura_ubb Re: [6.3.x] [beta] Random Quotes - 06/03/2002 5:24 PM
How random is it? I installed it and it only changes after I clear the cache. Otherwise everytime time I visit my test board its got the same quote on.

Thankyou :kiss:
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 06/03/2002 6:11 PM
Well... it's as random as it gets.

I had noticed that before, the quote isn't updated on the forum summary page unless you clear your cache, or disable caching completely. Kinda sad... frown

I'll look around for possible "solutions" so it's updated on every view of the page. smile

Thanks for the reminder!
Posted By: Laura_ubb Re: [6.3.x] [beta] Random Quotes - 06/03/2002 6:15 PM
quote:
Originally posted by Idle:
Well... it's as random as it gets.

I had noticed that before, the quote isn't updated on the forum summary page unless you clear your cache, or disable caching completely. Kinda sad... frown

I'll look around for possible "solutions" so it's updated on every view of the page. smile

Thanks for the reminder!

Thanx babe. *kiss*
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 06/03/2002 6:33 PM
One way around this problem would be to clear the forum summary cache right before the page is displayed... but I wouldn't recommend it since it puts so much extra load on the server and slows the process down considerably.
Well, or that's what it does on my server at least. :rolleyes:

If you want to give it a try, then follow these instructions:

[code][/code]
Posted By: Syntax Re: [6.3.x] [beta] Random Quotes - 06/03/2002 7:36 PM
quote:
Originally posted by Laura_ubb:
How random is it? I installed it and it only changes after I clear the cache. Otherwise everytime time I visit my test board its got the same quote on.

Thankyou :kiss:

I believe it is changing every hour or so, atleast it does at my board smile
Posted By: Laura_ubb Re: [6.3.x] [beta] Random Quotes - 06/03/2002 7:58 PM
[code][/code][/b]
Gave it ago and it works, but it does put a lot of pressure on the server. Also a lot slower too frown
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 06/03/2002 8:20 PM
Yeah.

I'll have another look after dinner, maybe I can come up with something better, who knows! wink
Posted By: ADWOFF Re: [6.3.x] [beta] Random Quotes - 06/03/2002 8:47 PM
Well, nuts.

I tried installing this again. No dice.

I hacked using the text file. No dice.

I'm pretty sure I chmoded everything correctly.

I uploaded the text files to a newly created quotes directory.

I cleared the cache.

Opened the board.

Nothing. Nada. frown

The only way I can even get the "Random Quote" table to appear is with Syntax's code; but even then, the quote doesn't appear. frown

I guess I'll pass on this hack for now.
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 06/03/2002 9:25 PM
Wai-wai-wai-wait a minute!
You're using UBB v6.2?

This mod's made for the 6.3x series, and shouldn't work under earlier versions without some modifications.
Posted By: Deb Re: [6.3.x] [beta] Random Quotes - 06/03/2002 11:11 PM
quote:
Originally posted by Idle:
Wai-wai-wai-wait a minute!
You're using UBB v6.2?

This mod's made for the 6.3x series, and shouldn't work under earlier versions without some modifications.

Sue's test board is v6.3 and I think that's where she probably tried it. smile
Posted By: ADWOFF Re: [6.3.x] [beta] Random Quotes - 06/03/2002 11:55 PM
quote:
Originally posted by Deb:
quote:
Originally posted by Idle:
Wai-wai-wai-wait a minute!
You're using UBB v6.2?

This mod's made for the 6.3x series, and shouldn't work under earlier versions without some modifications.

Sue's test board is v6.3 and I think that's where she probably tried it. smile
Deb's right! I've been trying to set up my test board so that I can upgrade my main board. laugh
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 06/04/2002 5:29 AM
Doh!

I just gave the text instructions yet another try on a fresh install of UBB v6.3,
and it seems to work just fine.

Try downloading the text instructions again, I just updated it now.
I may have missed something the last time. smile
Posted By: Dragon Motorsports Re: [6.3.x] [beta] Random Quotes - 06/04/2002 8:54 PM
I am having the same problem with my board as well. No quotes, yet Syntax table is showing up. I installed using the newest text directions in the link in this thread and I imported the instructions to Multi hack. Still a no go. http://snow.prohosting.com/dms78363/cgi-bin/ultimatebb.cgi
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 06/04/2002 11:06 PM
Hmm... could you open vars_idle.cgi (variables/cgi directory) and post the contents here?

You can also try the following to see if UBB is actually reading the quotes properly:

[code][/code]Then look for "rq_debug.txt" in your NonCGI directory, open it and see if there has any quote been written to it.
Posted By: Dragon Motorsports Re: [6.3.x] [beta] Random Quotes - 06/05/2002 4:00 AM
Nope no text file in either cgi nor non cgi directories. Also the vars_idle.cgi coding is here:
[code][/code]
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 06/05/2002 1:07 PM
I had a look at the instructions again, and added a couple of steps... re-tested everything as well.

Download the updated instructions.

You'll need to overwrite cp_quotes.cgi, do the two steps added for ultimatebb.cgi and the two ones added for cp.cgi.

Oh, I also updated the code for modifying your public_forum_summary.pl (both normal and JCTemplates).

Give it a try and see if that works. smile
Posted By: Dragon Motorsports Re: [6.3.x] [beta] Random Quotes - 06/05/2002 5:05 PM
Nope. Same thing. I started from scratch on the same hacked board. I made a mhp file out of the updated instructions as well. I also noticed that one step in cp.cgi was repeated twice. Or at least there is not two lines with :
[code][/code]The MHP file I made with Multi Hack v2.0 can be downloaded here:
http://snow.prohosting.com/dms78363/hacks/rqs_63xx.mhp

I don't think I messed anything up. And I am not using JCTemplates at all.
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 06/05/2002 7:14 PM
Oops... I updated the text instructions, for some reason I had pasted the cp.cgi code twice.

Oh, and added the "missing" step for ultimatebb.cgi as well.

If you still don't have any luck with that,
you can PM me your test board's stuff and I'll have a look and modify the thing for you. wink
Posted By: Dragon Motorsports Re: [6.3.x] [beta] Random Quotes - 06/05/2002 9:51 PM
Ok, again I updated the multihack file I made and nothing, so I just did it by hand and bam now I got quotes. For some reason it dont like the multi hack. I mopdified the instructions a little where you have to put the variables in. Maybe I was supposed to use insert instead of add after. smile anyway I got mine working. Was hoping to update a Multi hack for you but oh well. Now all we need is that little cache bug fixed to get the quotes to refresh. Without having to clear the cache on every page load. smile good hack though.
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 06/05/2002 10:29 PM
Finally!

I'm new to this MultiHack stuff... don't like it at all, but then again that's just my not so humble opinion. tipsy

Yeah, as for the cache "bug", I'm still trying to figure something out for that one.
But doesn't it change when someone posts on your board?
It should do (it does for me) since the forum summary cache is cleared after each new post made. confused
Posted By: Dragon Motorsports Re: [6.3.x] [beta] Random Quotes - 06/05/2002 11:15 PM
Good point. I will keep an eye out for that.
Posted By: Laura_ubb Re: [6.3.x] [beta] Random Quotes - 06/05/2002 11:37 PM
Yay, mine does update after someone posts. Which is not that bad, does get people to post afterall. tipsy
Posted By: Idle Re: [6.3.x] [beta] Random Quotes - 06/06/2002 12:28 AM
Yeah.
In my opinion it's alright.
After all, the quotes aren't supposed to attract your visitors, constantly refreshing just to see the next one. tipsy
© UBB.Developers