I have it set up so that only 1 user role can create personal pages. But before i could set the access role settings a user made a personal page. I need to get him off this list. How do i delete his personal page now or can I? I dont want to delete his account..

Thanks

Comments

agentrickard’s picture

Component: Miscellaneous » Code

There is no UI for this. If you have access to MySQL, you would issue this command, where UID is the user id of the account holder.

DELETE FROM {mysite} WHERE uid = UID;
DELETE FROM {mysite_data} WHERE uid = UID;

Note that the {} indicate Drupal table prefixing.

This feature probably needs to be supported.

icefire’s picture

OK, I have C-Panel

Can anyone point me in the right direction to run the code?

Thanks

agentrickard’s picture

Title: How do I delet user's Pages. » How do I delete user's Pages.

How did you originally install the Drupal database? Does C-Panel give you access to PHPMyAdmin?

Alternately, you could create a Block using PHP format and run the code that way.

But if you don't know SQL, I wouldn't.

agentrickard’s picture

Version: 5.x-2.6 » master
Assigned: Unassigned » agentrickard
Priority: Critical » Normal

For tracking purposes, I would call this a "critical" support request. But it's a valid feature, so filing against HEAD. With luck, I'll get to it this week.

icefire’s picture

I had it installed with Fantastico. I am noob with MySQL. But if you can give me directions or pointers.. I would really appreciate it.

icefire’s picture

I have Acces to PHPMyAdmin.

agentrickard’s picture

OK. Do this:

1) Get the user's UID number. For these instructions, I'll use 99 as the UID.

2) Go to PhpMyAdmin.

3) Select your Drupal database.

4) Find the table 'mysite' and the table 'mysite_data'. If you installed Drupal with table prefixing, the names may be 'prefix_mysite' and 'prefix_mysite_data'. I will assume no prefix.

5) Click the SQL tab.

6) In the Run SQL queries box, paste this code:

DELETE FROM mysite WHERE uid = 99;
DELETE FROM mysite_data WHERE uid = 99;

7) Click 'Go' to execute the query.

That should do it.

icefire’s picture

Ok all seems to have went well. Thank you so very much! Here is the results from running the code:

DELETE FROM mysite WHERE uid = 17;# Affected rows: 1

DELETE FROM mysite_data WHERE uid = 17;# MySQL returned an empty result set (i.e. zero rows).

agentrickard’s picture

Yup, that did it. If you have the Path module turned on, you may want to check your url aliases to see if an alias was created.

I am going to leave this ticket open. I'll add a Delete feature to the next release.

icefire’s picture

Cool, ill be on the look out for it. Do you have a handbook that i can read that will help me and others to learn how to use all its features?

I have it set up on my site where I have to create a catagory for the user "such as there name" and the user posts to that catagory "name" and it posts in the users page. Is there any other easy way to set it up?

Thanks

agentrickard’s picture

Read this page, thoroughly, for links to documentation. Especially under 'Resources.'

http://drupal.org/project/mysite

Also see the massively detailed README.txt files in your download.

You probably want to use the User Posts feature instead of category-per-user. See section 5.7 of the README.

----
5.7 Users *

The Users plugin is new in MySite 5.x.2 and allows MySite users to track posts
by individual site users.

The settings for this plugin are based on the user Roles active for your site.
Only selected roles can be tracked in MySite. This feature lets the site
administrator have some selectivity over which users can be tracked.

By default, all "authenticated users" are available to all MySite users. If
"authenticated users" are allowed, then _all_ roles will be allowed by MySite
except for "anonymous user".

Note: The "anonymous user" role is included in the list in cases where
anonymous users are allowed to post site content.

icefire’s picture

I don't know if I am asking you to much but... by any chance, would you be willing to create an account to my site, I can make you sub-admin, and you can check it out, give me pointers, and maybe tweek and fix my settings.

I have set it up so user roles "Service provider" and "Sub-admin" can only make mysite pages.

I cant figure out how to set it up like you said by the "The Users plugin" I think i have it right but the only way i can get it to work is by creating category-per-user.

If you don't think this is a good idea then its ok, I can keep working on it. It just takes long time for me being noob and all. I am learning and i thank you for your support.

agentrickard’s picture

Sure. Use my contact form to send me account details.

icefire’s picture

OK i emailed you account details.

Thanks

agentrickard’s picture

Copying the email here for the record. Other people might benefit.

OK, I logged in and poked around. It's interesting, you're using the MySite module in a way I did not intend. You should consider writing it up, as it's pretty cool. Use the MySite group at http://groups.drupal.org/mysite

The User plugin isn't working as designed for two reasons.

1) Most of the content was created by user 1 "Daniel". As an admin, you can assign posts to other users. If you don't, the User plugin won't recognize content by other users.

2) User 1 is not assigned to any roles. [I made Daniel a "Service Provider"]

If you enable "authenticated user" under mysite/settings/type/user, then Daniel and a few others show up. Three notes here:

1) By design, only users who have posted are available in the list of content.

2) You probably don't want authenticated users in this list, so I gave user 1 a role.

3) The User plugin doesn't pull posts about users; it pulls posts created by users.

Side not, you might like the Skeleton module, which will let you create those "service information" pages as re-usable books. http://drupal.org/project/skeleton .

agentrickard’s picture

Status: Active » Fixed

I've added a Delete tab that only the admin can see. Will roll into the next release. Code should be committed to HEAD this weekend.

Marking this issue as fixed. Please raise further issues separately.

Anonymous’s picture

Status: Fixed » Closed (fixed)