Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-07-2001, 10:55 AM
MarkB's Avatar
MarkB MarkB is offline
 
Join Date: Oct 2001
Location: London, UK
Posts: 324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thanks

Mark
Reply With Quote
  #2  
Old 07-08-2001, 09:26 PM
MarkB's Avatar
MarkB MarkB is offline
 
Join Date: Oct 2001
Location: London, UK
Posts: 324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone?
Reply With Quote
  #3  
Old 07-13-2001, 10:58 AM
Rostor Rostor is offline
 
Join Date: Nov 2001
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Mark .... well I wait with you for a response if there is one
Reply With Quote
  #4  
Old 07-13-2001, 01:52 PM
DEMOLiTiON
Guest
 
Posts: n/a
Default

PHP Code:
<?

require("./global.php");

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

}

?>
Reply With Quote
  #5  
Old 07-13-2001, 02:05 PM
mam14
Guest
 
Posts: n/a
Default

That's it?
Reply With Quote
  #6  
Old 07-13-2001, 02:38 PM
DEMOLiTiON
Guest
 
Posts: n/a
Default

Quote:
Originally posted by mam14
That's it?
yep
Reply With Quote
  #7  
Old 07-13-2001, 02:59 PM
GameCrash GameCrash is offline
 
Join Date: Oct 2001
Location: Germany (Bavaria)
Posts: 262
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #8  
Old 07-13-2001, 04:39 PM
Rostor Rostor is offline
 
Join Date: Nov 2001
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Gives error on the global.php
Reply With Quote
  #9  
Old 07-13-2001, 04:54 PM
DEMOLiTiON
Guest
 
Posts: n/a
Default

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

Gives error on the global.php
You have to create a new file e.g. test.php and put the code in there.
Reply With Quote
  #10  
Old 07-13-2001, 05:18 PM
Rostor Rostor is offline
 
Join Date: Nov 2001
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:30 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.04500 seconds
  • Memory Usage 2,242KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (6)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete