Skip to content
Snippets Groups Projects
Commit 205f29ca authored by Michael Fairchild's avatar Michael Fairchild
Browse files

Add legacy icon support

parent 434fcc6a
Branches
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8" ?>
<plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8">
<name>UNL Avatars</name>
<author>UNL</author>
<version>1.0</version>
<description>Adds legacy and public Avatar (icon) support</description>
<requires>
<type>elgg_release</type>
<version>2.0</version>
</requires>
</plugin_manifest>
<?php
function unl_avatars_init() {
elgg_register_page_handler('pg', 'unl_avatars_pg_handler');
}
// Fire up the plugin initialization using the elgg handler
elgg_register_event_handler('init','system','unl_avatars_init');
function unl_avatars_pg_handler($segments) {
if ('icon' != $segments[0]) {
return false;
}
if (!isset($segments[1], $segments[2])) {
return false;
}
$username = $segments[1];
$size = $segments[2];
if (!$user = get_user_by_username($username)) {
return false;
}
//Forward to the new guy
forward('mod/profile/icondirect.php?guid='.$user->guid.'&size='.$size);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment