vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Forum Home Enhancements - Welcome Panel Template Rewrite (https://vborg.vbsupport.ru/showthread.php?t=118385)

King Kovifor 05-17-2007 08:15 PM

Here should be a working patch:

PHP Code:

if ($vbulletin->userinfo['userid'] > && $vbulletin->userinfo['userid'] != '' || !$vbulletin->userinfo['userid'])
{
    require_once(
DIR '/includes/functions_user.php');
    
$vbulletin->userinfo['avatar_build'] = fetch_avatar_url($vbulletin->userinfo['userid']);

    if (empty(
$vbulletin->userinfo['avatar_build']) || !is_array($vbulletin->userinfo['avatar_build']))
    {
        
$vbulletin->userinfo['avatar_build'] = array($vbulletin->options['wp_forumimagelink'] . 'noavatar.gif');
    }

    
$vbulletin->userinfo['avatar_build'] = '<img src="' $vbulletin->userinfo['avatar_build'][0] . '"'.iif($vbulletin->userinfo['avatar_build'][1],$vbulletin->userinfo['avatar_build'][1],'').'border="0" alt="Edit Your Avatar" />';

    
$postsin = array();
    
$gp      $db->query_read("SELECT p.threadid, t.forumid FROM " TABLE_PREFIX "post p LEFT JOIN " TABLE_PREFIX "thread t ON(t.threadid = p.threadid) WHERE p.userid = {$vbulletin->userinfo['userid']}");
    while (
$gpb $db->fetch_array($gp))
    {
        if (!
$postsin[$gpb['forumid']])
        {
            
$postsin[$gpb['forumid']] = 1;
        }
        else
        {
            
$postsin[$gpb['forumid']]++;
        }
    }

    
$active = array(0);

    if (
is_array($postsin) && is_array($vbulletin->forumcache))
    {
        foreach (
$postsin as $forumid => $pi)
        {
            if (
$pi $active[0])
            {
                
$active = array($pi$forumid);
            }
        }
    }

    if (!empty(
$active[1]))
    {
        
$vbulletin->userinfo['active'] = array($vbulletin->forumcache[$active[1]], $active[0]);
    }
    else
    {
        
$vbulletin->userinfo['active'] = false;
    }

    
$exec_totalposts str_replace(','''$totalposts);

    if (
$exec_totalposts 1)
    {
        
$exec_totalposts 1;
    }

    
$vbulletin->userinfo['posts'] = vb_number_format($vbulletin->userinfo['posts']);
    
$jointime = (TIMENOW $vbulletin->userinfo['joindate']) / 86400;

    if (
$jointime 1)
    {
        
$vbulletin->userinfo['postsperday'] = $vbulletin->userinfo['posts'];
    }
    else
    {
        
$vbulletin->userinfo['postsperday'] = vb_number_format(str_replace(','''$vbulletin->userinfo['posts']) / $jointime2);
    }

    
$vbulletin->userinfo['postpercent'] = vb_number_format(((str_replace(','''$vbulletin->userinfo['posts']) / $exec_totalposts ) * 100),2);

    
$vbulletin->userinfo['newposts'] = $db->query_first("SELECT COUNT(*) AS newposts FROM " TABLE_PREFIX "post WHERE dateline >= '{$vbulletin->userinfo['lastvisit']}' AND visible = '1'");
    
$vbulletin->userinfo['newposts'] = vb_number_format($vbulletin->userinfo['newposts']['newposts']);

    
$vbulletin->userinfo['newthreads'] = $db->query_first("SELECT COUNT(*) AS newthreads FROM " TABLE_PREFIX "thread WHERE dateline >= '{$vbulletin->userinfo['lastvisit']}' AND visible = '1' AND sticky in(0,1)");
    
$vbulletin->userinfo['newthreads'] = vb_number_format($vbulletin->userinfo['newthreads']['newthreads']);

    
$vbulletin->userinfo['lastvisit'] = vbdate($vbulletin->options['timeformat'], $vbulletin->userinfo['lastvisit']) . ', ' vbdate($vbulletin->options['dateformat'], $vbulletin->userinfo['lastvisit']);

    
$exec_lastposts $db->query_first("SELECT COUNT(*) AS lastposts FROM " TABLE_PREFIX "post WHERE visible = 1 AND dateline >= ".(TIMENOW 86400));
    
$exec_lastposts vb_number_format($exec_lastposts['lastposts']);

    
$vbulletin->templatecache['FORUMHOME'] = str_replace('$navbar','$navbar ' $vbulletin->templatecache['forumhome_welcomepanel_' $vbulletin->options['wp_style']],$vbulletin->templatecache['FORUMHOME']);


Replace the code in the "main" plugin (under Welcome Panel Template Rewrite) and see if it works...

The only reason I'm not updating it to vb3.0.6 (will do later) is that I'm adding more features and stuff...

Spookysalem 05-18-2007 07:44 AM

Wicked that worked a treat thanks King.

I have one more thing to ask...at the top of the panel i have Welcome back : (username) (AVC) <---where can i go to remove this..

Tri@de 05-18-2007 08:21 AM

Hmmm something wrong...
i log in and i see:
Threre are 45,848 new posts and 4,945 threads since your last visit 01:00, 01 gen 70.

Mrdby 05-18-2007 04:05 PM

Upload Them Iimages In What Folder In The Image File?

King Kovifor 05-18-2007 06:37 PM

Quote:

Originally Posted by Spookysalem (Post 1250045)
Wicked that worked a treat thanks King.

I have one more thing to ask...at the top of the panel i have Welcome back : (username) (AVC) <---where can i go to remove this..

It says AVC still?! Dang-It! It's in the forumhome_welcomepanel_avc template.

Quote:

Originally Posted by Tri@de (Post 1250054)
Hmmm something wrong...
i log in and i see:
Threre are 45,848 new posts and 4,945 threads since your last visit 01:00, 01 gen 70.

The last visit seems to be messing up somehow... I'm guessing you have 45,848 posts and 9,495 threads on your forum? Will look into.

Quote:

Originally Posted by Mrdby (Post 1250263)
Upload Them Iimages In What Folder In The Image File?

Upload them into the root image directory (also get the noavatar.gif from ZT, will add in a later release)... You can place them else where using the Image Path setting.

Mrdby 05-18-2007 06:38 PM

Thanks..and ummm who is ZT? lol

Mrdby 05-18-2007 06:46 PM

why can't i view forum leaders if i'm admin?

Mrdby 05-18-2007 06:54 PM

OK INSTALLED...This is a nice mod!!!!

Mrdby 05-18-2007 06:56 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=123886" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=123886</a> This doesn't work with your hack. ANy ideas?

King Kovifor 05-19-2007 12:10 PM

Quote:

Originally Posted by Mrdby (Post 1250365)
Thanks..and ummm who is ZT? lol

Zero Tolerance. He wrote the original one that I evolved.

Quote:

Originally Posted by Mrdby (Post 1250371)
why can't i view forum leaders if i'm admin?

What do you mean?

Quote:

Originally Posted by Mrdby (Post 1250375)
OK INSTALLED...This is a nice mod!!!!

Glad you like it.

Quote:

Originally Posted by Mrdby (Post 1250377)
https://vborg.vbsupport.ru/showthread.php?t=123886 This doesn't work with your hack. ANy ideas?

Not sure why not... Any errors?


All times are GMT. The time now is 06:29 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.01670 seconds
  • Memory Usage 1,796KB
  • 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
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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