I've created a module (my first) that I have started using called "mypage". Every user can select the taxonomy terms he/she reads, and then they are combined into one page which can be accessed at "?q=mypage/view". This lets you provide users with a "personal" page.

Under the covers, all the module does is create a "taxonomy/view/or/1,3,7,16" page. However, the user's subscriptions are saved in the database and therefore get persisted.

Additionally, the simpler URL makes sense to unsophisticated users who don't know anything about taxonomies.

There are two pages total... "build my page" and "view my page". The "build" page displays all taxonomies and terms in a tree, with a checkbox next to each. The user simply checks the ones he/she wants and the selections get saved. The "view" page looks up the chosen terms and creates a customized page.

The module also allows customized RSS feeds. Since feeds are requested by users who aren't logged in, getting a feed requires a username in the URL: "?q=mypage/feed/jsmith"

It seems this would work best for intranet sites or sites with mostly internal users. A marketing employee in Los Angeles wants to see nodes related to marketing and Los Angeles, but does not want to see all the nodes directed to the finance department, or the Chicago sales staff. This person may also want to receive info about the company's softball team but not its wine-tasting club. This module makes that type of filtering very easy.

I will post the module as soon as I get a CVS account. I'd like to hear people's comments and suggestions, hopefully you will find it useful.

Comments

njivy’s picture

Sounds like a good start.

jasonwhat’s picture

Is this mod up yet? I'd love to use it for my non-profit news site. Will really help users weed through all the different news items

andynyc’s picture

I just got a CVS account this weekend, so I will try to add this module this week.

andynyc’s picture

I finally figured out how to use CVS, so I've added this. It's called "mypage" and is at:
http://cvs.drupal.org/viewcvs/contributions/modules/mypage/

I filled out a new project submission, so I assume it will be listed with other contributed modules soon.

tsitzlar’s picture

I have utilized the mypage subscriptions within the BlogAPI module (so a user can post only to the categories he/she is subscribed to).

I would be very interested in learning/seeing more about this...

andynyc’s picture

I modified the "blogapi_get_category_list" function so that it queries the user's subscriptions, as defined on the "build my page" page.

Two things to note:

1) I don't use blogs at all, so I have also modified the module to ignore blogs altogether, I use it to create story nodes for the main site, and 2) remember that the "mypage" module does not have any permissions associated with it, so this is not a way to limit users from posting to certain categories, instead it is only a convenience feature so that they don't get swamped with a list of 100's of categories.

Here is the modified function:

// this function changed significantly, returns only the 
//   categories the user is subscribed to (through mypage)
function blogapi_get_category_list($req_params) {
  $params = blogapi_convert($req_params);
  $user = blogapi_validate_user($params[1], $params[2]);
  if (!$user->uid) {
    return blogapi_error($user);
  }

  $dbresult = db_fetch_object(db_query("SELECT name, mypage_view FROM {users} WHERE uid = %d", $user->uid));
  $tid_list = $dbresult->mypage_view;
  $tids = explode(",", $tid_list);

  $categories = array();
  foreach ($tids as $tidkey => $tid) {
	  $term = db_fetch_object(db_query("SELECT name FROM {term_data} WHERE tid = %d", $tid));
    $term_name = $term->name;
    
    $categories[] = new xmlrpcval(array('categoryName' => new xmlrpcval($term_name, 'string'),
                                        'categoryId' => new xmlrpcval($tid, 'string')),
                                        'struct');
  }

  return new xmlrpcresp(new xmlrpcval($categories, "array"));
}

As I said, I modified the blogapi module a lot, so there may be another change that also needs to be made, that I have accidently left off. Let me know if that is the case, but for getting customized category lists into w.bloggar, I think this function is sufficient.

Please let me know if you are using the module, it's my first one and I'd appreciate the feedback, good or bad, so I can work on improving it.

tsitzlar’s picture

I'm on HEAD, so I'm trying to work my way thru getting your module up and running under the CVS checkout.

Have you been working on this yourself as well? I'd love to play around w/ this; might even have some ideas for expansions.

andynyc’s picture

I have not been actively working on updating this for 4.5. I do plan on doing so once 4.5 is final (or close to it). Unfortunately, as a student and Drupal user/admin, I don't have much time to play around with the not-yet-released versions. However I am looking forward to 4.5 and definitely want to make this module compatible.

I'd love to hear the other enhancements you have in mind. A friend recently suggested allowing users to get lists of the users who had "subscribed" to a particular taxonomy term. I think that is a great idea.

jwever’s picture

Is it possible to have the mypage be the default page when a user logs in?

andynyc’s picture

Yes you can. This is an administrative setting.

Go to admin -> config and set "Default front page" to "mypage/view".

I believe this will also make it the default front page for anonymous users though (I don't allow anon access so this is not an issue).

I'm not 100% sure about this, since my site isn't configured this way, but if you want to show your normal front page to anon users, then default to "mypage/view" when they log in, you will have to make small changes to the user.module. Look for $edit["destination"] in that file, I think you want to change the destination to automatically go to "mypage/view" instead. I'm guessing there is more info about automatically going to a specific page after logging in, if you search the site.

larry’s picture

Hello andynyc,
Thanks for creating the mypage module. I think the idea is great and goes well with Drupal. I'm having a simple problem...the kind that always is tough to figure out. I CANNOT for the life of me, get the mypage.mysql file to write the database tables when it's run. I've done this successfully many times with other modules from Drupal( and other software ), but now nothing. Could you or someone else reading this please explain how this should be done with mypage. mysql. My path is correct...I've even run it on other modules just to test it...yet when I use mypage.mysql I get...."ERROR on line 10 duplicate table name 'mypage_view' used"....what am I missing?

Thanks for reading,
Larry

--There are no Kangaroos in Austria--

andynyc’s picture

I'm not sure how you are getting that error, it sounds like you are trying to create a new table called "mypage_view", and MySQL is telling you that you already have an existing table with that name (if the error is "duplicate table name").

The SQL statement is intended to add 2 columns to the existing "users" table. So the fact that you somehow have a table named "mypage_view" is a mystery... something went wrong.

If you have access to the DB through phpMyAdmin, or something, you need to drop any tables named mypage_*anything*. They have been created in error (actually, are you running any other software on the server? maybe the table is from another application?).

I checked the SQL in the CVS package and it is correct. It starts with ALTER TABLE, meaning you are changing an existing table, not creating a new one.

In phpMyAdmin, you could add the two columns manually, call them "mypage_view" and "mypage_build", and set both to varchar(255). Or you could copy the SQL statement (everything is comment except for the one line) and paste it into the SQL Statement window and run it there.

If you don't have access to the DB through myPHPAdmin, I can't really help, I don't know how you would access the DB to execute the SQL statement.

Perhaps you accidently changed the .mysql file? I would download a new copy of the CVS package and use the fresh SQL file.

larry’s picture

Hello andynyc,
Thanks for the suggestions...I'll try them out and give my results. I have no doubt the ERROR isn't an ERRROR....just something that needs fiddling from my end. I appreciate your timely response.

Many thanks again,
Larry

--There are no Kangaroos in Austria--

larry’s picture

Hello andynyc,
You were right on the tables....I had another set with the 'mypage' name used as a row. I cleared everything out...got it all set-up correctly...and...nothing. The 'users' table is correct. I can even go to 'build my page' and 'view my page'...but nothing. I can see on 'build my page' the taxonomies that I've made. No clickable names...no check-boxes...just non-clickable taxonomy names. I have no idea how to use this module...it sounds great...I just can't get it to work. I'd appreciate any suggestions.

Thanks again,
Larry

--There are no Kangaroos in Austria--

andynyc’s picture

I'm going to guess that when you say you can see the "taxonomy names" you mean the "vocabulary names", as opposed to the "taxonomy terms".

Just FYI, the way Drupal works, is that you create a vocabulary, within which you create taxonomy terms. So you might create a vocabulary "Drinks" with terms "Beer," "Wine," "Milk," "Water" etc. Drupal allows you to post to the terms, but it won't let you post to the vocab "Drinks". I'm assuming you already know this -- but I wrote it just in case.

The mypage module has 3 primary variables you need to set for your site. If you look at the module, at the top there are some instructions, and then 3 lines that start with "define". I looked at the values as set in the CVS module, and while they work for my site, they are probably wrong for most sites. I'd advise you to change all 3 to the opposite values, especially if your vocabularies aren't hierarchal (terms can have children and grandchildren).

See if that helps you. And just in case you want to understand what the switches do, the documentation at the top of the module should explain that.

Hope this helps.

moshe weitzman’s picture

this sounds a lot like taxonomy_browser.module. Can we combine them into 1 module? Should we?

andynyc’s picture

I read the description of taxonomy_module (didn't view the source or try it out yet), and these are the questions I have about that module:

Does taxonomy_browser save user preferences, or does the user have to select terms every time?

Does it provide a custom RSS feed?

Can user preferences be leveraged to use with blogapi module (only post to categories you have chosen), or with archive module (view previous posts only in your categories)?

Can a taxonomy_browser page be set as a (logged-in) user's default home page?

The description of the module does not mention these features, which I am using and are essential for my site, at least. If that module does some of these things then proceeding towards a merge might be worth considering, in the meantime perhaps a source not connected to either module could do an "independent" evaluation.

jasonwhat’s picture

It would be great to work this with the My Workspace module (in CVS) so that a user logs in and is taken to their page with their workspace as well (workspace shows posts they've made). Also, if we could (well, I shouldn't say we cause I'm no programmer) quick post type link next to subscribed my page feeds so the user can quickly click and post into that taxonomy, or quoting a node in thier view would be great as well.

Now that I'm started, I'll keep going and saying it would be sweet if users could select nodes and terms to add to their "My Page" view and have a "My Page" shared view where they can show others their my page info.

just some thoughts.