Random Quote

Started by Marcus Forsberg, January 31, 2009, 06:52:59 PM

Previous topic - Next topic

Marcus Forsberg




Random Quote 1.2.2.1
Show a random quote on each page. Quotes are set by admins.
Link to Mod | Comment On This Mod

Author: Nas
Type: New Feature
Available since: January 31 2009
Latest version: 1.2.2.1
Compatible with: SMF 1.1.x, SMF 2.0 RC1.2
Available languages:



What does it do?
Random Quote will allow administrators to add a list of quotes in the admin panel. A random quote out of these will then be displayed under the menu in the forum.

How to use
To use Random Quote, download the package from the SMF customization site, and install it via your Package Manger.
Now set up the mod*, and it should start working.

* = Settings are located in
Admin > Modifications (2.0 RC1.2)
Admin > Features & Settings > Basic settings (1.1.x)


Support & comments
If you have a problem with this mod, want to comment, or have any question, please post to the modification support topic and I will reply as soon as possible.

Other information
Translation of this mod
o I am always happy to get translations of my work so that more users can use it. If you have translated this modification, please post the translation in the support topic.
Please make sure you have translated everything, and that there are no spelling misstakes etc.
Also, please post both a non-UTF8 version and a UTF8 version.


Changelog
1.2.2.1 | August 28 2009
* Support SMF 2.0 RC1.2
1.2.2 | May 27 2009
1 Fixed an undefined index error. Thanks to ke4obt for testing.
1.2.1 | May 23 2009
* Support SMF 2.0 RC1-1
1.2 | February 7 2009
+ Allow admins to colorize the label.
+ Made the box for entering quotes a bit bigger.
1.1 | February 2 2009
+ Added a box in the adminpanel where you can enter your own label instead of "Quote of the moment" (Requested by Mr.Tony)
1.0 | January 31 2009
$ The modification was finished and submitted to the SMF mod site, after being requested by TheDisturbedOne.





Changelog legend
+ New feature
- Feature removal
! Bugfix
> New language
< Removed language
* New version support
$ Initial release / Big update

Versionnames
Format: $.o.x.!
Example: 3.2.4.1

$ New version
o New features added
x Bugfix
! Small bugfix / New version support


Passed versions of this mod
1.2.2
1.2.1
1.2
1.1
1.0


Blinker

Thanks for this mod Nascar, I've been using the news feature for quotes, this is much better. Great work!

DareDevil1990

installed the mod without any porblems enabled it put some quotes but i dont see any change in my site...but if i make my sites heme default it works :(  what to do :(

Dzonny

great, i like this thing... :)

ke4obt

Hey Nas,

After adding quotes can they be changed from the ACP Featchers and/options area?
TNX Flip
Thanks Much

Flip - KE4OBT
     The Blind Ham
Helping other blind hams
get on the air!


Yes I am really a BLIND user!

So, if a mod doesn't install properly, and I can't get help from your part of the forum,
I will come begging for YOUR help since you wrote it and know how it works
um, uh, well,
At least I would really, really hope you do!
HEE-HEE-HEE

Marcus Forsberg

@MRDJ

You will have to make the edits to index.tempalte.php in your custom theme. Attach it here if you dont know how.

@ke4obt

Go to Admin > Features and Options and you should find everything there.

ke4obt

Hey Nas,

Think I asked the question the wrong way.
Should have asked if from the acp can i edit the quotes that i've already entered into random quotes?
I had already found the controles for the mod.

BTW. This is a great mod, now I'm waiting for the new x-revalution who's on line mod for smf 1.1.7,
(the wife said it looks realy nice).
Again GREAT work on a GREAT mod.
Thanks Much

Flip - KE4OBT
     The Blind Ham
Helping other blind hams
get on the air!


Yes I am really a BLIND user!

So, if a mod doesn't install properly, and I can't get help from your part of the forum,
I will come begging for YOUR help since you wrote it and know how it works
um, uh, well,
At least I would really, really hope you do!
HEE-HEE-HEE

fmofmpls

Great mod! I'm liking this a lot!

One question though, does the mod auto refresh itself whenever a member clicks back to a previously viewed page? It seems at times that the quote will disappear until you click on a new and un-viewed link or thread?

Mick.

Thanx NAS,  works very well.    I use it as "Did you know?" and then use facts.

Sudhakar Arjunan

This is one of the useful Mod Nas. Thanks for it.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Mick.

If you use www.dzinerstudio.com themes:


Find in IndexTemplate.php:

<div id="bodyarea">
<div id="body-wrap">';


Add after:

// Have the admin written any quotes to be used, and is the mod enabled?
if (!empty($modSettings['random_quote']) && !empty($modSettings['random_quote_enable']))
{

echo'
<br /><div class="tborder" style="padding: 5px;">';

// Seperate the quotes from each other.
$quotes = explode("\n", $modSettings['random_quote']);

// Number of different quotes
$num_quotes = count($quotes)-1;

// A random number
$number = mt_rand(0,$num_quotes);

echo'<b>' .$txt['random_quote_label']. '</b> ' .parse_bbc($quotes[$number]). '</div>';
}

blondeamon

Hmm the background white color ,esses badly with the eye....how can i change those? I use Dilbermc blue
Always looking for the best

www.kamenos.gr  Greek Gaming Community

TW1ST3D

Great Mod !! and Functional on so many Levels for so many different things !!

Is there any way to change the color of the "Quote of the Moment" Text ( the hard coded part)
Running 2.0 Gold.......SMF Rocks!!

blondeamon

I guess we could use html before every quote we write. But we need it to be in the index in order not to have to write it ourselves every time
Always looking for the best

www.kamenos.gr  Greek Gaming Community

TW1ST3D

Quote from: blondeamon on February 01, 2009, 12:35:13 PM
I guess we could use html before every quote we write. But we need it to be in the index in order not to have to write it ourselves every time

True, but if possible I'd rather Hard Code it, to keep from doing that...................
Running 2.0 Gold.......SMF Rocks!!

Marcus Forsberg

@TW1ST3D
Yes. In index.template.php, find:

echo'<b>' .$txt['random_quote_label']. '</b> ' .parse_bbc($quotes[$number]). '</div>';

Replace whit:

echo'<font color="#C9C9C9"><b>' .$txt['random_quote_label']. '</b></font> ' .parse_bbc($quotes[$number]). '</div>';

Replace #C9C9C9 whit your color.




@blondeamon
You could change "tborder" in this section:

<div class="tborder" style="padding: 5px;">

To "catbg", "catbg2", "titlebg" or "topbg".




@fmofmpls
I don't think the quote will be updated if they use the back button.




@ke4obt
Yes, you can edit them.




@Everyone
Thanks for the comments, and I am glad you enjoyed this. It was very simple and I did it very fast.

TW1ST3D

@ Nas


Thanks.............I thought it would be easy..................
Running 2.0 Gold.......SMF Rocks!!

blondeamon

Perfect now the font color is what i wanted it to be, i used 000000 for black.

One more thing, what do i need to add to change the quotes colour as well? Its still white.

Great great mod
Always looking for the best

www.kamenos.gr  Greek Gaming Community

Mick.

Quote from: blondeamon on February 01, 2009, 01:12:04 PM
Perfect now the font color is what i wanted it to be, i used 000000 for black.

One more thing, what do i need to add to change the quotes colour as well? Its still white.

Great great mod

Add your text between these tags  [color=red][/color] in admin.

fmofmpls

Quote from: fmofmpls on February 01, 2009, 10:38:36 AM
It seems at times that the quote will disappear until you click on a new and un-viewed link or thread?

My bad. I was seeing periodic blank lines because I included a blank line between quotes. Took out the blank lines between quotes and all is working well now! What a fun mod! Thanks again!

Advertisement: