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

Reply
 
Thread Tools Display Modes
  #11  
Old 01-06-2004, 06:04 PM
rrottman rrottman is offline
 
Join Date: Jun 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by assassingod
You'd have to edited the functions to show where the login redirects too, but this would affect all other pages too. The only way I can think of doing it is to create another functions similar to vBs login code.
Could you possibly explain how to do this?
I know there are a couple of threads available which deal somehow with the login box. But I found nothing explaining to a relatively new vB "hacker" how to do a login box.

I also looked into the navbar template. The main problem is, that coding the form itself is pretty easy but the form action almost always submits to vB's login.php which would then again do its standard forwarding stuff.

So I guess it's not only the form which needs to be codes (the easy part) but also the login procedure itself.

Any hint on where to start? How to do it? Maybe anybody has already done it? Maybe I can reuse parts of the vB code?
Reply With Quote
  #12  
Old 01-06-2004, 06:43 PM
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Posts: 3,337
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you take a look at login.php, you'll get a fair idea on how to do it. I myself have never tried it (since i've never needed too) but i'm sure all the info is in login.php
Reply With Quote
  #13  
Old 01-07-2004, 12:52 PM
[FG]Omega [FG]Omega is offline
 
Join Date: Dec 2003
Location: Vienna
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Omega]ok, thx Faranth. Now I use a hack (for vb 2.3.3) , that displays also how many pm's you have, who's online (usernames) and how many threads and posts were posted since the last visit. Can anybody tell me how to add this info when a user logs in (on a non-vb-page)?
of course for vb 3.0.0 RC

Like this:

"Welcome back, [FG]Omega! Your last visit was: 04.01.2004. X new threads and X new posts were posted since your last visit. View new posts (<-- this is a link).

Your CP (also a link) | Log out (also a link) | Private Messages - You have X new PMs since your last visit.

There are now X members online"

^-- yeah, like that ^^
Reply With Quote
  #14  
Old 01-11-2004, 11:36 PM
Dave-ahfb Dave-ahfb is offline
 
Join Date: Mar 2002
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It sounds as though we are after the same thing. Much of what you are asking I already have figured out on my test page ( http://www.ahfb2000.com/test.php )

We do seem to have different results when redirecting. Upon login mine brings you back to the nonvb page you logged in from.

I am close to getting it 100% but I cannot get it to show the user info (username, avatar, remove login and show logout). It is always the guest templates which show.

Dave
Reply With Quote
  #15  
Old 01-12-2004, 06:48 AM
rrottman rrottman is offline
 
Join Date: Jun 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@[FG]Omega:
To display the information you are describing, you can do your page like this:
PHP Code:
<?php
    chdir
("./forum");
    require_once(
"./global.php");
    require_once(
"./includes/functions_bigthree.php");
    global 
$bbuserinfo;
    if (
$bbuserinfo['userid'] > 0) {    // userid = 0 usually means unregistered / logged out
        
echo ("Welcome back {$bbuserinfo['username']}. Thank you for posting {$bbuserinfo['posts']} so far.<br />Number of PMs:  {$bbuserinfo['pmtotal']} / Unread: {$bbuserinfo['pmunread']}.<br />");
        echo (
"Your last visit was on: {$bbuserinfo['lastvisitdate']}.<br />");

    
$activeusers '';
    if (
$vboptions['displayloggedin'])
    {
        
$datecut TIMENOW $vboptions['cookietimeout'];
        
$numbervisible 0;
        
$numberregistered 0;
        
$numberguest 0;
    
        
$forumusers $DB_site->query("
            SELECT
                user.username, (user.options & 
$_USEROPTIONS[invisible]) AS invisible, user.usergroupid,
                session.userid, session.inforum, session.lastactivity,
                IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
            FROM " 
TABLE_PREFIX "session AS session
            LEFT JOIN " 
TABLE_PREFIX "user AS user ON(user.userid = session.userid)
            WHERE session.lastactivity > 
$datecut
            ORDER BY " 
iif($permissions['genericpermissions'] & CANSEEHIDDEN'invisible ASC, ') . "username ASC, lastactivity DESC
        "
);
    
        if (
$bbuserinfo['userid'])
        {
            
// fakes the user being online for an initial page view of index.php
            
$bbuserinfo['joingroupid'] = iif($bbuserinfo['displaygroupid'], $bbuserinfo['displaygroupid'], $bbuserinfo['usergroupid']);
            
$userinfos = array
            (
                
$bbuserinfo['userid'] => array
                (
                    
'userid' => $bbuserinfo['userid'],
                    
'username' => $bbuserinfo['username'],
                    
'invisible' => $bbuserinfo['invisible'],
                    
'inforum' => 0,
                    
'lastactivity' => TIMENOW,
                    
'musername' => fetch_musername($bbuserinfo'joingroupid')
                )
            );
            
$numberregistered 1;
            
$numbervisible 1;
            
fetch_online_status($userinfos[$bbuserinfo['userid']]);
            
$loggedin $userinfos[$bbuserinfo['userid']];
            eval(
'$activeusers = ", ' fetch_template('forumhome_loggedinuser') . '";');
        }
        else
        {
            
$userinfos = array();
        }
        
$inforum = array();
    
        while (
$loggedin $DB_site->fetch_array($forumusers))
        {
            
$userid $loggedin['userid'];
            if (!
$userid)
            {    
// Guest
                
$numberguest++;
                
$inforum["$loggedin[inforum]"]++;
            }
            else if (empty(
$userinfos["$userid"]['lastactivity']) OR ($userinfos["$userid"]['lastactivity'] < $loggedin['lastactivity']))
            {
                
$userinfos["$userid"] = $loggedin;
                
$numberregistered++;
                if (
$userid != $bbuserinfo['userid'])
                {
                    
$inforum["$loggedin[inforum]"]++;
                }
                
$loggedin['musername'] = fetch_musername($loggedin);
    
                if (
fetch_online_status($loggedin))
                {
                    
$numbervisible++;
                    eval(
'$activeusers .= ", ' fetch_template('forumhome_loggedinuser') . '";');
                }
            }
        }
    
        
// memory saving
        
unset($userinfos$loggedin);
    
        
$activeusers substr($activeusers 2); // get rid of initial comma
    
        
$DB_site->free_result($loggedins);
    
        
$totalonline $numberregistered $numberguest;
        
$numberinvisible $numberregistered $numbervisible;
    
        }
        echo (
"Currently active users: $activeusers <br />");
        }
    
?>
Reply With Quote
  #16  
Old 01-12-2004, 06:49 AM
rrottman rrottman is offline
 
Join Date: Jun 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The output the above code produces on a non VB page is:

Welcome back localhost. Thank you for posting 3 so far.
Number of PMs: 0 / Unread: 0.
Your last visit was on: 01-11-2004 11:45 PM.
Currently active users: localhost
Reply With Quote
  #17  
Old 01-12-2004, 12:10 PM
Davey-UK's Avatar
Davey-UK Davey-UK is offline
 
Join Date: Feb 2003
Location: Sheffield-UK
Posts: 244
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, it works great for me apart from 2 things.

1. Active user link goes to member.php, instead of /board/member.php

2. If not logged in, it shows:

Unable to add cookies, header already sent.
File: N/A
Line: 0

I would like this to say Welcome guest or something (maybe a login box)

Thanks
Dave
Reply With Quote
  #18  
Old 01-12-2004, 03:00 PM
Jannefant Jannefant is offline
 
Join Date: Dec 2003
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The posted code + the asked stuff "I would like this to say Welcome guest or something (maybe a login box)" ist the hack i´m looking for ... an the links have to redirect to /boardpath/*.php ... instead of /*.php ...

If these options are made ... i can use it ...
Reply With Quote
  #19  
Old 01-14-2004, 06:06 PM
noonespecial noonespecial is offline
 
Join Date: Nov 2002
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any addition to this?
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 03:15 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.07032 seconds
  • Memory Usage 2,298KB
  • 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_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete