Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
#152968 05/26/2002 12:09 AM
Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
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

Sponsored Links
Joined: May 2001
Posts: 6,708
Member
Member
Offline
Joined: May 2001
Posts: 6,708
Your doing great with these hacks Idle. Good job. smile

BTW, It's Zip, not a text file. wink

Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
Is there a demo of this somewhere? I'd love to see it in action.


Sue
adwoff.com
Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
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

Joined: May 2001
Posts: 6,708
Member
Member
Offline
Joined: May 2001
Posts: 6,708
I'm getting an error going to your test board.

Sponsored Links
Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
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

Joined: Dec 2000
Posts: 371
Member
Member
Offline
Joined: Dec 2000
Posts: 371
It's generating a software error in cp.cgi

Joined: Dec 2000
Posts: 371
Member
Member
Offline
Joined: Dec 2000
Posts: 371
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

Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
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?

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
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

Sponsored Links
Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
Oh... silly, little Idle!
Hahahaha, I posted incomplete URL. :rolleyes:

Try this instead. smile

Joined: May 2001
Posts: 6,708
Member
Member
Offline
Joined: May 2001
Posts: 6,708
Cannot Find Server...

Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
Sorry, was re-installing Windows.
It's up again. smile

Joined: May 2001
Posts: 6,708
Member
Member
Offline
Joined: May 2001
Posts: 6,708
It finally worked, good to see this hack in action. smile

Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
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

Joined: Jun 2001
Posts: 572
Member
Member
Offline
Joined: Jun 2001
Posts: 572
Cool! I like it. Would there be a possibility of making a multihack file for this?

~Jon

Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
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

Joined: May 2002
Posts: 18
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 18
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

Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
Nice!

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Nice one idle... I've been needing to replace the javascript one that broke on my site months ago smile


- Allen wavey
- What Drives You?
Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
Yeah, isn't it wonderful what 20 gallons of coffee and no rest can do? laugh

Joined: May 2002
Posts: 28
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 28
Very nice! Thought I had probs with those window error messages until I checked the txt quotes though!!! wink laugh

Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
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.

Joined: May 2002
Posts: 2
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 2
The test for safety.

Joined: May 2002
Posts: 2
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 2
The test for safety2.

Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
Eh?

Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
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


Sue
adwoff.com
Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
*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.

Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
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

Joined: Apr 2001
Posts: 218
Member
Member
Offline
Joined: Apr 2001
Posts: 218
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:

Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
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!

Joined: Apr 2001
Posts: 218
Member
Member
Offline
Joined: Apr 2001
Posts: 218
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*

Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
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]

Joined: May 2002
Posts: 18
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 18
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

Joined: Apr 2001
Posts: 218
Member
Member
Offline
Joined: Apr 2001
Posts: 218
[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

Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
Yeah.

I'll have another look after dinner, maybe I can come up with something better, who knows! wink

Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
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.


Sue
adwoff.com
Joined: Sep 2001
Posts: 379
Member
Member
Offline
Joined: Sep 2001
Posts: 379
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.

Joined: Feb 2000
Posts: 2,668
Deb Offline
Pooh-Bah
Pooh-Bah
Offline
Joined: Feb 2000
Posts: 2,668
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
Joined: May 2001
Posts: 794
Content Queen
Content Queen
Offline
Joined: May 2001
Posts: 794
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


Sue
adwoff.com
Page 1 of 2 1 2

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)