Exemple #1
0
/**
* Get images for display on front page
*
* @param int number of images
* @param int (optional) guid of owner
* @return string of html for display
*
* To use with the custom index plugin, use something like this:
	
if (is_plugin_enabled('tidypics')) {
?>
<!-- display latest photos -->
<div class="index_box">
	<h2><a href="<?php echo $vars['url']; ?>pg/photos/world/"><?php echo elgg_echo("tidypics:mostrecent"); ?></a></h2>
	<div class="contentWrapper">
<?php
echo tp_get_latest_photos(5);
?>
	</div>
</div>
<?php
}
?>

* Good luck
*/
function tp_get_latest_photos($num_images, $owner_guid = 0, $context = 'front')
{
    $prev_context = get_context();
    set_context($context);
    $image_html = elgg_list_entities(array('type' => 'object', 'subtype' => 'image', 'owner_guid' => $owner_guid, 'limit' => $num_images, 'full_view' => false, 'pagination' => false));
    set_context($prev_context);
    return $image_html;
}
Exemple #2
0
function groups_from_members_submenus()
{
    global $CONFIG;
    $page_owner = page_owner_entity();
    // Submenu items for all group pages
    if ($page_owner instanceof ElggGroup && get_context() == 'groups' && get_loggedin_userid() != $page_owner->getOwner()) {
        if (isloggedin() && !isadminloggedin()) {
            $context = get_context();
            set_context('groupsfrommembers');
            if ($page_owner->canEdit()) {
                add_submenu_item(elgg_echo('groups:invite'), $CONFIG->wwwroot . "mod/groupsfrommembers/invite.php?group_guid={$page_owner->getGUID()}", '1groupsactions');
                if (!$page_owner->isPublicMembership()) {
                    add_submenu_item(elgg_echo('groups:membershiprequests'), $CONFIG->wwwroot . "mod/groups/membershipreq.php?group_guid={$page_owner->getGUID()}", '1groupsactions');
                }
            }
            set_context($context);
        }
    }
}
Exemple #3
0
/**
 * Turns the current page over to the page handler, allowing registered handlers to take over
 *
 * @param string $handler The name of the handler type (eg 'blog')
 * @param array $page The parameters to the page, as an array (exploded by '/' slashes)
 * @return true|false Depending on whether a registered page handler was found
 */
function page_handler($handler, $page)
{
    global $CONFIG;
    set_context($handler);
    $query = parse_url($_SERVER['REQUEST_URI']);
    if (isset($query['query'])) {
        $query = $query['query'];
        $query = rawurldecode($query);
        $query = explode('&', $query);
        if (sizeof($query) > 0) {
            foreach ($query as $queryelement) {
                $vals = explode('=', $queryelement);
                if (sizeof($vals) > 1) {
                    set_input($vals[0], $vals[1]);
                }
            }
        }
    }
    $page = explode('/', $page);
    if (!isset($CONFIG->pagehandler) || empty($handler)) {
        $result = false;
    } else {
        if (isset($CONFIG->pagehandler[$handler]) && is_callable($CONFIG->pagehandler[$handler])) {
            $function = $CONFIG->pagehandler[$handler];
            $result = $function($page, $handler);
            if ($result !== false) {
                $result = true;
            }
        } else {
            $result = false;
        }
    }
    if (!$result) {
        $result = default_page_handler($page, $handler);
    }
    if ($result !== false) {
        $result = true;
    }
    return $result;
}
/**
 * Turns the current page over to the page handler, allowing registered handlers to take over
 *
 * @param string $handler The name of the handler type (eg 'blog')
 * @param array $page The parameters to the page, as an array (exploded by '/' slashes)
 * @return true|false Depending on whether a registered page handler was found
 */
function page_handler($handler, $page)
{
    global $CONFIG;
    set_context($handler);
    // if there are any query parameters, make them available from get_input
    if (strpos($_SERVER['REQUEST_URI'], '?') !== FALSE) {
        $query = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1);
        if (isset($query)) {
            $query_arr = elgg_parse_str($query);
            if (is_array($query_arr)) {
                foreach ($query_arr as $name => $val) {
                    set_input($name, $val);
                }
            }
        }
    }
    // if page url ends in a / then last element of $page is an empty string
    $page = explode('/', $page);
    if (!isset($CONFIG->pagehandler) || empty($handler)) {
        $result = false;
    } else {
        if (isset($CONFIG->pagehandler[$handler]) && is_callable($CONFIG->pagehandler[$handler])) {
            $function = $CONFIG->pagehandler[$handler];
            $result = $function($page, $handler);
            if ($result !== false) {
                $result = true;
            }
        } else {
            $result = false;
        }
    }
    if (!$result) {
        $result = default_page_handler($page, $handler);
    }
    if ($result !== false) {
        $result = true;
    }
    return $result;
}
/**
 * Assembles html for edit sections of site pages.
 *
 * @param str $section
 * @return str html
 */
function sitepages_get_edit_section_content($page_type)
{
    set_context('admin');
    $keywords = '';
    $title = elgg_view_title(elgg_echo('sitepages'));
    $menu = elgg_view('sitepages/menu', array('page_type' => $page_type));
    switch ($page_type) {
        case 'front':
            $view = 'sitepages/forms/editfront';
            $keywords = elgg_view('sitepages/keywords');
            break;
        case 'seo':
            $view = 'sitepages/forms/editmeta';
            break;
        default:
            $view = 'sitepages/forms/edit';
            break;
    }
    $form .= elgg_view($view, array('page_type' => $page_type));
    $body = $title . $menu . $form;
    $content = elgg_view_layout('one_column_with_sidebar', $body, $keywords);
    return $content;
}
/**
 * Turns the current page over to the page handler, allowing registered handlers to take over
 *
 * @param string $handler The name of the handler type (eg 'blog')
 * @param array $page The parameters to the page, as an array (exploded by '/' slashes)
 * @return true|false Depending on whether a registered page handler was found
 */
function page_handler($handler, $page)
{
    global $CONFIG;
    set_context($handler);
    $query = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1);
    //parse_url($_SERVER['REQUEST_URI']);
    if (isset($query)) {
        parse_str($query, $query_arr);
        if (is_array($query_arr)) {
            foreach ($query_arr as $name => $val) {
                set_input($name, $val);
            }
        }
    }
    $page = explode('/', $page);
    if (!isset($CONFIG->pagehandler) || empty($handler)) {
        $result = false;
    } else {
        if (isset($CONFIG->pagehandler[$handler]) && is_callable($CONFIG->pagehandler[$handler])) {
            $function = $CONFIG->pagehandler[$handler];
            $result = $function($page, $handler);
            if ($result !== false) {
                $result = true;
            }
        } else {
            $result = false;
        }
    }
    if (!$result) {
        $result = default_page_handler($page, $handler);
    }
    if ($result !== false) {
        $result = true;
    }
    return $result;
}
Exemple #7
0
            if (elgg_view_exists($enttype . '/' . $entsubtype . '/embed')) {
                $content = elgg_view($enttype . '/' . $entsubtype . '/embed', array('entity' => $entity, 'full' => true));
            } else {
                $content = elgg_view($enttype . '/default/embed', array('entity' => $entity, 'full' => true));
            }
            $content = str_replace("\n", "", $content);
            $content = str_replace("\r", "", $content);
            //$content = htmlentities($content,null,'utf-8');
            $content = htmlentities($content, ENT_COMPAT, "UTF-8");
            $link = "javascript:elggUpdateContent('{$content}','{$vars['internalname']}');";
            if ($entity instanceof ElggObject) {
                $title = $entity->title;
                $mime = $entity->mimetype;
            } else {
                $title = $entity->name;
                $mime = '';
            }
            set_context('search');
            if (elgg_view_exists("{$enttype}/{$entsubtype}/embedlist")) {
                $entview = elgg_view("{$enttype}/{$entsubtype}/embedlist", array('entity' => $entity));
            } else {
                $entview = elgg_view_entity($entity);
            }
            $entview = str_replace($entity->getURL(), $link, $entview);
            echo $entview;
            set_context($context);
        }
    }
}
?>
</div>
Exemple #8
0
/**
 * Generic search viewer
 * Given a GUID, this page will try and display any entity
 * 
 * @package Elgg
 * @subpackage Core
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd
 * @copyright Curverider Ltd 2008-2009
 * @link http://elgg.org/
 */
// Load Elgg engine
require_once dirname(dirname(__FILE__)) . "/engine/start.php";
// Set context
set_context('search');
// Get input
$tag = get_input('tag');
$subtype = get_input('subtype');
if (!($objecttype = get_input('object'))) {
    $objecttype = "";
}
if (!($md_type = get_input('tagtype'))) {
    $md_type = "";
}
$owner_guid = get_input('owner_guid', 0);
if (substr_count($owner_guid, ',')) {
    $owner_guid_array = explode(",", $owner_guid);
} else {
    $owner_guid_array = $owner_guid;
}
<?php

require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
admin_gatekeeper();
set_context('admin');
set_page_owner($_SESSION['guid']);
$body = elgg_view("CKEditor/forms/admin");
$title = elgg_view_title(elgg_echo('ckeditor:admin_title'));
$body = elgg_view_layout("two_column_left_sidebar", '', $title . $body);
page_draw($title, $body);
Exemple #10
0
 * @author Curverider Ltd
 * @copyright Curverider Ltd 2008-2009
 * @link http://elgg.com/
 * 
 * 
 * TODO: File icons, download & mime types
 */
//require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
if (is_callable('group_gatekeeper')) {
    group_gatekeeper();
}
//set the title
if (page_owner() == $_SESSION['user']) {
    $area2 = elgg_view_title($title = elgg_echo('file:yours'));
} else {
    $area2 = elgg_view_title($title = elgg_echo('files'));
}
// Get objects
set_context('search');
$area2 .= list_entities("object", "file", page_owner(), 10);
set_context('file');
$get_filter = get_filetype_cloud(page_owner());
if ($get_filter) {
    $area1 = $get_filter;
} else {
    $area2 .= elgg_view('page_elements/contentwrapper', array('body' => elgg_echo("file:none")));
}
$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
// Finally draw the page
page_draw(sprintf(elgg_echo("file:user"), page_owner_entity()->name), $body);
Exemple #11
0
elgg_push_breadcrumb(elgg_echo('bookmarks:all'), $CONFIG->wwwroot . "mod/bookmarks/all.php");
elgg_push_breadcrumb(sprintf(elgg_echo("bookmarks:user"), $page_owner->name));
//set bookmarks header
if (page_owner() == get_loggedin_userid()) {
    $area1 .= elgg_view('page_elements/content_header', array('context' => "own", 'type' => 'bookmarks'));
} else {
    $area1 .= elgg_view('navigation/breadcrumbs');
    $area1 .= elgg_view('page_elements/content_header_member', array('type' => 'bookmarks'));
}
// List bookmarks
set_context('search');
$bookmarks = list_entities('object', 'bookmarks', page_owner());
if (!$bookmarks && $page_owner->guid == get_loggedin_user()->guid) {
    $bookmarks = elgg_view('help/bookmarks');
}
$area2 .= $bookmarks;
set_context('bookmarks');
//if the logged in user is not looking at their stuff, display the ownerblock
if (page_owner() != get_loggedin_user()->guid) {
    $area3 = elgg_view('bookmarks/ownerblock');
}
// include a view for plugins to extend
$area3 .= elgg_view("bookmarks/sidebar", array("object_type" => 'bookmarks'));
if (isloggedin()) {
    // if logged in, get the bookmarklet
    $area3 .= elgg_view("bookmarks/bookmarklet");
}
// Format page
$body = elgg_view_layout('one_column_with_sidebar', $area1 . $area2, $area3);
// Draw it
echo page_draw(sprintf(elgg_echo("bookmarks:user"), page_owner_entity()->name), $body);
Exemple #12
0
<?php

/**
 * Profile Manager
 * 
 * Group Profile Fields Config page
 * 
 * @package profile_manager
 * @author ColdTrick IT Solutions
 * @copyright Coldtrick IT Solutions 2009
 * @link http://www.coldtrick.com/
 */
global $CONFIG;
admin_gatekeeper();
set_context("admin");
set_page_owner($_SESSION['guid']);
$title_text = elgg_echo("profile_manager:group_fields:title");
$title = elgg_view_title($title_text);
$js = elgg_view("profile_manager/js");
$add = elgg_view("profile_manager/group_fields/add");
$list = elgg_view("profile_manager/group_fields/list");
$import = elgg_view("profile_manager/group_fields/import");
$page_data = $title . $js . $add . $list . $import;
page_draw($title_text, elgg_view_layout("two_column_left_sidebar", "", $page_data));
<?php

/*
 * Elgg Forms
 * Kevin Jardine
 * Radagast Solutions
 * http://radagast.biz
 *
 * Lists the current forms
 *
 */
// Define context
set_context('form');
set_page_owner(get_loggedin_userid());
$title = elgg_echo('form:list_forms_title');
$body = elgg_view('form/forms/list_forms');
page_draw($title, elgg_view_layout("two_column_left_sidebar", '', elgg_view_title($title) . $body));
<?php

/**
 * Elgg Pages
 * 
 * @package ElggPages
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd
 * @copyright Curverider Ltd 2008-2009
 * @link http://elgg.com/
 */
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
$page_guid = get_input('page_guid');
set_context('pages');
if (is_callable('group_gatekeeper')) {
    group_gatekeeper();
}
$pages = get_entity($page_guid);
if (!$pages) {
    forward();
}
$container = $pages->container_guid;
if ($container) {
    set_page_owner($container);
} else {
    set_page_owner($pages->owner_guid);
}
global $CONFIG;
// add_submenu_item(sprintf(elgg_echo("pages:user"), page_owner_entity()->name), $CONFIG->url . "pg/pages/owned/" . page_owner_entity()->username, 'pageslinksgeneral');
if ($pages->canEdit()) {
    add_submenu_item(elgg_echo('pages:newchild'), "{$CONFIG->wwwroot}pg/pages/new/?parent_guid={$pages->getGUID()}&container_guid=" . page_owner(), 'pagesactions');
/*
 * Elgg Forms
 * Kevin Jardine
 * Radagast Solutions
 * http://radagast.biz
 *
 * The main form for creating and changing forms.
 *
 */
// Load Elgg engine
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
// Load form model
require_once dirname(__FILE__) . "/models/model.php";
// Define context
set_context('form:admin');
admin_gatekeeper();
global $CONFIG;
$form_id = get_input('id', 0);
$username = get_input('username', '');
$profile = get_input('profile', '');
if ($form_id) {
    $form = get_entity($form_id);
    if ($form) {
        $fields = form_get_fields($form_id);
        $owner = get_entity($form->owner_guid);
        $username = $owner->username;
        $vars = array('form' => $form, 'fields' => $fields, 'form_username' => $username);
        $title = sprintf(elgg_echo('form:manage_form_title'), $form->title, $form->name);
    } else {
        register_error(elgg_echo('form:bad_form_id'));
Exemple #16
0
     if (!isMyALbum($_zp_current_album->name, ALL_RIGHTS)) {
         $hc = $_zp_current_image->get('hitcounter') + 1;
         $_zp_current_image->set('hitcounter', $hc);
         $_zp_current_image->save();
     }
     // Display an Album page.
 } else {
     if (in_context(ZP_ALBUM)) {
         if ($_zp_current_album->isDynamic()) {
             $search = $_zp_current_album->getSearchEngine();
             $cookiepath = WEBPATH;
             if (WEBPATH == '') {
                 $cookiepath = '/';
             }
             zp_setcookie("zenphoto_image_search_params", $search->getSearchParams(), 0, $cookiepath);
             set_context(ZP_INDEX | ZP_ALBUM);
             $theme = setupTheme();
             $_zp_gallery_page = basename($obj = THEMEFOLDER . "/{$theme}/album.php");
         } else {
             handleSearchParms('album', $_zp_current_album);
             $theme = setupTheme();
             $_zp_gallery_page = basename($obj = THEMEFOLDER . "/{$theme}/album.php");
         }
         // update hit counter
         if (!isMyALbum($_zp_current_album->name, ALL_RIGHTS) && getCurrentPage() == 1) {
             $hc = $_zp_current_album->get('hitcounter') + 1;
             $_zp_current_album->set('hitcounter', $hc);
             $_zp_current_album->save();
         }
         // Display the Index page.
     } else {
Exemple #17
0
global $_zp_themeroot, $_zp_current_search, $_highlight_image, $_zp_current_image;
$imageCount = isset($_zp_current_search) ? count($_zp_current_search->getImages()) : 0;
AlbumUtil::setAlbumPage(false);
ThemeUtil::$script .= "isAlbumPage = false;\n";
ThemeUtil::$script .= "var images = [], initialImageThumbSelection = 0;\n";
$cls = $isAlbumPage ? 'album-page' : 'left image-page';
?>

<div id="album-nav" class="left opa60">
	<div class="nav-cell filler"><span>&nbsp;</span></div>
	<?php 
$prevText = "<div id='image-nav-prev' class='image-nav-scroll opa60'><img src='{$_zp_themeroot}/resources/images/arrow_up.png' width='16' height='16'/></div>";
$nextText = "<div id='image-nav-next' class='image-nav-scroll opa60 {$cls}'><img src='{$_zp_themeroot}/resources/images/arrow_down.png' width='16' height='16'/></div>";
if (!in_context(ZP_SEARCH)) {
    $_zp_current_search = new SearchEngine();
    set_context(ZP_SEARCH);
}
$prevNext = AlbumUtil::printNavigation($prevText, $nextText, false, 7, true);
?>
	<div class="nav-cell filler end"><span>&nbsp;</span></div>
</div>

<div style="padding-left: 1px;">
	<div id="album-menu" class="opa60">
		<div id="album-thumb">
			<img src="<?php 
echo getRandomImages()->getCustomImage(NULL, 192, 48, 192, 48, NULL, null, false);
?>
" width="195" height="48"/>
		</div>
	</div>
Exemple #18
0
<?php

/**
 * Activity viewer
 *
 * @package Elgg
 * @subpackage Core
 * @author Curverider Ltd
 * @link http://elgg.org/
 */
require_once dirname(dirname(__FILE__)) . "/engine/start.php";
set_context('search');
$area2 = elgg_list_entities("", "", 0, 10, false);
set_context('entities');
$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
page_draw("", $body);
<?php

/**
 * Elgg notifications plugin index
 * 
 * @package ElggNotifications
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd
 * @copyright Curverider Ltd 2008-2010
 * @link http://elgg.com/
 */
// Load Elgg framework
require_once dirname(dirname(dirname(__FILE__))) . '/engine/start.php';
// Ensure only logged-in users can see this page
gatekeeper();
// Set the context to settings
set_context('settings');
// Get the form
global $SESSION;
$people = array();
if ($people_ents = elgg_get_entities_from_relationship(array('relationship' => 'notify', 'relationship_guid' => $SESSION['user']->guid, 'types' => 'user', 'limit' => 99999))) {
    foreach ($people_ents as $ent) {
        $people[] = $ent->guid;
    }
}
$body = elgg_view('notifications/subscriptions/form', array('people' => $people));
// Insert it into the correct canvas layout
$body = elgg_view_layout('two_column_left_sidebar', '', $body);
// Draw the page
page_draw(elgg_echo('notifications:subscriptions:changesettings'), $body);
Exemple #20
0
<?php

/**
 * Elgg latest content page
 *
 * @package Elgg
 * @subpackage Core
 * @author Curverider Ltd
 * @link http://elgg.org/
 */
/**
 * Start the Elgg engine
 */
require_once dirname(dirname(__FILE__)) . "/engine/start.php";
// Load the front page
global $CONFIG;
if (is_plugin_enabled('riverdashboard')) {
    $title = elgg_view_title(elgg_echo('content:latest'));
    set_context('search');
    $content = elgg_list_registered_entities(array('limit' => 10, 'full_view' => FALSE, 'allowed_types' => array('object', 'group')));
    set_context('latest');
} else {
    $content = "Riverdashboard not loaded";
}
$content = elgg_view_layout('one_column_with_sidebar', $title . $content);
page_draw(elgg_echo('content:latest'), $content);
<?php

/**
 * Friends of friends.
 * 
 * @package friends_of_friends
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Pedro Prez
 * @copyright 2009
 * @link http://www.pedroprez.com.ar/
 */
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
gatekeeper();
set_context('friendsoffriends');
// Get the current page's owner
$page_owner = page_owner_entity();
if ($page_owner === false || is_null($page_owner)) {
    $page_owner = get_loggedin_user();
    set_page_owner(get_loggedin_userid());
}
$title = elgg_view_title(elgg_echo('friendsoffriends'));
// Display main admin menu
$body = friends_of_friends_list_entities($page_owner->getGUID(), 10, true);
page_draw(elgg_echo('friendsoffriends'), elgg_view_layout("two_column_left_sidebar", '', $title . $body));
/**
 * Places album and all of its album pages on one sitemap
 *
 * Gets links to all albums incl. pagination and if the Google image video extension is enabled for images using this as well.
 * This is independent from the images fetched by getSitemapImages().
 *
 * NOTE: Using the Google extension is currently NOT recommended if you have a huge gallery.
 *
 * @return string
 */
function getSitemapAlbums()
{
    global $_zp_gallery, $sitemap_number;
    $data = '';
    $sitemap_locales = generateLanguageList();
    $albumchangefreq = getOption('sitemap_changefreq_albums');
    $imagechangefreq = getOption('sitemap_changefreq_images');
    $albumlastmod = getOption('sitemap_lastmod_albums');
    $albumlastmod = sanitize($albumlastmod);
    $imagelastmod = getOption('sitemap_lastmod_images');
    $albums = array();
    getSitemapAlbumList($_zp_gallery, $albums, 'passAlbums');
    $offset = $sitemap_number - 1;
    $albums = array_slice($albums, $offset, SITEMAP_CHUNK);
    if (!empty($albums)) {
        $data .= sitemap_echonl('<?xml version="1.0" encoding="UTF-8"?>');
        $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
        foreach ($albums as $album) {
            $albumobj = newAlbum($album['folder']);
            set_context(ZP_ALBUM);
            makeAlbumCurrent($albumobj);
            $pageCount = getTotalPages();
            //$imageCount = getNumImages();
            //$images = $albumobj->getImages();
            $date = sitemap_getDateformat($albumobj, $albumlastmod);
            switch (SITEMAP_LOCALE_TYPE) {
                case 1:
                    foreach ($sitemap_locales as $locale) {
                        $url = seo_locale::localePath(true, $locale) . '/' . pathurlencode($albumobj->name);
                        $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                        $data .= sitemap_echonl("\t</url>");
                    }
                    break;
                case 2:
                    foreach ($sitemap_locales as $locale) {
                        $url = rewrite_path(pathurlencode($albumobj->name), '?album=' . pathurlencode($albumobj->name), dynamic_locale::fullHostPath($locale));
                        $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                        $data .= sitemap_echonl("\t</url>");
                    }
                    break;
                default:
                    $url = rewrite_path(pathurlencode($albumobj->name), '?album=' . pathurlencode($albumobj->name), FULLWEBPATH);
                    $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                    $data .= sitemap_echonl("\t</url>");
                    break;
            }
            // print album pages if avaiable
            if ($pageCount > 1) {
                for ($x = 2; $x <= $pageCount; $x++) {
                    switch (SITEMAP_LOCALE_TYPE) {
                        case 1:
                            foreach ($sitemap_locales as $locale) {
                                $url = seo_locale::localePath(true, $locale) . '/' . pathurlencode($albumobj->name) . '/' . _PAGE_ . '/' . $x;
                                $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                                $data .= sitemap_echonl("\t</url>");
                            }
                            break;
                        case 2:
                            foreach ($sitemap_locales as $locale) {
                                $url = rewrite_path(pathurlencode($albumobj->name) . '/' . _PAGE_ . '/' . $x, '?album=' . pathurlencode($albumobj->name) . '&amp;page=' . $x, dynamic_locale::fullHostPath($locale));
                                $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                                $data .= sitemap_echonl("\t</url>");
                            }
                            break;
                        default:
                            $url = rewrite_path(pathurlencode($albumobj->name) . '/' . _PAGE_ . '/' . $x, '?album=' . pathurlencode($albumobj->name) . '&amp;page=' . $x, FULLWEBPATH);
                            $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                            $data .= sitemap_echonl("\t</url>");
                            break;
                    }
                }
            }
        }
        $data .= sitemap_echonl('</urlset>');
        // End off the <urlset> tag
    }
    restore_context();
    return $data;
}
Exemple #23
0
/**
 * Add a new widget that is being cloned via StickyWidgets.
 *
 * @param int $user_guid User GUID to associate this widget with
 * @param string $handler The handler for this widget
 * @param string $context The page context for this widget
 * @param int $order The order to display this widget in
 * @param int $column The column to display this widget in (1, 2 or 3)
 * @return true|false Depending on success
 */
function add_widget_via_sticky($user_guid, $handler, $context, $order = 0, $column = 1)
{
    if (empty($user_guid) || empty($context) || empty($handler) || !widget_type_exists($handler)) {
        return false;
    }
    if ($user = get_user($user_guid)) {
        $widget = new ElggWidget();
        $widget->owner_guid = $user_guid;
        $widget->access_id = 1;
        $widget->container_guid = $user_guid;
        $ctx = get_context();
        set_context('add_sticky_widgets');
        if (!$widget->save()) {
            set_context($ctx);
            return false;
        }
        set_context($ctx);
        $widget->handler = $handler;
        $widget->context = $context;
        $widget->column = $column;
        $widget->order = $order;
        // save_widget_location($widget, $order, $column);
        return true;
    }
    return false;
}
 * Elgg form display
 * Displays the specified Elgg form
 * 
 * @package Elgg
 * @subpackage Form
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Kevin Jardine <*****@*****.**>
 * @copyright Radagast Solutions 2008
 * @link http://radagast.biz/
 */
// Load Elgg engine
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
// Load form model
require_once dirname(__FILE__) . "/models/model.php";
// Define context
set_context('form:content');
$form_id = get_input('id', 0);
$form_data_id = get_input('d', 0);
$preview = get_input('preview', 0);
$form = get_entity($form_id);
if ($form && $form->type == 'object' && get_subtype_from_id($form->subtype) == 'form:form') {
    set_page_owner($form->owner_guid);
    if ($form_data_id && ($form_data = form_get_data($form_data_id))) {
        if (get_entity($form_data_id)->canEdit()) {
            $tab_data = form_get_data_for_edit_form($form, $form_data);
        } else {
            register_error(elgg_echo('form:content_not_found'));
            forward();
        }
    } else {
        $tab_data = form_get_data_for_edit_form($form);
Exemple #25
0
    } else {
        if (page_owner() && page_owner() != $_SESSION['guid']) {
            $area2 = elgg_view_title(sprintf(elgg_echo("file:user:type:" . $tag), page_owner_entity()->name));
        } else {
            $area2 = elgg_view_title(elgg_echo("file:type:" . $tag));
        }
    }
}
if ($friends) {
    $area1 = get_filetype_cloud($friends, true);
} else {
    if ($owner_guid) {
        $area1 = get_filetype_cloud($owner_guid);
    } else {
        $area1 = get_filetype_cloud();
    }
}
// Set context
set_context('search');
$limit = 10;
if ($search_viewtype == "gallery") {
    $limit = 12;
}
if (!empty($tag)) {
    $area2 .= list_entities_from_metadata($md_type, $tag, 'object', 'file', $owner_guid, $limit);
} else {
    $area2 .= list_entities("object", "file", $owner_guid, $limit);
}
set_context("file");
$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2);
page_draw(sprintf(elgg_echo('searchtitle'), $tag), $body);
/**
 * Prints the content of a codeblock for an image, album or Zenpage newsarticle or page.
 *
 * @param int $number The codeblock you want to get
 * @param mixed $what optonal object for which you want the codeblock
 *
 * @return string
 */
function printCodeblock($number = 1, $what = NULL)
{
    $codeblock = getCodeblock($number, $what);
    if ($codeblock) {
        $context = get_context();
        eval('?>' . $codeblock);
        set_context($context);
    }
}
<?php

/**
 * Full group profile
 * 
 * @package ElggGroups
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd
 * @copyright Curverider Ltd 2008-2010
 * @link http://elgg.com/
 */
$group_guid = get_input('group_guid');
set_context('groups');
global $autofeed;
$autofeed = true;
$group = get_entity($group_guid);
if ($group) {
    set_page_owner($group_guid);
    $title = $group->name;
    // Hide some items from closed groups when the user is not logged in.
    $view_all = true;
    $groupaccess = group_gatekeeper(false);
    if (!$groupaccess) {
        $view_all = false;
    }
    $area2 = elgg_view_title($title);
    $area2 .= elgg_view('group/group', array('entity' => $group, 'user' => $_SESSION['user'], 'full' => true));
    if ($view_all) {
        //group profile 'items' - these are not real widgets, just contents to display
        $area2 .= elgg_view('groups/profileitems', array('entity' => $group));
        //group members
Exemple #28
0
function rem_context($context)
{
    global $_zp_current_context;
    set_context(get_context() & ~$context);
}
Exemple #29
0
 * @package ElggProfile
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd <*****@*****.**>
 * @copyright Curverider Ltd 2008-2010
 * @link http://elgg.com/
 */
// Get the Elgg engine
require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
// If we're not logged on, forward the user elsewhere
if (!isloggedin()) {
    forward();
}
// Get owner of profile - set in page handler
$user = page_owner_entity();
if (!$user) {
    register_error(elgg_echo("profile:notfound"));
    forward();
}
// check if logged in user can edit this profile
if (!$user->canEdit()) {
    register_error(elgg_echo("profile:noaccess"));
    forward();
}
// Get edit form
$area1 = elgg_view_title(elgg_echo('profile:edit'));
$area1 .= elgg_view("profile/edit", array('entity' => $user));
set_context('profile_edit');
// get the required canvas area
$body = elgg_view_layout("one_column_with_sidebar", $area1);
// Draw the page
page_draw(elgg_echo("profile:edit"), $body);
Exemple #30
0
"><img src="<?php 
                echo $_zp_themeroot;
                ?>
/images/zoom-in-2-n.png" alt="<?php 
                echo gettext('Preview Image');
                ?>
" /></a>
						<?php 
            }
            ?>
					</div>
					<?php 
        }
    }
    $_zp_current_album = null;
    set_context(ZP_INDEX);
    // reset for drop menu....
}
?>
				</div>
			</div>
		</div>
		<div class="row">
				<div id="object-info">
					<?php 
if (getOption('zpbase_galleryishome')) {
    ?>
<div id="object-desc"><?php 
    printGalleryDesc();
    ?>
</div><?php