vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   welcome/login panel on non-vB page (https://vborg.vbsupport.ru/showthread.php?t=37134)

Darren Lewis 04-06-2002 10:00 PM

welcome/login panel on non-vB page
 
I've seen a lot of requests for this around here, but no solutions.

Latest version is 1.30
Works with V2.2.9 Should work with earlier version of 2.2.x too.


OVERVIEW
========
This hack/modification is designed to create a welcome panel on your non-vB homepage, so that users are either welcomed back if they are registered, or invited to login/register if they are not.

There are config options to show avatar and/or PM information and/or who's online (with or without usernames) in your welcome panel.

If you want to see a working example, then go to http://www.thebookforum.com The hack installed there does not show all of its features, but gives a general idea. The templates allow complete control over the look of the login/welcome panel.

There is one PHP file (webwelcome.php) to upload, and ten custom VB templates to create.

The templates can be modified to suit the design of your site. The ones that I have included in the zip file are those that I created for my site.

There are options to include the following additional info
- Avatar for guests or user's own avatar if logged in. If no avatar selected, a default one will be shown. Example guest and default avatars included in this release package.
- PM info to logged in users (will not show if user cannot use PMs or has chosen not to)
- Who's online (number of members of guests). Additional option to choose whether to show usernames.


CREDITS
======
This hack also uses some code originally written by several members of vbulletin.org in particular Firefly and MrLister.

Full credit is given in the php file for the relevent bits of code used. I have modified their code slightly to work with this hack.

I have not formally asked their permission due to the open source nature of the hacks at vbulletin.org
If they object I will remove their code from this hack release.


HISTORY
======
V1.30 13 September 2002
Hack creation now very simple. No more copy & paste. I've changed a lot of the original vb code so copy & paste would be nearly impossible.
Added option to include PM info and who's online (with or without usernames) in the welcome panel.
Default templates included in the hack release altered to include these new options.
New templates for the additional info to be shown.

V1.20 11 September 2002
Added option to include user's avatar in the welcome panel.
Default templates included in the hack release altered to include these new options.
Default templates altered to be more generic.

V1.10 13 May 2002
Fixes the bug where the "most users online...." on the forum page keeps reseting to zero.
Removes a lot of the unecessary bloat from the script.
Creation of script simplified. Now just cut and paste.
NB template name change in this version - webwelcome_home is now called webwelcome.

V1.00 07 April 2002
Original release.

TECK 04-07-2002 08:07 PM

what do you mean: "it involves modifying a copy of the vBulletin index.php file"? and what exacly this hack do?
congrats anyway on your time you spend to make this hack.

Darren Lewis 04-07-2002 08:13 PM

Quote:

what do you mean: "it involves modifying a copy of the vBulletin index.php file"?
The index.php that vBulletin uses in the www.yourdomain.com/forums directory has to be copied and then modified so that your non-vB webpage can access the info that vBulletin uses.

Quote:

what exacly this hack do?
On my website, the homepage is not the vBulletin forum page. I want to welcome my members back and let them know how may new posts there have been since their last visit etc... when they visit the front homepage.

If a visitor is not a member, then I want them to see a different message that welcomes them, and encourages them to explore deeper in my website (ie visit and sign up in the forums).

Thanks for the support. The best thing I've done recently was to move off ezboard and buy vBulletin :)

TECK 04-07-2002 08:26 PM

i understand now. :)
thanks.

btw i looked at your file and i have to congratulate you. :)
you gave credit to all hack writers and did an excellent job on explaining all that have to be done to install successfully your hack.

congrats! ;)

defnot 04-07-2002 09:09 PM

thanks !!! it's a cool hack ..

esoin 04-07-2002 11:03 PM

sounds like an awesome hack... But I am getting an error.. check it out

http://www.gopednation.com/index.php

Lanigironu 04-08-2002 12:28 AM

Very good hack. I just needed something similar to this. I was planning on installing a whole bunch of small hacks, but this is even better.

Thanks.

Darren Lewis 04-08-2002 08:55 AM

Thank you all very much for the replies and support.

Quote:

sounds like an awesome hack... But I am getting an error.. check it out
Thanks. I've had a look at your page and the problem is that your website's index.php file cannot find the webwelcome.php script.

The problems is with the path in the statement
PHP Code:

<?php include ("webwelcome.php"); ?>

Have you got the webwelcome.php file in the same directory as your website's index.php file, ie the root? If you have the above include should work. Some servers can be a bit funny about paths though. You could try changing it to an absolute server path.

I've double checked that the above include statement will work when the webelcome.php file is in the root folder with the index.php file and it does on my server (running Linux).

Hope this helps.

Darren.

DynamoSupremo 04-09-2002 01:01 AM

I'm getting this error, any ideas?

Quote:

Fatal error: Call to undefined function: getpermissions() in /home/lhbcyouth/webwelcome.php on line 9
Line 9 contains this:
Code:

$permissions=getpermissions();

scsa20 04-09-2002 06:56 AM

okey, I got it to let you log in, but won't keep me log in thru. out my site (or, in this case, page)...the page is http://www.simon-soft.com/test/hacktest.php and the forum is loc. at http://forums.simon-soft.com

how can I fix that problem??

Darren Lewis 04-09-2002 02:28 PM

Quote:

Originally posted by DynamoSupremo
I'm getting this error, any ideas? Fatal error: Call to undefined function: getpermissions() in /home/lhbcyouth/webwelcome.php on line 9. Line 9 contains this: $permissions=getpermissions();
This is caused because the webwelcome.php file cannot find the global.php file which is in your forums directory (eg yourdomain.com/forums/). At the very top of your page that is running the webwelcome.php script as an include file (above all other code) you will need to have the following code
PHP Code:

<?php
chdir
("forums/");
require(
'./global.php');
?>

If you are not running the webwelcome.php script as an include in another PHP file you can probably leave it where it is when you are modifying the copy of the original vBulletin file.

Hope that helps.

Quote:

Originally posted by scsa20
okey, I got it to let you log in, but won't keep me log in thru. out my site (or, in this case, page)...
Hmmm....
This sounds like a problem with the cookie. I've had a look at your page and it runs the script OK. I can click on "View Today's Active Threads" and it runs that query OK. Must be a problem with your cookie. I cannot reproduce the problem on my site.
I deleted my cookie and re-started my browser (IE6). I was able to log in from my website homepage, view the forum and post replies. I shut the browser, re-opened and went back to my site. The welcome message was displayed that I was already logged in.

What browser are you running? Could be something to do with the cookie or privacy settings on that? Might be something to do with viewing cached pages? Sorry I can't be of any more help :(

EDIT - I've just noticed that your forums are on a subdomain of your main site. What is the cookie set to in your vBulletn admin panel? This might be causing some problems? Just an idea.

scsa20 04-09-2002 04:04 PM

Quote:

Originally posted by Darren Lewis

EDIT - I've just noticed that your forums are on a subdomain of your main site. What is the cookie set to in your vBulletn admin panel? This might be causing some problems? Just an idea.

how can I find out what what the cookie set in my vBulletin admin cp??

Darren Lewis 04-09-2002 04:55 PM

Quote:

Originally posted by scsa20
how can I find out what what the cookie set in my vBulletin admin cp??
Log in to your admin control panel.

Select "vBulletin Options" from the left menu

Select "HTTP Headers & Output" from the top menu.

esoin 04-09-2002 07:30 PM

Cool.. I set it to absolute now it works! thanks!

but... now that the index is a PHP file.... will it work the same way as a index.html file... where.. when someone goes to www.gopednation.com... it pulls up the index.html file...

?

Thanks

eso

Quote:

Originally posted by Darren Lewis
Thank you all very much for the replies and support.

Thanks. I've had a look at your page and the problem is that your website's index.php file cannot find the webwelcome.php script.

The problems is with the path in the statement
PHP Code:

<?php include ("webwelcome.php"); ?>

Have you got the webwelcome.php file in the same directory as your website's index.php file, ie the root? If you have the above include should work. Some servers can be a bit funny about paths though. You could try changing it to an absolute server path.

I've double checked that the above include statement will work when the webelcome.php file is in the root folder with the index.php file and it does on my server (running Linux).

Hope this helps.

Darren.


esoin 04-09-2002 07:35 PM

also... the rest of my PHP scripts don't work... any work arounds for this? thanks again

eso

scsa20 04-09-2002 10:37 PM

lol, I think I know what I forgot to do...I'll get back to you if it works or not ;)

*added*lol, I forget to fell put in ".simon-soft.com" in the "Cookie Domain" part :nervous: well...it's working now, thank you ;)

DynamoSupremo 04-10-2002 03:50 AM

Ok, I can get the script to run, but I can't get it to recognize that I'm logged in. It just keeps giving me the same unregistered message whether I login through the forums or through the script itself. I've setup the cookies as stated previously in this thread, so I'm not sure if that is it or not. Thanks for you help, I've been looking for a hack like this for a long time!

EDIT: To see what I'm talking about you can go to my test page @ http://www.lhbcyouth.com/test2.php

wintz 04-10-2002 08:41 AM

I`ve just installed this hack but i`m getting this error

Quote:

Fatal error: Failed opening required './global.php' (include_path='.:/usr/share/php') in /home/blake/public_html/index.php on line 3
can anyone help please, thanks

Darren Lewis 04-10-2002 08:47 AM

Quote:

esoin wrote
now that the index is a PHP file.... will it work the same way as a index.html file
Yes the browser will display the index.php file. If you have both an index.html and an index.php, I'm not sure which one will get pulled. Best to just have one index file.

Quote:

esoin wrote
also... the rest of my PHP scripts don't work... any work arounds for this?
If these are scripts on your index.php page, then this is caused because the scripts are look in your forums directory now due to the code
PHP Code:

chdir("forums/"); 

Depending on what scripts you have, you will need to modify the paths that they are using to look for other files. EG I'm using tubedog's excellent hack, but I had to modify the path it was using to look for the config.php file.

Quote:

Dynamospuremo wrote
Ok, I can get the script to run, but I can't get it to recognize that I'm logged in. It just keeps giving me the same unregistered message whether I login through the forums or through the script itself. I've setup the cookies as stated previously in this thread, so I'm not sure if that is it or not. Thanks for you help, I've been looking for a hack like this for a long time!
There must be a problem with your cookie settings (or the browser cache/privacy settings).
In my admin settings the cookie domain is left blank, and the path to save cookies is left as the default /
My forums are at www.thebookforum.com/forums not on a subdomain.

Hope that helps everyone. Let me know how things go. I may try to add some more options in the future when I've learnt a lot more about PHP and how vBulletin works. I can then update the install instructions with known workarounds etc...

Darren.

Darren Lewis 04-10-2002 09:03 AM

Quote:

Originally posted by wintz
I`ve just installed this hack but i`m getting this error
Fatal error: Failed opening required './global.php' (include_path='.:/usr/share/php') in /home/blake/public_html/index.php on line 3
can anyone help please, thanks

At the very top of your index.php file you have inserted this code
PHP Code:

<?php
chdir
("forums/");
require(
'./global.php');
?>

What is the URL to your vBulletin forums. If it is not yourdomain.com/forums then the above PHP will not work correctly. You will need to modify the second line (beginning with chdir) to the correct path to your forums from the new index.php file.

Darren

wintz 04-10-2002 09:08 AM

Thanks for your reply, i did change it from

<?php
chdir("forums/");
require('./global.php');
?>

to

<?php
chdir("forum/");
require('./global.php');
?>

as my url to the board is www.case-sensitive.co.uk/forum/

Darren Lewis 04-10-2002 09:27 AM

Quote:

wintz wrote
Thanks for your reply, i did change it......
Hmm....
Perhaps try changing it to the absolute server path, ie /home/blake/public_html/forum/ Some servers seem to need absolute paths.

wintz 04-10-2002 09:35 AM

ok thanks, so i`ve got this right it would need to be changed to

<?php
chdir("/home/blake/public_html/forum/");
require('./global.php');
?>

or is that wrong

Darren Lewis 04-10-2002 12:15 PM

Yes that's right. Try that and see if it works.

DynamoSupremo 04-10-2002 12:29 PM

Quote:

Originally posted by Darren Lewis
There must be a problem with your cookie settings (or the browser cache/privacy settings).
In my admin settings the cookie domain is left blank, and the path to save cookies is left as the default /
My forums are at www.thebookforum.com/forums not on a subdomain.

My aren't on a subdomain either, and I've tried it with with the cookie settings left at default. I dunno, I'll piddle with it. Thanks!

wintz 04-10-2002 01:44 PM

Quote:

Originally posted by Darren Lewis
Yes that's right. Try that and see if it works.
No it didn`t work m8, still getting the same error

scsa20 04-10-2002 08:41 PM

make sure, in the Admin CP area of the main options that you have set the domain to set the cookies to .yourdomain.com

kineda 04-10-2002 11:08 PM

I installed this hack and it works perfect! But is there anyway to let people who login return to the original non-VB page they logged in from instead of going to the forums?

DynamoSupremo 04-11-2002 12:24 AM

This is from the readme for the hack
Quote:

Login/Logout takes user back to page they logged in or logged out from rather than the vBulletin forums page.
https://vborg.vbsupport.ru/showthrea...threadid=30642

kineda 04-11-2002 12:27 AM

Awesome.. yup and went back and found that and it works perfect!

wintz 04-11-2002 07:55 AM

Quote:

Originally posted by scsa20
make sure, in the Admin CP area of the main options that you have set the domain to set the cookies to .yourdomain.com
Yeah i just tried that and still i get the same error, i must be doing something wrong :ermm:

Darren Lewis 04-11-2002 09:31 AM

Wintz, try changing that code to this
PHP Code:

<?php
chdir
("./forum/");
require(
'./global.php');
?>


wintz 04-11-2002 10:07 AM

Thanks Darren, tried the new code but still i get the same error :(

Darren Lewis 04-11-2002 10:59 AM

Sorry wintz, can't think of anything else :( Maybe someone else can help? Let us know if you get it working.

It must be something to do with the paths to the global.php file in your forum directory, but I can't figure out what.

wintz 04-11-2002 11:17 AM

Well thanks for trying Darren it was appreciated ;)

Heat 04-17-2002 01:04 AM

I removed require('./global.php'); and I am still getting this error message.

Quote:

Warning: Cannot add header information - headers already sent by (output started at /www.cornertrap.com/ct2.0/index.php:3) in /www.cornertrap.com/forums/admin/functions.php on line 1620
from functions.php

Line
1617 if ($cookiedomain) {
1618 setcookie($name, $value, $expire, $cookiepath, 1619$cookiedomain, $secure);
1619 } else {
1620 setcookie($name, $value, $expire, $cookiepath, '', $secure);
1621 }

Any ideas on how to fix this problem?

Darren Lewis 04-17-2002 11:42 AM

Hello Heat. Have you added these few lines of code to the very top of the website's (ie not the /forums) index.php file?
PHP Code:

<?php
chdir
("forums/");
require(
'./global.php');
?>

This has to run before any other header information.

Are you running any other PHP scripts on your homepage?

Darren.

Heat 04-17-2002 02:17 PM

Thanks for the reply. I didn't put the code at the very top of the index page. Instead I ran it at the top of a separate html page that was included in index.php. Now it runs with no errors.

Thanks.

Darren Lewis 04-18-2002 12:12 PM

I think that there is a bug in the script. My "most ever online users....." at the bottom of the forums keeps resetting itself.

I suspect that this is caused by too much extra code being left in the newly created webwelcome.php file.

Does anyone else have this problem? If so, does anyone know which lines of code should be removed?

The other "bug" is that if you close your forums, your homepage will also show as closed - not sure how to resolve these problems :ermm:

Thanks.

Darren.

Heat 05-07-2002 10:15 AM

I have noticed this bug too. The "Most number of users ever online" resets. Will there be a fix?


All times are GMT. The time now is 04:46 PM.

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.03356 seconds
  • Memory Usage 1,855KB
  • 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
  • (7)bbcode_php_printable
  • (20)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
  • (40)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