Passed
Push — master ( e9b8fa...70ae29 )
by Kishan
02:22
created

slider.php (1 issue)

Severity
1
<?php
2
/** 
3
 * Copyright 2018 Social Manager.
4
 * 
5
 * PHP version 7.2.8
6
 *
7
 * @category Album_Manager
8
 * @package  Facebook
9
 * @author   Kishan Jasani <[email protected]>
10
 * @license  https://rtfbchallenge.000webhostapp.com/privacy_policy/privacy_policy.php 
11
 * @link     ""
12
 * 
13
 * You are hereby granted a non-exclusive, worldwide, royalty-free license to
14
 * use, copy, modify, and distribute this software in source code or binary
15
 * form for use in connection with the web services and APIs provided by
16
 * Kishan Jasani.
17
 *
18
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND
19
 */
20
require_once "fb-callback.php";
21
22
if (isset($_GET['albumId'])) {
23
    $albumId = $_GET['albumId'];
24
    $response_albums = $fb->get($albumId . "/photos?fields=images,id&limit=100", $accessToken);
25
    $albums = $response_albums->getGraphEdge()->asArray(); 
26
    $slides = ""; 
27
    foreach ($albums as $album) {
28
        $albumUrl = $album['images'][0]['source'];
29
        $slides .= '<div class="mySlides fade">';
30
        $slides .= '<img src="'. $albumUrl .'" style="width:100%; height: 450px"></div>';
31
    }
32
    $slides .= '<a class="prev" onclick="plusSlides(-1)">&#10094;</a>';
33
    $slides .= '<a class="next" onclick="plusSlides(1)">&#10095;</a>';
34
    echo $slides;
35
}
36
37
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...