-
Author
Tagged: CometChat
-
October 13, 2015 at 14:36 #82029Oscar570Participant
Hi,
I created differents levels for my website.(SILVER, GOLD AND PLATINUM)
The users must paid for each level. I bought Cometchat. How can I give acces to users for using Cometchat via Theme Options > Memberships for GOLD AND PLATINUM LEVELS ?
Thanks a lot for your help.
Regards,
Nathalie
October 14, 2015 at 18:43 #82259RaduModeratorHi,
Use add this php code to your kleo-child/functions.php
COPY CODEfunction CheckMemberships() { if(pmpro_hasMembershipLevel(array(1,2,3), get_current_user_id())){ echo ' <link type="text/css" href="/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8"> <script type="text/javascript" src="/cometchat/cometchatjs.php" charset="utf-8"></script> ';} } add_action('wp_head', 'CheckMemberships');
if(pmpro_hasMembershipLevel(array(1,2,3)
1,2,3 represents the membership package id, you can add more or less packages.
Now the cometchat widget will be loaded only if logged user has one of that memberships id.
Best Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 15, 2015 at 17:09 #82400RaduModeratorHi,
The solution that i have you provided it allows you to load the cometchat only for the mentioned level ID’s that are written here
COPY CODEif(pmpro_hasMembershipLevel(array(1,2,3), get_current_user_id()))
Where 1,2,3 are the memberships packs ID’s.
This is manually created code snipped and it will not provide you any additional settings in theme options panel.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 16, 2015 at 14:09 #82670Oscar570Participantok Radu.
For me :
ID 1 = level SILVER
ID 2 = level GOLD
ID 3 = level PLATINUM.So I’d like the users from levels gold and platinum have an access for Cometchat and not users’ level silver.
So I deleted ID 1.
Is it correct ? Certainly not because nothing has changed…. 🙁——–
function CheckMemberships() {if(pmpro_hasMembershipLevel(array(2,3), get_current_user_id())){
echo ‘
<link type=”text/css” href=”/cometchat/cometchatcss.php” rel=”stylesheet” charset=”utf-8″/>
<script type=”text/javascript” src=”/cometchat/cometchatjs.php” charset=”utf-8″></script>
‘;}
}add_action(‘wp_head’, ‘CheckMemberships’);
——–
October 16, 2015 at 18:51 #82732RaduModeratorHi,
With the code provided below the chat will be loaded only for memberships ID’s 2 and 3.
COPY CODEfunction CheckMemberships() { if(pmpro_hasMembershipLevel(array(2,3), get_current_user_id())){ echo ' <link type="text/css" href="/cometchat/cometchatcss.php" rel="stylesheet" charset="utf-8"/> <script type="text/javascript" src="/cometchat/cometchatjs.php" charset="utf-8"></script> ';} } add_action('wp_head', 'CheckMemberships');
Please understand this is a custom implementation you should probably hire a developer to can help with your desired requirements.
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘Plugins questions’ is closed to new topics and replies.