Example #1
0
function writeLinkPost($post)
{
    $title = getPostTitle($post);
    $photos = getPhotos($post);
    $link = "<a href=\"" . $post->url . "\" class=\"tumblr-link\"><span class=\"tumblr-url\">" . $post->publisher . "</span> <span class=\"tumblr-title\">" . $title . "</span><span class=\"tumblr-description\">" . $post->excerpt . "</span>" . $photos . "</a>";
    $caption = getCaption($post);
    return $link . $caption;
}
Example #2
0
function getPhotosByHighglithFirst($category)
{
    global $detect;
    $cache = phpFastCache();
    if (isset($_GET['clear_cache'])) {
        $cache->delete('posts');
    }
    $posts = $cache->get("posts");
    if (!$posts || $posts == null) {
        $posts = getPhotos($category, false);
        $posts = getPhotos($category, $posts);
        // cache for an hour
        $cache->set("posts", $posts, 3000);
    }
    return $posts;
}
 function getPhotos($searchPath)
 {
     $photos = array();
     // TODO fix duplicate code
     foreach (glob($searchPath . '*.{jpg,JPG}', GLOB_BRACE) as $photoPath) {
         $filename = substr($photoPath, strrpos($photoPath, '/') + 1);
         $photos[$filename] = $photoPath;
     }
     foreach (glob($searchPath . '*', GLOB_ONLYDIR) as $currentPath) {
         foreach (glob($currentPath . '*.{jpg,JPG}', GLOB_BRACE) as $photoPath) {
             $filename = substr($photoPath, strrpos($photoPath, '/') + 1);
             $photos[$filename] = $photoPath;
         }
         $photos = array_merge($photos, getPhotos($currentPath . '/'));
     }
     return $photos;
 }
Example #4
0
	})
        
        function waitUpload()
        {
            document.getElementById('btn_upload').style.display = 'none';
            document.getElementById('show_waiting').style.display = '';
            
        }
	</script>

</head>

<body>
    <h5>ประมวลภาพ</h5>
    <ul><?php 
getPhotos($_GET['album_id']);
?>
</ul>

    <!--h3>อัพโหลดรูปภาพ</h3-->
    <div style="clear:both">
    <form enctype="multipart/form-data" method="post" action="index.php?album_id=<?php 
echo $_GET['album_id'];
?>
">
        <input type="hidden" name="album_id" value="<?php 
echo $_GET['album_id'];
?>
"/>
        <!--input type="hidden" name="MAX_FILE_SIZE" value="2000000" /-->
	    <p><input type="file" name="fupload" />
Example #5
0
                }
            } else {
                $result = $obj1['data'];
            }
        }
    }
    return $result;
}
$get_access_token = file_get_contents('https://graph.facebook.com/oauth/access_token?client_id=169677393071841&client_secret=7fb529df333cb84be2eb0e545efc079a&grant_type=client_credentials');
$access_token = explode('|', $get_access_token)[1];
//fetch facebook page photos
$fb_page_id = "304229246363923";
$access_token = $get_access_token;
$limit = 25;
$offset = 0;
$photos = getPhotos($fb_page_id, $access_token, $offset, $limit, 'json');
$videos = getVideos($fb_page_id, $access_token, $offset, $limit, 'json');
// print_r($photos);
$collections = array_merge($photos, $videos);
shuffle($collections);
?>

<!DOCTYPE html>
<html lang="en" class="no-js">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
		<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
		<title>Blueprint: Google Grid Gallery</title>
		<meta name="description" content="Blueprint: Blueprint: Google Grid Gallery" />
		<meta name="keywords" content="google getting started gallery, image gallery, image grid, template, masonry" />
Example #6
0
        <link rel="shortcut icon" href="/ico/favicon.png">
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> 
    </head>

    <body>
        <?php 
include './header.php';
?>
  

        <div class="container-fluid">

            <?php 
parse_str($_SERVER['QUERY_STRING']);
if (isset($_SESSION['id'])) {
    getPhotos();
    getPoke();
    checkPhotos();
    checkPokes();
}
if (isset($method)) {
    if (isset($error)) {
        showSucess($method, $error);
    } else {
        showSucess($method, 0);
    }
}
if (!isset($action)) {
    $action = "ola";
}
switch ($action) {
Example #7
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/php/config.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/php/business/PhotoService.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/php/business/MetrikaService.php";
$json = getPhotos();
$metrikaCode = getYandexMetrikaCode();
require_once $_SERVER["DOCUMENT_ROOT"] . "/php/view/PhotoView.php";
function mapPropertyDetail($propertyDetail, $contentType)
{
    global $detailHeaderText;
    global $detailImage1;
    global $detailReference;
    global $detailPrice;
    global $detailPrice2;
    global $detailLocation;
    global $detailType;
    global $detailROLType;
    global $detailROLSubType;
    global $detailBeds;
    global $detailBaths;
    global $detailPlot;
    global $detailArea;
    global $detailTerrace;
    global $detailEnergy;
    global $detailDescription;
    global $photoArray;
    global $featuresArray;
    global $builds;
    global $dimension;
    global $agencyRef;
    global $languageArr;
    global $resultOutput;
    global $fSearchType;
    $resultText = '';
    $metaData = '';
    switch ($contentType) {
        case 1:
            if ($propertyDetail !== NULL) {
                $metaData = '';
                $metaData .= (string) $propertyDetail->Type . ',';
                $metaData .= (string) $propertyDetail->Area . ',';
                $metaData .= (string) $propertyDetail->Location . ',';
                $metaData .= (string) $propertyDetail->Reference . ',';
                $metaData .= (string) $propertyDetail->Bedrooms . $languageArr['field_Headings']['bedrooms']['short_Header'] . ',';
                $metaData .= (string) $propertyDetail->Bathrooms . $languageArr['field_Headings']['bathrooms']['short_Header'] . ',';
                $resultOutput = $metaData;
            }
            break;
        case 2:
            if ($propertyDetail !== NULL) {
                $detailType = (string) $propertyDetail->Type;
                $detailROLType = (string) $propertyDetail->ROLType;
                $detailROLSubType = (string) $propertyDetail->ROLSubType;
                $detailImage1 = (string) $propertyDetail->Pictures->Picture->PictureURL;
                $searchType = 'Resale';
                if (isAccessFromFeatureSearch()) {
                    $searchType = $fSearchType;
                } else {
                    if (isset($_SESSION["SearchType"])) {
                        $searchType = $_SESSION["SearchType"];
                    }
                }
                if ($searchType == 'Resale') {
                    $detailPrice = (string) $propertyDetail->Price;
                    $detailPrice2 = '';
                } else {
                    $detailPrice = (string) $propertyDetail->RentalPrice1;
                    $detailPrice2 = (string) $propertyDetail->RentalPrice2;
                }
                $detailArea = (string) $propertyDetail->Area;
                $detailLocation = (string) $propertyDetail->Location;
                $detailReference = (string) $propertyDetail->Reference;
                $detailDescription = (string) $propertyDetail->Description;
                $detailBeds = (string) $propertyDetail->Bedrooms;
                $detailBaths = (string) $propertyDetail->Bathrooms;
                $detailTerrace = (string) $propertyDetail->Terrace;
                $detailPlot = (string) $propertyDetail->GardenPlot;
                if (isset($propertyDetail->EnergyRating->Value) && (string) $propertyDetail->EnergyRating->Value != '') {
                    $detailEnergy = (string) $propertyDetail->EnergyRating->Value . ' ' . (string) $propertyDetail->EnergyRating->Rated;
                } else {
                    $detailEnergy = '';
                }
                $detailHeaderText = str_replace('{i}', $detailBeds, $languageArr['detail_Headings']['detail_Title']);
                $detailHeaderText = str_replace('{t}', $detailType, $detailHeaderText);
                $detailHeaderText = str_replace('{l}', $detailLocation, $detailHeaderText);
                $builds = (string) $propertyDetail->Built;
                $dimension = (string) $propertyDetail->Dimensions;
                $agencyRef = (string) $propertyDetail->AgencyRef;
                $photoArray = getPhotos($propertyDetail->Pictures);
                $featuresArray = getFeatures($propertyDetail->PropertyFeatures);
                $resultText .= drawPropertyDetail();
            } else {
                $resultText .= "<br /><br />" . $languageArr['results_Headings']['no_Result'];
            }
            $resultOutput = $resultText;
            break;
    }
    return $resultOutput;
}
echo $general['about_me'];
?>
	</div>
	
	<? if ($images) { ?> <!-- Images true/false check added outside of div some the 'photos' line and an empty div won't show up when disabled -->
	<div id="photos" class="content_bubble">
		<h3><? if (isset($general['first_name']) && $general['first_name'] != '') {echo strtolower($general['first_name'])."'s ";} ?>photos</h3>
		<div id="loading-pics"><img src="images/loading.gif"></div>
		<div id="pictures">
		<?php 
if ($images) {
    if ($accounts['flickr']['username'] !== '') {
        require_once 'helpers/flickr.php';
        $accounts['flickr']['username'] = getID($accounts['flickr']['username']);
        // This turns the username into an id if it isn't one
        $flickr_images = getPhotos($accounts['flickr']['username'], 25);
        foreach ($flickr_images as $item) {
            echo '<a href="' . $item['url'] . '" rel="prettyPhoto[flickr]"><img src="' . $item['url'] . '" class="image-thumb" id="' . $item['title'] . '" alt="<a href=\'' . $item['link'] . '\'>' . $item['title'] . '</a>"></a>';
        }
    }
    if ($accounts['flickr']['username'] !== '' && $accounts['picasa']['username'] !== '') {
        echo '<hr>';
    }
    if ($accounts['picasa']['username'] !== '') {
        require_once 'helpers/picasa.php';
        $picasa_images = getPicasaPhotos($accounts['picasa']['username'], 25);
        foreach ($picasa_images as $item) {
            echo '<a href="' . $item['url'] . '" rel="prettyPhoto[picasa]"><img src="' . $item['url'] . '" class="image-thumb" id="' . $item['title'] . '" alt="<a href=\'' . $item['link'] . '\'>' . $item['title'] . '</a>"></a>';
        }
    }
}
});
// Send comment
$app->post('/toilet-add-comment', function ($request, $response, $args) {
    $uuid = $request->getParsedBody()['uuid'];
    $toilet_id = $request->getParsedBody()['toilet_id'];
    $username = $request->getParsedBody()['username'];
    $content = $request->getParsedBody()['content'];
    $result = array();
    $result['error'] = saveComment($uuid, $toilet_id, $username, $content);
    $response = $response->withHeader('Content-type', 'application/json;charset=utf-8');
    return $response->write(json_encode($result));
});
// Get photo list for a given toilet sheet
$app->get('/toilet-photo-list/{toilet_id}', function ($request, $response, $args) {
    $toilet_id = (int) $args['toilet_id'];
    $photos = getPhotos($toilet_id);
    $res = json_encode($photos);
    $response = $response->withHeader('Content-type', 'application/json;charset=utf-8');
    return $response->write($res);
});
// Get comment list for a given toilet sheet
$app->get('/toilet-comment-list/{toilet_id}', function ($request, $response, $args) {
    $toilet_id = (int) $args['toilet_id'];
    $comments = getComments($toilet_id);
    $res = json_encode($comments);
    $response = $response->withHeader('Content-type', 'application/json;charset=utf-8');
    return $response->write($res);
});
// Pour la Liste
$app->get('/toilettesliste/{long}/{lat}/{min}/{max}/{max_distance}', function ($request, $response, $args) {
    //	http://localhost/handipressante-server/web/api.php/toilettesliste/-1.68047298/48.11004102/5/5/5000
Example #11
0
    $result = "";
    if (isAlbum($targetNick, $album)) {
        if (isset($nick)) {
            if (strcmp($targetNick, $nick) == 0 or strcmp($role, "admin") == 0) {
                $result = printPhotos(getPhotos($targetNick, $album), true);
                addAction($nick, $email, $ip, "self_photos");
                // EXTRA: Añadir privileged access.
            } elseif (strcmp($accessType, "private") != 0) {
                $result = printPhotos(getPhotos($targetNick, $album), false);
                addAction($nick, $email, $ip, "others_photos");
            } else {
                echo "Este álbum no puede ser visionado.";
            }
        } else {
            if (strcmp(getAlbumAccess($nick, $album), "public") == 0) {
                $result = printPhotos(getPhotos($targetNick, $album), false);
                addAction($nick, $email, $ip, "others_photos");
            } else {
                echo "Este álbum no es público.";
            }
        }
    } else {
        echo "El álbum no existe para el usuario seleccionado.";
    }
    echo $result;
} else {
    echo "No se ha especificado ningún usuario.";
}
function printPhotos($album, $self)
{
    $line = "";
Example #12
0
    //         'photo_id' => $p['id'],
    //     );
    //     $favs = $flickr->api($params);
    //     $favs = $favs['photo']['total']; // total count of favorites
    //     if($favs >= 5) {
    //         $params = array(
    //             'method'	=> 'flickr.photos.getInfo',
    //             'photo_id' => $p['id'],
    //         );
    //         $photo = $flickr->api($params);
    //         $data = array();
    //         $data['url_l'] = $p['url_l'];
    //         $data['url_sq'] = $p['url_sq'];
    //         $data['favorites'] = $favs;
    //         $data['owner'] = $photo['photo']['owner']['username'];
    //         $data['title'] = $photo['photo']['title']['_content'];
    //         $data['description'] = $photo['photo']['description']['_content'];
    //         $data['url'] = $photo['photo']['urls']['url'][0]['_content'];
    //         $result[] = $data;
    //     }
    //     if(count($result) >= 10) return $result;
    // }
    return $photos;
}
$tags = isset($_GET['tag']) ? $_GET['tag'] : 'landscape';
$res = getPhotos($tags);
$array = json_encode($res);
echo $array;
?>