Jump to content

Automated Client Reviews Into Joomla


IsaiahH

Recommended Posts

OK, so I have just now adjusted a code to automatically add in new client reviews when submitted (original code created by jbougeno ( http://forum.whmcs.com/showthread.php?t=12127 ) I simple modified it for my needs so all thanks go to jbougeno!

 

The code is:

<html>
<style>
table.mytable { width: 100%; padding: 0px; border: none; border: 0px solid #789DB3;}
table.mytable td { font-size: 12px; border: none; background-color: #212121; 
vertical-align: middle; padding: 7px; font-weight: normal; }
table.mytable tr.special td { border-bottom: 0px solid #ff0000; }
</style>
<head>
</head>
<body>
<?php 
mysql_connect("DB_Host", "DB_Admin_Name", "DB_Password") or die(mysql_error());
mysql_select_db("DB_Name") or die(mysql_error());
$result = mysql_query("SELECT yorum FROM mod_review ORDER BY yorum ASC LIMIT 10")
or die(mysql_error()); 
echo "<table width='500' border='0' class='mytable'>";
echo "<tr>
</tr>";
while($row = mysql_fetch_array($result)){
echo "<tr><td>"; 
echo "</td><td><center>"; 
echo $row['yorum'];
echo "</center></td><td>"; 
echo "</td></tr>";
}
echo "</table>"; 
?> 
</body>
</html>

 

To get the code to work for your Joomla site, simple change the DB_Host, DB_Admin_Name, DB_Password and the DB_Name to match your WHMCS DB info. This is a basic display and is set to display in ascending order and only displays the newest 10 reviews. You can change that by changing the "ORDER BY" and "LIMIT".

 

I also have a quick question if someone could please answer it. Inside the table above, it has a userid. when I input that table into the code (to try and display the name of the person who submitted the review) it displays the userid number. How can I make it dray from the tblclients table and from the first name field so that on the Joomla page, it would look like this:

 

"Review Here" -ClientsFirstNameHere

"2nd Review Here" -ClientsFirstNameHere

 

Any and all help would be greatly appreciated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated