1
vinit
how to show a block to newusers only
  • 2004/10/13 9:29

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


hi,

I want to share some welcome message with every newuser who has registered. Thus on the first time login of a new user the block should be shown and there after it should not. Could this be managed. I know technically is very simple. But how to implement it in current secerio where block lever permissions are based of group and not visits.

Could someone give me some clue about how to implement this?..

2
vinit
Re:how to show a block to newusers only
  • 2004/10/14 11:30

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


anyone having any clue in regard to this ????


3
wizanda
Re:how to show a block to newusers only
  • 2004/10/14 11:34

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


Yeh all you have todo is make a new block in the blocks menu

Position the block so it shows on the page you want

Then in groups set the blocks permission so it only shows for registered users

hey presto!!

4
DonXoop
Re:how to show a block to newusers only

Actually I think he is looking for a block that only shows once to a new user. I don't know of a way currently. But a few ways it might be done:

The easiest might be an automatic PM sent to a new user and was discussed somewhere around here.

A custom block could have a query that checks the last login date and if null gives some output, if > zero does something else.

A core method might be a new group permission that checks for last login. This would be the cleanest but the most work, maybe.

An interesting idea though.

5
vinit
Re:how to show a block to newusers only
  • 2004/10/14 14:10

  • vinit

  • Just can't stay away

  • Posts: 530

  • Since: 2004/1/10


yes DonXoop,

you are very right. I want that module to be displayed only in the first login or lets say first 5 logins.

The second stage to it would be to display a module until certian desired action is performed. It can be either automatic or manually.

A simple way is to maintian login counts. This can be interesting figure though. At the end of the a given period it would be intresting to show the graphs of top 10 visitors etc.

getting back to the point if we keep the count of number of times a user logs in then we can define those block level specification.

I know some or other core level developer might be thinking it as good thing to implement and other would be laughing out for the kind of thing i am asking. Anyway this is what is desired as of now and i am seriously hunting out some sort of hack or some module to do the same.

Thanks

6
ackbarr
Re:how to show a block to newusers only

well, since the number of logins per account is not tracked in the core, you could do something like this:

Create a new block, and using php, determine if the user registered in the last 'x' days:

The following code is untested, but should do the job:
//Adjust to the number of days
$numdays 10;

//Don't show block to anonymous users
if (!$xoopsUser) {
    return 
false;
}

$timediff $numdays * (60*60*24);
$curtime time();
$regtime $xoopsUser->getVar('user_regdate');

if (
$timediff $curtime $regtime) {
    return 
false;
}

//HTML Code goes here
echo "New User Message goes here";


* Edited the above code to use the $numdays variable

7
Flinx
Re:how to show a block to newusers only
  • 2004/10/14 14:37

  • Flinx

  • Just popping in

  • Posts: 14

  • Since: 2004/6/30


One way, although intensive for the Site Admin,

Would be to use a block for the "Registered" users, and then after some time, the Admin, would remove that user from regisered, and put them in a similarly permissioned group that didnot have access to the message.

I don't know if there are any other bad things that happen if a user is not "Registered", but I did a quick test, and it seems to work.
[If you are talking about alot of users... this probably is not a good idea.]

Flinx

Login

Who's Online

200 user(s) are online (111 user(s) are browsing Support Forums)


Members: 0


Guests: 200


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