PDA

View Full Version : Integration with vBulletin - Deluxe vB User login and access control on non vB pages


Billspaintball
21 Mar 2008, 12:13
Hack Description

This is the deluxe version of the user authentication and access control system I use on the non vB pages on my website.
For the simple no frills version

This uses the vB 3.7 login system to log you in and out. It allows you to move between your forums and other pages on your site while remaining logged in.

It allows you to do things such as restrict pages by usergroup, display different content depending on a user being logged in or not.
For example, you can have banner Adds displying to non members only, and/or let members access to specific content.

It also displays the logged in users Avatar, number of unread PM's, New posts since last visit, total posts and total threads.
It also allows you to specify a maximum Avatar size, and resize any avatars larger than that, while keeping their height/width ratios in proportion!
Its very handy if you allow large avatars, but want a small format display on your non forum pages.

If the user is not logged in, a login box is displayed, along with total posts and total threads in the forums.

I will try and offer support, but work and family commitments mean I dont have much free time.

This code is a mix of my own, and pieces I have used from other hacks that are floating around.


This script has been confirmed as working on

vB 3.7 RC1


Known Bugs
Will not display Avatars correctly if they are kept in the file system (database avatars are fine)

Change log

Version 3.00 (21st March 2008)

Initial release for vB 3.7.x



Click on Install
If you have this script installed then please click on the install link because;

You will get notified if any security issues are reported.
You will get notified when there are any upgrades to this script
It gives me a warm fuzzy feeling and motivates me to develop more :)


Donations
First of all, to be clear. This script is 100% free.

However if you feel an urge to donate I'm not going to say no. :)
Donations can be made at [url]http://www.billspaintball.com/vb3/bd_donate.php (http://www.vbulletin.org/forum/showthread.php?t=173693look here.[/URL)

Billspaintball
21 Mar 2008, 12:14
Usage

The hack is pretty useless without some usage instructions so here they are.

You can resize avatars, keeping them to their origional proportions to make them fit your prefered layout.
For instance, if you are using a fixed width column layout.
Do this by editing lines 5 and 6 in login_inc.php
These values are in pixels.

We can use conditionals to hide or display depending on a number of things such as
Logged in or out status,
or restrict to members of a specific usergroup.

We do this by using conditionals in php tags where the normal content of a webpage would go.


If you want something only accessable to a certain usergroup, use this code in your webpage. This example is only visible to members of usergroup 6.

<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
{
echo "This is only visible to people in usergroup 6";}
?>


You can use a simple variation of this to restrict entire pages to a certain usergroup.
For example,

<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
{
echo "Have stuff for here";
} else {
echo "You do not have permission for this page"; }
?>



Another use is to display different content to users depending on if they are logged in or not. For example

<?php
If ($vbulletin->userinfo['userid']!=0)
{
echo "Your logged in so we can display this";
} else {
echo "Your not logged in so we display this";
}
?>


Another use is to restrict advertising to people who are not logged in.
For example

<?php
if ($vbulletin->userinfo['userid'] <1) { echo"add code stuff goes here"; }
?>


Of course you can play around with conditionals to do a whole range of things, these are just brief example snippets.



Troubleshooting

If your reading this chances are you are having problems.

Here are some common causes and fixes.


Headers already sent or cookies already sent errors. Chances are that there is something, even just a space before the 4 lines of code in part 1. Edit this and ensure that there are no spaces before it.



Path problems are the next biggest problem. Your paths must be exact else it will not work. Double check that all paths are correct.
If you are unsure what the path is place the following code in a page all by itself.

<?php
echo getcwd();
?>
Name this file something like path.php then upload it to your website, browse to it and it will show you the exact path to your sites root.



Appears to login ok, but wont show you as logged in
Often caused by the vB cookie path setting.
To fix log into you vB admin area;
AdminCP -> vBulletin Options -> Cookies and HTTP Header Options -> Path to Save Cookies

Change

'Suggested Settings' dropdown from '/forums/' to '/' or 'yourdomain.com'



Subdomains and cross site logins
This is a known issue with many scripts (not just this one), sometimes fixable sometimes not. Its caused by vB, PHP and your hosts security measures.

First change your "cookie domain" settings.
vB Admin > Control Panel > Cookies and HTTP Header Options > Cookie Domain
Change it from being blank to
.yourdomain.com

You may need to set a post referrer in your whitelist.
vB Admin > Control Panel > General Settings > Post Referrer Whitelist
Instructions on what to enter are listed where you change this setting.

That should fix it if your forum is a subdomain.

If that fails then,
Open your /forum/login.php file and look for this code:
error_reporting(E_ALL & ~E_NOTICE);
Below that add
define('SKIP_REFERRER_CHECK', true);
Now save this and overwrite the file on the server with this one.

A further reported work around is to make a copy of the required Forum Forum files on your second Server. Then you must set in the config.php on the second server to use the ip of the server with which the VB-Database is running.



404 Error on expiring passwords
Cause - When redirected for expired password you are redirected to the directory that your login script is located in, not your forums root.

Fix - Edit phrase called passwordexpired

Your current phrase should be
Your password is {1} days old, and has therefore expired.<br />
<br />
Please change your password using <a href="profile.php?{2}do=editpassword">this page</a>.

change it to

Your password is {1} days old, and has therefore expired.<br />
<br />
Please change your password using <a href="../forums/profile.php?{2}do=editpassword">this page</a>.

where ../forums/ is your forums directory.



Still got problems?
It may be a conflict with somthing already in your site.
To check this we can just make a simple page.
Call it test.php and use just this code in it.
(Make sure there is no whitespace before the 1st line)

<?php
$curdir = getcwd ();
chdir('/path/to/your/forums');
require_once('/path/to/your/forums/global.php');
chdir ($curdir);
?>
<html>
<body>
This is a heading<br />
This is some more stuff <br />
And another line<br />
You get the idea<br />
Just place stuff as you normally would with HTML<br />
I use CSS to style and position on my site fwiw<br />
<br />
How about we put the login box right under here?<br />
<br />
<?php
require_once('/path/to/your/login_inc.php');
?>
</body>
</html>

Naturally, change paths to fit your forums, then upload it.
Browse to it and run it.

KURTZ
21 Mar 2008, 12:17
Hi Bill, some shots?

Billspaintball
21 Mar 2008, 12:30
Hi Bill, some shots?

Added.
See the screenshots section above.

KURTZ
21 Mar 2008, 12:48
Added.
See the screenshots section above.

thx :)

NeuroLancer
21 Mar 2008, 12:54
This is really easy to configure and use, its working great right out of the box, thanks.

Hornstar
21 Mar 2008, 23:05
Just wondering if you are working on this bug, or if it is not possible: Will not display Avatars correctly if they are kept in the file system (database avatars are fine)

Billspaintball
21 Mar 2008, 23:38
Just wondering if you are working on this bug, or if it is not possible: Will not display Avatars correctly if they are kept in the file system (database avatars are fine)
Not actively.
I did try and get around it in the past, but never came up with a workable solution.

projectego
22 Mar 2008, 00:03
/me clicks install :)

snunhuck
22 Mar 2008, 21:10
Adding PHP Code:

<?php
$curdir = getcwd ();
chdir(http://community.thinkteen.co.uk);
require_once('http://community.thinkteen.co.uk/global.php');
chdir ($curdir);
?>

breaks the page's layout.

Example here:

http://members.thinkteen.co.uk (original page)
http://members.co.uk/m2.php (Page broken + no login box)

Billspaintball
22 Mar 2008, 22:30
Try changing
chdir(http://community.thinkteen.co.uk);
to
chdir('http://community.thinkteen.co.uk');



Adding PHP Code:

<?php
$curdir = getcwd ();
chdir(http://community.thinkteen.co.uk);
require_once('http://community.thinkteen.co.uk/global.php');
chdir ($curdir);
?>

breaks the page's layout.

Example here:

http://members.thinkteen.co.uk (original page)
http://members.co.uk/m2.php (Page broken + no login box)

snunhuck
23 Mar 2008, 04:45
still broken :(

C.Birch
23 Mar 2008, 15:08
Try changing
chdir(http://community.thinkteen.co.uk);
to
chdir('http://community.thinkteen.co.uk');

Should that not be a server path and not a address? eg it should be '/home/username/public_html/

snunhuck
23 Mar 2008, 17:27
hmm, I'll see if it works :)

<?php
$curdir = getcwd ();
chdir('/home86a/sub005/sc46797-PRWR/community');
require_once('/home86a/sub005/sc46797-PRWR/community/global.php');
chdir ($curdir);
?>

Nope :( Still broken.

here's the page I'm trying to implement: http://members.thinkteen.co.uk/m2.html It's meant to look like this: http://members.thinkteen.co.uk

Billspaintball
24 Mar 2008, 12:53
here's the page I'm trying to implement: http://members.thinkteen.co.uk/m2.html

This mod only works with php pages, not html pages.

snunhuck
24 Mar 2008, 14:52
Good point - I forgot to do it :) and here's the new error:

Warning: getimagesize() [function.getimagesize]: Unable to access /mounted-stoarage/home86a/sub005/sc46797-PRWR/community/image.php?u=1 in /mounted-storage/home86a/sub005/sc46797-PRWR/members/login_inc.php on line 35

Warning: getimagesize(/mounted-stoarage/home86a/sub005/sc46797-PRWR/community/image.php?u=1) [function.getimagesize]: failed to open stream: No such file or directory in /mounted-storage/home86a/sub005/sc46797-PRWR/members/login_inc.php on line 35

The forum URL is http://community.thinkteen.co.uk - (aka. on a subdomain)

thegabriel
24 Mar 2008, 20:18
Hi,

I had implemented this code and it was working fine. My password had presently expired and my homepage looks scrambled. It is not redirecting to the forum page where it shows password expiry message.

If I go to the forums page, by typing http://www.example.com/forums then the message shows up.

Can you please guide me on how I could rectify this error?

Thanks,
G

Billspaintball
25 Mar 2008, 06:21
Hi,

I had implemented this code and it was working fine. My password had presently expired and my homepage looks scrambled. It is not redirecting to the forum page where it shows password expiry message.

If I go to the forums page, by typing http://www.example.com/forums then the message shows up.

Can you please guide me on how I could rectify this error?

Thanks,
G
Part 5 of the troubleshooting guide should help here.
http://www.vbulletin.org/forum/showpost.php?p=1470623&postcount=2

thegabriel
25 Mar 2008, 12:53
Hi,

Which program has this word "passwordexpired"? I am using VB version 3.6.8.

Please help.

Thanks,
G

thegabriel
25 Mar 2008, 14:21
Hi,

Which program has this word "passwordexpired"? I am using VB version 3.6.8.

Please help.

Thanks,
G

Just found where the phrase was ....
It was in the table vb_phrase (phrase_id = 101362)
:)

txsbmw
25 Mar 2008, 15:48
Anyone know how to make this code validate with:
http://validator.w3.org/
under XHTML 1.0 Transitional?

Almost all of my errors are coming from this one mod on my non vb pages.

davide101
01 Apr 2008, 16:47
I have two tips for anyone using this system.

First, it's to change the wording of the private messages phrase to anything you want. I have it set to say "Private messages, "1 new message", and "2 new messages". Here's the code for that (it goes in the include):

// Display PM Details and generate link to PM box
$pmremove = array("Unread ", "<strong>", "</strong>");
$unreadPM = str_replace($pmremove,"",$vbphrase[unread_x_nav_compiled]);
if ($unreadPM==1) {
echo "<a id=\"unreadpm\" href=\"".$forumpath."private.php?$session[sessionurl] \">1 new message</a>";
} else {
if ($unreadPM>1) {
echo "<a id=\"unreadpm\" href=\"".$forumpath."private.php?$session[sessionurl] \">" . $unreadPM . " new messages";
} else {
echo "<a href=\"".$forumpath."private.php?$session[sessionurl] \">Private Messages</a>";
}
}


Similarly, it's easy to show new posts with the proper grammatical syntax. In other words, have it say 'No new posts' '1 new post' or '2 new posts'.

// finds number of new posts
$newposts = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post AS post " . iif($vbulletin->options['threadmarking'], 'LEFT JOIN ' . TABLE_PREFIX . 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' . $vbulletin->userinfo['userid'] . ')') . " WHERE dateline >= " . $vbulletin->userinfo['lastvisit'] . iif($vbulletin->options['threadmarking'], ' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)'));
$newposts = vb_number_format($newposts['count']);

if ($newposts < 1) {
echo "<a href=\"".$forumpath."search.php?$session[sessionurl]do=getnew\">No new posts</a><br />";}

if ($newposts == 1) {
echo "<a href=\"".$forumpath."search.php?$session[sessionurl]do=getnew\">$newposts new post</a><br />";}

if ($newposts > 1) {
echo "<a href=\"".$forumpath."search.php?$session[sessionurl]do=getnew\">$newposts new posts</a><br />";}


Hope this helps someone. It took me a little bit of tinkering to get it just right.

Triky
04 Apr 2008, 13:03
I can't get it work.

Notice: Undefined index: HTTPS in c:\programmi\easyphp1-8\www\vbtest\includes\class_core.php on line 1643

Notice: Undefined index: HTTPS in c:\programmi\easyphp1-8\www\vbtest\includes\class_core.php on line 1643

Notice: Undefined index: HTTP_REFERER in c:\programmi\easyphp1-8\www\vbtest\includes\class_core.php on line 1670




Unable to add cookies, header already sent.
File: c:\programmi\easyphp1-8\www\vbtest\includes\class_core.php
Line: 1643

davide101
10 Apr 2008, 21:30
Does anyone know how to access the profile url? It's not located in $vbulletin->userinfo and I'm sure where else to look. I'd like to link the avatar there.

Billspaintball
27 Apr 2008, 06:39
I have two tips for anyone using this system.

First, it's to change the wording of the private messages phrase to anything you want. I have it set to say "Private messages, "1 new message", and "2 new messages". Here's the code for that (it goes in the include):

Hope this helps someone. It took me a little bit of tinkering to get it just right.

Thanks,
I will update the next version with those improvements.

Billspaintball
27 Apr 2008, 06:40
I can't get it work.
See item 1 in the troubleshooting guide.
http://www.vbulletin.org/forum/showpost.php?p=1470623&postcount=2

Ryan Ashbrook
30 Apr 2008, 05:51
I got file based avatars to work.

In the login_inc.php file find:

$file = $forumpath . "image.php?u=$userid";

And replace it with:


if ( $vbulletin->options['usefileavatar'] == 1 )
{
if ( $vbulletin->userinfo['avatarid'] == 0 )
{
$file = $forumpath . $vbulletin->options['avatarurl'] . "/avatar" . $userid . "_" . $vbulletin->userinfo['avatarrevision'] . ".gif";
}
else
{
// Unfortunately, need to query the database for the avatar, will work on array caching all avatars later.
$query = $db->query_first ( "SELECT * FROM " . TABLE_PREFIX . "avatar WHERE avatarid = " . $vbulletin->userinfo['avatarid'] . " ; " );
$avatar = $db->fetch_array ( $query );
$file = $forumpath . $avatar['avatarpath'];
}
}
else
{
$file = $forumpath . "image.php?u=" . $userid;
}

Individual users may need to tweak the avatar paths based on their settings, however this will probably work for most.

Ryan Ashbrook
30 Apr 2008, 05:55
Does anyone know how to access the profile url? It's not located in $vbulletin->userinfo and I'm sure where else to look. I'd like to link the avatar there.

Use this:

echo ( "<a href=\"" . $forumpath . "member.php?u=" . $vbulletin->userinfo['userid'] . "\">avatar image code here</a>" );

Javi_gray
30 Apr 2008, 06:22
What would I do if I wanted it to show friend requests in addition to private messaging?

Ryan Ashbrook
30 Apr 2008, 06:54
What would I do if I wanted it to show friend requests in addition to private messaging?

Add this:

echo ( "You currently have <a href=\"" . $forumpath . "profile.php?do=buddylist\">" . vb_number_format ( $vbulletin->userinfo['friendreqcount'] ) . "</a> friendship requests." );

Javi_gray
01 May 2008, 02:58
Add this:

echo ( "You currently have <a href=\"" . $forumpath . "profile.php?do=buddylist\">" . vb_number_format ( $vbulletin->userinfo['friendreqcount'] ) . "</a> friendship requests." );
where do you find those phrases? are they located in one of the templates?

Ryan Ashbrook
01 May 2008, 04:13
No, none of the code I have posted so far is contained in any templates, only in the file called login_inc.php the mod author provided. (The file you use for the main site)

Javi_gray
01 May 2008, 04:30
Oh ok. Is there anyway to get all the notifications to show up. Like the ones that come from the dropdown menu.

croft
02 May 2008, 13:33
How can i fix it so when you are logged in it looks like on the forum ? 'Laying down not standing up' ?

And thanks for this :)

Ryan Ashbrook
03 May 2008, 00:59
Oh ok. Is there anyway to get all the notifications to show up. Like the ones that come from the dropdown menu.

Sorry, I don't know, time doesn't permit me to dive into the workings of the notifications menu yet.

How can i fix it so when you are logged in it looks like on the forum ? 'Laying down not standing up' ?

And thanks for this :)

If you mean the table, then that all depends on your website's design. You should be able to reference vBulletin's own navbar for examples, shouldn't be too hard.

croft
08 May 2008, 12:48
Sorry, I don't know, time doesn't permit me to dive into the workings of the notifications menu yet.



If you mean the table, then that all depends on your website's design. You should be able to reference vBulletin's own navbar for examples, shouldn't be too hard.

Actually its not that easy, not for me anyway. My navbar template looks nothing like this php file in way o layout or coding :( Im not a coder guy and could use some help with this if possible ?

ramsayeg
08 May 2008, 20:51
I included global.php and I suddenly had an error with CuteNews:

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/content/xxx/html/xxx/private/v3beta/newsconf/inc/functions.inc.php on line 43

The news showed, but this error came up at the top of the page. Is anyone aware of anything?

Update: Well, looks like I have ANOTHER problem and this is about the cookies it seems, as it logs me in but doesn't show. I have using different domains for the site/forums, will it cause me problems to log in in the forums, if I enter a custom Cookie Domain of my website's domain?

ramsayeg
09 May 2008, 19:11
Sorry to bump but, can anyone help me? (read previous post)

steveheinsch
12 May 2008, 20:23
How does this work with vb 3.7 GOLD? I assume fine, but just wanted to check.

Ryan Ashbrook
13 May 2008, 03:02
Actually its not that easy, not for me anyway. My navbar template looks nothing like this php file in way o layout or coding :( Im not a coder guy and could use some help with this if possible ?

I'm not great with HTML, sorry.

I included global.php and I suddenly had an error with CuteNews:

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/content/xxx/html/xxx/private/v3beta/newsconf/inc/functions.inc.php on line 43

The news showed, but this error came up at the top of the page. Is anyone aware of anything?

Unsure, I don't remember htmlspecialchars() being used in it, unfortunately I don't have time to test.

Update: Well, looks like I have ANOTHER problem and this is about the cookies it seems, as it logs me in but doesn't show. I have using different domains for the site/forums, will it cause me problems to log in in the forums, if I enter a custom Cookie Domain of my website's domain?

I'm unsure of this as well, Cookies are not my area of expertise.

How does this work with vb 3.7 GOLD? I assume fine, but just wanted to check.

Works perfect, I'm using it right now. :)

johan204
15 May 2008, 07:10
Is it possible to secure pages that are fysical on a different server?

Billspaintball
15 May 2008, 13:17
I got file based avatars to work.


Individual users may need to tweak the avatar paths based on their settings, however this will probably work for most.


Nice :)

I had not quite worked that one out.

Will update the next version with this fix.

Billspaintball
15 May 2008, 13:19
I have using different domains for the site/forums, will it cause me problems to log in in the forums, if I enter a custom Cookie Domain of my website's domain?
Most likely.
See the troubleshooting guide - 2nd post in this thread, for things to try, that may help.

Billspaintball
15 May 2008, 13:19
How does this work with vb 3.7 GOLD? I assume fine, but just wanted to check.

Sure does :)

davide101
16 May 2008, 17:37
First, I adore this mod and have been using it for years to control advertising and have universal site banner that displays avatars, pms, and other goodies to logged in members.

I would be a ecstatic if I can find a way to show users browsing non-vb pages in Who's Online. I don't care if it says "Unknown Location", although ideally I will write a plugin that says "Browsing the rest of the site" or something generic. Then I can add a blurb to my universal header that says "x people browsing the site, x chatting live" (updated via cron to reduce load, of course).

Is this possible? I've searched extensively on multiple occasions but have never come across code that does this. If not, are there other mods, code tidbits, or pointers that could get me going in the right direction? I have a feeling that putting this type of information on the site would increase our stickiness for search engine traffic.

crippon
20 Jun 2008, 07:06
I get a error Fatal error: Call to a member function query_first_slave() on a non-object in /home/wonderfu/public_html/animesuteki.com/forum/includes/functions.php on line 1270
This is on wordpress header.php

fariborz
12 Aug 2008, 22:07
This error for what?
Fatal error: Call to a member function query_first_slave() on a non-object in /home/*Censored*/public_html/forum/includes/functions.php on line 1928
Yes, I'm use wordpress too

snunhuck
25 Aug 2008, 23:06
Fatal error: Call to a member function query_read() on a non-object in /home/services/public_html/login_inc.php on line 151

I get that :S

nic_net
10 Sep 2008, 09:55
Installed. Thanks!

nic_net
10 Sep 2008, 10:20
Is possible to show the number user and guest online?

Thanks

arakasi
13 Sep 2008, 18:16
Hm why "if ($vbulletin->userinfo['usergroupid'] == '6,2' )" doesn't work?

jonah1892
24 Sep 2008, 13:38
was wondering is it possible to get this to automatically redirect the user to the forums once they have logged in on this page

been trying alsorts but can not figure it out at all

lsatblu
16 Oct 2008, 21:45
Is anyone able to tell me if they are using with script with a cms? I wanted to use it with Expression Engine but this script and that script don't get along.

Can anyone point me in the direction of a good cms that works with this login script?

Thanks.

steveneff
17 Oct 2008, 14:46
Great mod, my fav so far.

I have this almost working with wordpress, the only problem being when it redirects back to wordpress it doesn't seem to check login status. Works great on my other pages.

I would be a ecstatic if I can find a way to show users browsing non-vb pages in Who's Online. I don't care if it says "Unknown Location", although ideally I will write a plugin that says "Browsing the rest of the site" or something generic. Then I can add a blurb to my universal header that says "x people browsing the site, x chatting live" (updated via cron to reduce load, of course).

Try this, It works but shows all pages that are named index.php as "Viewing Index" in the forum root. This may be a vb thing, if anyone has a fix it would be perfect.

<?php
$curdir = getcwd ();
chdir('/path/to/forums');
$phrasegroups = array();
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array();
require_once('/path/to/forums/global.php');
chdir ($curdir);
exec_shut_down();
?>

psychotica
28 Oct 2008, 05:40
For some reason, after trying the troubleshooting steps, the mod still shows that I'm logged in even if I'm not and it won't log me in through the php page on the website even after I've logged out on the forums.

coinwash
05 Nov 2008, 02:27
Fixed

steveneff
12 Nov 2008, 19:14
I haven't fully tested this and I'm no vbulletin expert but so far it works.

In the login box code find
if ($vbulletin->userinfo['userid']!=0) {


change to

global $vbulletin;
if ($vbulletin->userinfo['userid']!=0) {



It works the same for the other code snippets like no ads for members below.


<?php
global $vbulletin;
if ($vbulletin->userinfo['userid'] <1) {
?>
your ad code here
<?php
}
?>


note: I have Wordpress/Vbulletin Bridge installed so global.php is already called. if you dont and this doesn't work for you try adding the requre once code to the top of the wordpress index.php

AzzX
22 Nov 2008, 11:56
Thanks for that steveneff.

I might try making a widget for this.

MadsK
27 Nov 2008, 20:40
This might be a stupid question, but where do i put all this code in this file?

FanJournal
27 Nov 2008, 21:36
This is a great mod I've been looking for a while now. I'll be sure to tell you how smoothly I configure it.

ViciousCode
29 Nov 2008, 01:32
i get the same error

Fatal error: Call to a member function query_read() on a non-object in /home/services/public_html/login_inc.php on line 151

ptiteuf
17 Dec 2008, 11:27
Hello,
grieve for English but it was translated with google, voila I have a vBulletin license and your script "vB Deluxe User login and access control on non vB pages" because I'm interested me was that the root of my site there I have a system that manages the login. could you tell me if your latest version works for vBulletin 3.7.4 pl1. and say the modifications because I'm new to php.

Thank you in advance

reimic
03 Jan 2009, 17:00
I always get

Fatal error: Call to a member function query_read() on a non-object in /var/www/******/blog/login_inc.php on line 152

If someone could fix that for me, i am willing to pay! Please consider me! apfelphone @mac.com

Vaupell
09 Jan 2009, 00:00
just testing and helping a guy out, cause im a asp guy..
but i got it working on a test page..

http://www.evisystems.org/test.php

running on a win2k box with php 5 something..

dont use all those ///// on a windows server.
apache perhaps,, baah who uses that.. (Just kidding. ) :p


<?php
$curdir = getcwd ();
chdir('yourforumfolder');
require_once('yourforumfolder/global.php');
chdir ($curdir);
?>

edit yourfolder url.

Howewer its only really usefull when u add your profile img and such..
missing a few pointers in the readme, but it works.. Nice job..

Works on 3.8 gold - MArked as installed cause i love the mod!

Wstar
19 Jan 2009, 16:55
I am having trouble with this. I have added the following code

$curdir = getcwd ();
chdir('/nfs/c02/h04/mnt/40498/domains/dev.scotthermanfitness.com/html/forum');
require_once('/nfs/c02/h04/mnt/40498/domains/dev.scotthermanfitness.com/html/forum/global.php');
chdir ($curdir);

When I load the page up, it goes right to the forum page telling me im not logged in. Its like its forwarding me to the forum.

Any ideas?

AzzX
23 Jan 2009, 08:12
i get the same error

Fatal error: Call to a member function query_read() on a non-object in /home/services/public_html/login_inc.php on line 151


Replace $db with $vbulletin->db on line 151 and 152

BlackJacket
28 Jan 2009, 02:43
I need help. I have been at this for hours and i still have not figured it out.

I want this page (http://mod.1320legend.com/index.php) to only be displayed to moderators and administrators. But its not working when i try to input ANY of the php scripts included with this hack.

PLEASE HELP! :D:D

AzzX
29 Jan 2009, 13:05
Edit : It Does seem to work with Vb 3.8

Aresetyr
16 Mar 2009, 14:56
Is there any way to get this working under joomla 1.5? I am sitting here, trying to get it work with the jumi component, but won't really work :(

ps: with vb 3.8!

Davey-UK
24 Mar 2009, 19:46
This has worked fantastically for me for months now, but am now trying to add newest members etc via another mod called vBexternal.

Everything works fin apart from when i have both scripts on the same page, the login form shows up on my page instead of the welcome message, even though i am logged in on the forum page.

If i remove the vBexternal include from the page, it all works fine..

I have to add require_once('./vBExternal.php'); to the top of the page, and wondered if you can only use "include_once" a certain number of times in one page, but i am thinking its more likely to be a set cookie problem

Any ideas please?

steveheinsch
01 Apr 2009, 00:48
Hi Bill, thanks for the great hack. Ive managed to get vb working from within the codeigniter framework, so the possibilities are endless :)

Just thought I'd throw a little simpler code for you to get threadcount/postcount.

This:
$getstats = $db->query_read('SELECT threadcount, replycount FROM ' . TABLE_PREFIX . 'forum');
while ($forum = $db->fetch_array($getstats))
{
$totthreads += $forum['threadcount'];
$totposts += $forum['replycount'];
}
$totthreads = vb_number_format($totthreads);
$totposts = vb_number_format($totposts);

Can be replaced with:

$getstats = $db->query_read('SELECT SUM(replycount) AS replies, SUM(threadcount) as threads FROM ' . TABLE_PREFIX . 'forum');
$forum = $db->fetch_array($getstats);
$totthreads = vb_number_format($forum['threads']);
$totposts = vb_number_format($forum['replies']);

and let mysql do the calculations instead of php.

larabagguley
17 Jun 2009, 11:28
Hi, is it possible to add the forgotten password link in here?

Many thanks,
Lara

nicooo
11 Jul 2009, 07:43
Hi, is there a way to show also how total members are online like in the picture example?
Thanks

Davey-UK
11 Jul 2009, 09:28
Hi, is there a way to show also how total members are online like in the picture example?
Thanks
That just shows the total forum members, not who is actually online.

nicooo
13 Jul 2009, 03:49
but online the number, like in the picture

NinjaKiwi
05 Apr 2011, 21:42
Hi Bill,
Thx so much for your work on this.
Just wondering if there is any chance you will be making this compatible with VB4?
I've tried to integrate your script with our VB4 forum:
http://ninjakiwi.com/index-login-test.php
It almost works, but is not pulling the user info.
Cheers

wraggster
06 Jun 2011, 21:44
just like to say this works fine with the latest VB3 :)