Adding a graphic identifier to teachers in online users

Adding a graphic identifier to teachers in online users

by Deleted user -
Number of replies: 2

Hi,

If anyone has added code to the online users block that would identify a teacher/lecturer/staff member by adding a graphic/pix after their fullname similar to the message icon I would appreciate any info on how to insert that please.

Regards

Gerald

Average of ratings: -
In reply to Deleted user

Re: Adding a graphic identifier to teachers in online users

by Chris Collman -
Picture of Documentation writers
Did you ever figure out how to add another icon that would identify a teachers, administrator etc in the online user's block?    Don't we see something like that on Moodle.org ?  

Thanks  Chris
In reply to Deleted user

Re: Adding a graphic identifier to teachers in online users

by Chris Collman -
Picture of Documentation writers
Hi Gerald,
Thank you for your post.   I am not a developer and don't really understand php.   Having said that, I think I figured out where to tweak the code. I believe this tweak will indicate which online users shown on the homepage are teachers or administrators.   I think admins are hidden when in a course, but teachers will show up in their course with the added icon. 

Others might step in and correct me.   I made the following changes in my localhost 1.5.3 and 1.6.1 Moodles.   You will need to have access (probably as a site administrator) to the file \moodle\blocks\online_users\block_online_users.php  .

Between lines 90 and 100 you should see a line something like:

$teacher->fullname = '<strong>'.fullname($teacher).'</strong>';

change it to
$teacher->fullname = '<strong>'.fullname($teacher).'</strong>'.'<img src="'.$CFG->pixpath.'/i/info.gif" style="vertical-align: middle;" alt="';

This  inserts the blue info icon after the bolded name for an instructor or admin person.   I would think adding an file of the same size to the \moodle\pix\i folder with a different image, and changing name in the code to that image might work.

Hopes this helps.  I attached an example.
Attachment Instructors_online_example.JPG
Average of ratings: Useful (1)