vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   login box for non-vB pages (https://vborg.vbsupport.ru/showthread.php?t=23661)

Ruth 07-25-2001 08:17 PM

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

Marulatree 03-21-2003 04:07 PM

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.

mr e 03-22-2003 04:34 AM

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

Marulatree 03-22-2003 10:04 PM

Thanks i'll give that a go now.

Marulatree 03-22-2003 11:23 PM

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

Dean C 03-23-2003 08:26 AM

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

Marulatree 03-23-2003 10:17 AM

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';
?>


Dean C 03-23-2003 10:23 AM

Your Welcome :) - i hope your problem is now solved :D

- miSt

Marulatree 03-23-2003 11:45 AM

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?

Nebby 05-03-2003 03:27 AM

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')."\";");

!!!cyr0n_k0r 05-03-2003 06:40 AM

Must the index have a PHP extension?

Is there another extension that can be used that will also work with php? IE *.asp or something?


All times are GMT. The time now is 03:36 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.01186 seconds
  • Memory Usage 1,732KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)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