vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Displaying username/login fields on non-vB page? (https://vborg.vbsupport.ru/showthread.php?t=22192)

MarkB 07-07-2001 10:55 AM

Hiyis :)

I want to be able to have a message such as 'Welcome, username on a non-vB page (ie, the rest of my site!), if the user is registered and has the cookie present (obviously), or if the user isn't logged in or registered, show the login boxes/registration link...

Is this possible? My main site uses PHPNuke, but I'm guessing if I coded in a require for whatever vB files I needed, it'd ref the vB database for the username etc......?

I'm not a PHP/SQL guru, so please excuse my ignorance if this is a simple thing to do:p

Thanks :)

Mark

MarkB 07-08-2001 09:26 PM

Anyone? :(

Rostor 07-13-2001 10:58 AM

Hi Mark .... well I wait with you for a response if there is one :)

DEMOLiTiON 07-13-2001 01:52 PM

PHP Code:

<?

require("./global.php");

if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
  
echo"Welcome back, <b>$username</b>";

}

?>


mam14 07-13-2001 02:05 PM

That's it?

DEMOLiTiON 07-13-2001 02:38 PM

Quote:

Originally posted by mam14
That's it?
yep

GameCrash 07-13-2001 02:59 PM

If you want to geht the loginform, you have to change the code a bit:

PHP Code:

<?

require("./global.php");

if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
  
echo"Welcome back, <b>$username</b>";

} else {

?>

[Loginform here]

<?

}

?>

You can simply insert the loginform from the index.php I think...

Rostor 07-13-2001 04:39 PM

Thx you for fast response ... but it doesn't works to me :confused: :confused:

Gives error on the global.php

DEMOLiTiON 07-13-2001 04:54 PM

Quote:

Originally posted by Rostor
Thx you for fast response ... but it doesn't works to me :confused: :confused:

Gives error on the global.php

You have to create a new file e.g. test.php and put the code in there.

Rostor 07-13-2001 05:18 PM

Yes I ' v created a new file and then copied your code.

Then i modified this:

require("forum/global.php");

and test it.

This is the result:
Warning: Undefined variable: REQUEST_URI in C:\Inetpub\wwwroot\swzone.it\forum\global.php on line 33

Warning: Undefined variable: QUERY_STRING in C:\Inetpub\wwwroot\swzone.it\forum\global.php on line 41

Warning: Undefined index: HTTP_POST_VARS in C:\Inetpub\wwwroot\swzone.it\forum\global.php on line 58

Warning: Undefined index: action in C:\Inetpub\wwwroot\swzone.it\forum\global.php on line 58

Warning: Undefined index: action in C:\Inetpub\wwwroot\swzone.it\forum\global.php on line 61

Fatal error: Failed opening required './admin/config.php' (include_path='') in C:\Inetpub\wwwroot\swzone.it\forum\global.php on line 66

My server (I host directly) is an IIS5 with Php 4.0.6
Thx for your interest :)


All times are GMT. The time now is 12:31 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.01069 seconds
  • Memory Usage 1,737KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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