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)

ausnrl 01-30-2006 06:51 AM

So you will be able to solve these problems
Doesnt log me out when i hit logout
When delete cookies it logs me in on forums but doesnt say welcome back nrlleague.
CSS Form Change
When you narrow down to the Simple version?

JaseyJas 01-31-2006 03:27 AM

umm i keep getting
Quote:

Fatal error: Cannot redeclare class vbulletinhook in /forums/includes/class_hook.php on line 29

ausnrl 01-31-2006 04:59 AM

Billspaintball whats going to be different about the other one you are going to release. if i got you my php document would you fix it up for me?

Billspaintball 01-31-2006 11:06 AM

Quote:

Originally Posted by ausnrl
Billspaintball whats going to be different about the other one you are going to release.

Just rewritten so its neater, only one line to change instead of 4, and better instructions.
(Then there is the more complex version I use that displays the logged in users Avatar, and any unread PM's, whict I will tidy up and release one day)


Your logout problem is probably because you have whitespace (just a plain ole space)either before or in the includes.

Here, try this.

Save this code in a file called test.php an upload it to your server.
Remember to edit the 3 paths here so they match your site.

PHP Code:

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

    <html>
    <body>
    This is a heading<br />
    This is some more stuff <br />
    And another line<br />
    You get the idea<br />
    Just place stuff as you normally would with HTML<br />
    I use CSS to style and position on my site fwiw<br />
    <br />
    How about we put the login box right under here?<br />
    <br />
    <?php
require_once('/path/to/your/login_inc.php');
    
?>
    </body>
    </html>

remember, you need to edit the paths in your login_inc.php and upload it as well.

Billspaintball 01-31-2006 11:08 AM

Quote:

Originally Posted by JaseyJas
umm i keep getting

You have some other mods installed?

Realm of Horror Comics 01-31-2006 12:27 PM

Hey

I've installed this but right now the login box is right at the top of my page (see www.realmofhorrorcomics.com) How do I put the login box where I want it on the page?

Thanks!

Billspaintball 01-31-2006 06:42 PM

Quote:

Originally Posted by Realm of Horror Comics
Hey

I've installed this but right now the login box is right at the top of my page (see www.realmofhorrorcomics.com) How do I put the login box where I want it on the page?

Thanks!

This sample page should show you how.
https://vborg.vbsupport.ru/showpost....2&postcount=44

Realm of Horror Comics 01-31-2006 11:28 PM

Quote:

Originally Posted by Billspaintball
This sample page should show you how.
https://vborg.vbsupport.ru/showpost....2&postcount=44

Oooh, I see.

Thanks a lot! Great hack by the way, just what I was looking for. Thanks.

Clicked install btw. :)

Realm of Horror Comics 01-31-2006 11:56 PM

Just one other question, how do I edit the text:


Welcome Back, Username here !

... when a user is logged in?





Thanks! :)

Billspaintball 02-01-2006 12:11 AM

Quote:

Originally Posted by Realm of Horror Comics
Just one other question, how do I edit the text:

Welcome Back, Username here !

... when a user is logged in?
Thanks! :)

In the file login_inc.php, look up the top for this (around line 5)
PHP Code:

// Display welcome back message
echo "Welcome Back, <b>";
echo 
$vbulletin->userinfo['username'];
echo 
" !</b><br>"

You can change the text, fonts, styling etc.

:)

Realm of Horror Comics 02-01-2006 12:14 AM

Oh I see.

Cheers.

Realm of Horror Comics 02-01-2006 12:20 AM

Sorry for all the questions, but is there a way to show the user avatar when they are logged in?

Billspaintball 02-01-2006 12:29 AM

Quote:

Originally Posted by Realm of Horror Comics
is there a way to show the user avatar when they are logged in?

Sure.
Thats what I have on my own site.

Its a bit more complex than this hack.
I'm going to release it as a seperate hack when I get around to tidying the code up a bit.

Realm of Horror Comics 02-01-2006 12:36 AM

Quote:

Originally Posted by Billspaintball
Sure.
Thats what I have on my own site.

Its a bit more complex than this hack.
I'm going to release it as a seperate hack when I get around to tidying the code up a bit.

Cool I'll be sure to check it out when you do.

ausnrl 02-01-2006 04:19 AM

Can you help me right what happens is i login and the welcome message doesnt appear?

Billspaintball 02-01-2006 04:42 AM

Quote:

Originally Posted by ausnrl
Can you help me right what happens is i login and the welcome message doesnt appear?

Post the actual code that you are using in login_inc.php and on your other page.
Plus any error messages and an accurate desctripion of what happens and what does not.
Also, what version of vB are you running?

ausnrl 02-01-2006 05:28 AM

I am running 3.5.1 but i dont think that would cause any issues Would it? If your going to do an update when you think it will be updated?

The files of my coding etc are attached

Billspaintball 02-01-2006 05:44 AM

OK, problem is your using a subdomain for your forums, which is known to cause issues with scripts like this (vB security related Im told).

There is a couple of things you can try.

1st, in login_inc.php change the paths to this format
Code:

http://www.nrlleague.com/forums/
I noticed you can reach your forums with both URL's so give that a go first.

If you have no luck with this approach then try this
https://vborg.vbsupport.ru/showpost....1&postcount=27
then if that fails, try this
https://vborg.vbsupport.ru/showpost....1&postcount=34

Let us know how you go.

ausnrl 02-01-2006 09:35 AM

Nup nothing worked mate. Theres an update on login_inc.php

ausnrl 02-02-2006 04:46 AM

Please Please Please someone help

Billspaintball 02-02-2006 06:00 AM

1st up.
Subdomains + scripts + vB are a known problem, and not always fixable.

2nd.
Had a look at the source behind http://www.nrlleague.com/indexnew2.php On the site your links are in the format forums.nrlleague
Change them to the nrlleague.com/forums link and see if that fixes it.

Sven 02-02-2006 08:46 AM

Quote:

Originally Posted by Billspaintball
1st up.
Subdomains + scripts + vB are a known problem, and not always fixable.

2nd.
Had a look at the source behind http://www.nrlleague.com/indexnew2.php On the site your links are in the format forums.nrlleague
Change them to the nrlleague.com/forums link and see if that fixes it.

Have you got any news regarding my problem?

ausnrl 02-02-2006 09:11 AM

O i had them changed but forgot to upload it that was whats wrong. Anyway thanks for the help nice hacks.

so to display things like how many pms htey have we just use the phrases?

Realm of Horror Comics 02-02-2006 11:37 AM

Quote:

Originally Posted by ausnrl
so to display things like how many pms htey have we just use the phrases?

Yeah, I wanna know this too...

Billspaintball 02-02-2006 12:14 PM

Quote:

Originally Posted by ausnrl
O i had them changed but forgot to upload it that was whats wrong.

:laugh: Been there, done that.
Glad that its all working now.
Quote:

so to display things like how many pms htey have we just use the phrases?
This simple one only does stuff like the sample in this post https://vborg.vbsupport.ru/showpost....98&postcount=2
I wanted to keep this to the bare minimum of complexity so anyone can use it with much knowledge of php.

The more fully featured one will have the stuff like avatars and PM's on it like on my site. I havent had time to tidy up the code on it yet. It will be simple to upgrade, just change the login_inc.php file.

Billspaintball 02-02-2006 12:19 PM

Quote:

Originally Posted by Sven
Have you got any news regarding my problem?

Sorry, I havent found any simple way around a cross domain cookie issue like this.
The only way I can think of is if you actually hacked vB's login.php to get it to post the variables back.

Sven 02-02-2006 12:53 PM

Quote:

Originally Posted by Billspaintball
Sorry, I havent found any simple way around a cross domain cookie issue like this.
The only way I can think of is if you actually hacked vB's login.php to get it to post the variables back.

I guess the other way would be to create an own login that is querying the vb database... but I doubt I have the knowledge to do that w/o opening security holes...

Thx anyway... I'm going to stick with my interim solution and use the normal login I created, apart from vB.

exegete 02-02-2006 01:04 PM

Quote:

Originally Posted by Sven
I guess the other way would be to create an own login that is querying the vb database... but I doubt I have the knowledge to do that w/o opening security holes...

Thx anyway... I'm going to stick with my interim solution and use the normal login I created, apart from vB.

If you're modularising this code into sub-functions, don't forget to "global $vbulletin;" at the start, or your script will never realise that anyone is logged in. It took me hours to figure that tiny little thing out. Grr.

Additionally, I have this extension working fine across subdomains (forums on community.mydomain.org with the extension on www.mydomain.org). Make sure you have your cookie domain (Admin CP -> Cookies -> Cookie Domain) set to ".yourdomain.com". I also have this set in my php.ini file (but probably not strictly necessary). I'm not using any other special hacks or modifications to integrate my subdomains either, it's a very standard setup.

Oh, and, one other thing you might want to check: Admin CP -> General Settings -> Post Referrer Whitelist. Make sure ".yourdomain.com" is listed in there too, so your subdomains can post forms to each other without any complaints.

Billspaintball 02-04-2006 04:54 AM

Hack Updated
As of now this hack has been updated from 1.1 to 1.10.

See the changelog in the first post here for details.

tuanluu 02-04-2006 07:54 AM

Is it possible for us to hook 4image using this hack? I try to other 4image interation, but it give too much error and does not work well. I think the code for for that 4image is too busy. I have not heard from that coder lately.

If yes, please show me the step thank ahead

Billspaintball 02-05-2006 06:41 PM

Quote:

Originally Posted by tuanluu
Is it possible for us to hook 4image using this hack?

Not really.
You would need to hack 4image quite extensively.

tuanluu 02-05-2006 07:00 PM

okay thanks

Lynk Former 02-06-2006 06:21 PM

I have another mod installed (vBExternal 1.6) and keep getting

Quote:

Fatal error: Cannot redeclare class vbulletinhook in /forums/includes/class_hook.php on line 29
Why do I get this and how can I make these two mods coexist on the same page?


EDIT: Nevermind, I've figured it out :p

Barteken 02-08-2006 02:13 PM

hmm i'm just getting nothing :s
I used the path given by the path file...
uploaded the login_inc file + edited

This is the beginning of my code (till where i edited)
Quote:

<?php
chdir('/customers/swalus-productions.be/swalus-productions.be/httpd.www');
require_once('/customers/swalus-productions.be/swalus-productions.be/httpd.www/global.php');
?>
<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
{
echo "Have stuff for here";
} else {
echo "You do not have permission for this page"; }

?>
<?php
$v="2 r16 17.03.2005";
include('include/version.inc.php');

require_once( 'include/Config.class.php');
<?php
require_once('/customers/swalus-productions.be/swalus-productions.be/httpd.www/login_inc.php');
?>
$globalpath='';
$config='config.ini';
I want to make sure that only logged in people can see the page...

Grtz

Billspaintball 02-08-2006 10:25 PM

Weird looking path...

but one thing I noticed is that your missing a closing tag which may or may not be the problem.

Try changing
PHP Code:

<?php
$v
="2 r16 17.03.2005";
include(
'include/version.inc.php');

require_once( 
'include/Config.class.php');
<?
php
require_once('/customers/swalus-productions.be/swalus-productions.be/httpd.www/login_inc.php');
?>

to

PHP Code:

<?php
$v
="2 r16 17.03.2005";
include(
'include/version.inc.php');

require_once( 
'include/Config.class.php');
?>

<?php
require_once('/customers/swalus-productions.be/swalus-productions.be/httpd.www/login_inc.php');
?>


Realm of Horror Comics 02-09-2006 05:49 AM

Is it possible to add the user's avatar yet?
Does anyone know how to do this?

eByte 02-09-2006 08:43 AM

Quote:

Originally Posted by Lynk Former
I have another mod installed (vBExternal 1.6) and keep getting



Why do I get this and how can I make these two mods coexist on the same page?


EDIT: Nevermind, I've figured it out :p

Hey, I'm using vBExternal also and getting the same error. What did you do to fix the problem? Thanks.

Barteken 02-09-2006 02:43 PM

Quote:

Originally Posted by Billspaintball
Weird looking path...

but one thing I noticed is that your missing a closing tag which may or may not be the problem.

Try changing
PHP Code:

<?php
$v
="2 r16 17.03.2005";
include(
'include/version.inc.php');

require_once( 
'include/Config.class.php');
<?
php
require_once('/customers/swalus-productions.be/swalus-productions.be/httpd.www/login_inc.php');
?>

to

PHP Code:

<?php
$v
="2 r16 17.03.2005";
include(
'include/version.inc.php');

require_once( 
'include/Config.class.php');
?>

<?php
require_once('/customers/swalus-productions.be/swalus-productions.be/httpd.www/login_inc.php');
?>


Ok this helped page is now showing up but doesn't load (it's an imagevue page btw) second problem is that if i login i'm just redirected to the vbb page which would be good if someone that isn't logged in won't be able to view the page at all.

Thx in advance
Barteken

Billspaintball 02-09-2006 10:24 PM

Quote:

Originally Posted by Barteken
Ok this helped page is now showing up but doesn't load (it's an imagevue page btw) second problem is that if i login i'm just redirected to the vbb page which would be good if someone that isn't logged in won't be able to view the page at all.

Thx in advance
Barteken

To rule out anything else on the page conflicting, do the test page listed right at the end of the troubleshooting section.
See https://vborg.vbsupport.ru/showpost....98&postcount=2

Billspaintball 02-09-2006 10:26 PM

Quote:

Originally Posted by Realm of Horror Comics
Is it possible to add the user's avatar yet?
Does anyone know how to do this?

Not possible with this simple version.

If I havent released the full version with avatars and the rest by this wednesday, PM me a reminder.


All times are GMT. The time now is 01:01 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.02599 seconds
  • Memory Usage 1,857KB
  • 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
  • (6)bbcode_php_printable
  • (23)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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