nitro |
05-25-2006 08:47 AM |
Quote:
Originally Posted by Cap'n Steve
Attached are instructions for adding a random quote block to vBadvanced CMPS. vBportal seems to have become a commercial product, if anyone knows how to create addons for that, please let me know.
UPDATE: Added instructions for adding quotes to the quick moderation block.
|
Should be fairly simple to make the vba portal module work in vbPortal:
Not tested, Do try this @ Home first
You can never have enough db backups
Dont blame me if you havent followed the above
Code box used for vb licenced users veiwing only.
Code:
Copy the content of this vbA modules php (quote.php) code to your fav text editor dropping the <?php and the ?> (first and last line).
Add this global line probably before any other.
global $vbpoptions, $vbplingual, $vboptions, $vbphrase, $db;
Find:
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('quote_randomquote') . '";');
and change to:
eval('$showrandquote = "' . fetch_template('quote_randomquote') . '";');
and add below it:
return $showrandquote;
Now hop into your vbPortal CP and add a new block
Type: php
Title: Random quote
Weight: any number above 0
Link: (optional add link to the quote page if you want)
Uses templates: No (*for now)
save and then add your new php code to the text area and save again.
Preview block in the vbPortal CP
All good go toggle it on where you like in your module manager.
*Dont like the display ( portal block output )?
Copy the quote_randomquote template to P_quote_randomquote
Edit your block and change this line from:
eval('$showrandquote = "' . fetch_template('quote_randomquote') . '";');
to:
eval('$showrandquote = "' . fetch_template('P_quote_randomquote') . '";');
Now you can edit the portal output without affecting the forum home output. You may wish to try setting the block to use templates now. :)
Note this is not tested and is only show random quote with rating, but I think I may know someone who wants to try it out. ;)
Final note: ensure your quoteit threshold setting is such that you will get a random quote or you might not get displayed what was expected.
Thanks to Sandman53 for being the guineapig. ;)
|