![]() |
vBulletin 3 Request - Random Quotes
Hello Again,
Does anyone happen to know the best method to have random quotes displayed everytime a page in vBulletin is refreshed? An image of where I have setup for the quotes to be displayed is as follows: http://i.imgur.com/29KA8Fk.png?1 And the code for that is: Code:
<table class="tcat" cellpadding="4" cellspacing="0" border="0" width="100%" align="center" style="border-top:1px solid $stylevar[tborder_bgcolor]; border-bottom:1px solid $stylevar[tborder_bgcolor]"> |
What I would do is define a 2D array of quotes, where each element of the array contains a quote and the author, and then generate a random number between 1 and the length of the array (inclusive), then pass the selected array element to your template. :)
|
Quote:
|
You could use a global plugin hook, and I believe in vB 3 you don't even need to register the variables in your template.
I don't have time right now, but if you want, I will look into creating a vB 3.8.x product to do this. :) |
So you can use the plugin in much the same way as I did to define the $quotemain for the footer template, right?
Code:
eval('$quotemain= "' . fetch_template('quotes_main') . '";'); --------------- Added [DATE]1491083304[/DATE] at [TIME]1491083304[/TIME] --------------- Quote:
Code:
<script type="text/javascript" src="clientscript/quotes_database.js"></script> PHP Code:
PHP Code:
http://i.imgur.com/WKaQou4.png?1 -Sara |
Use this.... edit to your liking
I have an edited version of it on my site. https://vborg.vbsupport.ru/showthrea...highlight=tips |
Quote:
|
All times are GMT. The time now is 12:04 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|