List all Joomla rated / voted articles

Joomla built in rating / voting plugin allows visitors to vote on your articles. You can view ratings in the front end at the top of each article, but there is no easy way to see all rated articles in one place. This can be done using a simple SQL query.

This assumes that you are using phpMyAdmin:

  1. Login into your Joomla site phpMyAdmin control panel.
  2. On left hand side click on your website database.
  3. Click on SQL tab
  4. Paste following SQL query and press Go

    SELECT Content.id AS ID, title AS Title, rating_sum / rating_count AS Rating, rating_count AS Count, rating_sum AS Sum
    FROM jos_content_rating
    LEFT JOIN jos_content AS Content ON id = content_id
    ORDER BY id

Change your database table prefix from jos_ to whatever you have in your database.

The query will return a table with:
Article ID
Article Title
Current Rating
Number of Votes
Rating Sum

Sorted by Article ID. You can click on column headings to sort by different criteria.

To avoid having manually copy and paste SQL query every time, your can save it as a view, by clicking Create View at the bottom of the page. View will be displayed in your database tables list.

Joomla – insert module into article

Normally you can’t place module within articles. However there is easy workaround which allows you to do exactly this.

  1. Customize your Module
    Extensions > Module Manager  > [your module]
    Customize your module as required.
    Then go to Position field, delete existing entry and type your own custom position e.g. content_my_module. You can type pretty much any name, but don’t use existing built in positions such as left, right, top, user1, etc.
    Save module
  2. Enable "Load Module" Plugin
    Extensions > Plugin manager > Content - Load Module
    Make sure plugin is enabled and Style is set to No wrapping (raw output)
    Save Plugin
  3. Open your article and in place where you want the module to appear type where content_my_module is position name you created in step 2
Joomla 1.5

Add additional fields to a Joomla 1.5 registration form

There is no easy way to add additional fields to a default Joomla 1.5 registration form. This can be done by installing third party extensions or changing some core Joomla files. Changing core files is normally not recommended as Joomla update may overwrite them. If you upgrade to Joomla 1.6/1.7 it can be achieved much easier as explained in this article. However if you don't want to upgrade this article explains how you can add additional field by changing core files.

In this example we will add an optional "Address" field to a default Joomla 1.5 registration form, but obviously you can add more fields if required.

1. Add additional field to the database table

Login into your phpMyAdmin control panel, open jos_users table, click on Structure tab.
Add 1 field After email and click GO
Add additional fields to a Joomla 1.5 registration form
Fill following fields:
Field: cust_address
Type: TEXT
Click SAVE
Add additional fields to a Joomla 1.5 registration form

2. Change registration form

This will add a new address field into user registration form.

Edit file: components/com_user/views/register/tmpl/default.php

In section:
<form action="<?php echo JRoute::_
after
<tr>
<td height="40">
<label id="emailmsg" for="email">
<?php echo JText::_( 'Email' ); ?>:
</label>
</td>
<td>
<input type="text" id="email" name="email" size="40" value="<?php echo $this->escape($this->user->get( 'email' ));?>" maxlength="100" /> *
</td>
</tr>
Add following code:
<tr>
<td height="40">
<label id="cust_address" for="cust_address">
<?php echo JText::_( 'Address'); ?>:
</label>
</td>
<td>
<input type="text" id="cust_address" name="cust_address" size="40" maxlength="200" value="<?php echo $this->user->get('cust_address'); ?>"/>
</td>
</tr>

3. Add a new variable to user.php

This will ensure new Address entry is saved to the database.

Edit file: libraries/joomla/database/table/user.php

Just after:
class JTableUser extends JTable
{
Add
:
var $cust_address = null;

4. Change the back-end

This will allow to view and edit new Address field in the back-end.

Edit file: administrator/components/com_users/views/user/tmpl/form.php

In section:
<form action="index.php" method="post" name="adminForm" autocomplete="off">
after:
<tr>
<td>
<label for="email">
<?php echo JText::_( 'Email' ); ?>
</label>
</td>
<td>
<input type="text" name="email" id="email" size="40" value="<?php echo $this->user->get('email'); ?>" />
</td>
</tr>
Add following code:
<tr>
<td>
<label for="cust_address">
<?php echo JText::_( 'Address'); ?>
</label>
</td>
<td>
<input type="text" name="cust_address" id="cust_address" size="40" value="<?php echo $this->user->get('cust_address'); ?>" />
</td>
</tr>

Tested on Joomla 1.5.23

Newsletter

Subscribe to receive occasional updates on new posts.
Your email will not be used for any other purpose and you can unsubscribe at any time.
Please wait