vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Username on Non-VB Page (https://vborg.vbsupport.ru/showthread.php?t=51383)

ohspot 04-09-2003 11:07 AM

Username on Non-VB Page
 
I'm trying to print a message either welcoming members back, or if they are not logged in, asking them to either login or register.

I have tried This


Code:


<?

require("forums/global.php");

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

}

?>

But can't get it to work. Basically, I want one of the following messages:

Welcome Back, USERNAME

OR

Please Login or Register To Interact In Our Community.

With the words Login, Register & Community being hyperlinks to their respective areas.

This page/message will be outside the forums directory.

Thanks in advance for any help!!

:)

mr e 04-10-2003 04:36 PM

i might be missing something but try this

require("./forums/global.php");

filburt1 04-10-2003 04:56 PM

You're not defining the opposite case.
PHP Code:

chdir("./forums");
require(
"global.php");

if (
$bbuserinfo['userid'] == 0)
{
    echo 
"you're a guest";
}
else
{
    echo 
"Just kidding, you're " $bbuserinfo['username'];



ohspot 04-10-2003 09:16 PM

Hmmm... I tried both tid bits of code, and here is what I get:

PHP Code:

WarningCannot modify header information headers already sent by (output started at /home/ohsppigz/public_html/1index.php:8in /home/ohsppigz/public_html/forums/admin/functions.php on line 1660
you
're a guest 

Also, how did you get your signature? I've seen those images with forum stats all over thie forum, is there a hack that allows you to do that or something - very nice.

And thanks for the help!

ohspot 04-10-2003 09:20 PM

I tried saving the code in a seperate file (welcome.php) and I didn't get the header information - however, it always shows up as guest - even though I'm logged in.

I even tried logging in then being redirected back to the welcome.php page - same thing, you are a guest.

:banana:


All times are GMT. The time now is 07:48 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.01084 seconds
  • Memory Usage 1,721KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete