vb.org Archive

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

PnL 02-23-2007 06:34 PM

HoG - this always redirects me back to the page from which our members log in.

QUESTION: How do I manipulate the size of the "Log In" button? I'd like to be able to streamline this hack so it fits neatly in a small area, and the button is quite large right now - can I adjust the size of it?

SocomNego 02-23-2007 07:44 PM

Quote:

Originally Posted by Billspaintball (Post 1188048)
There should be nothing wrong with the functions.php file, the problem will be in the page that has called it.

Have you followed the steps in the troubleshooting guide? https://vborg.vbsupport.ru/showpost....79&postcount=2
Including step 5 with the test code.

If you still have problems after this, please post the first few lines of the page you are trying to use this hack on.

Ok here is my code....The funny thing is that I have it on my home page and it works, but on this page it doesn't work even though I set it up the same way....

PHP Code:

<?php
   chdir
('/home/gamesoga/public_html/forums'); 
   require_once(
'/home/gamesoga/public_html/forums/global.php');  
?>

 
<?
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
?>
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2 Final//EN'>
<HTML><HEAD>
<META NAME='Generator' CONTENT='Texpad 4'>
<TITLE></TITLE>
<STYLE type='text/css'>
<!--
BODY{
CURSOR: default;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
FONT-SIZE: 12px;
COLOR: #FFFFFF;
BACKGROUND: #000044;
MARGIN-LEFT: 0px;
MARGIN-RIGHT: 0px;
MARGIN-TOP: 0px;
MARGIN-BOTTOM: 0px;
MARGIN-WIDTH: 0px;
MARGIN-HEIGHT: 0px;
SCROLLBAR-FACE-COLOR: #333399;
SCROLLBAR-HIGHLIGHT-COLOR: #000000;
SCROLLBAR-SHADOW-COLOR: #000000;
SCROLLBAR-3DLIGHT-COLOR: #000044;
SCROLLBAR-ARROW-COLOR: #000000;
SCROLLBAR-TRACK-COLOR: #000033;
SCROLLBAR-DARKSHADOW-COLOR: #000000
}
A{
COLOR: #FFFFFF;
TEXT-DECORATION: none
}
A:VISITED{
COLOR: #FFFFFF;
TEXT-DECORATION: none
}
A:HOVER{
COLOR: #FF0000;
TEXT-DECORATION: none
}
A:ACTIVE{
COLOR: #FFFFFF;
TEXT-DECORATION: none
}
UL{
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
FONT-SIZE: 12px
}
LI{
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
FONT-SIZE: 12px
}
P{
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
FONT-SIZE: 12px
}
TD{
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
FONT-SIZE: 12px
}
TR{FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
FONT-SIZE: 12px
}
SELECT    {COLOR: #51485F; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 10px}
INPUT     {COLOR: #51485F; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 10px}
TEXTAREA  {COLOR: #51485F; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 10px}
OPTION    {COLOR: #51485F; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 10px}
FORM      {FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 10px}
.loginforma{
COLOR: #FFFFFF;
border-width: 1;
border-color: #000000;
BACKGROUND-IMAGE: url('<? echo"$url[curtheme]"; ?>/images/loginforma.gif')
}
.loginformb{
COLOR: #FFFFFF;
border-width: 1;
border-color: #000000;
BACKGROUND-IMAGE: url('<? echo"$url[curtheme]"; ?>/images/loginformb.gif')
}
.loginformc{
border-width: 0;
border-color: #000000;
width:34px; 
height:19px;
BACKGROUND-IMAGE: url('<? echo"$url[curtheme]"; ?>/images/loginformc.gif')
}

.catfont{
color: #FF9900;
}
.altcolor{
background: #3a4466;
}
.altcolora{
background: #000033;
}
.altcolorb{
background: #000020;
}
.altcolorc{
background: #000020;
}

-->
</STYLE>
<?
echo($out[header]);
?>

<SCRIPT LANGUAGE='JavaScript'>
function ugcorgy() {
if (parent != self)
  top.location.href = self.location.href
}
</SCRIPT>

</head>

<body onload='javascript:ugcorgy()'>



<table width='100%' height='100%' valign='top' border='0' bordercolor='#000000' cellspacing='0' cellpadding='0'>
<tr>
<td width='100%' height='90' valign='top' align='center' colspan='2'>

<table width='100%' height='90' align='left' border='0' bordercolor='#000000' cellspacing='0' cellpadding='0'>
<tr>
<td width='305' height='55' valign='top' align='left' class='menu'>
<img src='<? echo"$url[curtheme]"; ?>/images/header_upper.gif' border='0'></a><br>
<img src='<? echo"$url[curtheme]"; ?>/images/header_lower.gif'></td>

<td width='100%' height='90' valign='top' align='left' background='<? echo"$url[curtheme]"; ?>/images/top_bg.gif'>
&nbsp;</td>

<td width='10' height='90' valign='top' align='left'>
<img src='<? echo"$url[curtheme]"; ?>/images/top_menu_a.gif'></td>
<td width='13' height='90' valign='top' align='left'>
<img src='<? echo"$url[curtheme]"; ?>/images/top_menu_c.gif'></td>

<td width='10' height='90' valign='top' align='left' background='<? echo"$url[curtheme]"; ?>/images/top_bg.gif'>
&nbsp;</td>

<td width='10' height='90' valign='top' align='left'>
<img src='<? echo"$url[curtheme]"; ?>/images/top_menu_a.gif'></td>
<td width='*' height='90' valign='top' align='left' background='<? echo"$url[curtheme]"; ?>/images/top_menu_b.gif'>



<?php
   
require_once('/home/gamesoga/public_html/login_inc2.php');
?>


</td>
<td width='13' height='90' valign='top' align='left'>
<img src='<? echo"$url[curtheme]"; ?>/images/top_menu_c.gif'></td>


<td width='10' height='90' valign='top' align='left' background='<? echo"$url[curtheme]"; ?>/images/top_bg.gif'>
&nbsp;</td>

<td width='10' height='90' valign='top' align='left'>
<img src='<? echo"$url[curtheme]"; ?>/images/top_menu_a.gif'></td>
<td width='13' height='90' valign='top' align='left'>
<img src='<? echo"$url[curtheme]"; ?>/images/top_menu_c.gif'></td>


</tr>
</table>

</td>
</tr>
<tr>
<td width='175' height='100%' valign='top' align='left' background='<? echo"$url[curtheme]"; ?>/images/left_bg.gif'>

<table width='175' height='100%' align='left' border='0' cellspacing='0' cellpadding='0'>


<?
echo($out[menu]);
?>


<tr>
<td width='175' height='*' valign='top' align='left'>
&nbsp;</td>
</tr>
</table>


</td>
<td width='100%' height='100%' valign='top' align='left'>


<!-- BODY START -->

<?
echo($out[body]);
?>

<br></td>

</td>
</tr>
<tr>
<td width='100%' height='50' valign='left' align='bottom' colspan='2' background='<? echo"$url[curtheme]"; ?>/images/bottom_bg.gif'>

<table width='100%' height='50' align='left' border='0' cellspacing='0' cellpadding='0'>
<tr>

<td width='325' height='50' valign='bottom' align='center'>
<img src='<? echo"$url[curtheme]"; ?>/images/bottom_left_corner.gif'></td>


<td width='5%' height='50' valign='bottom' align='center'>
&nbsp;</td>

<td width='10' height='50' valign='left' align='center'>
<img src='<? echo"$url[curtheme]"; ?>/images/bot_menu_a.gif'></td>

<td width='400' height='50' valign='center' align='center' background='<? echo"$url[curtheme]"; ?>/images/bot_menu_b.gif'>

<?
/*
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
printf("<center><font size='-2' color='#FFFFFF'>This page created in %f seconds</font></center>", $totaltime);
*/
?>
</td>


<td width='10' height='50' valign='bottom' align='center'>
<img src='<? echo"$url[curtheme]"; ?>/images/bot_menu_c.gif'></td>

<td width='*' height='50' valign='bottom' align='center'>
&nbsp;</td>

</tr>
</table>

</td>
</tr>
</table>
</body>
</html>


Billspaintball 02-26-2007 04:13 AM

Quote:

Originally Posted by HoG (Post 1189010)
Is it possible to redirect back to the page you accessed the login form from? if so can someone please give me the code to edit?

Thnx

It should do that automaticly.

Billspaintball 02-26-2007 04:16 AM

Quote:

Originally Posted by PnL (Post 1189242)
HoG - this always redirects me back to the page from which our members log in.

QUESTION: How do I manipulate the size of the "Log In" button? I'd like to be able to streamline this hack so it fits neatly in a small area, and the button is quite large right now - can I adjust the size of it?

In the file
login_inc.php
find the line with
// You can style this with html or CSS as normal if desired.
and you will see the login form code.
You can make the boxes smaller by editing
size=10
and/or you can add css or html tags to format the text size/colour/font etc as desired.

Billspaintball 02-26-2007 04:21 AM

Quote:

Originally Posted by SocomNego (Post 1189302)
Ok here is my code....The funny thing is that I have it on my home page and it works, but on this page it doesn't work even though I set it up the same way....

PHP Code:

<?php
   chdir
('/home/gamesoga/public_html/forums'); 
   require_once(
'/home/gamesoga/public_html/forums/global.php');  
?>



Try changing that bit above to
<?php
$curdir = getcwd ();
chdir('/home/gamesoga/public_html/forums');
require_once('/home/gamesoga/public_html/forums'/global.php');
chdir ($curdir);
?>

If that does not work I suspect that your trying to use a variable named the same as a reserved vB one.

DaveS 02-26-2007 05:14 PM

Does this mod allow me to use the vB headers and footers?

Billspaintball 02-26-2007 09:23 PM

Quote:

Originally Posted by DaveS (Post 1191268)
Does this mod allow me to use the vB headers and footers?

I dont know.
I havent looked into whats involved in calling the vB header and footer templates.

abenoking 02-28-2007 04:17 PM

Many thanks. This snippet allowed me to do something that I've been begging for support on vb.org for the past several months. Plus, it is super-easy to modify and customize.

My only question, is if you have a complete list of $vbulletin->userinfo[] variables that I can use in conjunction with this mod.

jasbell 03-01-2007 01:02 PM

This is probably a common request/hack so that is why I am describing what I have done.

I took Billspaintball's script for use as a single point login for my site, with the objective of not letting anyone into my entire site without the correct credentials/authorization. I want to permit access only to user groups 2,5,6,or 7 (registered users, moderators, and admins).

www.mysite.com
www.mysite.com/forums

A page with Bill's script code sits at the root (index.php) and my forum is under /forums. If a non-authorized user comes along I want to bounce him/her back to the ROOT with a message.

First I set the permissions of the usergroups to what I think they should be to stop them from getting nto my site at all, then I also use the following alteration of Bill's code on the root index page:

Code:

if($isAdmin){
        //show welcome message
        //show logout link
        //show link to forum
}elseif($isAuthorized){
        //javascript that sends authorized user to the forum homepage /forums
        echo "
        <script>       
                document.onload = redir();       
                function redir(){
                        window.location.replace(\"forums\");       
                }
        </script>
        ";
}else{
        //USER IS NOT AUTHORIZED
        //show a specific message regarding why they do not have access
        //show login boxes
        //show registration request link ONLY if user is usergroup 1 (Unregistered / Not Logged In)
}

The complication arises when I set the permissions of the usergroups of the unauthorized users. I dont want them to see ANYTHING. However, if I set the permissions of these users so that Usergroup Manager>>Forum Viewing Permissions>>Can View Forum == NO, the basic VBulletin authentication stops working correctly and I get a ghostlike home index page that appears like a screwed up version of the forum index page (see 1st attached snapshot). Also, logout stops working (see second attached snapshot).

If I change the permissions and allow my defined set of unauthorized usergroups access to view forums the problem goes away. However, this defeats my goal in preventing these unauthorized users from seeing the forum in the first place and by typing in /forum they can view the forum homepage!

Can anyone can shed light on this and help me achieve what I would like to do?

Thanks!

Jonathan

abenoking 03-09-2007 04:18 PM

Quote:

Originally Posted by Skeezster (Post 1187168)
Found the problem - it doesn't like being inside a function. Think I'm sorted now!

Just thought I would emphasize this, as I missed it the first time, and it hung me up for a couple of days. You cannot call the form or require inside a function.

Any chance for a fix on this though? It would make templating much easier.


All times are GMT. The time now is 04:04 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.01255 seconds
  • Memory Usage 1,799KB
  • 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
  • (2)bbcode_php_printable
  • (6)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