I just got tickets to go see The Cramps at House of Blues on October 24th!!! If I had to pick one band I've always wanted to see live The Cramps would be it. Needless to say I'm super excited!!!
Monthly Archive for August, 2006
Page 2 of 3
Thought this was a cool site. It sends all of your web surfing through a proxy, then displays the content in a frame that looks like a word processing program (i.e. Microsoft Word) so it looks like you're working on a document.
I finally figured out how to hack the user roles in wordpress to control exactly what they could and couldn't do. Although the default user roles were adequate, it didn't provide the type of control I needed. Wordpress 2.0 assigns user roles with an associated user level for backwards compatibility. These access levels are labeled 0-10; 10 being the highest access level granted.
So, exactly how do you customize these default user roles? The first thing to do is go to http://codex.wordpress.org/Roles_and_Capabilities and read the user level vs. role conversion details and brush up on the different user roles.
Next, let's familiarize ourselves with exactly what happens when a user logs in to Wordpress. This is a very obtuse and basic overview of the process; please don't hold me accountable for details. When a user logs in they are redirected to the admin.php page. Once they enter their id and password admin.php calls other php files to check the user roles then calls menu.php to build the admin page and menu. The menu is built based on access levels (0-10). So if your profile is set as a level 7 and the "Write Page" button is set with a level 8; you can't see it. In a nutshell, we are going to alter this menu.php document to give us the custom access we want. Let's get busy and start coding!
Step 1: Go to your Wordpress root, then \wp-admin\menu.php. Open it in the editor of your choice.
Step 2: Now edit any menu item or sub-menu item according to different user levels. See below for my example.
Example: I had a user setup as with the role of "Editor", but, due to a custom Wordpress build I did not want the user creating, editing, or managing pages or categories. So I found the items I wanted to edit…
- $submenu['post.php'][10] = array(__('Write Page'), ‘edit_pages', ‘page-new.php');
- $submenu['edit.php'][15] = array(__('Categories'), ‘manage_categories', ‘categories.php')
Since the default Editor role has an access level of 7, I needed to change the level of these sub-menu items to 8 by adding the following lines of code:
- $submenu['post.php'][10] = array(__('Write Page'), 8, ‘edit_pages', ‘page-new.php');
- $submenu['edit.php'][15] = array(__('Categories'), 8, ‘manage_categories', ‘categories.php')
Save the file and copy it over ther old and now when the user logs in they no longer see the "Write Page", "Manage Page", or any Categories menu items. All done!
New scanned pictures of surfing at my favorite San Diego break, Black's Beach, and various other SD waves. On the other front I'm now an uncle for the first time. My older brother Adam and his wife Lindsay just had a baby girl named Amelia Grace. She looks beautiful and I'm excited to meet her. Here's some pictures courtesy of RodHough.com…
Welcome to the new website!!! It's a work in progress and I'll continue to build it over the next week or two. I switched everything over to a custom Wordpress setup which I'm really excited about. Anyways, I'm tired and am going to pass out. Enjoy!
[gv data="http://video.google.com/googleplayer.swf?docId=-8591879745880686794&hl=en"][/gv]