How to add Daily Quotes on the homepage

okweb posted 6th of December 2008 in Community Voice. 6 comments.

You need first to add a new PHP Block,

I have used @newdreamers - How_to_enable_PHP_block_in_the_Page_Builder 

to do this here.

You can also past PHP-code bellow to your DB if you prefer to use jtadeo - How_to_Add_PHP_in_a_BLOCK

-----------------------------------------------------------

1: Builders/Pages Builder -> Homepage

Add a new PHP block in the Page Builder


Caption Lang Key: _Quotes
Visible for:  Guest  Member 
PHP-code:
$arr = db_arr("SELECT `Text`, `Author` FROM DailyQuotes ORDER BY RAND() LIMIT 1");

echo "
<table cellspacing=\"0\" cellpadding=0>
<tr><td><i>{$arr['Text']}</i></td></tr>
<tr><td><b>{$arr['Author']}</b></td></tr>
</table>
";

-----


2: Settings/Languagees Setting -> Add a new language key

New language key name: _Quotes
Category: Page titles
String texts for available languages: Daily Quotes

 

Now you can take a look at your site.

 
Comments
·Oldest
·Top
Please login to post a comment.
iced
Cheers for the useful info... :)
jtadeo
oh wow!

okweb very niiice.

Mahvelous, just mahvelous.

Thanks for spawning this a bit more. Great kudos to both you and newdreamwers.

It is generous acts like this that help a community to grow.

...sip...
aishah
see moresorry but i can`t find the no.1
can you explain me again no.1 please

1: Builders/Pages Builder -> Homepage

Add a new PHP block in the Page Builder


Caption Lang Key: _Quotes
Visible for: Guest Member
PHP-code:
$arr = db_arr("SELECT `Text`, `Author` FROM DailyQuotes ORDER BY RAND() LIMIT 1");

echo "
<table cellspacing=\"0\" cellpadding=0>
<tr><td><i>{$arr['Text']}</i></td></tr>
<tr><td><b>{$arr['Author']}</b></td></tr>
</table>
";
okweb
You need to add a PHP block first, Dolphin don't have it as default so you need to add this first.

You can use @newdreamers code to do it
http://www.boonex.com/unity/blog/entry/How_to_enable_PHP_block_in_the_Page_Builder

or you use @jtadeo code to do it
http://www.boonex.com/unity/blog/entry/How_to_Add_PHP_in_a_BLOCK

If you are a bit comfortable with edit some PHP code and use phpMyAdmin I would have used @newdreamers way to do it.(Very easy to add a new PHP block later)
--------------------

When see more you have added @newdreamers code/change,
then you can add a new PHP block in the Page Builder.

Now you can use my code to add Daily Quotes to homepage.
okweb
See my first post for the correct URL address
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.
PET:0.061444997787476