[Request] Random Quotation MOD

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Suggested Hosts
Tanapangarap
Registered User
Posts: 67
Joined: Sat Mar 11, 2006 5:18 am
Contact:

[Request] Random Quotation MOD

Post by Tanapangarap »

Random quotation is one of several MODs I'll be requesting and hoping to have taken up.

http://www.brad-johnson.com/forum/index.php

I link to my forum because I want you to take a look at how the MOD looks on my forum. Scroll down near the bottom of the index, and you will see the random quotation area below the "Who Is Online" or, as I renamed it, "Forum Statistics" section. I would like to be able to do that.

The particular random quotation MOD I'm using is "Random Quotes 2.0". Unfortunately, I couldn't find it searching this forum, but I do have the MOD saved on my hard drive, so here is the info:

Code: Select all

###########################################################################################
## Hack Title:   Random Quotes 
## Hack Version: 2.0 
## Author:       Yo^Bam <yobam@linux.nu> 
## Fixed by:     Acid <acid_junky@web.de
## Description:  Displays a random quote on your phpBB. 
## 
## Files To Edit:  index.php, index_body.tpl 
## Included Files: quotes.txt
###########################################################################################
## 
## quotes.txt goes in your phpBB root dir.
##
###########################################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
###########################################################################################

# 
#-----[ OPEN /index.php ]------------------------------ 
# 

# 
#-----[ FIND around line 262 ]----------------------------------- 
# 

	$template->assign_vars(array( 
	      'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),

# 
#-----[ REPLACE WITH ]------------------------------------------- 
# 

	srand ((double) microtime() * 1000000); 
	$zitate = file("quotes.txt"); 
	$i = count($zitate)-1; 

	   $template->assign_vars(array( 
	      'QUOTE' => $zitate[rand(0,$i)], 
	      'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),


# 
#-----[ OPEN /templates/xxx/index_body.tpl ]------------------------------ 
# 

# 
#-----[ ADD wherever you want ]----------------------------------- 
# 

	<span class="gen">{QUOTE}</span> 


# 
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------- 
# EoM
The above MOD came with a quotes.txt file that I placed on my forum's root directory, and it's that file the MOD reached for for the quotations it would display on random on the index.

Extra features such as. . .
-- the ability for users to submit their own quotations into a queue for validation by the admin;
-- the ability for users to comment on any quotation sort of like each random quotation having a guestbook page;
would be cool but aren't as important for me as just having a MOD that does the same thing and can be made to look and function the same way as the one I'm currently using.

EDIT: Also, the quotes.txt file uses html to format the quotes, and each quote is recognized by being on a new line. I was wondering if this could be applied to a phpBB3 MOD, or if I'd have to reformat my whole list.
geoffreak
Registered User
Posts: 591
Joined: Sat Feb 12, 2005 8:39 am
Contact:

Re: [Request] Random Quotation MOD

Post by geoffreak »

just modify viewtopic and add a template variable then use it under the html replacement of your bbcode.
I should work, but no guarantees ;)
Anime Revolution - Your new #1 source for All things anime and manga!
READ MY BLOG ALREADY!
Tanapangarap
Registered User
Posts: 67
Joined: Sat Mar 11, 2006 5:18 am
Contact:

Re: [Request] Random Quotation MOD

Post by Tanapangarap »

Sorry, but I'm not completely grasping how to go about doing what you advised, as I am a novice with modification of the phpBB software. Did any of what you said have to do with how I'm going to get the modification to pull quotations from the quotes.txt file in the root directory?
geoffreak
Registered User
Posts: 591
Joined: Sat Feb 12, 2005 8:39 am
Contact:

Re: [Request] Random Quotation MOD

Post by geoffreak »

Nevermind then.
Stick with the request :lol:
Anime Revolution - Your new #1 source for All things anime and manga!
READ MY BLOG ALREADY!
yaw_pakhtoon
Registered User
Posts: 107
Joined: Wed Sep 12, 2007 12:18 am

Re: [Request] Random Quotation MOD

Post by yaw_pakhtoon »

thanks.. i've been looking everywhere for this mod..

:D

i've been wodering, which version of shoutbox did you use..

thanks.
Image
User avatar
*Capmaster*
Registered User
Posts: 159
Joined: Tue Mar 20, 2007 5:00 pm
Location: Albuquerque, NM
Contact:

Re: [Request] Random Quotation MOD

Post by *Capmaster* »

I had the hack on my old ver. 2 forum and I'm also looking for a version for phpBB3.

One was being developed here, but it got shelved for awhile:

http://www.phpbb.com/community/viewtopi ... dom+quotes

I'll echo the OP and request that someone write this mod ;)
User avatar
*Capmaster*
Registered User
Posts: 159
Joined: Tue Mar 20, 2007 5:00 pm
Location: Albuquerque, NM
Contact:

Re: [Request] Random Quotation MOD

Post by *Capmaster* »

geoffreak wrote:just modify viewtopic and add a template variable then use it under the html replacement of your bbcode.
I should work, but no guarantees ;)
I know how to do this. I'll give it a try.

If it works I'll post the edits here.
User avatar
*Capmaster*
Registered User
Posts: 159
Joined: Tue Mar 20, 2007 5:00 pm
Location: Albuquerque, NM
Contact:

Re: [Request] Random Quotation MOD

Post by *Capmaster* »

That was easy :mrgreen:

All I had to do was modify the syntax in the index.php edit.

Here's the mod install file:
###########################################################################################
## Hack Title: Random Quotes
## Hack Version: 2.0
## Author: Yo^Bam <yobam@linux.nu>
## Fixed by: Acid <acid_junky@web.de
## Adapted to phpBB3 by: Capmaster <admin@convopit.org>
## Description: Displays a random quote on your phpBB.
##
## Files To Edit: index.php, index_body.html
## Included Files: quotes.txt
###########################################################################################
##
## quotes.txt goes in your phpBB root dir.
##
###########################################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
###########################################################################################

#
#-----[ OPEN /index.php ]------------------------------
#

#
#-----[ FIND ]-----------------------------------
#

$template->assign_vars(array(
'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),

#
#-----[ REPLACE WITH ]-------------------------------------------
#
srand ((double) microtime() * 1000000);
$zitate = file("quotes.txt");
$i = count($zitate)-1;
$template->assign_vars(array(
'QUOTE' => $zitate[rand(0,$i)],
'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),


#
#-----[ OPEN /styles/XXXXX/template/index_body.html ]------------------------------
#

#
#-----[ ADD wherever you want ]-----------------------------------
#

<span class="gen">{QUOTE}</span>


#
#-----[ SAVE/CLOSE ALL FILES ]-----------------------------------
# EoM
Here's the Quotes.txt file you place in your forum root. This came with the hack. You can add your own quotes to it. Just follow the same format - one quote per line ;) I've added some from members of my forum to mine:
There is hopeful symbolism in the fact that flags do not wave in a vacuum. - Arthur C. Clarke
People who say they sleep like a baby usually don't have one. - Leo J. Burke
For four-fifths of our history, our planet was populated by pond scum. - J.W. Schopf
I'm all in favor of keeping dangerous weapons out of the hands of fools. Let's start with typewriters. - Solomon Short
Irrigation of the land with seawater desalinated by fusion power is ancient. It's called 'rain'. - Michael McClary
The capacity of human beings to bore one another seems to be vastly greater than that of any other animal. - H. L. Mencken (1880 - 1956)
The only time to buy these is on a day with no 'y' in it. - Warren Buffett
Treat all disasters as if they were trivialities but never treat a triviality as if it were a disaster. - Quentin Crisp
Last edited by *Capmaster* on Thu Jul 31, 2008 8:02 pm, edited 1 time in total.
Amatsu
Registered User
Posts: 10
Joined: Fri Feb 08, 2008 3:04 pm

Re: [Request] Random Quotation MOD

Post by Amatsu »

Hello.

I've tried your script Capmaster but it doesn't work, I think you may be missing a line perhaps, the one that points out where to find the quotes.txt.

I was looking forward to a mod like this, so cheers.
User avatar
*Capmaster*
Registered User
Posts: 159
Joined: Tue Mar 20, 2007 5:00 pm
Location: Albuquerque, NM
Contact:

Re: [Request] Random Quotation MOD

Post by *Capmaster* »

Amatsu wrote:Hello.

I've tried your script Capmaster but it doesn't work, I think you may be missing a line perhaps, the one that points out where to find the quotes.txt.

I was looking forward to a mod like this, so cheers.
Oops :oops: DUH! :D I forgot three lines.

Edits made to post above. Thanks for catching that ;)
User avatar
Lightfeather
Registered User
Posts: 246
Joined: Sat Jan 25, 2003 4:52 am

Re: [Request] Random Quotation MOD

Post by Lightfeather »

Thanks very much for this. My forum is starting to feel a little bit more like "home" again.
"Experience is what you get when you don't get what you want."
Amatsu
Registered User
Posts: 10
Joined: Fri Feb 08, 2008 3:04 pm

Re: [Request] Random Quotation MOD

Post by Amatsu »

Hello again. I've manage to install it and apparently works fine, but I have an issue, the quotes only apprear when I'm at the index, when I enter into a section of the forum or a post it disappears! I have to go back to the index to see the quote again.

Are you having the same problem or is it just me? Thank you.
User avatar
DragonMaster1
Registered User
Posts: 994
Joined: Tue Aug 17, 2004 11:04 am
Name: Terry
Contact:

Re: [Request] Random Quotation MOD

Post by DragonMaster1 »

Amatsu wrote:Hello again. I've manage to install it and apparently works fine, but I have an issue, the quotes only apprear when I'm at the index, when I enter into a section of the forum or a post it disappears! I have to go back to the index to see the quote again.

Are you having the same problem or is it just me? Thank you.
GREAT MOD!!!

Mine does this also, but I was thinking that if they were on every page they might get old seeing them all the time

I think I prefer only on the index...at least for my board
User avatar
Lightfeather
Registered User
Posts: 246
Joined: Sat Jan 25, 2003 4:52 am

Re: [Request] Random Quotation MOD

Post by Lightfeather »

That's because when you make edits to index they only show up on the index. If you want the quotes to show up everywhere you have to make edits to the overall_header but I'm not sure how to go about it.
"Experience is what you get when you don't get what you want."
Amatsu
Registered User
Posts: 10
Joined: Fri Feb 08, 2008 3:04 pm

Re: [Request] Random Quotation MOD

Post by Amatsu »

Actually I did it in the overall_header. The thing is if I manually write some text in there it shows up everywhere, but for some reason the quotes only appear when you are in the index of the forum.
Locked

Return to “[3.0.x] MOD Requests”