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)
-   -   vBa CMPS - Member of the Day (https://vborg.vbsupport.ru/showthread.php?t=81178)

restless 05-08-2005 10:00 PM

vBa CMPS - Member of the Day
 
This adds Kentaurus' "Member of the Day" to your vBa CMPS. I take no credit for his hack whatsoever. You must have his hack installed for this to work.

- Added function to show default avatar for users with no selected avatar.
- Added link to member's Usernotes (in template).
- Added like to member's Friends [vBBuddies hack] (in template).

1. Edit global.php

Find:
PHP Code:

$specialtemplates array_merge($specialtemplates
         array(
             
'adv_modules'

add BELOW:
PHP Code:

'memberoftheday'

Find:
PHP Code:

$globaltemplates array_merge($globaltemplates,
         array(
              
'adv_portal'

Add BELOW:
PHP Code:

'memberoftheday'

Find:
PHP Code:

if (defined('VBA_PORTAL'))
{
    require_once(
'./includes/vba_cmps_include_bottom.php');


Add ABOVE:
PHP Code:

$mday unserialize($datastore['memberoftheday']);
if (
$mday['hascustomavatar'] AND $vboptions['avatarenabled'])
        
            {
             
$avatarurl "$vboptions[bburl]/image.php?u=$mday[userid]";
            }
         else
        {
            
$avatarurl "$stylevar[imgdir_misc]/noavatar.gif";
        }
eval(
'$memberoftheday .= "' fetch_template('memberoftheday') . '";'); 

2. create new template adv_portal_member

Add code:
PHP Code:

$memberoftheday 

or you can make any new template using the templates in the next post below (without having to call the original hack's memberoftheday template)

3. Add a new module:


Module Title: Member of the Day
Template to Include: member


Place it wherever you like (left, center, right)

That's it.

restless 05-09-2005 05:40 AM

There are a few different ways to display this of course. I'll include a few of my own (see attachments):

Center Module:
PHP Code:

<table align="center" border="0" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]class="tborder" width="80%">

<
tr><td class="alt1" width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
        <
tr
         <
td class="alt1" width="100"><div align="center"><a target="_top" href="$vboptions[bburl]/member.php?&u=$mday[userid]"><img src="$avatarurlborder="0" alt="Visit $mday[username]'s Profile"></a></div></td>
    <
td class="alt1"><b>Vagrant of the Day: <a target="_top" href="$vboptions[bburl]/member.php?&u=$mday[userid]">$mday[username]</a></b><br/><br/>
      
     
View $mday[username]'s <a target="_top" href="$vboptions[bburl]/member.php?&u=$mday[userid]">Profile</a><BR>
     View $mday[username]'
<a target="_top" href="$vboptions[bburl]/usernote.php?&u=$mday[userid]">UserNotes</a><BR>
     
View $mday[username]'s <a target="_top" href="$vboptions[bburl]/buddies.php?&u=$mday[userid]">Friends</a><BR>
      Posts: $mday[posts]</span><br/>
     Favorite forum: <a href="$vboptions[bburl]/forumdisplay.php?f=$mday[forumid]">$mday[forumname]</a> </td>
        </tr>
        
        </table></td></tr>
</table><BR> 

Left/Right Module:
PHP Code:

<table align="center" border="0" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]class="tborder" width="100%">
<
tr>
<
td class="tcat">
<
span class="smallfont">
<
strong>$vba_options[portal_blockbulletMember of the Day</strong>
</
span>
</
td>
</
tr>
<
tr><td class="$getbgrowwidth="100%"><table width="100%" border="0" cellspacing="0" cellpadding="2">
        <
tr
         <
td align="left" class="alt1"><b><a target="_top" href="$vboptions[bburl]/member.php?&u=$mday[userid]">$mday[username]</a></b><BR
         <
a target="_top" href="$vboptions[bburl]/member.php?&u=$mday[userid]"><img src="$avatarurlborder="0" alt="Visit $mday[username]'s Profile"></a><BR>
            
View <a target="_top" href="$vboptions[bburl]/member.php?&u=$mday[userid]">Profile</a><br>
            
View <a target="_top" href="$vboptions[bburl]/usernote.php?&u=$mday[userid]">UserNotes</a><br>
            
Posts$mday[posts]<br/>
         
Favorite forum: <a href="$vboptions[bburl]/forumdisplay.php?f=$mday[forumid]">$mday[forumname]</a
          </
td>
        </
tr>
      </
table></td></tr>
</
table><BR

CMPS Stats Module:
PHP Code:

<!-- Stats Block -->
    
<
table align="center" border="0" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]class="tborder"width="100%">
  <
tr
    <
td width="200" class="tcat"><span class="smallfont"><strong>$vba_options[portal_blockbullet
     <
phrase 1="$vboptions[hometitle]">$vbphrase[x_statistics]</phrase> </strong></span></td>
    <
td class="tcat"><b>$vba_options[portal_blockbulletVagrant of the Day: <a target="_top" href="$vboptions[bburl]/member.php?&u=$mday[userid]">$mday[username]</a></b></td>
  </
tr>
  <
tr
    <
td class="$getbgrow"><span class="smallfont"$vbphrase[members]: $numbermembers<br />
      
$vbphrase[threads]: $totalthreads<br />
      
$vbphrase[posts]: $totalposts<br />
     
$vbphrase[top_poster]: <a href="$vboptions[bburl]/member.php?$session[sessionurl]u=$topposter[userid]">$topposter[username]</a
      (
$topposter[posts])<br />
      <
br />
     <
phrase 1="$vboptions[bburl]/member.php?$session[sessionurl]u=$newuserid2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase
      </
span> <if condition="$birthdays"><BR>
      <
span class="smallfont"> <b>$vbphrase[todays_birthdays]:</b><br />
      
$birthdays</span></if> </td>
    <
td class="$getbgrow"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <
tr
         <
td width="100"><div align="center"><a target="_top" href="$vboptions[bburl]/member.php?&u=$mday[userid]"><img src="$avatarurlborder="0" alt="Visit $mday[username]'s Profile"></a></div></td>
         <
td><span class="smallfont">View $mday[username]'s <a target="_top" href="$vboptions[bburl]/member.php?&u=$mday[userid]">Profile</a><BR>
            View $mday[username]'
<a target="_top" href="$vboptions[bburl]/usernote.php?&u=$mday[userid]">UserNotes</a><BR>
            
View $mday[username]'s <a target="_top" href="$vboptions[bburl]/buddies.php?&u=$mday[userid]">Friends</a><BR>
            Posts: $mday[posts]<br/>
         Favorite forum: <a href="$vboptions[bburl]/forumdisplay.php?f=$mday[forumid]">$mday[forumname]</a></span></td>
        </tr>
      </table></td>
  </tr>
</table>
<br />
<!-- End Stats Block --> 


iSpanish 05-09-2005 07:29 AM

Nice Module

*Marboosh.Net Clicks Install


thanks

Polo 05-09-2005 12:56 PM

Nice :) thank you restless :)

Polo 05-10-2005 04:06 PM

been having issues with this hack since I have the welcome pannel hack installed :ermm:

also, change this:

PHP Code:

/*======================================================================*\
|| ####################################################################
|| # Downloaded: 13:38, Tue Feb 22nd 2005
|| # CVS: $RCSfile: global.php,v $ - $Revision: 1.256.2.5 $
|| ####################################################################
\*======================================================================*/ 

to something more clear... new/unexperienced people will not be able to find this part of the code, unless they downloaded the file from vbulletin.com at the very exact moment in time as you (which is almost impossible)

restless 05-10-2005 04:27 PM

Quote:

Originally Posted by Polo
been having issues with this hack since I have the welcome pannel hack installed :ermm:

which hack is that, polo?

Polo 05-10-2005 05:26 PM

This one restless:

https://vborg.vbsupport.ru/showthread.php?t=66969

restless 05-10-2005 07:07 PM

it the avatar bit that's messing up the welcome panel?

Polo 05-10-2005 07:53 PM

Quote:

Originally Posted by restless
it the avatar bit that's messing up the welcome panel?

yes... exactly how do you know?

the member of the month avatar goes to the welcome pannel at the top... and my avatar is in the "member of the month" block...

restless 05-12-2005 12:07 AM

I installed that hack just to see what was up. I got it working fine. i tested it with an avatar and with no avatar.

in global.php I changed
PHP Code:

$bbuserinfo['user_avatar']="<img src='{$bbuserinfo['user_avatar']}' alt='Edit Your Avatar' border='0'>"

to
PHP Code:

$bbuserinfo['user_avatar']="<img src='$vboptions[bburl]/image.php?u=$bbuserinfo[userid]' alt='Edit Your Avatar' border='0'>"

in the navar template I changed
PHP Code:

<if condition="THIS_SCRIPT == 'adv_index'">
    <
a href="profile.php?{$session['sessionurl']}&do=editavatar"><img src="$avatarurlborder=0></a>
    <else />
    {
$welcome_avatar}
    </if> 

to
PHP Code:

{$welcome_avatar


Nordinho 05-13-2005 03:39 PM

For some reason the 'memberoftheday' template remains uncached, it's added to the special templates and global templated...I can manually add it to each page, but isn't there an easier way??

restless 05-14-2005 12:54 AM

Quote:

Originally Posted by Nordinho
For some reason the 'memberoftheday' template remains uncached, it's added to the special templates and global templated...I can manually add it to each page, but isn't there an easier way??

not 100% sure what you mean.

Nordinho 05-14-2005 01:54 AM

Quote:

Originally Posted by restless
not 100% sure what you mean.

hmmm...well, the 'memberoftheday' template is uncached. I did add the modifications to global.php. I know I can add the code in each file to cache the module, but isn't there an easier way to do it, instead of editing each file?? hope this is more clear...

edit- solved, and off course my own stupid mistake ;) (vba cmps has some globaltemplates as well in global.php and I added them to that)

Nordinho 05-17-2005 11:48 PM

Hey Restless,

The hack stops functioning when I move the avatars to be stored as files, instead of the being in the database...I think the line below should point to the custom avatar path if that's used...

PHP Code:

 $avatarurl "$vboptions[bburl]/image.php?u=$mday[userid]"


Nordinho 05-20-2005 01:52 PM

Quote:

Originally Posted by Nordinho
Hey Restless,

The hack stops functioning when I move the avatars to be stored as files, instead of the being in the database...I think the line below should point to the custom avatar path if that's used...

PHP Code:

 $avatarurl "$vboptions[bburl]/image.php?u=$mday[userid]"


any idea's??

KW802 05-20-2005 07:11 PM

Before modifying global.php, did you try adding "memberoftheday" to the "Templates to be included" section of the module?

deb0 05-22-2005 04:30 AM

avatar icon is not showing up in CMPS. I have followed all instructions exactly. Shows the no avatar.gif. User does have customer avatar.

deb0 05-22-2005 05:18 AM

I figured it out. Thanks.

Nordinho 06-23-2005 07:35 PM

Quote:

Originally Posted by deb0
I figured it out. Thanks.

hmmm, how did you get it to work with custom avatars??

Sean S 06-23-2005 08:06 PM

Quote:

Originally Posted by Nordinho
any idea's??

thank you restless for the module! :D

Colejo 09-09-2005 02:51 PM

I have a small problem on this. Instead of showing the member of the day's avatar it shows the avatar of the person logged in. Can anyone tell me what might be wrong?

uReside.com 09-12-2005 04:43 AM

could this be changed a little bit to be a "featured forum" instead of the member, i have 840 forums and a featured one would be cool, i have it hard coded right now.
www.ureside.com

StuKeR 11-15-2005 09:08 AM

does it works on 3.5.1 ? cause I try to modify the global.php and I don't find anything similar to replace with this code...

any idea please?

thx

sidewinder1 11-26-2005 10:54 PM

how do you change the text color in that block? cant find it... my forums are dark grey and the hack's letters are black,makes it really hard to see this.


All times are GMT. The time now is 04:45 PM.

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.01667 seconds
  • Memory Usage 1,889KB
  • 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
  • (17)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete