vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Simple vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=100992)

DelaZ 09-08-2006 06:33 PM

Hey thanks for the hack!
I got a complete newbish question though... I'm rather new at this.

What's the code for the form itself? What do I place here exactly? (in html)
Quote:

Where you want to have your login box place this block of code.
This is my website btw:
http://www.++++hollywood.be (damn censoring :) ... it's "f u c k hollywood.be")
Thanks

Billspaintball 09-11-2006 04:27 AM

Quote:

Originally Posted by DelaZ
Hey thanks for the hack!
I got a complete newbish question though... I'm rather new at this.

What's the code for the form itself? What do I place here exactly? (in html)

Thanks

The actual form code is in the file login_inc.php

You just need to place
PHP Code:

<?php  
    
require_once('/path/to/your/login_inc.php');  
?>

At the point in your page that you want the login box to appear.

DelaZ 09-11-2006 04:28 PM

Quote:

Originally Posted by Billspaintball
The actual form code is in the file login_inc.php

You just need to place
PHP Code:

<?php  
    
require_once('/path/to/your/login_inc.php');  
?>

At the point in your page that you want the login box to appear.

Thanks alot works now

Peter_Rosado 09-24-2006 11:54 AM

Does this work in 3.6.1? hmmm

Billspaintball 09-26-2006 06:08 AM

Quote:

Originally Posted by Peter_Rosado
Does this work in 3.6.1? hmmm

Yes.
It works in all 3.5.x and 3.6.x releases to date.

TosaInu 10-01-2006 11:27 PM

I need to hide a html page until users are logged in. You start with making the page php, but HTML content is still visible. The HTML also contains some Javascript and it would be nice if this could be shielded permanently. Wrapping the whole HTML content inside <?php tags make it invisible, but also stops it from working.

How do I block the whole page until the user is logged in, also when viewing sourcecode?

Billspaintball 10-02-2006 03:26 AM

Quote:

Originally Posted by TosaInu
I need to hide a html page until users are logged in. You start with making the page php, but HTML content is still visible. The HTML also contains some Javascript and it would be nice if this could be shielded permanently. Wrapping the whole HTML content inside <?php tags make it invisible, but also stops it from working.

How do I block the whole page until the user is logged in, also when viewing sourcecode?

Just wrap the HTML inside PHP as you tried.
However, you must do it correctly else it wont work.

They must be put either in PRINT or ECHO statements.

Example:
PHP Code:

<?php echo("
      <div class=\"content\">
      <H1>Paintball ?</H1>
      <H2>Paintball? What's that?</H2>
      <p>Paintball is an intense,
      ...blah, blah, blah..
      </div>
"
); ?>

One important note.

See If you use quotes within PHP code you MUST escape them with \ else it will give you an error.

For example I had quotes in my enclosed HTML above so I did this
HTML Code:

<div class=\"content\">
Hope that makes sense :)

No need to read on from here, but there is another way which you may prefer.
You could always just add the html as an include when required.
For example.
PHP Code:

if ($usergroup == '6' )
    {include(
"/home/xxx/public_html/include/menu.inc");} 

The file menu.inc is just straight HTML content.
It has no body, title, header tags etc, just straight HTML content.

TheGorf 10-04-2006 07:21 PM

Is there any way to get around the chdir( ) requirement in the file that you are trying to place the logon form on? I'm trying to integrate this into our website, however we use a lot of include_once( ) to include various pieces of custom code to create the overall look and feel of the site. Consequently, this chdir really mucks things up.

Otherwise if I just put it on a static page it works great. :) Thoughts?

Billspaintball 10-04-2006 08:53 PM

Try this.
It should change you back to the origional directory.

PHP Code:

<?php  
$curdir 
getcwd (); 
chdir('/path/to/your/forums');     
require_once(
'/path/to/your/forums/global.php');  
chdir ($curdir); 
?>


PS, if this works and you use this hack please click instal :)

TheGorf 10-04-2006 09:18 PM

ah ok that seems to have worked. Although there is an error in the piece of code I just downloaded:

The code is:
Code:

// If logged in display logout link
echo "<a href=\"".$forumpath."login.php?$session[sessionurl]do=logout&amp;logouthash=$logouthash";
echo $vbulletin->userinfo['logouthash'];
echo "\">";
echo "<font size=\"1\" face=\"verdana\">Log Out</font></a>
";

Note that after the first $forumpath the string should then be ."/login.php..." Otherwise the Log Out link points to an invalid path.


All times are GMT. The time now is 06:18 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.01418 seconds
  • Memory Usage 1,755KB
  • 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
  • (1)bbcode_html_printable
  • (5)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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