本文整理汇总了PHP中Network::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Network::get方法的具体用法?PHP Network::get怎么用?PHP Network::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network::get方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
function get()
{
$profile_uid = intval($_GET['p']);
$load = argc() > 1 && argv(1) == 'load' ? 1 : 0;
header("Content-type: text/html");
echo "<!DOCTYPE html><html><body>\r\n";
echo array_key_exists('msie', $_GET) && $_GET['msie'] == 1 ? '<div>' : '<section>';
$mod = new Network();
$text = $mod->get($profile_uid, $load);
$pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
$replace = "<img\${1} dst=\"\${2}\"";
// $text = preg_replace($pattern, $replace, $text);
/*
if(! $load) {
$replace = '<br />' . t('[Embedded content - reload page to view]') . '<br />';
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
$text = preg_replace($pattern, $replace, $text);
}
*/
echo str_replace("\t", ' ', $text);
echo array_key_exists('msie', $_GET) && $_GET['msie'] == 1 ? '</div>' : '</section>';
echo "</body></html>\r\n";
// logger('update_network: ' . $text);
killme();
}
示例2: render
function render()
{
$network = new Network();
$this->network_links = $network->get();
$this->inner_HTML = $this->generate_inner_html();
$links = parent::render();
return $links;
}
示例3: render
function render()
{
$network = new Network();
$extra = unserialize(PA::$network_info->extra);
$this->network_data = '';
if (!empty($extra['network_feature'])) {
$network->network_id = $extra['network_feature'];
$this->network_data = $network->get();
}
$this->inner_HTML = $this->generate_inner_html();
$content = parent::render();
return $content;
}
示例4: handleGETPageSubmit
public function handleGETPageSubmit($request_data)
{
if (!empty($request_data['keyword'])) {
$this->name_string = @$request_data['name_string'];
$this->keyword = $request_data['keyword'];
}
if (!empty($request_data['sort_by'])) {
$this->sort_by = $request_data['sort_by'];
}
if (!empty(PA::$page_uid)) {
$this->uid = PA::$page_uid;
$this->sort_by = $request_data['sort_by'];
}
$params = array('cnt' => TRUE);
$network_obj = new Network();
$this->total_network = $network_obj->get($params);
}
示例5: array
* http://wiki.peopleaggregator.org/index.php
* TODO: use Network::get_members() method
*/
$login_required = FALSE;
$use_theme = 'Beta';
//TODO : Remove this when new UI is completely implemented.
include "includes/page.php";
require "{$current_blockmodule_path}/MembersFacewallModule/MembersFacewallModule.php";
$uid = @$_GET['uid'];
$sort_by = $selected_option = @$_GET['sort_by'];
$sorting_options[] = array('caption' => __('Last Login'), 'value' => 'last_login');
$sorting_options[] = array('caption' => __('Latest Registered'), 'value' => 'latest_registered');
if (CURRENT_NETWORK_URL_PREFIX != 'www' && CURRENT_NETWORK_URL_PREFIX != '') {
$network = new Network();
$where = "address = '" . CURRENT_NETWORK_URL_PREFIX . "'";
$netinfo = $network->get(NULL, $where);
$params = array('page' => 1, 'show' => 5);
if ($sort_by == 'last_login') {
$a = array('sort_by' => 'U.last_login');
$params = array_merge($params, $a);
}
$users = Network::get_network_members($netinfo[0]->network_id, $params);
} else {
if ($sort_by == 'last_login') {
$users = User::allUsers(10, 'last_login', 5);
} else {
if ($sort_by == 'latest_registered') {
$users = User::allUsers(10, 'latest', 5);
}
}
for ($i = 0; $i < count($users['users_data']); $i++) {
示例6: Network
function render_network_image($net_or_id) {
// find the id
if (is_numeric($net_or_id)) {
// there's no easy way to get info about a network; we have to go through this incantation...
$net_obj = new Network();
$net_obj->network_id = $net_or_id;
$net = $net_obj->get();
$net = $net[0];
} else {
$net = $net_or_id;
}
// and display
$networks = $this->state['networks'];
$included = isset($networks['included'][(int)$net->network_id]);
$img = uihelper_resize_mk_user_img($net->inner_logo_image, 75, 75);
$name = $net->name;
$cls = "friend_pic";
if ($included) $cls .= " included_friend";
$include_op = $included ? "exclude" : "include";
$onclick = "badge.include_obj('networks', 'network_$net->network_id', $net->network_id, '$include_op');";
return <<<ENS
<div class="$cls" onclick="$onclick" title="Click to $include_op this network.">
<p>$img</p>
<p>$name</p>
</div>
ENS;
}
示例7: catch
// adding default relation
if ($_SESSION['user']['id'] != SUPER_USER_ID) {
uihelper_add_default_relation($_SESSION['user']['id']);
}
// adding default media as well as album
uihelper_add_default_media($_SESSION['user']['id']);
uihelper_add_default_media($_SESSION['user']['id'], '_audio');
uihelper_add_default_media($_SESSION['user']['id'], '_video');
uihelper_add_default_blog($_SESSION['user']['id']);
}
} catch (PAException $e) {
$msg = "{$e->message}";
}
$network = new Network();
$network->set_params(array('network_id' => $nid));
$netinfo = $network->get();
$netinfo = $netinfo[0];
$requester = new User();
$requester->load((int) $_SESSION['user']['id']);
$recipient = type_cast($netinfo, 'Network');
// defined in helper_functions.php
PANotify::send("network_join", $recipient, $requester, array());
$redirect_url = "http://" . $netinfo->address . "." . PA::$domain_suffix . BASE_URL_REL . PA_ROUTE_HOME_PAGE . "/msg=7001";
header("Location:{$redirect_url}");
exit;
// $msg = "You have successfully joined the '".stripslashes($netinfo->name)."' network. Click <a href='http://".$netinfo->address.".".PA::$domain_suffix.BASE_URL_REL."/homepage.php'>here</a> to go to network.";
} else {
//$msg = "Please login first to join the network.";
header("Location: " . PA::$url . "/login.php?error=1&return=" . urlencode($_SERVER['REQUEST_URI']));
}
} else {
示例8: initializeModule
public function initializeModule($request_method, $request_data)
{
$params = array('cnt' => TRUE);
$network_obj = new Network();
$this->total_network = $network_obj->get($params);
}
示例9: array
global $featured_network;
if (@$_POST['feature_network'] == 0) {
// 0 for no selection
$msg = 'Please select a network';
} else {
$network_basic_controls = PA::$network_defaults;
$network_basic_controls['network_feature'] = $_POST['feature_network'];
$data = array('extra' => serialize($network_basic_controls), 'network_id' => PA::$network_info->network_id, 'changed' => time());
$network = new Network();
$network->set_params($data);
if (empty($msg)) {
try {
$nid = $network->save();
$network_object = new Network();
$network_object->network_id = (int) $_POST['feature_network'];
$featured_network = $network_object->get();
$msg = 'Network Information Successfully Updated';
} catch (PAException $e) {
$msg = "{$e->message}";
}
}
}
}
$page = new PageRenderer("setup_module", PAGE_NETWORK_FEATURE, __("Featured Network"), 'container_two_column.tpl', 'header.tpl', PRI, HOMEPAGE, PA::$network_info);
if (!empty($msg)) {
$msg_tpl = new Template(CURRENT_THEME_FSPATH . "/display_message.tpl");
$msg_tpl->set('message', $msg);
$m = $msg_tpl->fetch();
$page->add_module("middle", "top", $m);
}
$page->html_body_attributes = 'class="no_second_tier network_config"';
示例10: setup_module
$parameter = js_includes('common.js');
$page_id = PAGE_NETWORKS_HOME;
if (!PA::$network_capable) {
die(__("Networks are disabled."));
}
// which blocks are coming on this page
$setting_data = ModuleSetting::load_setting(PAGE_NETWORKS_HOME, @PA::$login_user->user_id);
$setting_data['left'] = is_array(@$setting_data['left']) ? $setting_data['left'] : array();
if (@$_SESSION['user']['id']) {
array_unshift($setting_data['left'], 'MyNetworksModule');
}
array_unshift($setting_data['left'], 'FeaturedNetworkModule', 'VideoTourModule');
$params = array();
$params['cnt'] = TRUE;
$network_obj = new Network();
$total_network = $network_obj->get($params);
function setup_module($column, $moduleName, $obj)
{
global $user_edit, $error, $uid, $rel_type, $uid, $user, $paging, $page_uid, $login_uid, $total_network;
switch ($moduleName) {
case 'FeaturedNetworkModule':
$obj->block_type = 'FeaturedNetwork';
break;
case 'VideoTourModule':
$obj->block_type = 'VideoTour';
break;
case 'MyNetworksModule':
if (!$_SESSION['user']['id']) {
return "skip";
}
if ($page_uid && $page_uid != $login_uid) {
示例11: Network
<?php
$login_required = FALSE;
include "includes/page.php";
$Network = new Network();
$result_object = $Network->get();
$display_string = "";
$networks = count($result_object);
if ($networks > 0) {
for ($counter = 0; $counter < $networks; $counter++) {
$header_image = $result_object[$counter]->header_image == "" ? 'noimage.jpg' : $result_object[$counter]->header_image;
$inner_logo_image = $result_object[$counter]->inner_logo_image == "" ? 'noimage.jpg' : $result_object[$counter]->inner_logo_image;
$display_string .= "<tr>\n <td width='400px' style='border:1px solid #666666'><img src='files/" . $header_image . "'><div align='center'><a href='http://" . $result_object[$counter]->address . ".peopleaggregator.net' target='_blank'>" . $result_object[$counter]->address . ".peopleaggregator.net</a></div></td>\n <td width='400px' style='border:1px solid #666666'><img src='files/" . $inner_logo_image . "'></td>\n </tr>";
}
}
?>
<html>
<head>
<title>
PeopleAggregator:Network Logos
</title>
</head>
<body>
<table cellspacing="3" cellpadding="2" width="800" align="center" style="border:1px solid #333333">
<tr>
<td width="400px" style="border:1px solid #666666;" align="center"><h2>Header Image</h2></td>
<td width="400px" style="border:1px solid #666666;" align="center"><h2>Inner Logo</h2></td>
</tr>
<?php
echo $display_string;