Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PlanetRed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jeff Sturek
PlanetRed
Commits
205f29ca
Commit
205f29ca
authored
9 years ago
by
Michael Fairchild
Browse files
Options
Downloads
Patches
Plain Diff
Add legacy icon support
parent
434fcc6a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/unl_avatars/manifest.xml
+11
-0
11 additions, 0 deletions
plugins/unl_avatars/manifest.xml
plugins/unl_avatars/start.php
+28
-0
28 additions, 0 deletions
plugins/unl_avatars/start.php
with
39 additions
and
0 deletions
plugins/unl_avatars/manifest.xml
0 → 100644
+
11
−
0
View file @
205f29ca
<?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>
This diff is collapsed.
Click to expand it.
plugins/unl_avatars/start.php
0 → 100644
+
28
−
0
View file @
205f29ca
<?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
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment