diff --git a/page_profile/profil.php b/page_profile/profil.php index c63823585119b6a6b0897ab43d673f9164f4d39d..43541ce85d175d5a2f7e03851c1c34c400f2895a 100644 --- a/page_profile/profil.php +++ b/page_profile/profil.php @@ -130,6 +130,8 @@ $youtube_fav = $_SESSION['youtube']; } ?> <br/> <h5></h5> </div> + </br><br/> + </div> </div> </div> @@ -143,8 +145,13 @@ $youtube_fav = $_SESSION['youtube']; echo "<a href='#b'> Evolution of Tweets Retweets</a>"; } elseif ($socialNetwork === "Youtube") { - echo "<a href='#a'> Evolution of Views</a>"; + echo "<a href='#a'> Evolution of Views of recent videos</a>"; + echo "</div>"; + echo "<div>"; + echo "<a href='#b'> Evolution of Likes of recent videos</a>"; echo "</div>"; + echo "<div>"; + echo "<a href='#c'> Evolution of Dislikes of recent videos</a>"; } ?> </div> @@ -157,7 +164,7 @@ $youtube_fav = $_SESSION['youtube']; echo "Evolution of Tweets Likes"; } elseif ($socialNetwork === "Youtube") { - echo "Evolution of Views"; + echo "Evolution of Views of recent videos"; } ?> </span><br/><br/> @@ -176,7 +183,16 @@ $youtube_fav = $_SESSION['youtube']; lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $likes, 700, 400); } elseif ($socialNetwork === "Youtube") { - echo ""; + $count = 10; + + $chartName = "chart3"; + $caption = "Evolution of views : Last ".$count." videos"; + $xAxisName = "Video (from most recent to oldest)"; + $yAxisName = "Number of Views"; + + $views = getviewCountOfRecentVideo($id, $count); + + lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $views, 700, 400); } ?> </br><br/> @@ -187,7 +203,7 @@ $youtube_fav = $_SESSION['youtube']; echo "Evolution of Tweets Retweets"; } elseif ($socialNetwork === "Youtube") { - echo ""; + echo "Evolution of Likes of recent videos"; } ?> </span><br/><br/> @@ -206,11 +222,83 @@ $youtube_fav = $_SESSION['youtube']; lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $retweets, 700, 400); } elseif ($socialNetwork === "Youtube") { + $count = 10; + + $chartName = "chart4"; + $caption = "Evolution of likes : Last ".$count." videos"; + $xAxisName = "Video (from most recent to oldest)"; + $yAxisName = "Number of Likes"; + + $likes = getLikeCountOfRecentVideo($id, $count); + + lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $likes, 700, 400); + } + ?> + </br><br/> + </div> + <div id='c'><br/><br/><span class="title_graphs"> + <?php + if ($socialNetwork === "Twitter") { echo ""; } + elseif ($socialNetwork === "Youtube") { + echo "Evolution of Dislikes of recent videos"; + } + ?> + </span><br/><br/> + <?php + if ($socialNetwork === "Twitter") { + echo ""; + } + elseif ($socialNetwork === "Youtube") { + $count = 10; + + $chartName = "chart5"; + $caption = "Evolution of dislikes : Last ".$count." videos"; + $xAxisName = "Video (from most recent to oldest)"; + $yAxisName = "Number of Dislikes"; + + $dislikes = getDislikeCountOfRecentVideo($id, $count); + + lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $dislikes, 700, 400); + } ?> </br><br/> </div> + <!-- <div id='d'><br/><br/><span class="title_graphs"> + <?php + // if ($socialNetwork === "Twitter") { + // echo ""; + // } + // elseif ($socialNetwork === "Youtube") { + // echo "Evolution of views of most popular videos"; + // } + ?> + </span><br/><br/> + <?php + // if ($socialNetwork === "Twitter") { + // echo ""; + // } + // elseif ($socialNetwork === "Youtube") { + // $count = 10; + + // $chartName = "chart6"; + // $caption = "Evolution of views : ".$count." most popular videos"; + // $xAxisName = "Video (from most recent to oldest)"; + // $yAxisName = "Number of Views"; + + // $videosID = getCountTopVideos($id, $count); + // $views = []; + // for ($i = 0; $i < $count; $i++) { + // $views[] = getVideoViewCountById($videosID[$i]); + // } + + // lineGraphMean($chartName, $caption, $xAxisName, $yAxisName, $views, 700, 400); + // } + ?> + </br><br/> + </div> --> + </div> </div> diff --git a/page_welcome/register.php b/page_welcome/register.php index dda3227c2e63341991ad2f8e1c1b59ce3127af11..b059ae20334f7373248325bb8df16311b4c87d08 100644 --- a/page_welcome/register.php +++ b/page_welcome/register.php @@ -47,6 +47,7 @@ if (isset($_POST['register'])) { } $empty_array = array(); // Finally, register user if there are no errors in the form + echo $errors[0]; if (count($errors) == 0) { $password = md5($password_1);//encrypt the password before saving in the database diff --git a/youtube-api/userInfos.php b/youtube-api/userInfos.php index 40148aff4f05001d13e3d6038c94a8e706773cf3..f0beb1300572d7239e7161469581ec28c47435ce 100644 --- a/youtube-api/userInfos.php +++ b/youtube-api/userInfos.php @@ -109,7 +109,7 @@ function getVideoViewCountById($id){ /** - * Search Get the most populare count videos's id in a channel by channelID + * Search Get the most popular count videos's id in a channel by channelID * @param $channelId * @param $count * @return an array including the id of the most populare count videos @@ -189,5 +189,7 @@ function getLikeCountOfRecentVideo($channelId,$count) } +//print_r(getCountTopVideos("UCWeg2Pkate69NFdBeuRFTAw", 10)); +