Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Different types of data and the Users Roles WordPress

  • SOLVED


Hi to everyone, I would realize a site in Wordpress with some functionalities, but I don't know if they are realizable with it.

In my site I need to have <strong>two types of data</strong>, not only the classical posts, but also the companies (with data different from post, like image, address, etc). In the site has to be possible searching the posts or the companies using different parameters, but also has to be possible to search the posts, near (geographically) to that companies.

I need also to change the <strong>roles of the users</strong>. I have two types of users:
* the first user can insert posts (but non the companies). And when he inserts a post, he can select a specific company (related to the post).
* the second user can insert posts, but he also can insert companies

Wich of these operations could be done using a PLUGIN? The manage of the users roles? And about the insertion of a new type of data (the companies) it is possible?

Thanks for your help

Answers (2)

2011-02-26

Vidyut Kale answers:

About the user roles, try http://wordpress.org/extend/plugins/role-scoper/ Your user permissions should be a simple matter with this. If it doesn't give you exactly the kind of setting permissions you want, look around for another plugin that is similar. ;)

For the two kinds of data, try the plugin http://wordpress.org/extend/plugins/custom-post-type-ui/ and create a separate post type for the companies. You can attach different taxonomies to it to take care of tags/categories of information about them.

You can even create two post types to take care of clients and companies and leave the regular posts for news updates kind of thing. The plugins are quite self-explanatory.


giorgioghisa comments:

So with these plugins I'm able to create new kinds of data and new user roles without write code.

But I don't understand if:
* it is possible to set user roles to manage also new data type;
* it is possible to connect the new data type (e.g. Companies) to the main one (Posts)?


Vidyut Kale comments:

from the plugin page:

<strong>Partial Feature List</strong>

WP roles work as is or can be limited by content-specific Restrictions

RS roles grant additional Read or Edit access for specific Pages, Posts or Categories

Define User Groups and give them one or more RS roles

Can elevate Subscribers to edit desired content (ensures safe failure mode)

Control which categories users can post to

Control which pages users can associate sub-pages to

Specify element(s) in Edit Form to withhold from non-Editors

Grant Read or Edit access for a limited time duration

Limit the post/page publish dates which a role assignment applies to

Customizable Hidden Content Teaser (or hide posts/pages completely)

RSS Feed Filter with HTTP authentication option

File Attachment filter blocks direct URL requests if user can't read corresponding post/page

Inheritance of Restrictions and Roles to sub-categories / sub-pages

Default Restrictions and Roles for new content

Un-editable posts are excluded from the Edit Posts/Pages list

Optimized to limit additional database queries

XML-RPC support

Integrates with the Revisionary plugin for moderated revisioning of published content.

<strong>Supports custom Post Types and Taxonomies (when defined using WP schema by a plugin such as Custom Post Type UI)</strong>

Extensive WP-mu support


Vidyut Kale comments:

It is better to use plugins for something like this. Its complex coding related with security. Someone has already done a good job and will be focusing on enhancing that functionality, which you get with one click. No point reinventing the wheel.

Plus, with plugins, your site is more futureproof in terms of theme changes or future wordpress functions changing.... if something doesn't work, you can isolate it till it can be fixed. If you build it all into one theme, you'll be stuck offline till you can fix it, and only YOU will have to fix it or get it fixed. Even changing the theme will mean a lot of work adapting the new one. Forget the "click and change" ease.

2011-02-26

S├ębastien | French WordpressDesigner answers:

it is possible to create a cutom type post for the companies and
you can create two custom profiles
would you i 'm coding that ?

You can create a custom post type with this code


add_action('init', 'company_register');

function company_register() {

$labels = array(
'name' => _x('Companies', 'post type general name'),
'singular_name' => _x('Company', 'post type singular name'),
'add_new' => _x('Add New', 'Company'),
'add_new_item' => __('Add New Company'),
'edit_item' => __('Edit Company'),
'new_item' => __('New Company'),
'view_item' => __('View Company'),
'search_items' => __('Search Company'),
'not_found' => __('No company found'),
'not_found_in_trash' => __('No Company found in Trash'),
'parent_item_colon' => ''
);

$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'menu_icon' => get_stylesheet_directory_uri() . '/your_icon.png',
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','thumbnail')
);

register_post_type( 'company' , $args );
}


add this code in the file functions.php in your theme folder, at te top of the file, just after <?php

In this case, a little menu "Company" will appear in the administration of wordpress. It is possible to custom fields in edition page of a company (image field etc...)
If you think that you can do that by yourself, you can read that : [[LINK href="http://codex.wordpress.org/Function_Reference/register_post_type"]]http://codex.wordpress.org/Function_Reference/register_post_type[[/LINK]]


S├ębastien | French WordpressDesigner comments:

if you want create custom role, that's easy. I have post a response here :
[[LINK href="http://wpquestions.com/question/show/id/1462"]]http://wpquestions.com/question/show/id/1462[[/LINK]]