The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Can someone please tell me what function I would execute to display the standard prompt to require the user to login or register? I want to call this from a javascript function in an html forum block.
The display I want to use is the message box with the normal system message: You are not logged in or you do not have permission to access this page. This could be due to one of several reasons: You are not logged in. Fill in the form at the bottom of this page and try again. You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system? If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation. Thanks. |
#2
|
|||
|
|||
![]()
I believe that's the message that you get when you call the php function print_no_permission(); But you can't call it directly from javascript, and there is no php script that will simply call that function (although there are probably a number of them that would display that if the user was logged out). I suppose you could write one, or use a plugin in misc.php, but to be honest I'm having trouble seeing what would happen after that message was displayed (the user would log in obviously, but then where would it take you?).
|
#3
|
|||
|
|||
![]()
Hopefully back to where you were before the message was displayed
|
#4
|
|||
|
|||
![]()
OK, I guess that does make sense. And if you call print_no_permission() it should display the message you want, and it then returns to the page it was called from. But I'm not sure how you'd use that because if it was part of the page that you're displaying, you'd never see it without being logged in.
I guess you're trying to make a forum block that lets you log in or something like that? |
#5
|
|||
|
|||
![]()
I have a forum block with option buttons. If the visitor tries to use one of these buttons without being signed in then I want to display the message.
Just like in these forums when you try to post and you're not logged in. You get a dialog box asking you to log in. After you do it takes you to the posting screen. That is what I'm trying to do. |
#6
|
|||
|
|||
![]()
OK, then I think you could do something like have your javascript call the same page but add a parameter like "&forcelogin=1" or something like that. Then at the top of your script for that page (after global.php is included) put something like:
Code:
if ($_GET['forcelogin'] AND $vbulletin->userinfo['userid'] == 0) { print_no_permission(); } I guess if you're using a forumblock then you're talking about the forum.php page? Then you can probably put the above code in a plugin using hook forumhome_start. |
#7
|
|||
|
|||
![]()
Actually I just want to call the routine from java script in my forum block without a page refresh and display the "you need to log in" message, have the user log in then they can try the forum block option buttons again.
Thanks for letting me know the routine name. I should be able to plug that into my code. |
#8
|
|||
|
|||
![]()
Is there a part of the vb code that works like you want (i.e. lets you log in without refreshing the page)? If so we can find it and figure out how it works.
You could have your js target another window and log in in a popup, but than you'd need some way for your js to know if it was successful or not. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|