Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated

Customizing Privacy Drop Down Menu

9 years 6 months ago
Licenses:
JomSocial Active

Hello:

What I would like is for the privacy drop menu for content to only display 3 options: Site Members, Friends, and Only Me. I was able to find solutions addressing this issue in the forums here and here , but so far I haven't had any success.

I've edited the /components/com_community/libraries/privacy.php so that it looks like this:

// Initialize default options to show
		if( empty( $access) )
		{
			$access[ 'public' ]           = false;   //change here
			$access[ 'members' ]	= true;
			$access[ 'friends' ]    	= true;
			$access[ 'self' ]		= true;
		}

But that didn't make the visible change for me. The drop down still looks like this:



There was also a tip to modify the css to hide the first line item:
.creator-privacy ul.js_dropDownParent li:first-child {
	display: none;	
	}

The problem is I don't know exactly where to put that css for the change to effective. I've looked in the following places:

1. /components/com_community/templates/default/css/style.css
2. /components/com_community/templates/default/privacy.php
3. /templates/protostar/css/template.css

Where should I add this css rule? Are there any other changes I need to make? It seems like that html for this menu is found in /components/com_community/templates/default/privacy.php.


Thanks!

9 years 6 months ago
  • Paul's Avatar
  • Paul
  • Visitor
  • Thank you received: 0
Licenses:

Hi Adrienne,

This is actually controlled in a compressed JS assets file which is re compiled during each release, once that file is edited you would need to re apply and re compile the file again at every bugfix or release. Because this is a core file running the product this would be a very risky thing to modify.

I'm afraid a change like that is outside the scope of our support

9 years 6 months ago
Licenses:
JomSocial Active

Hi!

Thanks for the reply.

It's very important that we disable the "Public" option in this pull down menu because we need our JomSocial instance to be completely private. We can't give our users the option to set content as public. We have enough technical know how on our end to track our custom changes and make sure that new JomSocial updates are applied correctly. So can you please point to the javascript file and line no. where I can make this css change? When you say that this is a compilied js file, do you mean that it is compressed and minified? If so, is there an uncompressed js file I can access?

Also, what exactly does this change below do as it relates to disabling the public option in the privacy drop down menu. I ask because I made this change and I can still see the public option in the privacy drop down.

// Initialize default options to show
		if( empty( $access) )
		{
			$access[ 'public' ]           = false;   //change here
			$access[ 'members' ]	= true;
			$access[ 'friends' ]    	= true;
			$access[ 'self' ]		= true;
		}


Thanks!

9 years 6 months ago
  • Paul's Avatar
  • Paul
  • Visitor
  • Thank you received: 0
Licenses:

Hi Adrienne,

I am sorry for the delay in replying, i actually remembered i have one of my own sites with this hack so i am trying to find all the places that were changed and then i can give you all the changes i made.

I will reply ASAP

9 years 6 months ago
Licenses:
JomSocial Active

Hi,

I wanted to follow up on this. Were you able to find the places in the code where I need make these changes?

9 years 6 months ago
  • Paul's Avatar
  • Paul
  • Visitor
  • Thank you received: 0
Licenses:

HI Adrienne,

Sorry this took a bit to get done but hopefully it will be worth the wait. :)

EnJoy

www.youtube.com/watch?v=D2DiDJCQcDs&inde...pxsDtudAxcsQ_JD-flYg

www.youtube.com/watch?v=CO-UgIdeV_c&inde...pxsDtudAxcsQ_JD-flYg

9 years 6 months ago
Licenses:
JomSocial Active

Hello!

Thanks a lot for the videos. They were very informative and for the most part everything worked as intended. There was one issue that popped up once I made these changes:

In the activity stream on the JomSocial home page, users have the option to "share" group activities. For instance, if User 1 creates a group, that gets published to the global activity stream and other users have the option to "share" that activity post. When I click share I get the following pop up:



As you can see, I've chosen to only have three privacy options: site members, friends, and only me. But in this pop up, it defaults to public . I would like to change it so it defaults to "site members" but I haven't been able to find the right file. Can you direct me to the file and line number where I should make this change?

Thanks!

9 years 6 months ago
  • Paul's Avatar
  • Paul
  • Visitor
  • Thank you received: 0
Licenses:

Hi Adrienne,

I will need to ask our java developer when he starts his shift in the morning then i will reply with the answer, im sure he will find where it is set in a few minutes.

9 years 6 months ago
Licenses:
JomSocial Active

Hello:

I wanted to follow up on this. Were you able to speak to the dev on where in the code I can make these changes?

9 years 6 months ago
  • Paul's Avatar
  • Paul
  • Visitor
  • Thank you received: 0
Licenses:

Hi Adrienne,

I have left another message for the developer but i am not able to interrupt them during there development times. Once i hear back i will let you know, i think if you search for that privacy string in the code your developer will find the one that has been missed. it is the same string that hides the others

9 years 5 months ago
Licenses:
JomSocial Active

Hi!

I wanted to follow up and see if the dev was able to locate where I should make these changes.

I also wanted to point out that I've found another case where the default privacy setting is "public". For custom and predefined messages, the default privacy setting is "public". Also, the "public" privacy setting is a selectable privacy option from the drop down menu. Can you also provide the file location and line numbers needed to make these changes. I've attached screen shots below.

This is what I see for the "custom message":







This is what I see for the "predefined message":

9 years 5 months ago
  • Paul's Avatar
  • Paul
  • Visitor
  • Thank you received: 0
Licenses:

Hi Adrienne,

The custom messages and predefined messages should work ok with the following changes in com_community/assets/js/_release/bundle.js im not sure if my inital instructions were for 2 changes or 3 as listed here

FInd this (there are 2 of them)

defaultPrivacy:e||"public"}

and change to this

 defaultPrivacy: e || "friends",  privacylist: ["friends", "me"]

then find this
privacylist:["public","site_members"]}),this.subviews.privacy.setPrivacy("public"))
and change to this
privacylist:["public","site_members"]}),this.subviews.privacy.setPrivacy("site_members"))

The share box privacy is the following function change com_community/helpers/activities.php" line 122 to the end of this fuction:
static public function getStreamPermissionHTML($privacy, $actorId = NULL) {

        $my = CFactory::getUser();

        if (($my->id != $actorId && !is_null($actorId) ) && !COwnerHelper::isCommunityAdmin()) {
            return;
        }

        $permissions = self::$_permission;
        unset($permissions[0]);
        unset($permissions[10]);

        if ( !isset($permissions[$privacy]) ) {
            reset($permissions);
            $privacy = key($permissions);
        }

        $html = '<span class="joms-share-meta joms-share-privacy">' . JText::_($permissions[$privacy]) . '</span>';
        $html .= '<div class="joms-privacy-dropdown joms-stream-privacy">';
        $html .= '<button type="button" class="dropdown-toggle" data-value="" data-toggle="dropdown"><span class="dropdown-value"><i class="' . self::$_icons[$privacy] . '"></i></span><span class="dropdown-caret joms-icon-caret-down"></span></button>';
        $html .= '<ul class="dropdown-menu">';

        foreach ($permissions as $value => $permission) {
            $html .= '<li><a href="javascript:" data-option-value="' . $value . '"><i class="' . self::$_icons[$value] . '"></i><span>' . JText::_($permission) . '</span></a></li>';
        }

        $html .= '</ul></div>';

        return $html;
    }

and also change templates/default/ajax.showsharepopup.php line 58 with this one:
<input type="hidden" name="joms-postbox-privacy" value="<?php echo PRIVACY_MEMBERS?>">

I hope this helps

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW