rexzooly wrote:Sorry i am dislexic
I want someting so when thay are a set rank the menu link will show if there not that wank thay
wont be show the link can anyone help me with that don't not matter anymore why but i still would
like this please so if a user is a set rank the link is show to them this is possable with a CMS e107
what is good but i don't want my hole site a CMS i want to use php BB as its etter for the forum so
can anyone else me if you need to know more PM me and i will send you my email addie.
Like I said, "ranks" mean nothing, they are just for show. The only way I know to do this, would be to create a group instead of a "rank". Then , put the people you want , in that group.
Then you can create a "switch" like the logged in/out switch, for that group.
If the person is not in a specified group, then they do not see whatever the html code for the link is.
Here is how to create the group "switch":
Code: Select all
##############################################################
## MOD Title: Usergroup Switches
## MOD Author: Lumpy Burgertushie < [email protected] > (Robert Adams) http://phpbb-installer.com
## MOD Author: dicky <[email protected] > (Richard Foote) http://dicky.askmaggymae.com
## MOD Description: This MOD creates switches like the login logout switches,
## only for certain usergroups. It will allow you to show buttons, links, tables,
## etc , to only those in certain usergroups.
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 3 Minutes
## Files To Edit:
## includes/page_header.php
## Included Files: N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check with Lumpy Burgertushie.
##############################################################
## Author Notes:
## you will need to find what the usergroup ID is before you do this.
## you can look in the database for the group_id in the phpbb_user_group table
## Also, you can make a switch for multiple groups as shown below.
## Or you can make a separate switch for individual groups if you wish.
## To do this, you would have to create multiple switches and give
## each one a new name in the code.
##############################################################
## MOD History:
##
## 2006-01-05 - Version 1.0.0
## - first release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#------[OPEN ]-----------
#
includes/page_header.php
#
#--------[ FIND ]------------
#
$template->assign_block_vars('switch_user_logged_in', array());
#
#--------[ AFTER, ADD ]-----------------------
#Find the group ID by accessing the groups table of the database.
#You can use something like phpmyadmin for this.
//Begin usergroup switches MOD
// Change these numbers to the ID's of the groups you want to allow access to
$display_html_group = array(1,2,3,4);
$display_html_allowed = false;
$sql = "SELECT group_id FROM " . USER_GROUP_TABLE . "
WHERE user_id = " . $userdata['user_id'];
if(!($result = $db->sql_query($sql)))
message_die(GENERAL_ERROR,'Could not select from usergroup table','',__LINE__,__FILE__,$sql);
while ($row = $db->sql_fetchrow($result))
{
$dhag = $row['group_id'];
}
if (in_array($dhag, $display_html_group))
{
$display_html_allowed = true;
}
if ( $display_html_allowed )
{
$template->assign_block_vars('switch_user_display_html',array() );
}
//End usergroup switches MOD
#
#----------[ DIY INSTRUCTIONS ]---------------
#
Then in your overall_header.tpl and other tpl files, You can then surround whatever you want to display to only certain usergroups
with the switches;
<!-- BEGIN switch_user_display_html -->
... stuff that only shows up when the user is in usergroup(s)...
<!-- END switch_user_display_html -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM