print_user_picture function, where is it???

print_user_picture function, where is it???

by Luis De Sousa -
Number of replies: 6

Hi moodlers...

I need to find print_user_picture funtion. It isn't in moodlelib file. Please, Where is it?

Luis De Sousa

Average of ratings: -
In reply to Luis De Sousa

Re: print_user_picture function, where is it???

by Robert Allerstorfer -
You can always find it yourself:
[root@anet ~]# cd /path_to_your/moodle
[root@anet moodle]# grep -r "function print_user_picture" .
./lib/weblib.php:function print_user_picture($user, $courseid, $picture=NULL, $size=0, $return=false, $link=true, $target='', $alttext=true) {
In reply to Robert Allerstorfer

Re: print_user_picture function, where is it???

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Robert > You can always find it yourself: [root@anet ~]# cd /path_to_your/moodle

Or, if like me you use a "standard" Windows platform and shy away from the "prehistoric" command line, you can use one of many utilities which enable you to search for strings within a set of files. I have been using for a long time and I can recommend:

Total Commander (not free but excellent value for the money)

PSPad (freeware)

Joseph

In reply to Joseph Rézeau

Re: print_user_picture function, where is it???

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Or if like me you shy away from the 'prehistoric' idea of using separate GUI tools to find a function in your source code, then when looking at your source file that includes the call to print_user_picture in Eclipse, you hold down Ctrl and click on the print_user_picture call so that it jumps instantly to the function definition smile

Seriously, apart from an attempt to rewrite prehistory, this post is just to point out one of the good reasons for using an integrated development environment that knows about all the files in your project. Doesn't specifically have to be Eclipse: any others will all have this kind of feature, along with the standard global file search (and replace, and regular expression search/replace).

--sam

PS Is this post a case for a sister site to JFGI? (In this case, just****inggrepit.com - doesn't exist! Business opportunity there...)

In reply to sam marshall

Re: print_user_picture function, where is it???

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Sam,
Thanks for taking the bait of the "prehistoric command line".wink And I'll add that I do use ECLIPSE and I agree that its integrated hyperlinking system to function calls is great.
Joseph
In reply to Robert Allerstorfer

Re: print_user_picture function, where is it???

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Also, there are several tools that build an index over the source code and then allow you to search faster than grep. I am happy with Linux tools ctags and cscope. They can be integrated into my favourite editor (ViM) easily. Beside looking for where the function is defined, I am also able to search where a function is called from, what function are called by a given function etc.