1
Fredrik
Hiding Tiny Content submenu from Anonymous Users
  • 2005/7/3 20:09

  • Fredrik

  • Just popping in

  • Posts: 26

  • Since: 2004/4/21


Is there any way to hide a submenu from unregistered users?

I use multiple tiny content modules to group content but some parts are for registered users only while other parts are for anyone to see.

2
Fredrik
Re: Hiding Tiny Content submenu from Anonymous Users
  • 2005/7/5 12:44

  • Fredrik

  • Just popping in

  • Posts: 26

  • Since: 2004/4/21


I solved it by using chapi's solution for a similar question. Instead of hiding the submenu I re-direct unauthorized users when they click the link in the menu.

The following was added to modules/tinycontent/index.php

// main query
}
if (($id == 19) && (empty($xoopsUser))) { // id of your content
redirect_header( XOOPS_URL , 2 , _NOPERM ) ;
exit ;
}else{

$result = $xoopsDB->query( "SELECT storyid,title,text,visible,nohtml,nosmiley,nobreaks,nocomments,link,address FROM $mytablename WHERE storyid='$id' AND visible" ) ;

if( ( $result_array = $xoopsDB->fetchArray( $result ) ) == false ) {
redirect_header( XOOPS_URL , 2 , _TC_FILENOTFOUND ) ;
exit ;
}
}

Login

Who's Online

344 user(s) are online (299 user(s) are browsing Support Forums)


Members: 0


Guests: 344


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits