Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //don't allow other scripts to grab and execute our file
- defined('_JEXEC') or die('Direct Access to this location is not allowed.');
- //User Information
- $user =& JFactory::getUser();
- $username = $user->username;
- $userid = $user->id;
- if (!$user->guest){
- //Queries
- $query = "SELECT * FROM jos_k2_fav_xref WHERE userID = '$userid' ORDER BY id DESC";
- $result = mysql_query($query) or die(mysql_error());
- if (!result) {
- echo "You have nothing in your favorites!";
- } else {
- while($row = mysql_fetch_assoc($result))
- {
- $catID = $row['catID'];
- $itemID = $row['itemID'];
- $title = $row['title'];
- echo "<h3 style='font-size:130%;'><a href='index.php?option=com_k2&Itemid=184&id=".$itemID."&lang=en&view=item'>".$title."</a></h3>";
- echo "
- <span class='userItemImage'>
- <a href='index.php?option=com_k2&Itemid=184&id=".$row['itemID']."&lang=en&view=item'>
- <img src=".JURI::root()."media/k2/items/cache/".md5("Image".$itemID)."_M.jpg />
- </a>
- </span>";
- echo "</br>";
- }
- }
- } else {
- echo "You are not logged in! If you do not have an account, please <a name='reg' title='Register' alt='msiubox' class='msiubox'>register</a>!";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment