TinyPortal

Development => Block Codes => Topic started by: delvec on April 25, 2007, 05:37:08 PM

Title: Welcome/encourage to post block
Post by: delvec on April 25, 2007, 05:37:08 PM
Would it be possible to add sorta a welcome block but also include a message for those who either havent posted at all(or in a certain period of time) and encourage them to post?
Title: Re: Welcome/encourage to post block
Post by: Zetan on April 25, 2007, 05:49:21 PM
Hi, have a look at this topic:
http://www.tinyportal.net/index.php?topic=10625.0


It might just do what you need.
I am currently using it.
I also have a welcome message for guests in my forum index



ZTN
Title: Re: Welcome/encourage to post block
Post by: akulion on April 25, 2007, 05:55:08 PM
Yes its very possible. Infact many forum systems use such a system for welcoming different types of people....

Like in vB u have welcome headers which greet people depending on..

- Guest: gives a small intro welcome and asks to register

- Member who has not posted yet: welcomes and tells them they have never posted and should so we can meet them

- Member who has been inactive (not posted for a week or so): tells them we miss them on the forum and they should post soon

-------------------------

Now this all can be done using PHP but it would require time and coding.

So this is the "poor mans welcome block"

Step 1: Create a user group (post count based) which has the requirement set to Posts Required: 1 You can call it 0 poster VERY IMP: note down the membergroup # (lets call it X)

Step 2: Create a center or side block PHP type (select frame but not title option and position should be the 1st block!) and place this code in it...


global $user_info;

if ($user_info['is_guest'])
echo '
Welcome to our site, we noticed that you are not registered yet? So why not join up. registration is free and has many benefits. <a href="/index.php?action=register"><b>Click here to join our community</b></a>
';

elseif (in_array(X, $user_info['groups']))
echo 'Welcome to our site, we noticed that you have never posted on our forums. Why not make an <a href="">introduction?</a> We would all love to meet you!';

else
echo 'CONTENT FOR NORMAL MEMBERGROUPS';



Now a few things to understand above...

A) Where it says

elseif (in_array(X, $user_info['groups']))

replace the X with the number of the memberroup u noted down in step 1

C) Where it says

Why not make an <a href="">introduction?</a>

Put the address of a NEW POST COMPOSE between the " and " after href=

C) Where it says

echo 'CONTENT FOR NORMAL MEMBERGROUPS';

you can place any content which would appear for everyone else except for guests and no posters OR you can leave it blank like this echo'';

PS: you can also use images if you like by using the image tag like so

<a href="http://ursite.com/image.gif">

just place it along with the messages in the PHP code above
-----

hope that helps
Title: Re: Welcome/encourage to post block
Post by: delvec on April 25, 2007, 08:11:15 PM
Quote from: Gobo on April 25, 2007, 05:55:08 PM
Yes its very possible. Infact many forum systems use such a system for welcoming different types of people....

Like in vB u have welcome headers which greet people depending on..

- Guest: gives a small intro welcome and asks to register

- Member who has not posted yet: welcomes and tells them they have never posted and should so we can meet them

- Member who has been inactive (not posted for a week or so): tells them we miss them on the forum and they should post soon

-------------------------


Thats exacly the vB header I was looking for- but more for this part
QuoteMember who has been inactive (not posted for a week or so): tells them we miss them on the forum and they should post soon
Title: Re: Welcome/encourage to post block
Post by: wilsy on April 28, 2007, 12:14:26 PM
Hi Gobo,

Thanks for the code, it works fantastically well with the invite mod which I am referring active posters to.

Regards,

Wilsy.
Title: Re: Welcome/encourage to post block
Post by: fb on July 14, 2007, 07:25:09 PM
Quote from: delvec on April 25, 2007, 08:11:15 PM
Quote from: Gobo on April 25, 2007, 05:55:08 PM
Yes its very possible. Infact many forum systems use such a system for welcoming different types of people....

Like in vB u have welcome headers which greet people depending on..

- Guest: gives a small intro welcome and asks to register

- Member who has not posted yet: welcomes and tells them they have never posted and should so we can meet them

- Member who has been inactive (not posted for a week or so): tells them we miss them on the forum and they should post soon

-------------------------


Thats exacly the vB header I was looking for- but more for this part
QuoteMember who has been inactive (not posted for a week or so): tells them we miss them on the forum and they should post soon


Agreed.. This would be very cool  :coolsmiley:
I've tried a few things, including:

   echo '   ', date("m-d-y", $user_info['last_post']) , ' ';

But the result was:

12-31-69

Anyone know the proper code to retrieve the date of a persons' last post?
 
Title: Re: Welcome/encourage to post block
Post by: IchBin on July 15, 2007, 03:44:15 AM
The last post of the user is not stored in any of the context or user_info arrays that I've seen. You'd probably have to make a query to do something like that.
Title: Re: Welcome/encourage to post block
Post by: christicehurst on September 21, 2007, 10:12:16 AM
When members join up, is there a way to remove the block when they make their first post?
Title: Re: Welcome/encourage to post block
Post by: Zetan on September 21, 2007, 10:27:49 AM
If you follow the instructions.. it will do that.
I have one slightly modified in our forum.. Welcome to guests.. Encourage to make first post when logged in. Then gone. Members who have made a post will never see the encourage to post message.
Title: Re: Welcome/encourage to post block
Post by: Reality12 on September 22, 2007, 12:34:22 AM
For those that use this code:

What kind of success rate would you give it?
Title: Re: Welcome/encourage to post block
Post by: Zetan on September 22, 2007, 10:00:04 AM
Not that I've noticed any success from it. But I like having it there.
I think it's difficult to judge a single thing that would encourage new members. I think a lot is down to how you word the text.
How you present your site and something unique to offer.