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)

Devil Woman 08-16-2007 06:41 PM

Quote:

Originally Posted by King Kovifor (Post 1317697)
Adminstrators Control Panel -> Plugins & Products -> Manage Plugins -> "Welcome Panel Template Rewrite" -> Main -> Edit. That will open up a browser editor for that, but copy and past into the php tags here.

Thanks for that I have found it and this is what I have

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']);


Thanks alot.

blue6995 08-16-2007 08:34 PM

I am using vBulletin version 3.6 and I am getting the following error message. How can I fix this? Thanks

Database error in vBulletin 3.6.0:

Invalid SQL:
SELECT COUNT(*) AS newposts FROM vb3_post WHERE dateline >= 22:11, 16-08-2007 AND visible = 1;

MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ':11, 16-08-2007 AND visible = 1' at line 1
Error Number : 1064
Date : Thursday, August 16th 2007 @ 11:32:12 PM
Script : http://www.rwf-forum.co.uk/vBulletin/index.php
Referrer :
IP Address :
Username : Classname : vb_database

King Kovifor 08-16-2007 11:24 PM

Quote:

Originally Posted by blue6995 (Post 1319196)
I am using vBulletin version 3.6 and I am getting the following error message. How can I fix this? Thanks

Database error in vBulletin 3.6.0:

Invalid SQL:
SELECT COUNT(*) AS newposts FROM vb3_post WHERE dateline >= 22:11, 16-08-2007 AND visible = 1;

MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ':11, 16-08-2007 AND visible = 1' at line 1
Error Number : 1064
Date : Thursday, August 16th 2007 @ 11:32:12 PM
Script : http://www.rwf-forum.co.uk/vBulletin/index.php
Referrer :
IP Address :
Username : Classname : vb_database

There is a Patch a page or too back. It's because of missing { } around the date.

Quote:

Originally Posted by Devil Woman (Post 1319111)
Thanks for that I have found it and this is what I have

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']);


Thanks alot.

Everything seems ok...

LPH2004 09-02-2007 06:58 PM

Sorry to bother but this works well on Harry Potter Chat but I cannot get it to show up on Technology Questions. I installed this on HPC months ago and cannot figure out why the install I'm trying today on TQ doesn't show. Where in the templates do I look to figure out where and how this is to show? I've read through the posts from other people but do not see a solution or answer to the direct question. Maybe the template being used is so tweaked that a manual install is best.

Thank you for this excellent mod and I look forward to a solution.

King Kovifor 09-09-2007 12:09 AM

Are you sure that you have uploaded the product, turned it on, and that the plugin is active?

LPH2004 09-10-2007 02:38 AM

Quote:

Originally Posted by King Kovifor (Post 1335123)
Are you sure that you have uploaded the product, turned it on, and that the plugin is active?

If you are addressing my request for support .. Yes, the product functions in other templates on the site but not the default template.

Where are the template edits being made so I can do this manually?

King Kovifor 09-10-2007 06:45 PM

The templates are being added through the plugin. Does your default template use $navbar?

andreamarucci 09-12-2007 12:19 PM

My compliments, everything works fine except Activate Plural Checking. I've checked this just to try but it's useless for me since I'm in Italy, so I unchecked it.

Problem is that the mod keep adding th "s" after the words.

How can I disable it definitely?

andreamarucci 09-12-2007 01:35 PM

Also, How can I reduce the dimensions of the characters in the welcome panel? I suppose I've to mod the css but I really don't know where.

Thanks again

King Kovifor 09-12-2007 11:33 PM

Quote:

Originally Posted by andreamarucci (Post 1337583)
My compliments, everything works fine except Activate Plural Checking. I've checked this just to try but it's useless for me since I'm in Italy, so I unchecked it.

Problem is that the mod keep adding th "s" after the words.

How can I disable it definitely?

The check for plural is used so that if it is 5 posts, it says posts. But if it is 1 post, it doesn't say 1 posts. And I think editing the prhase and removing some of the {} can get rid of it. I don't know off the top of my head.

Quote:

Originally Posted by andreamarucci (Post 1337625)
Also, How can I reduce the dimensions of the characters in the welcome panel? I suppose I've to mod the css but I really don't know where.

Thanks again

What do you mean the characters? And you could use the Style Manager to add CSS to this mod.


All times are GMT. The time now is 08:32 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.01990 seconds
  • Memory Usage 1,877KB
  • 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
  • (2)bbcode_php_printable
  • (6)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