Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Problem with user info box Details »»
Problem with user info box
Version: , by digitalJE5U5 digitalJE5U5 is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 01-21-2003 Last Update: Never Installs: 0
 
No support by the author.

I've added a user info box to the top of my forumhome. The problem Im having is that $newpm[messages] and Users Currently Online: <b>$headeronline</b> arent working. This info box is a combination of a few different hacks, so Im not sure what is wrong.

I've attached a screenshot to try and help explain my problem.

Thanks in advance.

Download Now

File Type: (21.4 KB, 10 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-21-2003, 11:46 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it in "header" template you added the html code? Or "forumhome"?
Post the actual php code so we can have a look at it.
Reply With Quote
  #3  
Old 01-22-2003, 02:59 PM
digitalJE5U5 digitalJE5U5 is offline
 
Join Date: Sep 2002
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code is in my forumhome_logoutcode template.
I have a seperate "user Info" box for forumhome_logincode template.


PHP Code:
<!-- WelcomePanel 2 -->
<
table width="739" border="0" cellspacing="0" cellpadding="0" align="center">
  <
tr>
    <
td width="739" height="16"><img src="images/welcomepanel4_01.gif" width="739" height="16"></td>
  </
tr>

  <
tr>
    <
td>
      <
table width="100%" cellpadding="0" cellspacing="0" border="1" bgcolor="#3B4A59" bordercolor="#455164">
        <
tr bordercolor="#455164" bgcolor="#646E74"
          <
td height="85" width="272"><table width="100%" border="1" cellspacing="4" cellpadding="0" height="100%" bordercolor="#646E74" bgcolor="#646E74">
        <
tr
          <
td bgcolor="#3B4A59" bordercolor="455164"
            <
div align="center"></div>
            <
div align="center"

<
table border="0" cellpadding="4" cellspacing="0" style="border-collapse: collapse" bordercolor="#3B4A59" width="100%" id="AutoNumber3" bgcolor="#3B4A59">
  <
tr
    <
td valign="top" bgcolor="#3B4A59" bordercolor="#3B4A59" rowspan="2"
      <
table width="0%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000" bgcolor="#3B4A59">

        <
tr
                              <
td bgcolor="#3B4A59" bordercolor="#3B4A59">$avatarimage</td>
        </
tr>
      </
table>
    </
td>
    <
td bgcolor="#3B4A59" bordercolor="#3B4A59"
      <
div align="center"><font face="Verdana"><b><font color="#FFFFFF" size="1">$unregwelcomemessage 
      $welcometext
</font></b
        </
font></div>
    </
td>

  </
tr>
  <
tr
    <
td bgcolor="#646E74" bordercolor="#646E74"
      <
p style="margin-top: 1; margin-bottom: 1; word-spacing:1" align="center"
                            <
font color="#FFFFFF" size="1" face="Verdana">Post 
                            Count
:<b>$bbuserinfo[posts]</b></font></p>
                          <
p style="margin-top: 1; margin-bottom: 1; word-spacing:1" align="center"
                            <
font color="#FFFFFF" size="1" face="Verdana">Local 
                            Time
: <b>$timenow</b></font></p>
                          <
p style="margin-top: 1; margin-bottom: 1; word-spacing:1" align="center"
                            <
font color="#FFFFFF" size="1" face="Verdana">You 
                            have
<b$newpm[messages] </b>new PM's.</font></p>
                          <p style="margin-top: 1; margin-bottom: 1; word-spacing:1" align="center"> 
                            <font color="#FFFFFF"><b><font face="Verdana" size="1"> 
                            <font class="sf"><a href='
member.php?s=&action=logout'>Log 
                            Out</a> </font> </font></b> </font></p>
    </td>
  </tr>
</table></div>
          </td>
        </tr>

      </table>
    </td>
          <td width="467"><table width="100%" border="1" cellspacing="4" cellpadding="4" height="100%" bordercolor="#646E74" bgcolor="#646E74">
        <tr> 
          <td bgcolor="#3B4A59" bordercolor="455164"> 
            <div align="center"><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">Registered 
                    Members: <b>$numbermembers</b></font><font color="#FFFFFF"><br>
                    <font size="1" face="Verdana">Total Threads: <b>$totalthreads</b> 
                    </font></font> <font color="#FFFFFF"><br>
                    <font size="1" face="Verdana">Total Posts: <b>$totalposts</b> 
                    </font></font> <font color="#FFFFFF"><br>
                    <font size="1" face="Verdana"> <b><a href="member.php?s=$session[sessionhash]&action=markread">Mark 
                    All Forums Read</a> </b></font></font> <font color="#FFFFFF"><br>
                    <font size="1" face="Verdana">Users Currently Online: <b>$headeronline</b></font></font></div>
          </td>
          <td bgcolor="#3B4A59" bordercolor="#455164"> 
            <div align="center">
                    <p style="margin-top: 2; margin-bottom: 2" align="center"><font color="#FFFFFF" size="1" face="Verdana">Last 
                      visited: $bbuserinfo[lastvisitdate].</font></p>
                    <p style="margin-top: 2; margin-bottom: 2" align="center"> 
                      <font color="#FFFFFF" size="1" face="Verdana">Newest member: 
                      <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid"><b>$newusername</b></a><br>
                      <a href="store.php?s=$session[sessionhash]&action=main"><b><u>$storename</u></b></a></font></p>
                    <p style="margin-top: 2; margin-bottom: 2" align="center"> 
                      <font color="#FFFFFF" size="1" face="Verdana"><b><a href="search.php?s=$session[sessionhash]&action=getnew">View 
                      New Posts</a> | <a href="search.php?s=$session[sessionhash]&action=getdaily">Todays 
                      Active Topics</a><br>
                      <br>
                       </b></font></p>
                    <p style="margin-top: 2; margin-bottom: 2" align="center">
                    </p>
                  </div>

          </td>
        </tr>
      </table>
    </td>
        </tr>
        <tr bordercolor="#455164" bgcolor="#3B4A59"> 
          <td colspan="2" height="7"></td>
        </tr>
      </table>

    </td>
  </tr>
</table>
<!-- End WelcomePanel 2 --> 
I allude to this template in forumhome template. Here is an excerpt:

</head>
<body>
$header
<br>
$logincode <br>

<!-- text -->
Reply With Quote
  #4  
Old 01-22-2003, 07:11 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not interested in the template, but the php code you added.
Reply With Quote
  #5  
Old 01-23-2003, 02:59 AM
digitalJE5U5 digitalJE5U5 is offline
 
Join Date: Sep 2002
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Firstly the avatar hack. Thanks to Firefly for writing and sharing this code. For reference, Fireflys original avatar hack can be found here: https://vborg.vbsupport.ru/showthrea...hreadid=32560. On with the hack...

Open index.php (NOTE: *not* admin/index.php) and find:

#############################
$permissions=getpermissions();
if (!$permissions['canview']) {
show_nopermission();
}
############################

and directly after it add this...

############################
if ($bbuserinfo[userid]!=0) {
$avatarurl=getavatarurl($bbuserinfo[userid]);
if ($avatarurl=='') {
$avatarurl='images/avatars/noavatar.gif';
}
$avatarimage='<a href="member.php?s='.$session[sessionhash].'&action=editavatar"><img src="'.$avatarurl.'" border="0">';
} else {
$avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="images/avatars/guestavatar.gif" border="0"></a>';
}
############################
and
Quote:
Again in index.php, find:

############################
// if user is know, then welcome
############################

and directly under it add this...

############################
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
############################
Reply With Quote
  #6  
Old 01-24-2003, 11:26 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

FIND:
Code:
// if user is know, then welcome
BELOW, ADD:
Code:
$countnewthreads = $DB_site->query_first("
  SELECT COUNT(*) AS total
  FROM thread
  WHERE dateline>$bbuserinfo[lastvisit]
");
$countnewposts = $DB_site->query_first("
  SELECT COUNT(*) AS total
  FROM post
  WHERE dateline>$bbuserinfo[lastvisit]
");
$getnewthread = number_format( $countnewthreads['total'] );
$getnewpost = number_format( $countnewposts['total'] );
Then use the 2 $getnewthread and $getnewpost variables in your template.
Reply With Quote
  #7  
Old 01-25-2003, 01:16 AM
digitalJE5U5 digitalJE5U5 is offline
 
Join Date: Sep 2002
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, but doesnt that just give me new posts and new threads since last visit? What I want, is new PMs, and total users online.

Im confused.
=/
Reply With Quote
  #8  
Old 01-25-2003, 03:59 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So post the code you have problems with then. What you posted above made me think that is your problem.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:39 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.05438 seconds
  • Memory Usage 2,341KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete