separate submenu for friends and communties
PHP forum :: Open Source Project :: Elgg
Page 1 of 1
separate submenu for friends and communties
http://mydomain.com/elgg/username/friends/
and
http://mydomain.com/elgg/username/communities/
both have the same sub menu, i.e.
Communities | Owned Communities | Community invitations | Friends | Friend of | Friendship requests | Access controls | Invite a friend
I would like to make it so that the Friends page only shows the friends related submenu options and the Communities page only shows the community related options. The lib.php file for each of these appears to only load the relevant sub menu items but the page actually loads both (not sure where from) so I'm not sure how to change this.
Thanks.
Answer:
The community index.php has:
$context = (defined('COMMUNITY_CONTEXT'))?COMMUNITY_CONTEXT:"network";
define("context", $context);
The friends index.php has:
define("context", "network");
Doesn't that mean they both have the same context (that being 'network')?
Would I need to change this first in order to give them different submenus?
Because the lib.php for friends loads up the friends submenu in the 'network' context and the lib.php for community loads up the community submenu in the 'network' context, so they're both always brought up, irrelevant of which page you're on.
I just changed the friends index.php from 'network' to 'friends' and then in the friends lib.php changed all instances of 'network' to 'friends' and it appears to have worked. Hopefully it won't have any negative knock-on effects?
and
http://mydomain.com/elgg/username/communities/
both have the same sub menu, i.e.
Communities | Owned Communities | Community invitations | Friends | Friend of | Friendship requests | Access controls | Invite a friend
I would like to make it so that the Friends page only shows the friends related submenu options and the Communities page only shows the community related options. The lib.php file for each of these appears to only load the relevant sub menu items but the page actually loads both (not sure where from) so I'm not sure how to change this.
Thanks.
Answer:
The community index.php has:
$context = (defined('COMMUNITY_CONTEXT'))?COMMUNITY_CONTEXT:"network";
define("context", $context);
The friends index.php has:
define("context", "network");
Doesn't that mean they both have the same context (that being 'network')?
Would I need to change this first in order to give them different submenus?
Because the lib.php for friends loads up the friends submenu in the 'network' context and the lib.php for community loads up the community submenu in the 'network' context, so they're both always brought up, irrelevant of which page you're on.
I just changed the friends index.php from 'network' to 'friends' and then in the friends lib.php changed all instances of 'network' to 'friends' and it appears to have worked. Hopefully it won't have any negative knock-on effects?
PHP forum :: Open Source Project :: Elgg
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Fri Jul 22, 2011 1:37 pm by shyamsunder
» Thousands of Free PHP Scripts Recommended
Wed May 18, 2011 10:33 am by bizboy12
» PHP form validation problem?
Wed Jan 12, 2011 1:25 pm by simy202
» string wrap
Sat Aug 02, 2008 2:06 pm by scvinodkumar
» retrieving current date rows
Tue Jul 15, 2008 3:25 am by scvinodkumar
» number in words
Tue Apr 29, 2008 3:10 pm by scvinodkumar
» Simple PHP Form Field Generator
Fri Apr 25, 2008 12:28 pm by scvinodkumar
» PHP password generator
Fri Apr 18, 2008 7:24 pm by scvinodkumar
» PHP Script to Extract Email Address from any text
Fri Apr 18, 2008 7:18 pm by scvinodkumar