Hi !
Ich benutzte dieses tolle Plugin, nur habe ich folgendes Problem ....
Ich habe eine Seite, die den Besuchern den Blog anzeigt, mit der Info das es sich um Inhalte für "nur Member" handelt.
Wenn sich der Besucher nun einloggt, wird er automatisch von meinem s2member-Plugin für die Dauer "X" mit der Rolle "Level1" eingetragen.
Sobald diese Zeit abläuft, ändert s2member die Rolle auf "Abonnent"
(Automatisch löschen möchte ich Ihn von s2member aber auch nicht.)
Mit dieser Rolle hat er aber immer noch Zugriff auf meine Berichte.
Das soll aber nicht sein.
Wie kann ich den PHP-Code ändern, damit die Rolle "Abonnent" ebenfalls keinen Zugriff hat ?
Hier der Code:
<?php
/*
Plugin Name: Access Control by Category
Plugin URI: http://dekisugi.net/wpplugins/access-control-by-category
Description: Visitors must logged on to see the content of any posts under "Subscribed" category. This can be used as a simple membership system. Please [rate] this plugin.
Author: Narin Olankijanan
Version: 1.1
Author URI: http://dekisugi.net/wpplugins
License: GPLv2
*/
/* Copyright 2012 Narin Olankijanan (email: narin@dekisugi.net)
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this progam; if not, write to the Free Software Foundation, Inc. 51 Franklin St, Fifth floor, Boston MA 02110-1301 USA
*/
add_filter('the_content', 'dk_res_post');
function dk_res_post($content){
global $post;
$post_id = $post->ID;
$cats = wp_get_post_categories( $post_id );
$is_restricted = false;
$post_categories = wp_get_post_categories( $post_id );
foreach($post_categories as $c){
$cat = get_category( $c );
if ($cat->name == "Subscribed") {
$is_restricted = true;
break;
}
}
if ($is_restricted AND !is_user_logged_in()) {
return "[ MEMBER ZONE, please Login or register...... ]";
} else {
return $content;
}
}
/* EOF */