Example #1
2
function renderProduct(MESH\Commerce\Products\Product $product)
{
    $vars = array('name' => $product->getName(), 'main' => displayImage($product->getMainImage(), 300, 300), 'images' => array());
    $imgs = array();
    foreach ($product->getImages() as $img) {
        $vars['images'][] = displayImage($img, 125, 125);
    }
    return theme('product', $vars);
}
Example #2
0
function displayImages($gallery)
{
    if (empty($gallery)) {
        echo "<h3>Gallery is empty</h3>";
    } else {
        foreach ($gallery as $image) {
            displayImage($image);
        }
    }
}
Example #3
0
function renderProduct($product)
{
    $main = isset($product->resizedMainImage) ? displayImage($product->resizedMainImage, 300, 300) : '';
    $name = isset($product->name) ? $product->name : 'No name';
    $vars = array('name' => $name, 'main' => $main, 'images' => array());
    $imgs = array();
    if (isset($product->resizedImages)) {
        foreach ($product->resizedImages as $img) {
            $vars['images'][] = displayImage($img, 125, 125);
        }
    }
    return theme('product', $vars);
}
function displayThumbs($imagefolder, $thumbsfolder, $maxthumbnailsize, $imagesperrow, $rowsperpage)
{
    if (!isset($_GET['page'])) {
        $page = "1";
    } else {
        $page = $_GET['page'];
    }
    if ($page == "all") {
        $lastpic = 9999999999999;
        $pictostartat = 0;
    } else {
        $lastpic = $rowsperpage * $imagesperrow * $page;
        $pictostartat = $lastpic - $rowsperpage * $imagesperrow;
    }
    $pics = directory($imagefolder, "jpg,JPG,JPEG,jpeg,png,PNG");
    $maxsize = $maxthumbnailsize;
    if (isset($pics[0]) && $pics[0] != "") {
        echo "<table><tr>";
        $COUNT = 0;
        foreach ($pics as $p) {
            if ($COUNT < $pictostartat) {
                $COUNT = $COUNT + 1;
                continue;
            } else {
                if ($COUNT >= $lastpic) {
                    $COUNT = $COUNT + 1;
                    continue;
                } else {
                    $COUNT = $COUNT + 1;
                }
            }
            displayImage($imagefolder, $p, $thumbsfolder, $maxsize, FALSE);
            if ($COUNT % $imagesperrow == 0) {
                echo "</tr><tr>";
            }
        }
        echo "</tr></table>";
    }
}
Example #5
0
 <table summary="{$empty_gallery_msg}"
  width="100%" cellpadding="2" cellspacing="0" border="0">
 <tr><td>
 <br />
 <div >{$empty_gallery_msg}</div>

EOT;
}
// Show Text Numeral or Thumbnail Links to all of the images (above image).
if ($sidebar == FALSE && $no_lnks_view == FALSE && !@$omit_navlinks == TRUE && $img_links_above == TRUE) {
    echo displayImageLinks($thmb_row, $nmrl_row);
}
// Show an Upper Navigation Row, above the displayed image.
echo navRow($upr_nav);
// Display the requested image or else the first image.
echo displayImage($reqd_image, $img_sz_labels);
// Lower Navigation Row, below the displayed image.
echo navRow($lwr_nav);
// Show Text Numeral or Thumbnail Links to all of the images (below image).
if ($sidebar == FALSE && $no_lnks_view == FALSE && !@$omit_navlinks == TRUE && $img_links_above == FALSE) {
    echo displayImageLinks($thmb_row, $nmrl_row);
}
// Gallery Footer Row (site link / copyright / qdig home link)
// echo footerRow();
if ($display_area == TRUE) {
    echo <<<EOT

 </td></tr></table></td>
 <!-- End Qdig gallery image display area -->

EOT;
<?php

include "settings.php";
include "utilities.php";
echo "<a href='" . currentScript() . "'>home</a>";
if (isset($_GET['album'])) {
    $albumfolder = $_GET['album'];
} else {
    $albumfolder = "";
}
$image = $_GET['image'];
$imagefolder = $imageroot . $albumfolder;
$thumbsfolder = $thumbsroot . $albumfolder;
if ($albumfolder != "") {
    echo " &gt; ";
    displayHeirarchy($albumfolder);
}
echo "<br/><br/>";
displayImage($imagefolder, $image, $thumbsfolder, $intermediatesize, TRUE);
?>

                <td>Grants Fetched</td>
                <td align="right">
                    <textarea placeholder="Each Entry Seprated by Semicolon ;" rows=3 cols=23 required name="fpgrants" wrap="soft" style="width:100%;margin:0;">{$row['grants']}</textarea>
                </td>
            </tr>
            <tr>
                <td>Interaction with <br>Professional Institutions</td>
                <td align="right">
                    <textarea placeholder="Each Entry Seprated by Semicolon ;" rows=3 cols=23 required name="fpprof_inter" wrap="soft" style="width:100%;margin:0;">{$row['prof_interaction']}</textarea>
                </td>
            </tr>
            <tr>
                <td>Your Photo<br><font size="2">(3.5cm x 4.5cm)</font></td>    
                <td align="right">
_END;
            displayImage($row[image_id]);
            echo <<<_END
                </td>
            <tr>
_END;
        }
        echo <<<_END
            <tr>
                <td>Check to Update Photo</td> 
                <td><input type="checkbox" id="photocheck" name="photocheck" value="1" style="vertical-align: middle; width:15%; margin: 0px; padding: 0;  height:13px"/>
                </td>
            </tr>
            <tr>
                <td>Upload Your Photo<br><font size="2">Max Size 3 MB</font></td>    
                <td align="right">
                    <input id="fpphoto" type="file" name="image" style="width:100%;margin:0;" required="true" disabled="true"/>
<?php

// Transparent 1px by 1px PNG
function displayImage()
{
    header('Content-Type: image/png');
    echo base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=');
}
function getClientId()
{
    return $_GET['cid'] == '' ? generateUuid() : $_GET['cid'];
}
function generateUuid()
{
    return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xfff) | 0x4000, mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));
}
function buildParameters()
{
    return array('v' => 1, 'tid' => 'UA-3638032-11', 'ds' => 'collect.php', 'z' => $_GET['z'], 'cid' => getClientId(), 'uip' => $_SERVER['REMOTE_ADDR'], 'ua' => $_SERVER['HTTP_USER_AGENT'], 'dr' => $_GET['dr'], 'sr' => $_GET['sr'], 'vp' => $_GET['vp'], 'de' => $_GET['de'], 'sd' => $_GET['sd'], 'ul' => $_GET['ul'], 'je' => $_GET['je'], 'fl' => $_GET['fl'], 't' => 'event', 'ni' => 1, 'dl' => $_GET['dl'], 'dt' => $_GET['dt'], 'ec' => 'universal analytics on ' . $_GET['dl'], 'ea' => $_GET['ea'], 'el' => '');
}
function sendEvent($parameters)
{
    $curl = curl_init();
    curl_setopt_array($curl, array(CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'], CURLOPT_URL => 'https://www.google-analytics.com/collect', CURLOPT_POST => count($parameters), CURLOPT_POSTFIELDS => http_build_query($parameters), CURLOPT_RETURNTRANSFER => true));
    curl_exec($curl);
    curl_close($curl);
}
$parameters = buildParameters();
sendEvent($parameters);
displayImage();
Example #9
0
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
</head>
<body onload="document.getElementById('refresh').style.display = 'block'; document.getElementById('loading').style.display = 'none';">
<center>
<a href='index.php'><img src="media/logo.png" /></a>
<br />
<?php 
define("IN_STORYBOT", 1);
require_once "config/config.php";
if (!is_mod(mod_id())) {
    die("Registration is required! Please visit <a href='index.php'>this link</a>.");
}
$admin = is_admin(mod_id());
$sid = oldestImage();
if ($sid != "") {
    echo displayImage($sid);
    echo "<br />";
    echo "<a href='action.php?type=0&sid=" . $sid . "' class='accept'>ACCEPT</a>";
    echo "<a href='action.php?type=1&sid=" . $sid . "' class='reject'>REJECT</a>";
    echo "<a href='action.php?type=2&sid=" . $sid . "' class='report'>REPORT</a>";
} else {
    echo "<br /><div id='loading'>Looking for new snaps...</div><div id='refresh' style='display: none;'>Refresh this page now and there may be more images. Thanks for your hard work!</div>";
}
if ($admin) {
    echo "<br /><br /><br /><table><tr><td><a href='admin.php' class='settings'>Admin panel</a></td>";
    if ($sid != "") {
        echo "<td><a href='action.php?type=-1&sid=" . $sid . "' class='ban'>Ban sender</a></td>";
    }
    echo "<td><a href='reports.php' class='reports'>Report log</a></td></tr></table>";
}
echo "<iframe style='height: 0px; width: 0px; border: none;' src='bot.php' />";
Example #10
0
        echo "The type of the file is not a supported image type.";
        echo "<br />";
        echo "FILE: " . $_FILES[$fileFieldName]["name"];
        echo "<br />";
        echo "File type: " . $_FILES[$fileFieldName]["type"];
    } else {
        if ($_FILES[$fileFieldName]["size"] > $maxImageSize) {
            // the function createImageFactory, called by uploadResizedImage raises
            // a fatal error when trying to create an image larger than 3 MB
            echo "The uploaded file is larger than allowed.";
            echo "<br />";
            echo "Uploaded file size: " . round($_FILES[$fileFieldName]["size"] / 1000) . " KB";
            echo "<br />";
            echo "Max allowed size: " . round($maxImageSize / 1000) . " KB";
        } else {
            //$imagePath = $pathToUpload .'foti1'. basename($_FILES[$fileFieldName]["name"]);
            $info = pathinfo($_FILES[$fileFieldName]['name']);
            $imagePath = $pathToUpload . 'fototemp.' . $info['extension'];
            if (file_exists($imagePath)) {
                unlink($imagePath);
            }
            if (uploadResizedImage($_FILES[$fileFieldName]["tmp_name"], $imagePath, $_FILES[$fileFieldName]["type"])) {
                displayImage($imagePath);
            } else {
                echo "There was an error uploading the file" . $imagePath . ", please try again!";
                echo "<br />";
                echo "If the error continues, the uploaded file may not be accepted by the system.";
            }
        }
    }
}
Example #11
0
// Binary image file
$doc4 = new MLPHP\Document($client);
// Create a Document object (passing the REST client)
$file4 = 'example.jpg';
// Define the path to the file to write
$doc4->setContentType('image/jpeg');
// Set the content type for the document
$doc4->setContentFile($file4);
// Set the file as the document content
$uri4 = '/' . $file4;
// Define the URI for the document
$doc4->write($uri4);
// Write the document to the database
// Embed the binary image file in a page with HTML
echo "Display the image document:\n";
displayImage($uri4, $doc4->getContentType());
// Helper function
echo "\n\n";
// Binary PDF file
$doc5 = new MLPHP\Document($client);
// Create a Document object (passing the REST client)
$file5 = 'example.pdf';
// Define the path to the file to write
$doc5->setContentType('application/pdf');
// Set the content type for the document
$doc5->setContentFile($file5);
// Set the file as the document content
$uri5 = '/' . $file5;
// Define the URI for the document
$doc5->write($uri5);
// Write the document to the database