Help displaying user videos that were uploaded

Discussion in 'PHP' started by assault14, Apr 5, 2009.

  1. #1
    ok well i have this code that displayes the users points, and stats. i tired adding a code that would display videos uploaded by the users, but it wouldnt work. this is my coded here

    ?php
    if (iMEMBER) {
    $DB_PREFIX = constant("DB_PREFIX");
    $rows = dbcount("(video_id)", "fusion_videos");
    $sql = mysql_query("SELECT * from fusion_videos where video_owner='".$user_data['user_id']."'") or die(mysql_error());
    $total = 0;
    $result = dbquery("SELECT video_id, video_owner, video_title from fusion_videos ORDER BY video_timestamp DESC LIMIT 0,5");
    
    		  
    if (dbrows($result) != 0) {
    $i=0;
       while($data = dbarray($result)) {
    if ($i % 2 == 0)
    { $row_color = "tbl1"; } else { $row_color = "tbl2"; }
         $itemsubject = trimlink($data['video_id'], 23);
          $itemdescription = trimlink($data['video_title'], 15);
    	  
    while($a = mysql_fetch_array($sql)) {
    	$total = $total + $a['video_views'];
    }
    if (!defined("IN_FUSION")) { die("Access Denied"); }
    
    if ($profile_method == "input") {
    	//Nothing
    } elseif ($profile_method == "display") {
    	include_once INFUSIONS."user_gold/infusion_db.php";
    	require_once INFUSIONS."user_gold/inc/functions.php";
    	$user_id = isnum($_GET['lookup']) ? $_GET['lookup'] : 0;
    	if($user_id) {	
    		list($name) = dbarraynum(dbquery("SELECT user_name FROM ".DB_USERS." WHERE user_id=".$user_id));
    		list($cash, $bank, $karma, $chips) = dbarraynum(dbquery("SELECT cash, bank, karma, chips FROM ".DB_UG3." WHERE owner_id=".$user_id));
    		echo "</table>";
    		
    		echo "<div style='margin:5px'></div>\n";
    		
    		echo "<table cellpadding='0' cellspacing='1' width='485' class='tbl-border' align='right'>\n<tr>\n";
    		echo "</tr>\n<tr>\n";
    		echo "<td class='tbl1' colspan='2'>";
    		echo "<table width='100%'>\n<tr>\n";
    		echo "<td class='tbl1' width='33.3%'>Videos Uploaded- ".number_format(dbcount("(video_id)", "fusion_videos", "video_owner='".$user_data['user_id']."'"))." </td>";
    		echo "<td class='tbl1' width='33.3%'>Video Views- ".$total."</td>";
    		echo "<td class='tbl1' width='33.3%'>Reward Points- ".formatMoney($cash)."</td>";
    		echo "</tr><tr>";
    		echo "<tr><td class='tbl2'><b>".$user_data['user_name']."'s Latest Videos</b></td></tr>\n";		
    		echo "<td class='".$row_color."'><a href='".BASEDIR."videos.php?view=".$data['video_id']."' title='".$data['video_title']."' class='side'> <img src='http://i3.ytimg.com/vi/".$data['video_id']."/default.jpg' border='0' alt='' /></a><br />\n";
    		echo "<a href='".BASEDIR."videos.php?view=".$data['video_id']."' title='".$data['video_title']."' class='side'>$itemdescription</a>\n";
    		echo"</td>";
    		$i++;
    		}
    		
    		} else {
       echo "</tr>\n</table><br>\n";
          echo "<div style='text-align:center' class='small'>No Videos</div>\n";
          }
    		echo "</tr>\n</table>\n";
    		echo "</td>\n";
    		echo "</tr>\n";
    }
    }
    }
    
    ?>
    PHP:
    this is where the magic happens

    echo "<tr><td class='tbl2'><b>".$user_data['user_name']."'s Latest Videos</b></td></tr>\n";		
    		echo "<td class='".$row_color."'><a href='".BASEDIR."videos.php?view=".$data['video_id']."' title='".$data['video_title']."' class='side'> <img src='http://i3.ytimg.com/vi/".$data['video_id']."/default.jpg' border='0' alt='' /></a><br />\n";
    		echo "<a href='".BASEDIR."videos.php?view=".$data['video_id']."' title='".$data['video_title']."' class='side'>$itemdescription</a>\n";
    		echo"</td>";
    Code (markup):
     
    assault14, Apr 5, 2009 IP
  2. assault14

    assault14 Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can anyone please look in to this
     
    assault14, Apr 9, 2009 IP
  3. assault14

    assault14 Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    NVM im Dropping this Project
     
    assault14, Apr 11, 2009 IP