IsaiahH Posted October 30, 2011 Share Posted October 30, 2011 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.