当前位置: 首页>>代码示例>>PHP>>正文


PHP getImage函数代码示例

本文整理汇总了PHP中getImage函数的典型用法代码示例。如果您正苦于以下问题:PHP getImage函数的具体用法?PHP getImage怎么用?PHP getImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getImage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addToQueue

function addToQueue($session_code, $track)
{
    global $connection;
    $query = "INSERT INTO Tracks (session_code,spotify_uri,artist,album,title,image,length) VALUES ('" . strtoupper($session_code) . "','" . mysqli_real_escape_string($connection, $track->getURI()) . "','" . mysqli_real_escape_string($connection, $track->getArtistAsString()) . "','" . mysqli_real_escape_string($connection, $track->getAlbum()) . "','" . mysqli_real_escape_string($connection, $track->getTitle()) . "','" . mysqli_real_escape_string($connection, getImage($track->getURI())) . "'," . (int) $track->getLength() . ")";
    mysqli_query($connection, $query);
    return true;
}
开发者ID:nathancoleman,项目名称:SeeSpotQueue,代码行数:7,代码来源:add_to_queue.php

示例2: doImage

function doImage($source, $width, $height, $timestamp = true, $name)
{
    $origImage = getImage($source, $width, $height);
    if (is_null($origImage)) {
        die("Rendering Error");
    }
    $image = resize($origImage, $width, $height);
    $thumb = resize($origImage, 100, 75);
    if ($timestamp) {
        $image = addTimeStamp($image);
    }
    $compression = 75;
    $filepath = "screenshots/";
    $filename = $filepath . $name . "_" . time() . ".jpg";
    $filename_thumb = $filepath . $name . "_" . time() . "_thumb.jpg";
    //main image
    imagejpeg($image, $filename, $compression);
    chmod($filename, 0600);
    imagedestroy($image);
    //thumb image
    imagejpeg($thumb, $filename_thumb, $compression);
    chmod($filename_thumb, 0600);
    imagedestroy($thumb);
    echo "OK";
}
开发者ID:JohnKimDev,项目名称:Security-IPCamera-Controller,代码行数:25,代码来源:webcam_screenshot.php

示例3: getPhotos

function getPhotos($category, $posts)
{
    $is_highlights = !is_array($posts);
    $data = !$is_highlights ? $posts : [];
    $url = 'http://' . $_SERVER['SERVER_NAME'] . '/' . 'cms/wp-json/posts?filter[posts_per_page]=-1&filter[order]=desc&filter[orderby]=post_date' . ($is_highlights ? '&filter[category_name]=destaque' : null);
    $response = \Httpful\Request::get($url)->send();
    $catId = get_cat_ID($category);
    foreach ($response->body as $key => $post) {
        $image_src = getImage($post->content);
        $attachment_id = pn_get_attachment_id_from_url($image_src);
        $image_large_src = wp_get_attachment_image_src($attachment_id, 'large');
        if (!$is_highlights && !isHighgligthCategory($catId, $post->terms->category)) {
            if ($image_src) {
                array_push($data, array('id' => $post->ID, 'title' => $post->title, 'image_src' => getImage($post->content), 'image_large_src' => $image_large_src[0]));
            }
        } else {
            if ($is_highlights && isHighgligthCategory($catId, $post->terms->category)) {
                if ($image_src) {
                    array_push($data, array('id' => $post->ID, 'title' => $post->title, 'image_src' => getImage($post->content), 'image_large_src' => $image_large_src[0]));
                }
            }
        }
    }
    return $data;
}
开发者ID:heldrida,项目名称:freedomnow,代码行数:25,代码来源:helperFns.php

示例4: printResultWithX

function printResultWithX($result)
{
    $rowNum = $result->num_rows;
    echo '<h1>' . $rowNum . ' cookbooks were found:</h1>';
    while ($rowNum > 0) {
        echo '<div class="recipe-preview-row">';
        for ($i = 0; $i < 3; $i++) {
            if ($row = $result->fetch_assoc()) {
                if (isVisible($row["cookbook_id"])) {
                    $path = getImage($row["cookbook_id"]);
                    echo '<a href="view-cookbook.php?cookbook_id=' . $row["cookbook_id"] . '">
								<div class="recipe-preview-row-icon">
									<img class="thumbnail" src="' . $path . '">
									<p>' . $row["cb_title"] . '</p>
								</div>
							</a>
							<a href="delete.php?cookbook_id=' . $row["cookbook_id"] . '" onclick="return confirm(\'Are you sure you want to delete ' . $row["cb_title"] . '\');">
								<img class="x" src="images/x.png"></a>';
                }
            }
            $rowNum = $rowNum - 1;
        }
        echo '</div>';
    }
}
开发者ID:eoyarzun,项目名称:CookbookNetwork,代码行数:25,代码来源:cookbook-search-handler.php

示例5: __construct

 public function __construct($params = null)
 {
     parent::__construct();
     if (isset($params['utility'])) {
         $this->utility = $params['utility'];
     } else {
         $this->utility = new Utility();
     }
     if (isset($params['url'])) {
         $this->url = $params['url'];
     } else {
         $this->url = new Url();
     }
     if (isset($params['image'])) {
         $this->image = $params['image'];
     } else {
         $this->image = getImage();
     }
     if (isset($params['user'])) {
         $this->user = $params['user'];
     } else {
         $this->user = new User();
     }
     if (isset($params['config'])) {
         $this->config = $params['config'];
     }
 }
开发者ID:gg1977,项目名称:frontend,代码行数:27,代码来源:Photo.php

示例6: getFlag

/**
 * getFlag()
 * 
 * @param string $flag
 * @param string $type
 * @return string Either the flag or default flag if none exists
 */
function getFlag($flag, $type = 'url')
{
    $image = getImage('/flags/' . strtolower($flag));
    if ($image) {
        return $image[$type];
    } else {
        return IMAGE_PATH . '/flags/0.gif';
    }
}
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:16,代码来源:functions.php

示例7: _moduleContent

function _moduleContent(&$smarty, $module_name)
{
    include_once "libs/paloSantoGrid.class.php";
    include_once "libs/paloSantoForm.class.php";
    include_once "libs/paloSantoOrganization.class.php";
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['elastix_dsn']["elastix"]);
    global $arrCredentials;
    $action = getAction();
    $content = "";
    switch ($action) {
        case "new_user":
            $content = viewFormUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "view":
            $content = viewFormUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "edit":
            $content = viewFormUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "save_new":
            $content = saveNewUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "save_edit":
            $content = saveEditUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "delete":
            $content = deleteUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "getGroups":
            $content = getGroups($pDB, $arrCredentials);
            break;
        case "getImage":
            $content = getImage($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "reloadAasterisk":
            $content = reloadAasterisk($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "reconstruct_mailbox":
            $content = reconstruct_mailbox($pDB, $arrConf, $arrCredentials);
            break;
            /*case "changes_email_quota":
              $content = changes_email_quota($smarty, $module_name, $pDB, $arrConf, $arrCredentials);
              break;*/
        /*case "changes_email_quota":
          $content = changes_email_quota($smarty, $module_name, $pDB, $arrConf, $arrCredentials);
          break;*/
        default:
            // report
            $content = reportUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
    }
    return $content;
}
开发者ID:lordbasex,项目名称:elastix-gui,代码行数:56,代码来源:index.php

示例8: getImage

function getImage($conn)
{
    $sql = "SELECT FLOOR(MAX(img.ID) * RAND()) AS ID\n            FROM IMAGENS img\n            INNER JOIN SITES s ON img.SITE_ID = s.ID\n            WHERE s.TIPO <> 'VID' AND s.ORIENTACAO = 'STR'";
    $stmt = $conn->query($sql);
    $row = $stmt->fetch(PDO::FETCH_ASSOC);
    $sql = "SELECT i.CAMINHO_IMAGEM AS IMG, s.TIPO AS TIPO\n            FROM IMAGENS i\n            INNER JOIN SITES s ON i.SITE_ID = s.ID\n            WHERE i.ID = " . $row["ID"];
    $stmt = $conn->query($sql);
    $row = $stmt->fetch(PDO::FETCH_ASSOC);
    if (empty($row) || empty($row["IMG"])) {
        $row = getImage($conn);
    }
    return $row;
}
开发者ID:afagundes,项目名称:ImageCrawler,代码行数:13,代码来源:postTwitter.php

示例9: displayDealerHand

function displayDealerHand($state, $upcard, $dealerHand, $dealerScore)
{
    $html = '';
    if (State::isActive($state)) {
        $html .= getImage($upcard);
    } else {
        $html .= getImage($upCard);
        $cards = $dealerHand->getCards();
        foreach ($cards as $card) {
            $html .= getImage($card);
        }
        $html .= '<br><br>';
        $html .= 'The dealer has: ' . $dealerScore;
    }
    return $html;
}
开发者ID:perenchiod,项目名称:php-blackjack,代码行数:16,代码来源:browserview.php

示例10: jsonItemData

function jsonItemData($classe = 0, $start = 0, $count = 10)
{
    $add = "";
    if ($classe != 0) {
        $add = "WHERE `Require_Job`='{$classe}'";
    }
    $query = "SELECT * FROM `iteminfo` {$add} ORDER BY `ID` LIMIT {$start}, {$count};";
    $data = queryDB($query);
    if ($data != null) {
        for ($i = 0; $i < $count; $i++) {
            $data[$i]['Icon'] = getImage($data[$i]['Icon']);
        }
        header('Content-type: application/json; charset=utf8');
        echo json_encode($data);
    }
}
开发者ID:ChowZenki,项目名称:ro2database,代码行数:16,代码来源:json.php

示例11: createNotification

function createNotification($ids, $msgType)
{
    //Set initial vars
    $conn = $GLOBALS['conn'];
    $curr = utf8_encode("£");
    $path = $_SERVER['HTTP_HOST'] . "/ProjectDing";
    $num_orders = count(array_unique($ids));
    $order_ids = implode($ids, ",");
    $orders_total = 0;
    $other_items_qty = -1;
    $s = null;
    //Execute query
    $sql = "SELECT * from pding_transactions WHERE order_id IN({$order_ids}) ORDER BY subtotal ASC";
    $result = mysqli_query($conn, $sql);
    //Incremental vars
    while ($row = mysqli_fetch_assoc($result)) {
        //Sum the subtotals
        $orders_total += $row['subtotal'];
        //Increment additional items qty
        $other_items_qty++;
        //(Lazy) - setting main item vars each time because last row will be most expensive
        $main_item_name = $row['product_name'];
        $main_item_qty = $row['quantity'];
        $main_item_sku = $row['product_code'];
    }
    //More vars
    if ($other_items_qty > 1) {
        $s = "s";
    }
    $main_item_image = getImage($main_item_sku);
    //Possible notification types
    $msgs = array(0 => array("desc" => "One order for one item only", "title" => $num_orders . " new web order for " . $curr . $orders_total, "body" => "New order received for " . $main_item_qty . "x " . $main_item_name . ". Click to view order details.", "action" => $path . "/view_order.php?ids=" . $order_ids, "image" => $main_item_image), 1 => array("desc" => "One order for multiple items", "title" => $num_orders . " new web order for " . $curr . $orders_total, "body" => "New order received for " . $main_item_qty . "x " . $main_item_name . " and " . $other_items_qty . " other item{$s}. Click to view order details.", "action" => $path . "/view_order.php?ids=" . $order_ids, "image" => $main_item_image), 2 => array("desc" => "Multiple orders", "title" => $num_orders . " new web orders received totalling " . $curr . $orders_total, "body" => "Click here to view the details of these orders.", "action" => $path . "/view_order.php?ids=" . $order_ids, "image" => $main_item_image));
    $notification = $msgs[$msgType];
    echo "<pre>";
    print_r($notification);
    echo "</pre>";
    //Insert notification into table
    $sql = "INSERT INTO pding_notifications VALUES ('', '" . mysqli_real_escape_string($conn, $notification['title']) . "', '" . mysqli_real_escape_string($conn, $notification['body']) . "', '" . mysqli_real_escape_string($conn, $notification['action']) . "', '" . mysqli_real_escape_string($conn, $notification['image']) . "', NOW())";
    echo $sql;
    mysqli_query($conn, $sql);
    //Mark transactions as "sent"
    foreach ($ids as $id) {
        $sql = "UPDATE pding_transactions SET notification_queued=1 WHERE order_id = {$id}";
        mysqli_query($conn, $sql);
    }
}
开发者ID:andrewchart,项目名称:ProjectDing,代码行数:46,代码来源:create_notifications_from_transactions.php

示例12: doImage

function doImage($source, $width, $height, $timestamp = true)
{
    $image = getImage($source, $width, $height);
    if (is_null($image)) {
        die("Rendering Error");
    }
    //no cache
    header("Cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    header('Content-Type: image/jpeg');
    $image = resize($image, $width, $height);
    if ($timestamp) {
        $image = addTimeStamp($image);
    }
    imagejpeg($image);
    imagedestroy($image);
}
开发者ID:JohnKimDev,项目名称:Security-IPCamera-Controller,代码行数:19,代码来源:webcam_image.php

示例13: draw

    function draw($result, $numitems, $width = 100, $align = 'center')
    {
        global $g_options, $game, $realgame, $db;
        $numpages = ceil($numitems / $this->numperpage);
        ?>

<div class="subblock" style="width:<?php 
        echo $width;
        ?>
%;text-align:<?php 
        echo $align;
        ?>
;">

<table class="data-table">

		<tr class="data-table-head">
<?php 
        $totalwidth = 0;
        if ($this->showranking) {
            $totalwidth += 5;
            echo "<td style=\"width:5%;text-align=:right;\" class=\"fSmall\">Rank</td>\n";
        }
        foreach ($this->columns as $col) {
            $totalwidth += $col->width;
            echo "<td style=\"width:{$col->width}%;text-align:{$col->align};\" class=\"fSmall\">";
            if ($col->sort != 'no') {
                echo getSortArrow($this->sort, $this->sortorder, $col->name, $col->title, $this->var_sort, $this->var_sortorder, $this->sorthash, $this->ajax);
            } else {
                echo $col->title;
            }
            echo "</td>\n";
        }
        ?>
		</tr>

<?php 
        if ($totalwidth != 100) {
            error("Warning: Column widths do not add to 100%! (={$totalwidth}%)", false);
        }
        $rank = ($this->page - 1) * $this->numperpage + 1;
        while ($rowdata = $db->fetch_array($result)) {
            echo "<tr>\n";
            $i = 0;
            if ($this->showranking) {
                $c = $i % 2 + 1;
                $i++;
                echo "<td style=\"text-align:right;\" class=\"bg{$c}\">{$rank}</td>\n";
            }
            foreach ($this->columns as $col) {
                $c = $i % 2 + 1;
                $class = "";
                $cellbody = '';
                $colval = $rowdata[$col->name];
                if ($col->align != 'left') {
                    $colalign = " style=\"text-align:{$col->align};\"";
                } else {
                    $colalign = "";
                }
                $class = "bg{$c}";
                if ($col->icon || $col->flag) {
                    $cellbody = '&nbsp;';
                }
                if ($col->link) {
                    if (strpos($col->link, 'javascript:') === false) {
                        $link = str_ireplace('%k', urlencode($rowdata[$this->keycol]), $col->link);
                        $cellbody .= "<a href=\"" . $g_options['scripturl'] . "?{$link}\">";
                    } else {
                        $col->link = str_replace('\\\\', '', $col->link);
                        $link = str_ireplace('%k', $rowdata[$this->keycol], $col->link);
                        $cellbody .= "<a href=\"{$link}\">";
                    }
                }
                if ($col->icon) {
                    $image = getImage("/{$col->icon}");
                    if ($image) {
                        $cellbody .= '<img src="' . $image['url'] . "\" class=\"tableicon\" alt=\"{$col->icon}\" />";
                    }
                } elseif ($col->flag) {
                    #$link = ereg_replace("%f", $col->link);
                    if ($g_options['countrydata'] == 1) {
                        if ($rowdata['flag'] == '') {
                            $rowdata['flag'] = '0';
                            $alt_text = 'No Country';
                        } else {
                            $alt_text = ucfirst(strtolower($rowdata['country']));
                        }
                        $cellbody .= '<img src="' . getFlag($rowdata['flag']) . "\" class=\"tableicon\" alt=\"{$alt_text}\" title=\"{$alt_text}\" />";
                    } else {
                        $col->flag = 'player';
                        $cellbody .= '<img src="' . IMAGE_PATH . "/{$col->flag}.gif\" class=\"tableicon\" alt=\"{$col->icon}.gif\" />";
                    }
                }
                switch ($col->type) {
                    case 'timestamp':
                        $cellbody = timestamp_to_str($colval);
                        break;
                    case 'roleimg':
                        $image = getImage("/games/{$game}/roles/" . strtolower($colval));
                        // check if image exists for game -- otherwise check realgame
//.........这里部分代码省略.........
开发者ID:PitbullOL,项目名称:insurgency-hlstatsx,代码行数:101,代码来源:class_table.php

示例14: parseFolder

function parseFolder($path)
{
    $covers = array('Folder.jpg', 'folder.jpg', 'Folder.png', 'folder.png', 'Cover.jpg', 'cover.jpg', 'Cover.png', 'cover.png');
    // default cover files
    foreach ($covers as $file) {
        getImage($path . $file);
    }
    // all (other) files
    foreach (glob($path . '*') as $file) {
        if (is_file($file)) {
            getImage($file);
        }
    }
}
开发者ID:dermidgen,项目名称:moode,代码行数:14,代码来源:coverart.php

示例15: draw


//.........这里部分代码省略.........
                // this needs to be changed.
                // remove table class and do it for every table manually
                // this way to do not have those if masages
                if ($col->name == "skill") {
                    // check if we have a top or flop
                    if (empty($rowdata['oldSkill'])) {
                        $rowdata['oldSkill'] = $rowdata['skill'];
                    }
                    if ($rowdata['skill'] > $rowdata['oldSkill']) {
                        $cellbody .= "<img src=\"" . $g_options["imgdir"] . "/skill_up.gif\" width='16' height='16' hspace='4' " . "border='0' align=\"middle\" alt=\"{$col->icon}.gif\">";
                    } elseif ($rowdata['skill'] < $rowdata['oldSkill']) {
                        $cellbody .= "<img src=\"" . $g_options["imgdir"] . "/skill_down.gif\" width='16' height='16' hspace='4' " . "border='0' align=\"middle\" alt=\"{$col->icon}.gif\">";
                    } else {
                        $cellbody .= "<img src=\"" . $g_options["imgdir"] . "/skill_stay.gif\" width='16' height='16' hspace='4' " . "border='0' align=\"middle\" alt=\"{$col->icon}.gif\">";
                    }
                }
                if ($col->link) {
                    $link = ereg_replace("%k", urlencode($rowdata[$this->keycol]), $col->link);
                    $cellbody .= "<a href=\"index.php?{$link}\">";
                }
                if ($col->icon) {
                    $pic = $col->icon . ".gif";
                    if ($col->icon == "player") {
                        if (isset($rowdata['active']) && $rowdata['active'] == "0") {
                            $pic = "player_inactive.gif";
                        }
                    }
                    $cellbody .= "<img src='" . $g_options["imgdir"] . $pic . "' width='16' height='16' hspace='4' " . "border='0' align=\"middle\" alt=\"{$col->icon}\">";
                }
                switch ($col->type) {
                    case "weaponimg":
                        $colval = strtolower(ereg_replace("[ \r\n\t]*", "", $colval));
                        $bgcolor = $g_options["table_wpnbgcolor"];
                        $image = getImage("/weapons/{$game}/{$colval}");
                        // check if image exists
                        if ($image) {
                            $cellbody .= "<img src=\"" . $image["url"] . "\" " . $image["size"] . " border='0' title='" . $rowdata['name'] . "' alt=\"" . $rowdata['name'] . "\">";
                        } else {
                            $cellbody .= $g_options["font_small"];
                            $cellbody .= "<font color=\"#FFFFFF\" class=\"weapon\"><b>";
                            $cellbody .= strToUpper($colval);
                            $cellbody .= "</b></font>";
                            $cellbody .= $g_options["fontend_small"];
                        }
                        break;
                    case "bargraph":
                        $cellbody .= "<img src=\"" . $g_options["imgdir"] . "/bar";
                        if ($colval > 40) {
                            $cellbody .= "6";
                        } elseif ($colval > 30) {
                            $cellbody .= "5";
                        } elseif ($colval > 20) {
                            $cellbody .= "4";
                        } elseif ($colval > 10) {
                            $cellbody .= "3";
                        } elseif ($colval > 5) {
                            $cellbody .= "2";
                        } else {
                            $cellbody .= "1";
                        }
                        $cellbody .= ".gif\" width=\"";
                        if ($colval < 1) {
                            $cellbody .= "1%";
                        } elseif ($colval > 100) {
                            $cellbody .= "100%";
                        } else {
开发者ID:BlackMajic,项目名称:HLStats,代码行数:67,代码来源:classes.inc.php


注:本文中的getImage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。