My client asked me why there are no pictures in the listing of mysites nor at the top of mysites and if I could enable them. I've looked and I can't see how to?

I think this is a bug as the SQL calls the picture but the code doesn't output it? I've looked round the setting and can't see a switch anywhere.

If it isn't a bug could it be a feature request please!

Comments

agentrickard’s picture

Assigned: Unassigned » agentrickard
Category: bug » support

The module should support most of this already. Read up on layout and format files in the README.

Are you referring to the picture of the owner of the MySite page or the pictures of the creators of content on the MySite page?

In the case of #1, the $owner object contains everything you should need (it's identical to the $user object), and you could add the owner picture by editing the following files:

a) plugins > layouts > default.php (line 16 is a good candidate for adding a picture)
b) plugins -> layouts > columns.php

Or you could create a new layout file.

In the case of #2, we'd have to change the API for the .inc files to include the author photo. Then we'd have to rewrite the format files to print the picture where appropriate.

agentrickard’s picture

It's not really a bug. It's just never been requested.

csc4’s picture

Well it has now ;)

I tried your suggestion - but I must be missing something - I've tried editing default.php as you suggest and it seems to make absolutely no difference - I've put


's in and all sorts and can't seem to change what's being rendered on the page at all?
agentrickard’s picture

Try this for a start. You'll need to do some tweaking to make it exactly as you want.

File: mysite/plugins/layouts/default.php

Line 16

    $output .= '<div class="profile">' . theme('user_picture', $owner) . l(t("%name's profile", array('%name' =>$owner->name)), 'user/' . $owner->uid) . "</div>";

There are some conditions that must be met for this to work:

1) User pictures must be enabled.
2) The user must have loaded a picture.
3) The user must be using the default MySite layout. (For the columns.php layout, change line 22 instead of line 16).
4) The user viewing the page must have 'access user profiles' permissions.

You will likely want to adjust the output to suit your design. But the code above should get you started. If you want to manipulate the image directly, access it as $owner->picture

agentrickard’s picture

Status: Active » Closed (works as designed)

I'm going to mark this 'by design.' I think modifying the default theme is a sufficient solution.

csc4’s picture

Thanks so much for the heads up (and sorry for my previous post being truncated).

Embarrassingly I was there - but had forgotten point 3- the user in question was using columns.

I still think in the best of all possible worlds it would be nice to let the users choose with a check box in their mysite setup...

agentrickard’s picture

Version: 4.7.x-3.5 » 5.x-1.x-dev
Component: Code » User interface
Category: support » feature

True, but that might also be creeping featurism. http://en.wikipedia.org/wiki/Creeping_featurism

The system was designed to have pluggable Layouts to address specific needs. I've had other user's complain about the presence of the Profile page link. The solution is either:

1) Have settings for every item on a layout.
2) Encourage people to use the API code to modify their installation.

There is a #3, which is "do #2 until I get around to #1."

New features, btw, only go into the v5 branch, so I've updated the status again.

agentrickard’s picture

Status: Closed (works as designed) » Postponed
agentrickard’s picture

Version: 5.x-1.x-dev » master
Status: Postponed » Fixed

A profile.inc has been committed to HEAD and solves this issue.

agentrickard’s picture

Status: Fixed » Closed (fixed)

Release in 5.x.2-beta3