![]() |
Yet Another vB Login on non-vB Page
This is not a plugin, nor is it a code modification. It is a separate script, so just configure the attached script, FTP it to wherever, and then call it from your browser. Once you test it out, you can edit the script to show whatever content you desire. Look at the code to see where to set your content. If you don't like this script, try mcahill's vB login on a non-vB page here.
If you use this script, click the install button. This allows you to receive update notices, should any be sent. It is also a nice way to say thanks! Fine Print: Obviously, use at your own risk. Support is not guaranteed. This script may not be redistributed! 25 Jul 2005: added $session to make_page_content global list |
Neat, I like how access is so easily controlled by the user group. I did notice that I had to slightly modify how I setup the path to my forums. My forum is in a folder called forums just below my docroot. If my example file is in the docroot (ie, above the forums folder) I had to set the full path as:
PHP Code:
|
One question on setting the usergroups. I can only seem to get it to work if that is the user's primary usergroup. Can it also check "Additional Usergroups"?
Thanks! |
@westpointer: try the attached...
|
Quote:
I've modified the code a little, setting a variable depending on whether or not the user is a member of the group: PHP Code:
PHP Code:
|
k, i like the look of this script. My problem is 2 fold, I don't need (or want) any usergroup support at the moment, I assume if i remove lines 95 -> 110 then this will solve that problem.
My 2nd problem is a touch more complex. I only want to display the welcome box (and be able to style it as I see fit). Looking at the code though it's calling the whole $header variable which is already made up by vb. What would I replace that with to meet my needs? |
@Snetty: You could just set UGS to all usergroup IDs to bypass the login page. As for what you want to display, just set $src_output as shown in the script.
|
How difficult would it be to expand this to something a little more complex?
What I'd like to see is something that:
|
@FASherman: you can do all of that. I was writing another example to show but haven't finished it yet. Thought I'd better fill in this post though. :speechless:
|
Is it possible to only show the small box that is on the right side of the navbar.
I want to extract data from the $navbar who do I do that? |
I want to put the small login box that is on the right side inside the navbar on an external page.
I have tried using your script but it just uses the whole navbar with the variable $navbar there is no way to extract it from the $navbar because it just prints the whole navbar at ones. Here is a screenshot of what I would like to extract: https://vborg.vbsupport.ru/ |
Will this work on version 3.0x ?
|
Quote:
Code:
define('VBN','307'); |
@Mimoun: To get part of the navbar, like in the attached picture, see the attached ZIP file.
|
Thank you very much Calorie I will try it out right now.
|
I have tried the script on my test forum and it works there is only 1 problem.
When I check my forum it shows the small login box 2 times. Is it possible to get the small login box on an external page without including it in the navbar template? Thanks again for making the script. |
@Mimoun: Try the example2.php file by itself. In the example2 script, do you see only one small login box?
|
Yes in the example2.php I see only one login box but on my forum I have the whole navbar + the small login box:
Here is a screenshot: http://www.freewebsitetemplates.com/...per/navbar.gif |
@Mimoun: Looks like $navbar is printed twice, once before and once after the eregi_replace. Check the template for two $navbar variables.
|
Sorry I misunderstood the readme file I placed the whole code in my navbar.
I checked the source code and understand now how you did it. You just get the whole navbar and strip down everything except the small login box part very clever. Could it be possible to place the small login box part in a new template and call the template loginbox so you can give it his own style without damaging the loginbox in the navbar? Thanks for your help. |
In the readme replace:
Code:
<!-- small login box --> Code:
<br /><table class=\"tborder\" cellpadding=\"$stylevar[cellpadding]\" cellspacing=\"$stylevar[cellspacing]\" border=\"0\"><tr> Code:
<!-- / small login box --> Code:
</tr></table><br /><br /> then use the following: Code:
eval('$smallloginbox = "' . fetch_template('smallloginbox') . '";'); You can also add smallloginbox to $globaltemplates if you want to cache the template. |
It works perfect now thank you very much.
If you have a website that needs a new design just pm me and I will make one for you for free. That's my way of saying thanks. |
After a lot of editing the script I got it fully customized.
You can see it working on my site . Thanks again calorie I have learned a lot from your script. |
Quote:
|
Hi,
I?ve set up example2, works fine standalone. But once it?s included from another page I get the following error message: Fatal error: Call to undefined method stdClass::query_first() in /var/www/community/messageboard/includes/functions.php on line 938 How come? take care Flint Stelter http://www.ddas.de |
@ddas: It's not finding what it needs, but not sure what you mean by including it in another page. The script is meant as standalone so you can add vB type pages wherever you want by simply editing the script.
|
Hiho, can someone tell me how to get the login correct?
i've tryed the script and it always redirects after the login to domain.tdl/login.php.. it should be domain.tdl/board/ or something like this regards, dennis |
Quote:
PHP Code:
Not a good way to do it, but it only works like this. |
@Disi: Check the allowed usergroups. If you want both primary and secondary groups, do this.
|
Quote:
|
@Disi: Does this happen when you upload example.php and try to login?
|
Quote:
|
@Disi: Okay, as example.php works, it seems that whatever edits you made to the file are causing the issue, but without knowing the edits, I cannot say why you have an issue, so just recheck your edits.
|
Quote:
|
This is great, I'm still kind of new to the whole world of vbulletin and php so I have a question and I'm not sure if it can be done with your script or not.
On my website, i have an members images area that you must login to view the images. I'm also running vbulletin as well. What I'm wondering, is it possible to use this script as a login page to the images area and have it authenticate the users in the vbulletin database? Basically, a user registers for an account on my site, the registration process is actually the vbulletin registration process, so the username/password gets added to the vbulletin database tables, I want to be able to use that login to access either the images gallery or the forum, but there will be a seperate login page for the images and then the standard vbulletin forum login. Thanks |
@mattfl: It is possible to 'wrap' other PHP scripts in vB authentication, it may or may not take some time and energy, and you might still need to block direct requests to images.
|
Quote:
|
Try out the example script, stick it somewhere outside your forum directory, and see if it does like you want, as that is probably the best way for you to evaluate it. If you like it, then you'll need to wrap the PHP gallery files some way like username is wrapped in the example script, assuming you want to protect PHP files outside of your forum directory while having the look of a vB page. If you are just looking to determine whether someone is logged in, nothing fancy, then you can stick the following atop the gallery files, and this will work fine for those users who accept cookies:
Code:
define('FWD','/full/path/to/forum'); // <-- set this !!! |
This is a fine script, however it doesn't replace replacement-variables. Could this be please included too? It's just that we have a lot replacement-variables in our forum.
|
I cannot get this working properly on vb3.5
even if I remove header, footer and navbar from the code below - they still show up. I want to create a small login box like the one used in myvbindex to display on a non vb page via an Iframe... any ideas? $src_output = <<<END $stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> $headinclude <title>$vboptions[bbtitle]</title> </head> <body onload="$onload"> </body> </html> END; |
All times are GMT. The time now is 03:08 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|