vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Simple vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=100992)

Billspaintball 02-09-2006 10:29 PM

Quote:

Originally Posted by eByte
Hey, I'm using vBExternal also and getting the same error. What did you do to fix the problem? Thanks.

I think I know why. Let me instal vB External over weekend and have a peek at it.

Barteken 02-10-2006 03:23 PM

Quote:

Originally Posted by Billspaintball
To rule out anything else on the page conflicting, do the test page listed right at the end of the troubleshooting section.
See https://vborg.vbsupport.ru/showpost....98&postcount=2

got it to work but, the login banner is on top now but if there is no one logged in the page is still visible... how can i change this?

Grtz barteken

Billspaintball 02-12-2006 09:28 PM

Quote:

Originally Posted by Barteken
but if there is no one logged in the page is still visible... how can i change this?

Grtz barteken

Theres a list of conditionals that you can use in the instructions and in the 2nd post of this thread.
https://vborg.vbsupport.ru/showpost....98&postcount=2

To show different content depending of if people are logged in or not, you want to use this one.
PHP Code:

<?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"
    } 
?>

The content can be text, html, php, inlude another page etc.

Kirk Y 02-13-2006 07:44 PM

Quote:

Originally Posted by Realm of Horror Comics
Is it possible to add the user's avatar yet?
Does anyone know how to do this?

In login_inc.php locate:
PHP Code:

// We check if user is logged in 

Above this place:
Code:

if ($vbulletin->userinfo['userid'])
{
require_once('./includes/functions_user.php'); //make sure we have the function we need
$navbar_ava = fetch_avatar_url($vbulletin->userinfo['userid']);
if (!is_array($navbar_ava))
{
$navbar_ava[] = "/images/misc/noavatar.gif";
}
}

In login_inc.php locate:
PHP Code:

// If Logged in display welcome back message 

Below this place:
Code:

echo "<img src='http://www.yoursite.com/forum/$navbar_ava[0]' align='left' />";
Upload the attached noavatar.gif image to your images/misc folder.
This will show the User's current avatar, and if the User has no avatar specified, it'll show the no avatar image. Don't forget to change the "yoursite.com" to reflect your forum.

See attached for Screenshots.

nicedreams 02-13-2006 07:55 PM

ok, so i got it working, sort of.

It shows me logged in, but doesnt look like my cookie ever expires when it should. so, on the page i created, i'm always logged in, even after the cookie should have timed out with me idling.

Also, from the who's online page, it never updates the time of last activity or the location if i'm on a page outside of vb.

Jim

Billspaintball 02-13-2006 09:09 PM

Quote:

Originally Posted by nicedreams
ok, so i got it working, sort of.

It shows me logged in, but doesnt look like my cookie ever expires when it should. so, on the page i created, i'm always logged in, even after the cookie should have timed out with me idling.

I will look at that.
Quote:

Also, from the who's online page, it never updates the time of last activity or the location if i'm on a page outside of vb.
Its not ment to.

Realm of Horror Comics 02-13-2006 10:08 PM

Quote:

Originally Posted by acidburn0520
In login_inc.php locate:
PHP Code:

// We check if user is logged in 

Above this place:
Code:

if ($vbulletin->userinfo['userid'])
{
require_once('./includes/functions_user.php'); //make sure we have the function we need
$navbar_ava = fetch_avatar_url($vbulletin->userinfo['userid']);
if (!is_array($navbar_ava))
{
$navbar_ava[] = "/images/misc/noavatar.gif";
}
}

In login_inc.php locate:
PHP Code:

// If Logged in display welcome back message 

Below this place:
Code:

echo "<img src='http://www.yoursite.com/forum/$navbar_ava[0]' align='left' />";
Upload the attached noavatar.gif image to your images/misc folder.
This will show the User's current avatar, and if the User has no avatar specified, it'll show the no avatar image. Don't forget to change the "yoursite.com" to reflect your forum.

See attached for Screenshots.

Sweet! That did it.

Thanks!

Billspaintball 02-14-2006 01:04 PM

Enhanced version with avatar, number of PM's and user stats is ready.... I think....
I just need to test it on someone who uses a table prefix for their database.

Realm of Horror Comics 02-14-2006 02:00 PM

Awesome, I look forward to it. :)

Kirk Y 02-15-2006 12:53 AM

I'm having an issue where everything looks like it's logging in fine, but when it goes back to the page, it shows me as not being logged in. I checked the cookie fix discussed in the Troubleshooting section and it's as it should be. Sometimes though, if I go to the Forum and then go back to the page, it shows me as logged in. Any ideas? I love this hack, but I don't want it acting up like this to the regular users.

Quote:

Originally Posted by Realm of Horror Comics
Sweet! That did it.

Thanks!

Good to hear it. I too wanted this feature!


All times are GMT. The time now is 07:28 AM.

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.01300 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (5)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete