HomeNotesHow to add Daily Quotes on the homepage
1267 days ago in 
Reactions: 6 comments 7 points0 reports
 
 

How to add Daily Quotes on the homepage

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.

Plussed by

 
 
 
 

Comments

Oldest First
|
Threaded
 
 
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
 
 
 
PET:0.071371078491211