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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2003, 01:02 PM
Dark_Angel2 Dark_Angel2 is offline
 
Join Date: Apr 2002
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Login Hack

Hi,

I'm looking for a hack which will allow to me to have a login box to my forums on a non VB PHP page. I would love it to work the same as this hack: https://vborg.vbsupport.ru/showthrea...threadid=37134 but with just the login box.

I've tried to edit that hack to do what I want but I can't get it to work correctly. Can anyone help me out please, it doesn't seem like a huge job and I would be so greatful.

Thanks in advance for any help.
Reply With Quote
  #2  
Old 01-12-2003, 10:43 PM
poi@nwdnb poi@nwdnb is offline
 
Join Date: Sep 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have done this today, the page that I have had the login boxes display on is not even php. Only a plain html form is needed.

Insert this into the HTML output of your page

PHP Code:
<form action="http://yoursite.com/forum/member.php" method="post">
<
b>Your User Name:</b><input type="text" name="username" value="" size="25"><br>
<
b>Your Password:</b><input type="password" name="password" value="" size="25"><br>
<
input type="hidden" name="action" value="login"><br>
<
input type="submit" value="Login!">
</
form
You'll need to change the form tag's action parameter to point to your member.php file.

You can have a look at the template "error_nopermission_loggedout" for reference, this has a similar form on it too.

Hope this helps!
Reply With Quote
  #3  
Old 01-14-2003, 10:41 AM
sbryan's Avatar
sbryan sbryan is offline
 
Join Date: Oct 2002
Location: Melbourne, Australia
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can u then use that somehow to log people into another part of the site? ie use the forum as your membership signup tool and then use the users login details on other parts of the site to access member only content?
Reply With Quote
  #4  
Old 01-14-2003, 10:50 AM
poi@nwdnb poi@nwdnb is offline
 
Join Date: Sep 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If your main site is on the same domain as the forums, you can check for the "bbuserid" cookie. When a user is logged into the forums, this cookie is present and stores the user's id.

So only allow them access if this cookie is present.
Reply With Quote
  #5  
Old 01-14-2003, 10:51 AM
sbryan's Avatar
sbryan sbryan is offline
 
Join Date: Oct 2002
Location: Melbourne, Australia
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ahhhh that may be a workaround... have u seen any examples of this or know of any code anywhere?
Reply With Quote
  #6  
Old 01-14-2003, 10:53 AM
poi@nwdnb poi@nwdnb is offline
 
Join Date: Sep 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have coded it in the last two days, but our main site is in ASP, so that may not be of any help to you.

If you want to see the code i have used, just shout!
Reply With Quote
  #7  
Old 01-14-2003, 11:00 AM
sbryan's Avatar
sbryan sbryan is offline
 
Join Date: Oct 2002
Location: Melbourne, Australia
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what im after is a comments field down the bottom of news items that i post. my site is in php. www.xboxworld.com.au

i could go either way

1.when page loads, detects forum cookie and displays comments text box/form at the bottom of the post, if not detected displays nothing.

2.for comments form under news post have username and login fields with the main comment text field. username and login is validated against the forum DB and allows them to make a comment if they are a member. if not it directs them to the signup forum page.
Reply With Quote
  #8  
Old 01-14-2003, 03:50 PM
poi@nwdnb poi@nwdnb is offline
 
Join Date: Sep 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The way i would probably do it is..

1a. Check the cookie and see if the user is logged in. If the user is logged in, then the comment fields can go up, no problems there.


If the users ISNT logged in:

2a. Display the form that i posted earlier in this thread (with a message saying "login to post a comment" or similar). This form will hand all the authentication duties over to the proper vBulletin scripts (member.php).

2b. Have the login auto-redirect back to the main page, and the user will be back, with the correct cookie, and stage 1a above will occur!

Use this hidden field in your form, this is what the member.php script will re-direct the user to if he logs in successfully:

PHP Code:
<input type="hidden" name="url" value="http://your.site.com/"
Reply With Quote
  #9  
Old 01-14-2003, 08:26 PM
sbryan's Avatar
sbryan sbryan is offline
 
Join Date: Oct 2002
Location: Melbourne, Australia
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for that ill give it a test out this afternoon!
Reply With Quote
  #10  
Old 01-16-2003, 01:50 AM
svoec svoec is offline
 
Join Date: Mar 2002
Location: KY
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I needed this exact code for some other project I was working on --- it rocks!! thanks!!!
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 05:44 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09998 seconds
  • Memory Usage 2,255KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_php
  • (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_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