11
m0nty
Re: Restricting access to user information
  • 2005/5/5 13:14

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


sorry went shoppin as ran out of coffee and stuff..

ok instead of the hack above

edit userinfo.php

find on line 65 (or thereabouts)
$member_handler =& xoops_gethandler('member');
        
$thisUser =& $member_handler->getUser($uid);


add right after

if (!$xoopsUser->getVar('posts') >= 5) {
        
redirect_header("index.php"2'You need a minimum of 5 posts to view member profiles');
    exit();
    }


so it looks like this after editing:

$member_handler =& xoops_gethandler('member');
        
$thisUser =& $member_handler->getUser($uid);
        if (!
$xoopsUser->getVar('posts') >= 5) {
        
redirect_header("index.php"2'You need a minimum of 5 posts to view member profiles');
    exit();
    }
        if (!
is_object($thisUser) || !$thisUser->isActive() ) {
            
redirect_header("index.php",3,_US_SELECTNG);
            exit();
        }

12
m0nty
Re: Restricting access to user information
  • 2005/5/5 13:17

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


admin will also not bhe able to view other profiles though, but i'm presuming admin will have more than 5 posts anyway.. if u want it so admin can view regardless, i could probably add the admin check into it aswell if need be..

13
RachelVirago
Re: Restricting access to user information

He He caffeine, where would we be without it?

Quote:

m0nty wrote:
i could probably add the admin check into it aswell if need be..


That would be very cute for the following reason, on future sites I could see some value in allowing admin to stay invisible thereby getting members to use FAQ.

However what I have learnt so far does give me an elegant solution for the current site.

Thanks very much for help with this because I get a lot of registrants who never post, conclusion, they just want access to profiles. Which in turn seems to inhibit genuine members.

This addresses it nicely.

14
m0nty
Re: Restricting access to user information
  • 2005/5/5 13:54

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


you're welcome :) i'll sort the admin out in a bit..

time flies when ya playin xoops.. lol i need to get some work done of my own lol

ps if i really think hard i could possibly add an option to admin config preferences so that u can sselect the amount of posts required from admin, but that would require adding a row to the database config table..

15
RachelVirago
Re: Restricting access to user information

I found time to test this in depth last night and it worked fine until I made one post on the new test account I created.

After that access to profiles as usual

Login

Who's Online

140 user(s) are online (101 user(s) are browsing Support Forums)


Members: 0


Guests: 140


more...

Donat-O-Meter

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

Latest GitHub Commits