Member of the Day

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
AngeDevil
Registered User
Posts: 35
Joined: Tue Jun 27, 2006 3:06 pm
Contact:

Member of the Day

Post by AngeDevil »

Basically a little thing at the bottom where it shows a Random members as "member of the day," no pictures, just their name and a link to their profile, and it would change daily :)
alexi02
Registered User
Posts: 271
Joined: Fri Mar 05, 2004 2:15 am
Location: Australia
Contact:

Post by alexi02 »

This should do it.

MOD Title: Member of the day
MOD Author: alexi02 < N/A > (Alejandro Iannuzzi) http://www.uzzisoft.com
MOD Description: Displays a random member of the day in the index page daily
MOD Version: 0.1.0

Download Here - http://www.uzzisoft.com/projects/member ... v0.1.0.txt

Image
AngeDevil
Registered User
Posts: 35
Joined: Tue Jun 27, 2006 3:06 pm
Contact:

Post by AngeDevil »

Thanks.

Oh man! Did you just code this? It rocks, thanks. Great birthday present! A mod made for mee :D
alexi02
Registered User
Posts: 271
Joined: Fri Mar 05, 2004 2:15 am
Location: Australia
Contact:

Post by alexi02 »

AngeDevil wrote: Thanks.

Oh man! Did you just code this? It rocks, thanks. Great birthday present! A mod made for mee :D


Sure did, enjoy :)
AngeDevil
Registered User
Posts: 35
Joined: Tue Jun 27, 2006 3:06 pm
Contact:

Post by AngeDevil »

Well then, I'll test it out right now :)
spamyboy
Registered User
Posts: 93
Joined: Sun Feb 04, 2007 8:15 am

Post by spamyboy »

Could you change one misc ? Member of the day shoudl display member that made most posts that day ? (and if no one did - none).
AngeDevil
Registered User
Posts: 35
Joined: Tue Jun 27, 2006 3:06 pm
Contact:

Post by AngeDevil »

Alright, works great with Easymod, one thing though, can you make it not include inactive members? Or is there a mod to not count them? Sorry if I'm being a pain, but I've got a lot of bots that are registered. The forums are http://www.synthetic-graphics.com/forum/ if you want to see your mod in action :)
Chudz
Registered User
Posts: 83
Joined: Tue Dec 19, 2006 2:36 am

Post by Chudz »

Since he quickly coded this for you I guess it wont have that feature but you could delete the inactive member from your forum?
User avatar
RMcGirr83
Former Team Member
Posts: 21963
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Post by RMcGirr83 »

AngeDevil wrote: Alright, works great with Easymod, one thing though, can you make it not include inactive members?


in index.php

FIND

Code: Select all

        //
        // Start Member of the day Mod
        //

        $sql = "SELECT user_id, username
                FROM " . USERS_TABLE;
REPLACE WITH

Code: Select all

        //
        // Start Member of the day Mod
        //

        $sql = "SELECT user_id, username
                FROM " . USERS_TABLE . "
                WHERE user_active = 1";
and, fwiw, I would probably move this

Code: Select all

//
// Start Member of the day Mod
//

// Update the Member of the day and the time
function update_member_of_the_day($row,$row_count) {
   global $board_config, $lang, $db;

   // Update the time
   $update_sql = "UPDATE " . CONFIG_TABLE . "
                  SET config_value = " . time() . "
                  WHERE config_name = 'member_of_the_day_time'";

   if ( !($result_update = $db->sql_query($update_sql)) ) {
      message_die(GENERAL_ERROR, 'Could not update config table', '', __LINE__, __FILE__, $update_sql);
   }

   // Randomise the Member of the day
   $x = rand(1,$row_count - 1);

   // Add user_id and username
   $user_details[0] = $row[$x]['user_id'];
   $user_details[1] = $row[$x]['username'];

   $combine_user_id_username = implode("\n",$user_details);

   // Update the member of the day
   $update_sql = "UPDATE " . CONFIG_TABLE . "
                  SET config_value = '" . $combine_user_id_username . "'
                  WHERE config_name = 'member_of_the_day'";

   if ( !($result_update = $db->sql_query($update_sql)) ) {
      message_die(GENERAL_ERROR, 'Could not update config table', '', __LINE__, __FILE__, $update_sql);
   }
}

//
// End Member of the day Mod
//
into includes/functions.php before the

Code: Select all

?>
alexi02
Registered User
Posts: 271
Joined: Fri Mar 05, 2004 2:15 am
Location: Australia
Contact:

Post by alexi02 »

Submitted v1.0.0 to the MOD-DB.

2007-02-06 - Version 1.0.0
- Moved the function update_member_of_the_day() to includes/functions.php
- Added addslashes() and str_replace() for \' to ''

http://www.uzzisoft.com/projects/member ... v1.0.0.txt
Post Reply

Return to “[2.0.x] MOD Requests”