public function image($label, $fieldname) {
    $v = $this->getVal($fieldname);
    if (!empty($v)) {
?>
  <div class="field_bigger">
    <h4><label><?= sprintf(__("Current %s"), $label)?></label></h4>
    <?
    $img_info = uihelper_resize_img($v, 200, 90, PA::$theme_rel."/skins/defaults/images/header_net.gif", NULL, RESIZE_FIT);
		?>
    <img src="<?= $img_info['url'];?>" alt="<?= __("Current Logo") ?>" <?= $img_info['size_attr']?> />
	</div>
  <br style="clear:both" />
<?php } ?>
  <div class="field">
    <h4><label><?= sprintf(__("Upload %s"), $label) ?></label></h4>
    <input name="<?= $fieldname?>" type="file" class="text short" id="<?= $fieldname ?>"/>
  </div>
  <br style="clear:both" />
  <?
  }
	$attval = @$atts[$field['name']]['value'];
	switch ($field['type']) {
		case 'urltextfield':
			if (!empty($attval)) {
				$url = htmlspecialchars($attval);
				if (!preg_match("!^http(s)*://!", $url)) {
					$url = 'http://'.$url;
				}
				$value = '<a href="'.$url.'">'.$url.'</a>';
			} else {
				$value = '';
			}
		break;
		case 'image':
			if (!empty($attval)) {
				$img_info = uihelper_resize_img($attval, 200, 90, PA::$theme_rel."/skins/defaults/images/header_net.gif", NULL, RESIZE_FIT);
				$value = '<img src="'.$img_info['url'].'" alt="'.$label.'" '.$img_info['size_attr'].' style="margin:0;float:none;"/>';
			} else {
				$value = '';
			}
		break;
		case 'stateselect':
			$value = @$statesList[$attval];
		break;
		case 'countryselect':
			$value = @$countryList[$attval];
		break;
		case 'dateselect':
			$day = @$atts[$field['name'].'_day']['value'];
			$month = @$atts[$field['name'].'_month']['value'];
			$year = @$atts[$field['name'].'_year']['value'];
 function get_links()
 {
     // Loading the Searching data
     if ($this->sort_by == 'alphabetic') {
         $this->sort_by = 'login_name';
         $sorting_direction = 'ASC';
     } else {
         $this->sort_by = 'created';
         $sorting_direction = 'DESC';
     }
     $this->only_with_photo = !$this->no_photo_ok;
     $extra_condition = null;
     if ($this->only_with_photo) {
         $extra_condition = "U.picture IS NOT NULL";
     }
     $users = array();
     $this->users_data = array();
     if (empty($this->search_data)) {
         $this->search_data = @$this->search;
     }
     if ($this->search_data) {
         // load users on the basis of the search parameters.
         if ($this->only_with_photo) {
             $users_count = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, TRUE, 'ALL', 0, 'U.' . $this->sort_by, 'DESC', $extra_condition);
             $this->Paging["count"] = $users_count['total_users'];
             $users = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, FALSE, $this->Paging["show"], $this->Paging["page"], 'U.' . $this->sort_by, $sorting_direction, $extra_condition);
         } else {
             $users_count = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, FALSE);
             $this->Paging["count"] = $users_count['total_users'];
             $users = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, FALSE, $this->Paging["show"], $this->Paging["page"], 'U.' . $this->sort_by, $sorting_direction);
         }
     } else {
         if ($this->only_with_photo) {
             $this->Paging["count"] = Network::get_network_members(PA::$network_info->network_id, array('cnt' => TRUE, 'extra_condition' => $extra_condition));
             $params = array('page' => $this->Paging["page"], 'show' => $this->Paging["show"], 'sort_by' => $this->sort_by, 'direction' => $sorting_direction, 'extra_condition' => $extra_condition);
             $users = Network::get_network_members(PA::$network_info->network_id, $params);
         } else {
             $this->Paging["count"] = Network::get_network_members(PA::$network_info->network_id, array('cnt' => TRUE));
             $params = array('page' => $this->Paging["page"], 'show' => $this->Paging["show"], 'sort_by' => $this->sort_by, 'direction' => $sorting_direction);
             $users = Network::get_network_members(PA::$network_info->network_id, $params);
         }
     }
     $users_count = count(@$users['users_data']);
     if ($users_count) {
         $user_profiles = $this->get_profile_data($users['users_data']);
         for ($cnt = 0; $cnt < $users_count; $cnt++) {
             if (empty($users['users_data'][$cnt]['picture'])) {
                 $users['users_data'][$cnt]['picture'] = 'files/default.png';
                 $big_img = uihelper_resize_img($users['users_data'][$cnt]['picture'], 120, 120, NULL, "alt=\"" . $users['users_data'][$cnt]['login_name'] . "\"");
                 $users['users_data'][$cnt]['big_picture'] = $big_img['url'];
             } else {
                 $img = uihelper_resize_mk_user_img($users['users_data'][$cnt]['picture'], 80, 80, 'alt="PA"');
                 $big_img = uihelper_resize_img($users['users_data'][$cnt]['picture'], 120, 120, NULL, "alt=\"" . $users['users_data'][$cnt]['login_name'] . "\"");
                 $users['users_data'][$cnt]['big_picture'] = $big_img['url'];
                 preg_match("/src=\"([^']*?)\"/", $img, $match);
                 //preg_match to get the src of the image
                 $users['users_data'][$cnt]['picture'] = $match[1];
             }
             $users['users_data'][$cnt] = array_merge($users['users_data'][$cnt], $user_profiles[$cnt]);
         }
         $this->users_data = $users['users_data'];
     }
 }
function get_network_image()
{
    $header_image = array();
    $extra = unserialize(PA::$network_info->extra);
    /* When user not selected any image for the Network then header image of the current
      theme will be displayed*/
    if (file_exists(PA::$project_dir . "/web/files/" . $extra['basic']['header_image']['name'])) {
        $header_image_file = PA::$project_dir . "/web/files/" . $extra['basic']['header_image']['name'];
    } else {
        if (file_exists(PA::$core_dir . "/web/files/" . $extra['basic']['header_image']['name'])) {
            $header_image_file = PA::$core_dir . "/web/files/" . $extra['basic']['header_image']['name'];
        } else {
            $header_image_file = null;
        }
    }
    if (empty($extra['basic']['header_image']['name']) || $header_image_file == null) {
        if (isset($extra['network_skin']) && !empty($extra['network_skin'])) {
            // Skin other than default has been seleted.
            $skin_info = skin_details($extra['network_skin']);
            $header_image = array();
            if (!empty($skin_info['headerImage'])) {
                $header_image['img'] = PA::$theme_url . '/skins/' . $extra['network_skin'] . '/images/' . $skin_info['headerImage'];
                $header_image['repeat'] = 'no-repeat';
            }
        } else {
            // Default skin has been selected.
            $header_image['img'] = PA::$theme_url . '/images/header_image.jpg';
            $header_image['repeat'] = 'no-repeat';
        }
    } else {
        /* Handling Croping*/
        if ($image_attrib = getimagesize($header_image_file)) {
            switch ($extra['basic']['header_image']['option']) {
                case DESKTOP_IMAGE_ACTION_TILE:
                    $opts = RESIZE_FIT;
                    // shrink or expand the image to fit inside 1000x191, then we'll repeat it from there
                    $repeat = 'repeat';
                    break;
                case DESKTOP_IMAGE_ACTION_CROP:
                    $opts = RESIZE_CROP;
                    // shrink or expand the image to > 1000x191, then crop the center out
                    $repeat = 'no-repeat';
                    break;
                case DESKTOP_IMAGE_ACTION_STRETCH:
                    $opts = RESIZE_STRETCH;
                    // ignore aspect ratio and stretch the image to 1000x191
                    $repeat = 'no-repeat';
                    break;
                case DESKTOP_IMAGE_ACTION_LEAVE:
                    $opts = $image_attrib[0] >= DESKTOP_MAX_WIDTH && $image_attrib[1] >= DESKTOP_MAX_HEIGHT ? RESIZE_CROP_NO_EXPAND : RESIZE_FIT_NO_EXPAND;
                    $repeat = 'no-repeat';
                    break;
                default:
                    $opts = RESIZE_CROP;
                    $repeat = 'no-repeat';
                    break;
            }
            $header_image_temp = uihelper_resize_img($extra['basic']['header_image']['name'], 1024, 191, PA::$theme_rel . "/images/header_image.jpg", 'alt="Desktop image."', $opts);
            $header_image['img'] = $header_image_temp['url'];
            $header_image['repeat'] = $repeat;
        }
    }
    return $header_image;
}
$normalizer->setParameter('', 'paCompanyType', $companyType);
//---------------------------------------------------------
/* ------------------------ old code ------------------------

  $allExposes = array(
        'exposeCore', 'exposeAddress', 
        'exposeSummary', 'exposePersonal',
         'exposeEducation', 'exposeCompany', 'exposePriorCompany',
        'exposeEducation',
        'exposeFlickrFriends', 'exposeFacebookFriends'
      );
------------------------------------------------------------ */
/* --- changed by Zoran Hron -------------------------------- */
$allExposes = array('exposeCore', 'exposeAddress', 'exposeSummary', 'exposePersonal', 'exposeEducation', 'exposeFlickrFriends', 'exposeFacebookFriends', 'exposeInternalFriends', 'exposeOtherFriends');
/*------------------------------------------------------------ */
$user_image = uihelper_resize_img(PA::$login_user->picture, 35, 35, DEFAULT_USER_PHOTO_REL, 'alt="User image."');
$user_photo = $user_image['url'];
$normalizer->setParameter('', 'userPic', $user_photo);
// show the form with previews
// filter the permissions
/*
values currently used in PA
Nobody="0"
Everybody="1"
Immediate Relations="2"
so to show all info a friend would see
we need to allow perms 1 AND 2
while friends only would be 2
*/
$perms = isset($_POST['perms']) ? $_POST['perms'] : "1,2";
$filter = new Normalizer('filterPerms');
<?php

global $network_info, $current_theme_rel_path;
if (!empty($option)) {
    $opts = $option;
} else {
    $opts = RESIZE_CROP;
}
$image_info = uihelper_resize_img("files/" . trim($header_image), 422, 71, "{$current_theme_rel_path}/images/header_image.jpg", $opts);
?>
<div id="desktop">        
  <h1>Desktop Image</h1>
  <form action="" enctype="multipart/form-data" method = "post">

    <fieldset class="center_box">
      <div class="field_bigger">
        <h4><label for="curr_desk_image">Current Desktop Image</label></h4>
        <img src="<?php 
echo $image_info['url'];
?>
" width="422" height="71" alt="PA" />
      </div>
                
      <div class="field_medium">
        <h4><label for="upload_desk_image">Upload Desktop Image</label></h4>
        <input type="file" class="text long" id="upload_desk_image" name="headerphoto" value="" />

         <div class="field_text">
           Image will appear on your Networks Pages
         </div>
       </div>
Example #7
0
$normalizer->setParameter('', 'paCompanyType', $companyType);
//---------------------------------------------------------
/* ------------------------ old code ------------------------

  $allExposes = array(
        'exposeCore', 'exposeAddress', 
        'exposeSummary', 'exposePersonal',
         'exposeEducation', 'exposeCompany', 'exposePriorCompany',
        'exposeEducation',
        'exposeFlickrFriends', 'exposeFacebookFriends'
      );
------------------------------------------------------------ */
/* --- changed by Zoran Hron -------------------------------- */
$allExposes = array('exposeCore', 'exposeAddress', 'exposeSummary', 'exposePersonal', 'exposeEducation', 'exposeFlickrFriends', 'exposeFacebookFriends', 'exposeInternalFriends');
/*------------------------------------------------------------ */
$user_image = uihelper_resize_img('files/' . $user->picture, 35, 35, DEFAULT_USER_PHOTO_REL, 'alt="User image."');
$user_photo = $user_image['url'];
$normalizer->setParameter('', 'userPic', $user_photo);
// show the form with previews
// filter the permissions
/*
values currently used in PA
Nobody="0"
Everybody="1"
Immediate Relations="2"
so to show all info a friend would see
we need to allow perms 1 AND 2
while friends only would be 2
*/
$perms = isset($_POST['perms']) ? $_POST['perms'] : "1,2";
$filter = new Normalizer('filterPerms');
* @package PeopleAggregator
*/
$login_required = FALSE;
$use_theme = 'Beta';
//TODO : Remove this when new UI is completely implemented.
include_once "web/includes/page.php";
require_once "api/Image/Image.php";
// Now we are trying to get the data from the given id
if (!empty($_GET['img_id'])) {
    $data_array = explode('_', $_GET['img_id']);
    $show_media = new Image();
    $show_media->load($data_array[1]);
    if (strstr($show_media->file_name, 'http://')) {
        $image_val['url'] = $show_media->file_name;
    } else {
        if (!empty($show_media->file_name)) {
            // Now we fatching all the data related to the image and display it
            $image_val = uihelper_resize_img($show_media->file_name, 220, 200, PA::$theme_rel . "/images/no_preview.gif", 'alt="Media gallery"');
        } else {
            // handling the SB image
            $var = $show_media->body;
            $start = strpos($var, '<image>') + 7;
            $end = strpos($var, '</image>');
            $image_val['url'] = substr($var, $start, $end - $start);
            $show_media->body = $show_media->title;
        }
    }
    echo '<h2 style="overflow:hidden"><center>' . $show_media->title . '</center></h2>';
    echo '<img src="' . $image_val['url'] . '" style="border:none; width:auto; height:200px;" />';
    echo '<br /><center>' . $show_media->body . '</center>';
}
 /** !!
  * Create the UI for editing a background image.  User and group in the
  * switch statement are left empty because a background image is a 
  * feature of neither. Call { @link generate_inner_html() } with the
  * information to create the interface.
  */
 private function setupCustomizeBackgroundImage($request_data)
 {
     $desktop_image_settings = array();
     $desktop_image_settings['background_image'] = null;
     switch ($this->settings_type) {
         case 'user':
             break;
         case 'group':
             break;
         case 'network':
             $extra = $this->shared_data['extra'];
             $desktop_image_settings['background_image'] = $extra['basic']['background_image']['name'];
             break;
     }
     $background_image = $desktop_image_settings['background_image'];
     $image_info = uihelper_resize_img($background_image, 1190, 350, PA::$theme_rel . "/skins/default/img/header_net.png");
     $this->set_inner_template('bg_image.php');
     $this->inner_HTML = $this->generate_inner_html(array('page_url' => $this->url, 'base_url' => $this->base_url, 'uid' => $this->uid, 'gid' => $this->gid, 'backgr_image_name' => $background_image, 'image_info' => $image_info, 'type' => 'bg_image', 'settings_type' => $this->settings_type));
 }
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * @todo
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * @version 0.0.0-1
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * @author Cyberspace Networks <*****@*****.**>
 * @license GNU General Public License
 * @copyright Copyright (c) 2000-2015 Cyberspace-Networks
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * The lastest version of Cyberspace Networks CoreSystem can be obtained from:
 * https://github.com/Cyberspace-Networks/CoreSystem
 * For questions, help, comments, discussion, etc. please visit
 * http://www.cyberspace-networks.com
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 */
$image_info = uihelper_resize_img(@$form_data['inner_logo_image'], 70, 60, PA::$theme_rel . "/img/default-network-image.gif");
$mother_network_info = Network::get_mothership_info();
$extra = unserialize($mother_network_info->extra);
?>
<div id="div_epm1">  
    <!-- form start -->
    <form role="form" method="post" action="" enctype="multipart/form-data">
        <div class="box-body">
            <?php 
if (!$is_edit) {
    ?>
                <div class="field_big">
                    <h4><label for="slogan"><?php 
    echo __("Network Address");
    ?>
: <span class="required">*</span></label></h4>
$login_required = FALSE;
$use_theme = 'Beta';
//TODO : Remove this when new UI is completely implemented.
include "../includes/page.php";
require_once "{$path_prefix}/ext/Image/Image.php";
global $login_uid, $current_theme_path;
// Now we are trying to get the data from the given id
if (!empty($_GET['img_id'])) {
    $data_array = explode('_', $_GET['img_id']);
    $show_media = new Image();
    $show_media->load($data_array[1]);
    if (strstr($show_media->file_name, 'http://')) {
        $image_val['url'] = $show_media->file_name;
    } else {
        if (!empty($show_media->file_name)) {
            // Now we fatching all the data related to the image and display it
            $image_val = uihelper_resize_img('files/' . $show_media->file_name, 220, 200, "{$current_theme_path}/images/no_preview.gif", 'alt="Media gallery"');
        } else {
            // handling the SB image
            $var = $show_media->body;
            $start = strpos($var, '<image>') + 7;
            $end = strpos($var, '</image>');
            $image_val['url'] = substr($var, $start, $end - $start);
            $show_media->body = $show_media->title;
        }
    }
    echo '<h2 style="overflow:hidden"><center>' . $show_media->title . '</center></h2>';
    echo '<img src="' . $image_val['url'] . '" width="220" height="200" />';
    echo '<br /><center>' . $show_media->body . '</center>';
}