TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,972
  • Latest: Lineo
Stats
  • Total Posts: 196,165
  • Total Topics: 21,346
  • Online today: 518
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 165
  • Total: 165

Welcome/encourage to post block

Started by delvec, April 25, 2007, 05:37:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

delvec

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?

Zetan

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

akulion

#2
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

delvec

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

wilsy

Hi Gobo,

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

Regards,

Wilsy.

fb

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?
 

IchBin

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.

christicehurst

When members join up, is there a way to remove the block when they make their first post?

Zetan

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.

Reality12

For those that use this code:

What kind of success rate would you give it?

This website is proudly hosted on Crocweb Cloud Website Hosting.