Since I cannot seem to embed the mysite info into other pages, I've decided to add some theming to the default.php page and add some functionality to said page.

I think it has a great opportunity to act as sort of a "control panel" page, with notifications of new messages, buddy requests, etc, along with mysite content.

That being said, I need to be able to set all mysite pages to private, then take away the ability for users to change that setting. Can anyone point me to the section of code that would accomplish this?

I'll be happy to share my control panel/mysite page with anyone who is interested in this functionality.

Thanks.

-Jesse

CommentFileSizeAuthor
#4 default.php.txt3.23 KBapt94jesse

Comments

agentrickard’s picture

I'd rather not have forked code running around if we can agree on the best implementation strategy for the core module.

Let's stop an take a look at the three elements of this request.

I cannot seem to embed the mysite info into other pages

I've been thinking about this request and it seems that one solution is to have a User settings tab for MySite. This tab would have three base options:

- Show link to MySite on user page
- Show MySite content on user page
- Do not show MySite content on user page

Implementing this feature would give you content within the user profile array, which could be themed as needed. In order to accomplish this, we'd have to change the code so that you would also be able to fire a request to a function and return the mysite page content.

I think it has a great opportunity to act as sort of a "control panel" page, with notifications of new messages, buddy requests, etc, along with mysite content.

Personally, I think integrating this into the User page as the 'control panel page' is a better idea. I don't think we should replace 'core' functionality with MySite.

But you could make MySite a 'control panel' by writing includes for the modules you want to integrate. The current API would support a BuddyList include, for example. You could define how you want to display Buddy messages as part of that include.

You shouldn't need to edit default.php to do this; you would simply define what 'content' means from these sources.

That being said, I need to be able to set all mysite pages to private, then take away the ability for users to change that setting.

That seems perfectly reasonable, and should be a core setting for the module. The admin would have three options:

- All MySites are public
- All MySites are private
- User may choose (and default setting is public / private)

This would also go into the User settings tab.

Is there a problem with waiting for a v5 release such that this must be addressed in 4.7?

apt94jesse’s picture

I guess I'm looking at things a little shelfishly. There's not really a problem with waiting for v5 from a module standpoint, I just don't know if I will be porting my project to drupal5 or if I will be keeping 4.7.4 as my project is almost ready for launch.

- Show link to MySite on user page
- Show MySite content on user page
- Do not show MySite content on user page

This would be a great addition, as long as you made the function available to other theme pages, such as custom user_profile.tpl.php files.

Personally, I think integrating this into the User page as the 'control panel page' is a better idea. I don't think we should replace 'core' functionality with MySite.

I don't really mean changing the core funcionality of mysite, I simply mean that in some applications, mysite content goes more along with a personal control page than a profile page. Such as a My Yahoo page, which is a page only the owner can view with custom content they have. I see it as having options to also change your photo and personal info from your mysite page, along with notifications on new messages and things like that. Check out this demo, which will probably only be online in this current form for another 12 to 24 hours:

http://www.wrestlespace.com/mysite/1

- All MySites are public
- All MySites are private
- User may choose (and default setting is public / private)

These seem like the perfect options, I think you hit the nail on the head here.

Please don't see my ideas as criticism. I think the MySite module fills a MUCH MUCH needed void in drupal modules, its something I've been looking for for the past year while I taught myself php (still a lot to learn) and the drupal interface.

I'm just coming from a practical project background and trying to modify this tool to how I see it working for me. From a module standpoint, the contributors seem to be miles ahead of anything else remotely close, I thank you all for that. That being said, I'd love to help in any way I can, testing or otherwise. Keep up the good work!

-Jesse

agentrickard’s picture

How are you doing the profile dashboard now? It's very cool.

The point I want to stress is that adding the profile functionality should be done through a profile.inc file -- and should be supported by the current code framework.

If you add features by hacking default.php, that's not using the API and other people can't (really) use the code. If we wrote a profile.inc file, it could become part of the distribution. I haven't written one yet due to time and a lack of direction. Your demo shows a good possible direction.

Take a look in the contrib folder of the download for examples. But since profile is a core Drupal module, it would become part of the core MySite download.

If you attach the code you wrote for that profile box, I'll take a look and see how it could be integrated using the API.

apt94jesse’s picture

Title: all mysites private... » added functionality to mysite...
StatusFileSize
new3.23 KB

I've attached the default.php file I have edited. I realized last night that editing this file only edits the default mysite profile, not everyone else's. I guess that should have been clear when I saw the name of the file, huh?

To acheive the current look, all I've done is add a div with a float:left attribute, then added a float:right attribute to the mysite div. I specified the widths, then filled in the content I wanted into my float:left div, such as picture, links to editing content, etc.

I'll be very honest, I really have no clue how .inc files work. I've been putting more effort into learning the basic php than the drupal system, even though I recognize the wide array of possibilities that drupal offers.

Log into the site using test:test. You can then view a sample of how I edited the default mysite page. I initially wanted the Link in the menu "control panel" to handle all the profile operations. However, when I discovered the mysite module, I wanted to combine these functions.

agentrickard’s picture

Component: User interface » Code
Category: support » feature

Yeah, that's a very non-Drupal hack; especially the use of $GLOBALS to pull vars.

I'll spend some time between now and New Year's building support for this concept.

agentrickard’s picture

There is a quick way to hook content from mysite and make it available to external functions. I just need to track down the implications.

It involves a change to mysite_page().

function mysite_page($uid = NULL, $pageview = TRUE) {

....

    if ($pageview) {
      print theme('mysite_'. $mysite->layout . '_layout', $content);
      return;
    }
    else {
      return $content;
    }

If $pageview is false and we pass a $uid, then the $content blob for a MySite page will be returned.

This has some cascading effects on .po files, so I have not committed the code yet.

agentrickard’s picture

This has been corrected in 4.7.x-DEV, 5.x.1-DEV, and HEAD.

See http://drupal.org/cvs?commit=55240

I updated the README. You now have the option of sending a UID and a $pageview flag to the mysite_page() function.

 $content = mysite_page($user->uid, FALSE);

This will return a $content object ready for theming.

Note that you cannot guarantee that all MySite format and layout files have been loaded -- those load on a user specific basis.

agentrickard’s picture

Title: added functionality to mysite... » Access MySite data from an external theme or block
Assigned: Unassigned » agentrickard
Status: Active » Fixed
agentrickard’s picture

Status: Fixed » Closed (fixed)