Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 07-23-2002, 05:50 PM
Martaigne Martaigne is offline
 
Join Date: Apr 2002
Location: Atlanta, GA
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default User Login for non vB pages

Okay, I've searched and found two small hacks for trying to add a user login or welcome panel to non-vB pages. Neither of them suit my purposes. The first was overly simple, just checking the login against the database and returning to the page with no user info. The second was more complicated, but was too much, being the entire welcome panel; additionally I couldn't get it to work with my site directory structure.

All I'm looking for is this. A simple file I can use as an include that will ask a user to login, register, or logout depending on their vB cookie. It'll say [b]'You are logged in as 'username'. logout'[b] if they are logged in, and have the form to login or register if they aren't. That simple.

Does anyone have anything this small and simple already? I've seen plenty of sites that use vB database for login, but only those two hacks here.
Reply With Quote
  #2  
Old 07-23-2002, 06:13 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it may not help you getting a welcome panel, but I guess it can help the rest:

https://vborg.vbsupport.ru/showthrea...threadid=36419

Take a look..
Reply With Quote
  #3  
Old 07-23-2002, 06:26 PM
Martaigne Martaigne is offline
 
Join Date: Apr 2002
Location: Atlanta, GA
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, I looked at that late last night while I was looking for different login solutions. Nice setup, but unfortunately doesn't suit my purposes either. Most of what I'm making is from scratch but I don't have enough knowledge of how vB works to make a stupid simple login.
Reply With Quote
  #4  
Old 07-23-2002, 06:31 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok then:

if you add line:
PHP Code:
require('./global.php'); 
in the begining of your PHP file, you can then check his status like

PHP Code:
if ($bbuserinfo[userid]>0) {echo "logged in";}
else {echo 
"not logged in or unregistered";} 
Reply With Quote
  #5  
Old 07-23-2002, 06:43 PM
Martaigne Martaigne is offline
 
Join Date: Apr 2002
Location: Atlanta, GA
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I also found this instruction in a search but I can't for the life of me figure out what half of it means! lol

"Val>

Use the $ logincode

Then use the forum home login template to display what you want for when they are logged out. (Keep normal for the login)

And use forumhoemlogout for what you want to display when they are logged in. Ala the box with their user info. Just be sure to include a link to logout in the user box.

This is what I have always done."
Reply With Quote
  #6  
Old 07-23-2002, 06:45 PM
Martaigne Martaigne is offline
 
Join Date: Apr 2002
Location: Atlanta, GA
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Logician
ok then:

if you add line:
PHP Code:
require('./global.php'); 
in the begining of your PHP file, you can then check his status like

PHP Code:
if ($bbuserinfo[userid]>0) {echo "logged in";}
else {echo 
"not logged in or unregistered";} 

Hey, this is pretty close to what I need. If I can get it to return the username in that message, and perhaps the userid somewhere so I can use it to check permissions on the admin side, it would pretty much be perfect.
Reply With Quote
  #7  
Old 07-23-2002, 06:50 PM
Martaigne Martaigne is offline
 
Join Date: Apr 2002
Location: Atlanta, GA
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I may have the template I need. Will this work by itself? Or do I just need to include globals.php?

PHP Code:
<smallfont><a href="member.php?s=$session[sessionhash]&action=markread">Mark All Forums Read</a> | <a href="showgroups.php?s=$session[sessionhash]">Forum Leaders</a></smallfont>

<
table border="0" cellpadding="0" cellspacing="0">
<
form action="member.php" method="post">
<
tr>
    <
td nowrap><smallfont><b>Not cookied?</b><br>Login with username and password:</smallfont></td>
</
tr><tr>
    <
td nowrap><input type="hidden" name="s" value="$session[sessionhash]">
    <
input type="hidden" name="action" value="login">
    <
input type="text" class="bginput" name="username" size="7">
    <
input type="password" class="bginput" name="password" size="7">
    <
input type="submit" class="bginput" value="Login!"></td>
</
tr>
</
form>
</
table
Reply With Quote
  #8  
Old 07-23-2002, 06:58 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

to post a template:

create it as a new template inside your admin CP then call it in your code like that:

eval("dooutput(\"".gettemplate("NAME_OF_YOUR_TEMPL ATE")."\");");

To refer user's username you can use variable $bbuserinfo[username] in your code (after "require global.php" line)
Reply With Quote
  #9  
Old 07-23-2002, 07:44 PM
Martaigne Martaigne is offline
 
Join Date: Apr 2002
Location: Atlanta, GA
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, I think this may be enough for me to work with for the time being.
Reply With Quote
  #10  
Old 07-23-2002, 08:06 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default



If you need any more help, holler!

Satan
Reply With Quote
Reply

Thread Tools
Display Modes

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:35 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.04489 seconds
  • Memory Usage 2,269KB
  • 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
  • (5)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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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