Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by RobAC RobAC is offline
Developer Last Online: Jun 2020 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 07-23-2001 Last Update: Never Installs: 15
 
No support by the author.

Ok....this is my first hack. It's small and should be very straight forward.

The source of this hack is a thread that started in the main Code Hacks forum by a user looking for a hack that would allow their members to log in from the main home page of their site. Once logged in, it would display a Welcome message when the logged in member returned to the home page.

The original source was provided by Demolition, but members were having problems with getting the hack to run.

Warning/Disclaimer: I am not a well seasoned PHP programmer. I get by as best I can, but usually learn from example and tinkering. I have changed the PHP coding around slightly, and added much more HTML in order to format the input fields etc. This hack was tested using Internet Explorer 5.5 and Netscat 4.7. I have verified that it works in both OS's several times. I am also running the latest version of PHP on my server, so I'm not sure how to help those of you that are running PHP3, but I'll do the best I can. I won't make any promises though. I plan on continuing to work on this as well as add a few more features to it as time permits.

Download the attached file and edit it using a text editor of your choice. Add the pathway to your forums directory where noted. Save the file as a PHP file to your main forums directory. If your site's home page is an HTML document you will have to call the PHP file using a server side include. If you're not sure how to do this, you should search the forums here as this topic has already been covered several times.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 07-24-2001, 04:58 PM
Steve Machol's Avatar
Steve Machol Steve Machol is offline
 
Join Date: Nov 2001
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by Ruth
smachol, thanks, but i tried that it doesn't work...
Reply With Quote
  #13  
Old 07-24-2001, 05:04 PM
RobAC RobAC is offline
 
Join Date: Oct 2001
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ruth,

Can you be more specific when you say it doesn't work? Are you getting warning messages back? What version of PHP are you running? Is the pathway to the global.php file correct?
Reply With Quote
  #14  
Old 07-24-2001, 05:07 PM
RobAC RobAC is offline
 
Join Date: Oct 2001
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Ruth
smachol, thanks, but i tried that it doesn't work...

RobAC, this is what i am trying to do...

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) prevent access to users awaiting confirmation (3) and users awaiting moderation (4)

i get error almost everywhere except for the login box, there is an error on show_nopermission line, and the user is not welcomed in non-vb pages. (i changed member.php to member3.php and alreasy set the redirect to the index of my main site (non-vB) )

please help

Is the main index page of your site an HTML document on PHP? So in other words, when someone clicks the link to go to your site....if they are a member, you want them to automatically be logged in....if they're cookies are set properly and have direct access to the site. If they aren't logged in, you want to be brought to a page that has nothing on it, other than the log in fields? It sounds like this is a little beyond my capability and I'm not sure I can help.
Reply With Quote
  #15  
Old 07-24-2001, 05:28 PM
Ruth Ruth is offline
 
Join Date: Oct 2001
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Ruth, what doesn't work exactly?
Test 1
when i use that code without show_nopermission code, it only shows the login box in my index.php (non vB), when i try to login using the box, and it redirects me to the same page (index.php) it doesnt show the welcome screen, it shows the login box again (like if i'm not using cookies or not looged in)

Test 2
when i change number 0 to 1 in

Quote:
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];

echo"Welcome Back, <b>$username</b>";
i get the welcome screen only "Welcome Back" and not $username
but when i logout and come back it doesnt show the login box at all.


Test 3
when i add this to the code
PHP Code:
if (!$bbuserinfo[userid] || $bbuserinfo[usergroupid]==|| $bbuserinfo[usergroupid]==4) {
show_nopermission();
eval(
"dooutput(\"".gettemplate("error_wrongpassword")."\");");

i get error in show_nopermission(); line


Quote:
Make sure the script is in the same directory as your global.php file. This code works perfectly on my site
the path to global.php works fine, and didnt have problem with it, however it is not in the same directory as the global.php, because i am trying to put this code in every non-vB page to protect it.

Quote:
What version of PHP are you running?
PHP4 with Zend Optimizer

Quote:
Is the main index page of your site an HTML document on PHP?
it is *.php

thanks for your help
Reply With Quote
  #16  
Old 07-24-2001, 05:34 PM
Steve Machol's Avatar
Steve Machol Steve Machol is offline
 
Join Date: Nov 2001
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ruth,

For what it's worth I believe I also had a problem using this unless the script was in the same directory as the global.php file. Sorry, I don't know what to recommend.
Reply With Quote
  #17  
Old 07-24-2001, 05:49 PM
Ruth Ruth is offline
 
Join Date: Oct 2001
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

smachol, is there a way by putting the script in the same path as global.php and just call it by one line like this code
PHP Code:
require("./global.php"); 
maybe something like require or include ("path-to/forums/login.php");
in every protected page.

i'm not experienced in this.

thanks
Reply With Quote
  #18  
Old 07-24-2001, 06:04 PM
Steve Machol's Avatar
Steve Machol Steve Machol is offline
 
Join Date: Nov 2001
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ruth,

I'm just beginning to learn PHP myself. All I know is that the code I posted above works on my site when global.php and the script using it ('last.php') are in the same directory. I haven't yet tested any other variations.
Reply With Quote
  #19  
Old 07-25-2001, 01:50 AM
BradC
Guest
 
Posts: n/a
Default

How about putting in there the direct link to the global.php

PHP Code:
require($DOCUMENT_ROOT "/foldername/global.php"); 
foldername being whatever folder(s) lead to your vb folder..

then you can put the script anywhere.


update:

I use this for mine... my vb folder is "main" and I have an "about" folder in the same root as the main folder and I use this in all my pages to get the global.php

PHP Code:
<?php
chdir
($DOCUMENT_ROOT "/main");
require(
$DOCUMENT_ROOT "/main/global.php");
chdir($DOCUMENT_ROOT "/about");
?>
Reply With Quote
  #20  
Old 07-26-2001, 01:20 AM
mferrell
Guest
 
Posts: n/a
Default

Anyone know how I can solve this error message when I require the global.php file on a non-vb page?

Warning: Failed opening './admin/config.php3' for inclusion (include_path='') in ./bulletinboard/global.php3 on line 66

Thanks.
Reply With Quote
  #21  
Old 07-26-2001, 01:31 AM
Ruth Ruth is offline
 
Join Date: Oct 2001
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BradC thanks i'll try that...


Quote:
Warning: Failed opening './admin/config.php3' for inclusion (include_path='') in ./bulletinboard/global.php3 on line 66
mferrell, make a duplicate file of global.php, change the path of config.php to the full path...and refer in your script to the duplicated global.php..and try...not sure if it works though.
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 08:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04877 seconds
  • Memory Usage 2,315KB
  • Queries Executed 25 (?)
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
  • (4)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (9)postbit_onlinestatus
  • (11)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