vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   [VB3 RC3] Member of the day (https://vborg.vbsupport.ru/showthread.php?t=60368)

Kentaurus 01-16-2004 10:00 PM

[VB3 RC3] Member of the day
 
Tested in 3.0.1

This hack lets you "elect" a member of the day (member of any period of
time actually, but defaults to member of the day).

The member of the day is someone randomly picked from all the users in
your forum that have certain amount of posts the day before, that have
visited the forum and that have at least 50 posts and 10 reputation. You
can also change that values.

By default it appers in top of the forumhome. It is a nice way for members
of the forum to get to know each other.

Info for hackers:
You may modify, improve, upgrade, redistribute this hack, include it
in another hack or yours or translate it provided you do it free of
charge and you distribute it in www.vbulletin.org at least, there is no
need to pm me asking for permission
Some portions of the code are (c) Jelsoft Enterprises Ltd.

Kentaurus 01-17-2004 08:25 PM

Tu further customize this hack you can edit the memberoftheday.php files, the settings are:

This is a comma separated list of the groups that will not be considered for the member of the day. Banned usergroups should be here.

$restrictedGroups = "3,4";

This are the minimum posts a user must have, if a user has less than 50 posts for example he cannot be selected member of the day

$posts = 50;

Since it makes no sense to make a user that visited the forum a month ago member of the day you can specify the number of days ago the user must have visited the forum. In this example if the user didn't visit the forum yesterday he is not elegible for member of the day

$lastactivity = 1;

Similar to the last setting only the user not only has to visit the forum but also has to post.

$lastpost = 1;

Users with less than x reputation will not be selected.

$reputation = 10;

As soon as a user is selected he cannot be selected again in this number of days. This gives other users a chance to be elected member of the day. In this example once a user was selected member of the day he cannot be selected again in 60 days.

$days = 60;

The member of the day shows the "favorite forum" of the user. This is the forum the user has more posts in. If by chance it is a private forum the name of the private forum will appear there. You might not want other users to see that because they cannot enter that forums anyway. Put a comma separated list of your private forums.

$privateForums = "1,2,3";

MindTrix 01-17-2004 08:28 PM

Looks like a nice idea, a screenshot would be nice aswell incase something goes wrong with your site.

Note the link in your first post isnt even a link to your site ;) (check your spelling in it)

NTLDR 01-17-2004 08:31 PM

Would be nice to see proper permissions for the forums. Good to see some use of the datastore and the cron system here.

Kentaurus 01-17-2004 08:46 PM

Quote:

Originally Posted by NTLDR
Would be nice to see proper permissions for the forums. Good to see some use of the datastore and the cron system here.

You mean something like this?

PHP Code:

$forumpermsmday fetch_permissions($mday['forumid']);
if (!(
$forumpermsmday CANVIEW))
{
 unset(
$mday['forumid']);
 unset(
$mday['forumname']);


This will hide the forum from the users that cannot see them. A conditional in the template is also needed.

However there is no easy way to do this. Even if the forum is not shown the user can know that since there is no favorite forum it means that the user has 0 posts (not likely) or the forum is a private one. Then he knows that there are private forums. Sometimes you don't even want your users to know that there are private forums.

Of course, I could always run the favorite forum check at index.php and if the first forum can't be seen I would go for the second, third or fourth one. But that query is a little heavy and I wouldn't like it to run at the index page.

NTLDR 01-17-2004 09:13 PM

The 2nd, 3rd etc forums could be stored during the cron preventing the need to add extra queries on every index.php load then use code similar to what you posted along with some conditionals to display it.

AN-net 01-18-2004 03:48 PM

is there a way this could be modifed that the member of the moment has like a special title in their profile and postbit? just wondering;)

Chris-FH 01-18-2004 03:57 PM

I love this hack... :up:

At my Forum, we call it Camel of the Day :D

Great Work!

C.

Boofo 01-19-2004 05:28 AM

Tha age part of this hack is way off. It shows 34 for mine and it should be 49. ;)

gmarik 01-19-2004 07:15 AM

This is great - It could be used on KuraFire's Journal hack as well (hint, hint)


All times are GMT. The time now is 03:16 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01258 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete