Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-22-2005, 03:06 PM
SupaJ SupaJ is offline
 
Join Date: Jan 2005
Location: Ulster, Northern Ireland
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Some q's

Hello, I'm designing my website and I want to integrate it with Vbulletin.
I have added a userpanel with the following script:

Code:
<?

if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
  
print("<align='center'><span class='sectionheader'>Welcome back, $username!<br>");

} else { 

?>
<form action='forums/login.php' method='post' onsubmit='md5hash(vb_login_password,vb_login_md5password)'>
        <script type='text/javascript' src='forums/clientscript/vbulletin_md5.js'></script>
        
         <span class="sectionheader">Username:</span>
            <input type='text' class='button' name='vb_login_username' id='navbar_username' size='15' accesskey='u' tabindex='1' value='' onfocus='if (this.value == 'username') this.value = '';' /><br>
            
            <span class="sectionheader">Password:&nbsp;</span>
            <input type='password' class='button' name='vb_login_password' size='15' accesskey='p' tabindex='2' /><br>
            <input type='checkbox' name='cookieuser' value='1' tabindex='3' id='cb_cookieuser_navbar' accesskey='c' checked='checked' /><span class='sectionheader'>Remember Me</span><br>
        
        
        <input name="submit" type='submit' class='button' accesskey='s' tabindex='4' title='Log In' value='Log In' />
        <input type='hidden' name='do' value='login' />
        <input type='hidden' name='forceredirect' value='1' />            
        <input type='hidden' name='vb_login_md5password' />
		</form>
                        <?

}

?>
which I got from this site (I forgot by wo, if somebody tells me who i'll give the appropriate credits), when you are logged in it brings you back and changes the login thing to "Welcome back" but instead of that I want it to display the avatar, the last time you were online and the amount of private msg's read and unread. How do I do this?

my 2nd question is:
How do I add the amount of posts on the forums on my main site?

thanks in advance
Reply With Quote
  #2  
Old 01-22-2005, 03:13 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To get the avatar
PHP Code:
$avatarurl fetch_avatar_url($bbuserinfo[userid]); 
PMs are in $bbuserinfp[pmunread] & $bbuserinfo[pmtotal]
Last activity is in $bbuserinfo[lastactivity] as a UNIX timestamp.

To get the total amount of posts
[sql]SELECT COUNT(*) AS totalposts FROM post[/sql]
Reply With Quote
  #3  
Old 01-22-2005, 04:28 PM
SupaJ SupaJ is offline
 
Join Date: Jan 2005
Location: Ulster, Northern Ireland
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
To get the avatar
PHP Code:
$avatarurl fetch_avatar_url($bbuserinfo[userid]); 
PMs are in $bbuserinfp[pmunread] & $bbuserinfo[pmtotal]
Last activity is in $bbuserinfo[lastactivity] as a UNIX timestamp.

To get the total amount of posts
[sql]SELECT COUNT(*) AS totalposts FROM post[/sql]
thanks alot, but i cant get lastactivity to work?

with the total posts i mean, to give me the number of posts on the main site.
Reply With Quote
  #4  
Old 01-22-2005, 04:31 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SupaJ
thanks alot, but i cant get lastactivity to work?
What's the problem with it?

Quote:
with the total posts i mean, to give me the number of posts on the main site.
The query I posted does give you the total number of posts on your board.
Isn't that what you want?
Reply With Quote
  #5  
Old 01-22-2005, 04:37 PM
SupaJ SupaJ is offline
 
Join Date: Jan 2005
Location: Ulster, Northern Ireland
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
What's the problem with it?


The query I posted does give you the total number of posts on your board.
Isn't that what you want?
well i added it to my site and it gives me this

Quote:
[avatar] Welcome, SupaJ!
You were last active at
You have 0 unread pms from a total of 0 pms.
it doesnt give me any date, is there any file i need to include for it?


with the posts i mean a string on my site that changes everytime the post number changes, so i dont have to update it manually
Reply With Quote
  #6  
Old 01-22-2005, 04:42 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SupaJ
it doesnt give me any date, is there any file i need to include for it?
That's more then strange, should definitly work.
Maybe you got a typo?

Quote:
with the posts i mean a string on my site that changes everytime the post number changes, so i dont have to update it manually
The query I posted does that.
Do you need PHP-Code too?
So here we go:

PHP Code:
$posts $DB_site->query_first("SELECT COUNT(*) AS total FROM " .  TABLE_PREFIX "post"); 
And then use $posts[total] in your template.
Reply With Quote
  #7  
Old 01-22-2005, 04:47 PM
SupaJ SupaJ is offline
 
Join Date: Jan 2005
Location: Ulster, Northern Ireland
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

postcount is working thanks alot!!

PHP Code:
$lastactive=$bbuserinfo['lastactivity'];
  
print(
"<align='left'><span class='sectionheader'><br />&nbsp;<img src='forums/$avatarurl'> Welcome, $username!<br />You were last active at $lastactivity<br />You have <strong>$pmunread</strong> unread pms from a total of <strong>$pmtotal</strong> pms."); 
I don't think i've made a typo... I've included two files.
global.php for username and /includes/functions_user.php for the avatar, the pm's just worked maybe I need to include another thing for lastactivity

edit: I made a typo, i see it now sorry lol
I will most definatly include your name in the final credits

Quote:
You were last active at 1106415842
huh? isn't that in unix thingy? how do i convert that to normal time...

sorry for double post
Reply With Quote
  #8  
Old 01-22-2005, 04:59 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As I said, it's a unix timestamp

If you want a readable date
PHP Code:
$lastactivitystr vbdate($vboptions['dateformat] . ' ' . $vboptions['timeformat'], $bbuserinfo['lastactivity']); 
Or you could also try to use $bbuserinfo['lastvisitdate'], this should already be formatted.
Reply With Quote
  #9  
Old 01-22-2005, 05:17 PM
SupaJ SupaJ is offline
 
Join Date: Jan 2005
Location: Ulster, Northern Ireland
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
As I said, it's a unix timestamp

If you want a readable date
PHP Code:
$lastactivitystr vbdate($vboptions['dateformat] . ' ' . $vboptions['timeformat'], $bbuserinfo['lastactivity']); 
Or you could also try to use $bbuserinfo['lastvisitdate'], this should already be formatted.
thanks it worked!!
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 04:19 AM.


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.04174 seconds
  • Memory Usage 2,266KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (6)bbcode_php
  • (9)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete