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


PHP Feed::get方法代码示例

本文整理汇总了PHP中Feed::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Feed::get方法的具体用法?PHP Feed::get怎么用?PHP Feed::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Feed的用法示例。


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

示例1: __construct

 /**
  * Takes a Feed object from a completed search and saves it
  *
  * @param Feed $feed
  */
 public function __construct(Feed $feed)
 {
     $this->upload_dir = wp_upload_dir();
     $this->feed = $feed;
     $this->mls = $feed->mls;
     self::posts($feed->get());
 }
开发者ID:LeapXD,项目名称:wptrebrets,代码行数:12,代码来源:Save.php

示例2: feed_controller

function feed_controller()
{
    global $mysqli, $redis, $session, $route, $feed_settings;
    $result = false;
    require_once "Modules/feed/feed_model.php";
    $feed = new Feed($mysqli, $redis, $feed_settings);
    if ($route->format == 'html') {
        if ($route->action == "list" && $session['write']) {
            $result = view("Modules/feed/Views/feedlist_view.php", array());
        } else {
            if ($route->action == "api" && $session['write']) {
                $result = view("Modules/feed/Views/feedapi_view.php", array());
            }
        }
    } else {
        if ($route->format == 'json') {
            // Public actions available on public feeds.
            if ($route->action == "list") {
                if ($session['read']) {
                    if (!isset($_GET['userid']) || isset($_GET['userid']) && $_GET['userid'] == $session['userid']) {
                        $result = $feed->get_user_feeds($session['userid']);
                    } else {
                        if (isset($_GET['userid']) && $_GET['userid'] != $session['userid']) {
                            $result = $feed->get_user_public_feeds(get('userid'));
                        }
                    }
                } else {
                    if (isset($_GET['userid'])) {
                        $result = $feed->get_user_public_feeds(get('userid'));
                    }
                }
            } elseif ($route->action == "create" && $session['write']) {
                $result = $feed->create($session['userid'], get('tag'), get('name'), get('datatype'), get('engine'), json_decode(get('options')));
            } elseif ($route->action == "updatesize" && $session['write']) {
                $result = $feed->update_user_feeds_size($session['userid']);
            } elseif ($route->action == "buffersize" && $session['write']) {
                $result = $feed->get_buffer_size();
                // To "fetch" multiple feed values in a single request
                // http://emoncms.org/feed/fetch.json?ids=123,567,890
            } elseif ($route->action == "fetch" && $session['read']) {
                $feedids = (array) explode(",", get('ids'));
                for ($i = 0; $i < count($feedids); $i++) {
                    $feedid = (int) $feedids[$i];
                    if ($feed->exist($feedid)) {
                        // if the feed exists
                        $result[$i] = $feed->get_value($feedid);
                        // null is a valid response
                    } else {
                        $result[$i] = false;
                    }
                    // false means feed not found
                }
            } else {
                $feedid = (int) get('id');
                // Actions that operate on a single existing feed that all use the feedid to select:
                // First we load the meta data for the feed that we want
                if ($feed->exist($feedid)) {
                    $f = $feed->get($feedid);
                    // if public or belongs to user
                    if ($f['public'] || $session['userid'] > 0 && $f['userid'] == $session['userid'] && $session['read']) {
                        if ($route->action == "timevalue") {
                            $result = $feed->get_timevalue($feedid);
                        } else {
                            if ($route->action == 'data') {
                                $skipmissing = 1;
                                $limitinterval = 1;
                                if (isset($_GET['skipmissing']) && $_GET['skipmissing'] == 0) {
                                    $skipmissing = 0;
                                }
                                if (isset($_GET['limitinterval']) && $_GET['limitinterval'] == 0) {
                                    $limitinterval = 0;
                                }
                                $result = $feed->get_data($feedid, get('start'), get('end'), get('interval'), $skipmissing, $limitinterval);
                            } else {
                                if ($route->action == "value") {
                                    $result = $feed->get_value($feedid);
                                } else {
                                    if ($route->action == "get") {
                                        $result = $feed->get_field($feedid, get('field'));
                                    } else {
                                        if ($route->action == "aget") {
                                            $result = $feed->get($feedid);
                                        } else {
                                            if ($route->action == 'histogram') {
                                                $result = $feed->histogram_get_power_vs_kwh($feedid, get('start'), get('end'));
                                            } else {
                                                if ($route->action == 'kwhatpower') {
                                                    $result = $feed->histogram_get_kwhd_atpower($feedid, get('min'), get('max'));
                                                } else {
                                                    if ($route->action == 'kwhatpowers') {
                                                        $result = $feed->histogram_get_kwhd_atpowers($feedid, get('points'));
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
//.........这里部分代码省略.........
开发者ID:ashokbasnet,项目名称:emoncms,代码行数:101,代码来源:feed_controller.php

示例3: vis_controller

function vis_controller()
{
    global $mysqli, $redis, $session, $route, $user, $feed_settings;
    $result = false;
    require "Modules/feed/feed_model.php";
    $feed = new Feed($mysqli, $redis, $feed_settings);
    require "Modules/vis/multigraph_model.php";
    $multigraph = new Multigraph($mysqli);
    $visdir = "vis/visualisations/";
    require "Modules/vis/vis_object.php";
    $write_apikey = "";
    $read_apikey = "";
    if ($session['read']) {
        $read_apikey = $user->get_apikey_read($session['userid']);
    }
    if ($session['write']) {
        $write_apikey = $user->get_apikey_write($session['userid']);
    }
    if ($route->format == 'html') {
        if ($route->action == 'list' && $session['write']) {
            $multigraphs = $multigraph->getlist($session['userid']);
            $feedlist = $feed->get_user_feeds($session['userid']);
            $result = view("Modules/vis/Views/vis_main_view.php", array('user' => $user->get($session['userid']), 'feedlist' => $feedlist, 'apikey' => $read_apikey, 'visualisations' => $visualisations, 'multigraphs' => $multigraphs));
        } else {
            if ($route->action == "auto") {
                $feedid = intval(get('feedid'));
                $datatype = $feed->get_field($feedid, 'datatype');
                if ($datatype == 0) {
                    $result = "Feed type or authentication not valid";
                }
                if ($datatype == 1) {
                    $route->action = 'graph';
                }
                if ($datatype == 2) {
                    $route->action = 'bargraph';
                }
                if ($datatype == 3) {
                    $route->action = 'histgraph';
                }
            }
        }
        while ($vis = current($visualisations)) {
            $viskey = key($visualisations);
            // If the visualisation has a set property called action
            // then override the visualisation key and use the set action instead
            if (isset($vis['action'])) {
                $viskey = $vis['action'];
            }
            if ($route->action == $viskey) {
                $array = array();
                $array['valid'] = true;
                if (isset($vis['options'])) {
                    foreach ($vis['options'] as $option) {
                        $key = $option[0];
                        $type = $option[2];
                        if (isset($option[3])) {
                            $default = $option[3];
                        } else {
                            $default = "";
                        }
                        if ($type == 0 || $type == 1 || $type == 2 || $type == 3) {
                            $feedid = (int) get($key);
                            if ($feedid) {
                                $f = $feed->get($feedid);
                                $array[$key] = $feedid;
                                $array[$key . 'name'] = $f['name'];
                                if ($f['userid'] != $session['userid']) {
                                    $array['valid'] = false;
                                }
                                if ($f['public']) {
                                    $array['valid'] = true;
                                }
                            } else {
                                $array['valid'] = false;
                            }
                        } else {
                            if ($type == 4) {
                                // Boolean not used at the moment
                                if (get($key) == true || get($key) == false) {
                                    $array[$key] = get($key);
                                } else {
                                    $array[$key] = $default;
                                }
                            } else {
                                if ($type == 5) {
                                    $array[$key] = preg_replace('/[^\\p{L}_\\p{N}\\s£$€¥]/u', '', get($key)) ? get($key) : $default;
                                } else {
                                    if ($type == 6) {
                                        $array[$key] = str_replace(',', '.', floatval(get($key) ? get($key) : $default));
                                    } else {
                                        if ($type == 7) {
                                            $array[$key] = intval(get($key) ? get($key) : $default);
                                        } else {
                                            if ($type == 8) {
                                                $mid = (int) get($key);
                                                if ($mid) {
                                                    $f = $multigraph->get($mid, $session['userid']);
                                                    $array[$key] = intval($mid ? $mid : $default);
                                                    if (!isset($f['feedlist'])) {
                                                        $array['valid'] = false;
//.........这里部分代码省略.........
开发者ID:jpsingleton,项目名称:emoncms,代码行数:101,代码来源:vis_controller.php

示例4:

<?php
	define('ROOT', '..');
	include ROOT . '/lib/include.php';
	
	$searchFeedId = $accessInfo['action'];
	$searchType = 'blogURL';
	if(is_numeric($searchFeedId)) {
		$searchKeyword = 'http://'.str_replace('http://', '', Feed::get($searchFeedId, 'blogURL'));	
		$searchExtraValue = $searchFeedId;
	} else {
		$searchKeyword = 'http://'.str_replace('http://', '', $accessInfo['address']);
		$searchExtraValue = Feed::blogURL2Id('http://'.str_replace('http://', '', $searchKeyword));
	}

	include ROOT . '/lib/begin.php';

	$pageCount = $skinConfig->postList; // ÆäÀÌÁö°¹¼ö
	list($posts, $totalFeedItems) = FeedItem::getFeedItems($searchType, $searchKeyword, $searchExtraValue, $page, $pageCount);
	$paging = Func::makePaging($page, $pageCount, $totalFeedItems);

	include ROOT . '/lib/piece/message.php';
	include ROOT . '/lib/piece/postlist.php';
	include ROOT . '/lib/end.php';
?>
开发者ID:ncloud,项目名称:bloglounge,代码行数:24,代码来源:blog.php

示例5: date

		
		$skin->replace('tags', $event->on('Text.linker.tags',UTF8::clear($linker_post['tags'])));

		$skin->replace('date', $event->on('Text.linker.date',(Validator::is_digit($linker_post['written']) ? date('Y-m-d h:i a', $linker_post['written']) : $linker_post['written'])));
		$skin->replace('view', $linker_post['click']);


		$linker_post['description'] = func::stripHTML($linker_post['description'].'>');
		if (substr($linker_post['description'], -1) == '>') $linker_post['description'] = substr($linker_post['description'], 0, strlen($linker_post['description']) - 1);
		$description = $linker_post['description'];
		if (strlen(trim($description)) == 0) $description = _t('(글의 앞부분이 이미지 혹은 HTML 태그만으로 되어있습니다)');

		$skin->replace('description_slashed', addslashes($post_description));
		$skin->replace('description', $event->on('Text.linker.description', $post_description));
		$skin->replace('blogname', UTF8::clear(Feed::get($linker_post['feed'], 'title')));
		$skin->replace('blogurl', htmlspecialchars(Feed::get($linker_post['feed'], 'blogURL')));
	
		$skin->replace('boom_rank', Boom::getRank($linker_post['id']));				
		$skin->replace('boom_rank_id', 'boomRank'.$linker_post['id']);
		$skin->replace('boomup_count', $linker_post['boomUp']);		
		$skin->replace('boomdown_count', $linker_post['boomDown']);		

		$skin->replace('boomup_onclick', 'javascript: boom(\''.$linker_post['id'].'\',\'up\');');
		$skin->replace('boomdown_onclick', 'javascript: boom(\''.$linker_post['id'].'\',\'down\');');

		$skin->replace('boomup_id', 'boomUp'.$linker_post['id']);
		$skin->replace('boomdown_id', 'boomDown'.$linker_post['id']);

		$boomedUp = Boom::isBoomedUp($linker_post['id']);
		$boomedDown = Boom::isBoomedDown($linker_post['id']);
开发者ID:ncloud,项目名称:bloglounge,代码行数:29,代码来源:linker.php

示例6: vis_controller

function vis_controller()
{
    global $mysqli, $redis, $session, $route, $user, $feed_settings;
    $result = false;
    require "Modules/feed/feed_model.php";
    $feed = new Feed($mysqli, $redis, $feed_settings);
    require "Modules/vis/multigraph_model.php";
    $multigraph = new Multigraph($mysqli);
    $visdir = "vis/visualisations/";
    require "Modules/vis/vis_object.php";
    $write_apikey = "";
    $read_apikey = "";
    if ($session['read']) {
        $read_apikey = $user->get_apikey_read($session['userid']);
    }
    if ($session['write']) {
        $write_apikey = $user->get_apikey_write($session['userid']);
    }
    if ($route->format == 'html') {
        if ($route->action == 'list' && $session['write']) {
            $multigraphs = $multigraph->getlist($session['userid']);
            $feedlist = $feed->get_user_feeds($session['userid']);
            $result = view("Modules/vis/vis_main_view.php", array('user' => $user->get($session['userid']), 'feedlist' => $feedlist, 'apikey' => $read_apikey, 'visualisations' => $visualisations, 'multigraphs' => $multigraphs));
        } else {
            // and is used primarily for quick checking feeds from the feeds page.
            if ($route->action == "auto") {
                $feedid = (int) get('feedid');
                $route->action = 'graph';
            }
            while ($vis = current($visualisations)) {
                $viskey = key($visualisations);
                // If the visualisation has a set property called action
                // then override the visualisation key and use the set action instead
                if (isset($vis['action'])) {
                    $viskey = $vis['action'];
                }
                if ($route->action == $viskey) {
                    $array = array();
                    $array['valid'] = true;
                    if (isset($vis['options'])) {
                        foreach ($vis['options'] as $option) {
                            $key = $option[0];
                            $type = $option[1];
                            if (isset($option[2])) {
                                $default = $option[2];
                            } else {
                                $default = "";
                            }
                            if ($type == 0 || $type == 1 || $type == 2 || $type == 3) {
                                $feedid = (int) get($key);
                                if ($feedid) {
                                    $f = $feed->get($feedid);
                                    $array[$key] = $feedid;
                                    $array[$key . 'name'] = $f['name'];
                                    if ($f['userid'] != $session['userid']) {
                                        $array['valid'] = false;
                                        $array['error'] = "You dont have the required permission to view this feed";
                                    }
                                    if ($f['public']) {
                                        $array['valid'] = true;
                                    }
                                } else {
                                    $array['valid'] = false;
                                    $array['error'] = "Please select a feed";
                                }
                            }
                            // Boolean not used at the moment
                            if ($type == 4) {
                                if (get($key) == true || get($key) == false) {
                                    $array[$key] = get($key);
                                } else {
                                    $array[$key] = $default;
                                }
                            }
                            if ($type == 5) {
                                $array[$key] = preg_replace('/[^\\w\\s£$€¥]/', '', get($key)) ? get($key) : $default;
                            }
                            if ($type == 6) {
                                $array[$key] = str_replace(',', '.', floatval(get($key) ? get($key) : $default));
                            }
                            if ($type == 7) {
                                $array[$key] = intval(get($key) ? get($key) : $default);
                            }
                            # we need to either urlescape the colour, or just scrub out invalid chars. I'm doing the second, since
                            # we can be fairly confident that colours are eiter a hex or a simple word (e.g. "blue" or such)
                            if ($key == "colour") {
                                $array[$key] = preg_replace('/[^\\dA-Za-z]/', '', $array[$key]);
                            }
                        }
                    }
                    $array['apikey'] = $read_apikey;
                    $array['write_apikey'] = $write_apikey;
                    $result = view("Modules/" . $visdir . $viskey . ".php", $array);
                    if ($array['valid'] == false) {
                        $result .= "<div style='position:absolute; top:0px; left:0px; background-color:rgba(240,240,240,0.5); width:100%; height:100%; text-align:center; padding-top:100px;'><h3>" . $array['error'] . "</h3></div>";
                    }
                }
                next($visualisations);
            }
        }
//.........这里部分代码省略.........
开发者ID:roy13,项目名称:EMON,代码行数:101,代码来源:vis_controller.php

示例7: explode

			$sp_post = $skin->parseTag('post_title', UTF8::clear($event->on('Text.postTitle', func::stripHTML($post['title']))), $sp_post);
			$sp_post = $skin->parseTag('post_author', UTF8::clear($event->on('Text.postAuthor',$post['author'])), $sp_post);

			list($post_category) = explode(',', UTF8::clear($post['tags']), 2);
			$sp_post = $skin->parseTag('post_category', $post_category, $sp_post);
			$sp_post = $skin->parseTag('post_date', $event->on('Text.postDate',(Validator::is_digit($post['written']) ? date('Y-m-d h:i a', $post['written']) : $post['written'])), $sp_post);
			$sp_post = $skin->parseTag('post_view', $post['click'], $sp_post);

			$post_description = $event->on('Text.postDescription', $post['description']);
			$post_description = str_replace('/cache/images/',$service['path'] . '/cache/images/', $post_description);

			$sp_post = $skin->parseTag('post_description', $post_description, $sp_post);
			$sp_post = $skin->parseTag('post_blogname', UTF8::clear(Feed::get($post['feed'], 'title')), $sp_post);
			$sp_post = $skin->parseTag('post_blogurl', htmlspecialchars(Feed::get($post['feed'], 'blogURL')), $sp_post);
			$sp_post = $skin->parseTag('post_bloglink', $service['path'].'/blog/'.Feed::get($post['feed'], 'id') , $sp_post);
			
			$sp_post = $skin->parseTag('boom_rank', Boom::getRank($post['id']), $sp_post);	
			$sp_post = $skin->parseTag('boom_rank_id', 'boomRank'.$post['id'], $sp_post);
			$sp_post = $skin->parseTag('boom_rank_class', 'boom_rank_'.Boom::getRank($post['id']), $sp_post);
			$sp_post = $skin->parseTag('boomup_count', $post['boomUp'], $sp_post);		
			$sp_post = $skin->parseTag('boomdown_count', $post['boomDown'], $sp_post);

			$sp_post = $skin->parseTag('boom_count_id', 'boomCount'.$post['id'], $sp_post);
			$sp_post = $skin->parseTag('boom_count', $post['boomUp'] - $post['boomDown'], $sp_post);
			$sp_post = $skin->parseTag('boom_count_class', 'boomCount boomCount'.($post['boomUp'] - $post['boomDown']), $sp_post);

			$sp_post = $skin->parseTag('boomup_onclick', 'boom(\''.$post['id'].'\',\'up\');', $sp_post);
			$sp_post = $skin->parseTag('boomdown_onclick', 'boom(\''.$post['id'].'\',\'down\');', $sp_post);

			$sp_post = $skin->parseTag('boomup_id', 'boomUp'.$post['id'], $sp_post);
开发者ID:ncloud,项目名称:bloglounge,代码行数:30,代码来源:post.php

示例8: feed_controller

function feed_controller()
{
    global $mysqli, $redis, $session, $route, $feed_settings;
    $result = false;
    include "Modules/feed/feed_model.php";
    $feed = new Feed($mysqli, $redis, $feed_settings);
    if ($route->format == 'html') {
        if ($route->action == "list" && $session['write']) {
            $result = view("Modules/feed/Views/feedlist_view.php", array());
        }
        if ($route->action == "api" && $session['write']) {
            $result = view("Modules/feed/Views/feedapi_view.php", array());
        }
    }
    if ($route->format == 'json') {
        // Public actions available on public feeds.
        if ($route->action == "list") {
            if (!isset($_GET['userid']) && $session['read']) {
                $result = $feed->get_user_feeds($session['userid']);
            }
            if (isset($_GET['userid']) && $session['read'] && $_GET['userid'] == $session['userid']) {
                $result = $feed->get_user_feeds($session['userid']);
            }
            if (isset($_GET['userid']) && $session['read'] && $_GET['userid'] != $session['userid']) {
                $result = $feed->get_user_public_feeds(get('userid'));
            }
            if (isset($_GET['userid']) && !$session['read']) {
                $result = $feed->get_user_public_feeds(get('userid'));
            }
        } elseif ($route->action == "getid" && $session['read']) {
            $result = $feed->get_id($session['userid'], get('name'));
        } elseif ($route->action == "create" && $session['write']) {
            $result = $feed->create($session['userid'], get('name'), get('datatype'), get('engine'), json_decode(get('options')));
        } elseif ($route->action == "updatesize" && $session['write']) {
            $result = $feed->update_user_feeds_size($session['userid']);
            // To "fetch" multiple feed values in a single request
            // http://emoncms.org/feed/fetch.json?ids=123,567,890
        } elseif ($route->action == "fetch" && $session['read']) {
            $feedids = (array) explode(",", get('ids'));
            for ($i = 0; $i < count($feedids); $i++) {
                $feedid = (int) $feedids[$i];
                if ($feed->exist($feedid)) {
                    $result[$i] = (double) $feed->get_value($feedid);
                } else {
                    $result[$i] = "";
                }
            }
        } else {
            $feedid = (int) get('id');
            // Actions that operate on a single existing feed that all use the feedid to select:
            // First we load the meta data for the feed that we want
            if ($feed->exist($feedid)) {
                $f = $feed->get($feedid);
                // if public or belongs to user
                if ($f['public'] || $session['userid'] > 0 && $f['userid'] == $session['userid'] && $session['read']) {
                    if ($route->action == "value") {
                        $result = $feed->get_value($feedid);
                    }
                    if ($route->action == "timevalue") {
                        $result = $feed->get_timevalue_seconds($feedid);
                    }
                    if ($route->action == "get") {
                        $result = $feed->get_field($feedid, get('field'));
                    }
                    // '/[^\w\s-]/'
                    if ($route->action == "aget") {
                        $result = $feed->get($feedid);
                    }
                    if ($route->action == 'histogram') {
                        $result = $feed->histogram_get_power_vs_kwh($feedid, get('start'), get('end'));
                    }
                    if ($route->action == 'kwhatpower') {
                        $result = $feed->histogram_get_kwhd_atpower($feedid, get('min'), get('max'));
                    }
                    if ($route->action == 'kwhatpowers') {
                        $result = $feed->histogram_get_kwhd_atpowers($feedid, get('points'));
                    }
                    if ($route->action == 'data') {
                        $result = $feed->get_data($feedid, get('start'), get('end'), get('dp'));
                    }
                    if ($route->action == 'average') {
                        $result = $feed->get_average($feedid, get('start'), get('end'), get('interval'));
                    }
                    if ($route->action == 'history') {
                        $result = $feed->get_history($feedid, get('start'), get('end'), get('interval'));
                    }
                }
                // write session required
                if (isset($session['write']) && $session['write'] && $session['userid'] > 0 && $f['userid'] == $session['userid']) {
                    // Storage engine agnostic
                    if ($route->action == 'set') {
                        $result = $feed->set_feed_fields($feedid, get('fields'));
                    }
                    if ($route->action == "insert") {
                        $result = $feed->insert_data($feedid, time(), get("time"), get("value"));
                    }
                    if ($route->action == "update") {
                        $result = $feed->update_data($feedid, time(), get("time"), get('value'));
                    }
                    if ($route->action == "delete") {
//.........这里部分代码省略.........
开发者ID:barriquello,项目名称:simon,代码行数:101,代码来源:feed_controller.php

示例9: getPredictionPage

		function getPredictionPage($id, $pageCount, $searchQuery='', $feedListPageOrder = 'created') {
			global $db, $database;

			$page = 1;

			$created = Feed::get($id,'created');
			if(!empty($created)) {	
				$searchQuery = 'created > ' . $created . (!empty($searchQuery)?' AND '.$searchQuery:'');
			}			

			if(!isAdmin()) {
				$sQuery = 'WHERE visibility = "y"';
			} else {
				$sQuery = 'WHERE 1=1';
			}

			if(!empty($searchQuery)) {
				$sQuery .= ' AND ' . $searchQuery;
			}

			$count = $db->queryCell('SELECT count(*) as count FROM '.$database['prefix'].'Feeds '.$sQuery.' ORDER BY '.$feedListPageOrder.' DESC');
			if($count > 0) {
				$page = ceil(($count + 1) / $pageCount);
			}
			
			return $page;
		}
开发者ID:ncloud,项目名称:bloglounge,代码行数:27,代码来源:LZ.PHP.Feeder.php

示例10: vis_controller

function vis_controller()
{
    global $mysqli, $redis, $session, $route, $user, $settings;
    $result = false;
    require "Modules/feed/feed_model.php";
    $feed = new Feed($mysqli, $redis, $settings);
    require "Modules/vis/multigraph_model.php";
    $multigraph = new Multigraph($mysqli);
    $visdir = "vis/visualisations/";
    /*
      1 - realtime
      2 - daily
      3 - histogram
      4 - boolean (not used uncomment line 122)
      5 - text
      6 - float value
      7 - int value
    */
    $visualisations = array('realtime' => array('options' => array(array('feedid', 1))), 'rawdata' => array('options' => array(array('feedid', 1), array('fill', 7, 0), array('units', 5, 'W'), array('colour', 5, 'EDC240'))), 'bargraph' => array('options' => array(array('feedid', 2), array('colour', 5, 'EDC240'))), 'timestoredaily' => array('options' => array(array('feedid', 1), array('units', 5, 'kWh'))), 'smoothie' => array('options' => array(array('feedid', 1), array('ufac', 6))), 'histgraph' => array('options' => array(array('feedid', 3), array('barwidth', 7, 50), array('start', 7, 0), array('end', 7, 0))), 'zoom' => array('options' => array(array('power', 1), array('kwhd', 2), array('currency', 5, '&pound;'), array('currency_after_val', 7, 0), array('pricekwh', 6, 0.14))), 'stacked' => array('options' => array(array('bottom', 2), array('top', 2))), 'stackedsolar' => array('options' => array(array('solar', 2), array('consumption', 2))), 'threshold' => array('options' => array(array('feedid', 3), array('thresholdA', 6, 500), array('thresholdB', 6, 2500))), 'simplezoom' => array('options' => array(array('power', 1), array('kwhd', 2))), 'orderbars' => array('options' => array(array('feedid', 2))), 'orderthreshold' => array('options' => array(array('feedid', 3), array('power', 1), array('thresholdA', 6, 500), array('thresholdB', 6, 2500))), 'editrealtime' => array('options' => array(array('feedid', 1))), 'editdaily' => array('options' => array(array('feedid', 2))), 'multigraph' => array('action' => 'multigraph', 'options' => array(array('mid', 7))), 'compare' => array('action' => 'compare', 'options' => array(array('powerx', 1), array('powery', 1))));
    $write_apikey = "";
    $read_apikey = "";
    if ($session['read']) {
        $read_apikey = $user->get_apikey_read($session['userid']);
    }
    if ($session['write']) {
        $write_apikey = $user->get_apikey_write($session['userid']);
    }
    if ($route->format == 'html') {
        if ($route->action == 'list' && $session['write']) {
            $multigraphs = $multigraph->getlist($session['userid']);
            $feedlist = $feed->get_user_feeds($session['userid']);
            $result = view("Modules/vis/vis_main_view.php", array('user' => $user->get($session['userid']), 'feedlist' => $feedlist, 'apikey' => $read_apikey, 'visualisations' => $visualisations, 'multigraphs' => $multigraphs));
        }
        // Auto - automatically selects visualisation based on datatype
        // and is used primarily for quick checking feeds from the feeds page.
        if ($route->action == "auto") {
            $feedid = intval(get('feedid'));
            $datatype = $feed->get_field($feedid, 'datatype');
            if ($datatype == 0) {
                $result = "Feed type or authentication not valid";
            }
            if ($datatype == 1) {
                $route->action = 'rawdata';
            }
            if ($datatype == 2) {
                $route->action = 'bargraph';
            }
            if ($datatype == 3) {
                $route->action = 'histgraph';
            }
        }
        while ($vis = current($visualisations)) {
            $viskey = key($visualisations);
            // If the visualisation has a set property called action
            // then override the visualisation key and use the set action instead
            if (isset($vis['action'])) {
                $viskey = $vis['action'];
            }
            if ($route->action == $viskey) {
                $array = array();
                $array['valid'] = true;
                if (isset($vis['options'])) {
                    foreach ($vis['options'] as $option) {
                        $key = $option[0];
                        $type = $option[1];
                        if (isset($option[2])) {
                            $default = $option[2];
                        } else {
                            $default = "";
                        }
                        if ($type == 1 || $type == 2 || $type == 3) {
                            $feedid = (int) get($key);
                            if ($feedid) {
                                $f = $feed->get($feedid);
                                $array[$key] = $feedid;
                                $array[$key . 'name'] = $f['name'];
                                if ($f['userid'] != $session['userid'] || $f['datatype'] != $type) {
                                    $array['valid'] = false;
                                }
                                if ($f['public'] && $f['datatype'] == $type) {
                                    $array['valid'] = true;
                                }
                            } else {
                                $array['valid'] = false;
                            }
                        }
                        // Boolean not used at the moment
                        if ($type == 4) {
                            if (get($key) == true || get($key) == false) {
                                $array[$key] = get($key);
                            } else {
                                $array[$key] = $default;
                            }
                        }
                        if ($type == 5) {
                            $array[$key] = preg_replace('/[^\\w\\s£$€¥]/', '', get($key)) ? get($key) : $default;
                        }
                        if ($type == 6) {
                            $array[$key] = str_replace(',', '.', floatval(get($key) ? get($key) : $default));
                        }
//.........这里部分代码省略.........
开发者ID:kenpi2b,项目名称:pkg-emoncms,代码行数:101,代码来源:vis_controller.php

示例11: getNoticePage

	function getNoticePage($input, $config) {
		global $database, $db, $event, $service;
		if(!isAdmin()) {
?>
<?php
			return $input;
		} 

		$blogId = isset($config['blog'])?$config['blog']:0;
		$tag = isset($config['tag'])?$config['tag']:'';
		$pluginURL = $event->pluginURL;
		
		$params = '';

		if(!empty($blogId)) {
			
			$pageCount = 15; // 페이지갯수
			$page = isset($_GET['page']) ? $_GET['page'] : 1;
			if(!isset($page) || empty($page)) $page = 1;

			list($posts, $totalFeedItems) = getNoticeFeedItems($blogId,$page,$pageCount);							
			$paging = Func::makePaging($page, $pageCount, $totalFeedItems);
			
			ob_start();

?>
		<link rel="stylesheet" href="<?php echo $pluginURL;?>/style.css" type="text/css" />

		<script type="text/javascript">
			var is_checked = false;
			function toggleCheckAll(className) {
				is_checked = !is_checked;
				$("."+className).each( function() {
						this.checked = is_checked;
				});
			}

			function deleteItem(id) {
				if(confirm("<?php echo _t('이 글을 삭제하시겠습니까?');?>")) {
					$.ajax({
					  type: "POST",
					  url: '<?php echo $pluginURL;?>/delete.php',
					  data: 'id=' + id,
					  dataType: 'xml',
					  success: function(msg){		
						error = $("response error", msg).text();
						if(error == "0") {
							document.location.reload();
						} else {
							alert($("response message", msg).text());
						}
					  },
					  error: function(msg) {
						 alert('unknown error');
					  }
					});
				}
			}

			function deleteAllItem(className) {
				var ids = '';
				$("."+className).each( function() {
						if(this.checked) {
							ids += $(this).val() + ',';
						}
				});

				if(ids == '') {
					return false;
				}		
				
				if(confirm("<?php echo _t('선택된 모든 글을 삭제하시겠습니까?');?>")) {
					$.ajax({
					  type: "POST",
					  url:  '<?php echo $pluginURL;?>/delete.php',
					  data: 'id=' + ids,
					  dataType: 'xml',
					  success: function(msg){		
						error = $("response error", msg).text();
						if(error == "0") {
							document.location.reload();
						} else {
							alert($("response message", msg).text());
						}
					  },
					  error: function(msg) {
						 alert('unknown error');
					  }
					});
				}
			}
		</script>

		<div class="title_wrap">
			<h3><?php echo _t('공지사항');?> <span class="cnt">(<?php echo $totalFeedItems;?>)</span></h3>
		</div>
		
		<div class="notice_wrap">
<?php
	$headers = array(array('title'=>_t('선택'),'class'=>'entrylist_select','width'=>'50px'),
//.........这里部分代码省略.........
开发者ID:ncloud,项目名称:bloglounge,代码行数:101,代码来源:index.php

示例12: getMagazineFocus

	function getMagazineFocus($input, $config) {	
		global $database, $db, $skin, $event, $service, $accessInfo;

		// 첫페이지에만 보이기 ..
		/*
		if(!(empty($accessInfo['controller']) && ($accessInfo['page']==1))) {
			return $input;
		}
		*/

		$pluginURL = $event->pluginURL;
		requireComponent('LZ.PHP.Media');

		if(!isset($config['tabDelay'])) {
			$config['tabDelay'] = 0;
		}
		
		ob_start();
?>
		<style type="text/css">
			.magazineFocusWrap {  padding-top:10px; }
				.magazineFocusTable { width:100%; border:5px solid #b2c941; }
				.magazineFocusTable .leftTab { width:166px; overflow:hidden; background:url("<?php echo $pluginURL;?>/images/bg_left_tab.gif") repeat-y right #fafafa; vertical-align:top; }
					.magazineFocusTable .leftTab ul { list-style:none; margin:0; padding:0; }
						.magazineFocusTable .leftTab ul li { color:#989898; padding-left:20px; padding-top:8px; padding-bottom:8px; margin-right:1px; background:url("<?php echo $pluginURL;?>/images/bg_left_line.gif") repeat-x top; cursor:pointer; font-size:13px; }
						
						.magazineFocusTable .leftTab ul li a { color:#989898; text-decoration:none; }

						.magazineFocusTable .leftTab ul li.first { background-image:none; }
						.magazineFocusTable .leftTab ul li.selected { background-color:#ffffff; margin-right:0; color:#333; font-weight:bold; }
						.magazineFocusTable .leftTab ul li.selected span { background:url("<?php echo $pluginURL;?>/images/bg_left_select.gif") no-repeat right; padding-right:14px; }

						.magazineFocusTable .leftTab ul li.selected a { color:#333; }

						.magazineFocusTable .leftTab ul li.dummy { cursor:default; }
				
				.magazineFocusTable .mainData { vertical-align:top; }

					.magazineFocusTable .mainData ul.item { list-style:none; padding:10px; padding-right:0; padding-bottom:0px; margin:0; display:none; overflow:hidden;  }
						.magazineFocusTable .mainData ul.viewed { display:block; }
					.magazineFocusTable .mainData ul.item li { width:430px; height:68px; padding-bottom:5px; margin-bottom:10px; overflow:hidden; border-bottom:1px solid #ececec; }
						.magazineFocusTable .mainData ul.item li.empty { color:#aaa; font-size:11px; padding-bottom:14px; }
						
						.magazineFocusTable .mainData ul.item li .thumbnail { float:left; margin-right:10px; width:62px; }
							.magazineFocusTable .mainData ul.item li .thumbnail img { width:62px; }

						.magazineFocusTable .mainData ul.item li .data { float:left; width:350px; }
							.magazineFocusTable .mainData ul.item li .data h3 { font-size:14px; color:#595959; font-weight:bold; margin:0; margin-bottom:2px; }
								.magazineFocusTable .mainData ul.item li .data h3 a { color:#4e4e4e; text-decoration:none; }
								.magazineFocusTable .mainData ul.item li .data h3 a:hover { text-decoration:underline; }
							
							.magazineFocusTable .mainData ul.item li .permalink { font-size:11px; margin-bottom:8px; height:12px; line-height:12px; overflow:hidden; }
								.magazineFocusTable .mainData ul.item li .permalink a { color:#909090; text-decoration:none; }
								.magazineFocusTable .mainData ul.item li .permalink a:hover { text-decoration:underline; }

							.magazineFocusTable .mainData ul.item li .data .desc { color:#5d5d5d; line-height:14px; font-size:11px; }

						.magazineFocusTable .mainData ul.item li .data2 { width: 430px; }

						.magazineFocusTable .mainData ul.item li.title_only { padding-bottom:0; border:0; height:14px; background:url("<?php echo $pluginURL;?>/images/bg_li.gif") no-repeat 0px 6px; padding-left:8px; letter-spacing:0px; }
							.magazineFocusTable .mainData ul.item li.title_only a { color:#4e4e4e; text-decoration:none; }
							.magazineFocusTable .mainData ul.item li.title_only a:hover { text-decoration:underline; }

							.magazineFocusTable .mainData ul.item li.title_only .sep { color:#eee; }
							.magazineFocusTable .mainData ul.item li.title_only .feedTitle { color:#999; font:11px Dotum; }
			
				.magazineFocusTable .focusImageWrap { padding:5px;  }
				.magazineFocusTable .focusImageWrap .focusImageDataWrap { padding:10px; padding-bottom:0px; background:url("<?php echo $pluginURL;?>/images/bg.gif") repeat-x; }
				.magazineFocusTable .focusImageWrap .focusImageDatas { float:left; width: 300px; height:164px; position: relative; overflow: hidden; }
				
					.magazineFocusTable .focusImageWrap #focusImageData { position:absolute; z-index:98; }
					
						.magazineFocusTable .focusImageWrap .focusImage { position:absolute; width: 300px; height: 160px; overflow:hidden; }
							.magazineFocusTable .focusImageWrap .focusImage img { width:300px; height: 344px; }

						.magazineFocusTable .focusImageWrap .focusShadow { position:absolute;  top:160px; width:300px; height:4px; background:url("<?php echo $pluginURL;?>/images/bg_image_shadow.gif") repeat-x; font-size:0; line-height:0; z-index:102; }
						
						.magazineFocusTable .focusImageWrap .focusTitleBG { width:300px; position:absolute; height:40px; background:#000000; opacity:0.3; filter: alpha(opacity = 30); z-index: 100; }
						
						.magazineFocusTable .focusImageWrap .focusImageTitle { width: 300px; color:#ffffff;  position:absolute; top:137px; padding:5px; z-index: 101; font-size:13px; line-height:15px; }

							.magazineFocusTable .focusImageWrap .focusImageTitle a { color:#ffffff; text-decoration:none; font-weight:bold; }
							.magazineFocusTable .focusImageWrap .focusImageTitle a:hover { text-decoration:underline; }	

							.magazineFocusTable .focusImageWrap .focusImageTitle .blogtitle { font-size:11px; color:#cdcdcd; }

				.magazineFocusTable .focusImageWrap .focusImageNav { float:left; margin-left:14px; }
					.magazineFocusTable .focusImageWrap .focusImageNav ul { list-style:none; margin:0; padding:0; }
					.magazineFocusTable .focusImageWrap .focusImageNav ul li { margin-bottom:6px; }
					.magazineFocusTable .focusImageWrap .focusImageNav ul li .thumbnail { width:30px; height:30px; overflow:hidden; border:1px solid #000; }
					.magazineFocusTable .focusImageWrap .focusImageNav ul li .thumbnail img { height:30px; }

					.magazineFocusTable .focusImageWrap .focusImageNav ul li.selected .thumbnail { opacity:0.5; filter: alpha(opacity = 50); }

					.magazineFocusTable .focusImageWrap .focusImageNav ul li .shadow { width:32px; height:4px; background:url("<?php echo $pluginURL;?>/images/bg_image_shadow.gif") repeat-x; font-size:0; line-height:0; }

					.magazineFocusTable .focusImageEmpty { text-align: center; color: #999; }					
		</style>
<?php
		$css = ob_get_contents();
//.........这里部分代码省略.........
开发者ID:ncloud,项目名称:bloglounge,代码行数:101,代码来源:index.php

示例13: echo

?>
					<div class="data<?php echo !empty($thumbnailFile)?'':' no_thumbnail_data';?>">
						<div class="title"><a href="<?php echo $service['path'];?>/admin/blog/entrylist?read=<?php echo $post['id'];?>"><?php echo UTF8::lessenAsEm(stripcslashes(func::stripHTML($post['title'])), 36);?></a><?php echo ($isNew?'<img src="'.$service['path'].'/images/admin/icon_new.gif" alt="new" align="absmiddle" class="new" />':'');?></div>
						<a href="<?php echo $service['path'];?>/admin/blog/entrylist?read=<?php echo $post['id'];?>"><?php echo $desc?></a>
					</div>
					<div class="clear"></div>
<?php
			$content = ob_get_contents();
			ob_end_clean();

			array_push($data['datas'], array('class'=>'entrylist_title','data'=> $content ));

			// 글 블로그
			ob_start();
?>
					<a href="<?php echo $service['path'];?>/admin/blog/list?read=<?php echo $post['feed'];?>" title="<?php echo _f('\'%1\' 정보보기', stripcslashes(Feed::get($post['feed'], 'title')));?>"><?php echo UTF8::lessenAsEm(stripcslashes(Feed::get($post['feed'], 'title')), 30);?></a> <?php echo $feedvisibility=='n'?'<span class="hide">'._t('(비공개)').'</span>':'';?>
<?php

			$content = ob_get_contents();
			ob_end_clean();

			array_push($data['datas'], array('class'=>'entrylist_blog','data'=> $content ));
			
			// 글 랭크
			$rank = Boom::getRank($post['id']);
			array_push($data['datas'], array('class'=>'entrylist_rank','data'=> '<span class="rank'.$rank.'">'.$rank.'</span>' ));
			
			// 글 읽은 수
			array_push($data['datas'], array('class'=>'entrylist_hit','data'=> $post['click']));
			
			// 글 실행
开发者ID:ncloud,项目名称:bloglounge,代码行数:31,代码来源:index.php


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