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-25-2001, 08:17 PM
Ruth Ruth is offline
 
Join Date: Oct 2001
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i need to do the following in non-vB pages:

(1) if the user already logged use their cookies and display a welcome $username + logout link

(2) if the user is not logged use the login form before displaying the page content.

(3) When the user logs in successfully, plant a cookie.

appreciate your help ...

thanks in advance
Reply With Quote
  #2  
Old 03-21-2003, 04:07 PM
Marulatree's Avatar
Marulatree Marulatree is offline
 
Join Date: Nov 2002
Location: London
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I need help with this too. I have gone through all the nonvb login box posts and none of them have helped - I really can't see why this is so hard. Please help some one.
Reply With Quote
  #3  
Old 03-22-2003, 04:34 AM
mr e's Avatar
mr e mr e is offline
 
Join Date: Dec 2001
Posts: 461
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

start by including global.php, if your above the forum root do a chdir('./vb/') then include('global.php') then just do a if($bbuserinfo[userid] != 0) {DISPLAY WELCOME;} else {DISPLAY LOGIN BOX}

just copy the code from the templates to the page
Reply With Quote
  #4  
Old 03-22-2003, 10:04 PM
Marulatree's Avatar
Marulatree Marulatree is offline
 
Join Date: Nov 2002
Location: London
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks i'll give that a go now.
Reply With Quote
  #5  
Old 03-22-2003, 11:23 PM
Marulatree's Avatar
Marulatree Marulatree is offline
 
Join Date: Nov 2002
Location: London
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mr e,

I have put this into my index.php file on my www.mysite.com/index.php:

Code:
<?
chdir("forum/");
require('global.php');
chdir("../");
$templatesused='webwelcome_welcometext,webwebwelcome_logincode,webwelcome_logoutcode,webwelcome_unregmessage,webwelcome_pmloggedin';
?>
and then further down I've added:

Code:
<? // if user is know, then welcome
if ($bbuserinfo['userid']!=0) {
  $username=$bbuserinfo['username'];
  eval("\$welcometext = \"".gettemplate('webwelcome_welcometext')."\";");
  eval("\$logincode = \"".gettemplate('webwelcome_logoutcode')."\";");

} else {
  $welcometext = "";
  eval("\$logincode = \"".gettemplate('webwelcome_logincode')."\";");
}

if ($bbuserinfo['userid']==0) {
  eval("\$unregwelcomemessage = \"".gettemplate('webwelcome_unregmessage')."\";");
}

?>

Everythings working fine except I get this at the top of my index file:

Warning: Cannot modify header information - headers already sent by (output started at /home/marulat/public_html/lib/mtlibrary.lib:19) in /home/marulat/public_html/forum/admin/functions.php on line 1652
Reply With Quote
  #6  
Old 03-23-2003, 08:26 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is a thread which explains the header errors in the hacking hints and tips forum. You might want to take a read of it :

https://vborg.vbsupport.ru/showthrea...threadid=47126

Regards

- miSt
Reply With Quote
  #7  
Old 03-23-2003, 10:17 AM
Marulatree's Avatar
Marulatree Marulatree is offline
 
Join Date: Nov 2002
Location: London
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the link miSt! I think the offending code is:

Code:
<?php require '/home/marulat/public_html/lib/******.lib';
chdir("forum/");
require('global.php');
chdir("../");
$templatesused='webwelcome_welcometext,webwebwelcome_logincode,webwelcome_logoutcode,webwelcome_unregmessage,webwelcome_pmloggedin';
?>
This little piece of code is also used in the top of my page for another script:
Code:
<?php require '/home/marulat/public_html/lib/******.lib';
?>
Reply With Quote
  #8  
Old 03-23-2003, 10:23 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your Welcome - i hope your problem is now solved

- miSt
Reply With Quote
  #9  
Old 03-23-2003, 11:45 AM
Marulatree's Avatar
Marulatree Marulatree is offline
 
Join Date: Nov 2002
Location: London
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

perfect all done. Thanks a million everybody for you help!

oh one more thing:

Where I have my login box include, it leave a HUGE gap above it. any ideas?
Reply With Quote
  #10  
Old 05-03-2003, 03:27 AM
Nebby Nebby is offline
 
Join Date: Mar 2003
Location: England
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

when i try this i keep getting the following

Fatal error: Call to undefined function: gettemplate() in /home/****/public_html/overallfoot.php on line 55

But why only on that template? the ones before it worked fine.

line 55 is:
eval("\$logincode = \"".gettemplate('webwelcome_logincode')."\";");
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 04:20 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.11079 seconds
  • Memory Usage 2,258KB
  • 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
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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
  • (10)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_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