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)
-   -   Deluxe vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=108026)

Billspaintball 05-22-2007 04:36 AM

Quote:

Originally Posted by CSGCarl (Post 1248326)
Hey,

I'm still having a problem I've fixed other but...

Code:

                                                                </table></td>\";
Error:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/-----/public_html/homepage.php on line 1016

And line 1016 is:


Code:
Code:

echo "Your not logged in so we display this";
I can't see whats wrong there.

If some one could help me out this would be great.


Regards,

Carl


This line here
Code:

</table></td>\";
needs to be
Code:

</table></td>";
The end " is part of the PHP statement and not the enclosed HTML so it should not be escaped, else you will get an error pointing to the next line of code that has another " in it.
(Escaping the " ment that you never ended that PHP statement correctly)

Billspaintball 05-22-2007 04:43 AM

Also, I recommend taking a few online tutorials on using HTML with PHP.
You really just need a basic level of experience in using them togeather and it all becomes clear. :)

CSGCarl 05-22-2007 10:26 AM

Hi,

Ye I have sorted it all now, well on way with it all now

consolegaming 06-03-2007 12:48 PM

Is there anyway to use this (i.e. including global to make logging in easy to sort out) without it auto banning banned users from our own pages?

The site I'd like to use this on will have a separate banning system on the site itself as forum bans shouldn't result in suspensions from the rest of the site. The two are very unrelated and as such shouldn't affect each other's bans.

Billspaintball 06-04-2007 01:35 PM

Quote:

Originally Posted by consolegaming (Post 1260285)
Is there anyway to use this (i.e. including global to make logging in easy to sort out) without it auto banning banned users from our own pages?

The site I'd like to use this on will have a separate banning system on the site itself as forum bans shouldn't result in suspensions from the rest of the site. The two are very unrelated and as such shouldn't affect each other's bans.

I havent tested it with a banned group, but it should not prevent them from accessing the pages this is used on.

isnichwahr 06-05-2007 09:36 PM

hi,

at first i have to say big thanks for this script, i need it very much and it looks pretty cool, but i have problem with it:

the script works fine in this way: i created an extra logintest.php with this contents:
require_once('/srv/www/htdocs/web0/html/v4/vb3/global.php');
require_once('/srv/www/htdocs/web0/html/v4/vb3/login_inc.php');

and in neu.php im including this logintest.php by:
<?php chdir("/srv/www/htdocs/web0/html/v4/vb3");
require("/srv/www/htdocs/web0/html/v4/vb3/logintest.php"); ?>

when i open the neu.php it works fine (when i delete the cookies at firefox options first),

but when i put the include code from neu.php into my index.php (same code!) i get:
Warnung: array_keys() [function.array-keys]: The first argument should be an array in /includes/functions.php (Zeile 4994)

Warnung: Empty regular expression in /includes/functions.php (Zeile 4994),

so some code of the board or loginscript collades with the code on my page. is there a possibility to fix this problem? i dont want to use frames/iframe or a little popup window to include the loginform, but i dont know how i can include it, without getting these errors, remember: neu.php alone works fine

many thanks, david

Sean James 06-06-2007 10:59 AM

Great hack, thank you for your hard work ;)

Added custom CSS, and change some of your code so it is W3C validated.

http://www.bluepearl-design.com/index.php

Sean James 06-06-2007 11:09 AM

Quote:

Originally Posted by Hakaslak (Post 1096744)
What I use to get total number of members. Works for me. Posting it here because it seems to be something people really want. Dunno why. I script kiddied the code that Billspaintball used to get thread/post counts, and did a quickie Google search for how to count rows. and mashed them up. /shrugs

Demo: beta.awp-tech.com

Code:

// get total number of members
$getstats_user_count = $db->query_read('SELECT COUNT(*) FROM ' .TABLE_PREFIX . 'user');
while ($forum_user_count = $db->fetch_array($getstats_user_count))
{
        $totusers += $forum_user_count['COUNT(*)'];
}
$totusers = vb_number_format($totusers);

I am really NOT good at coding (I know no PHP/mySQL), so use at your own risk. If I made any mistakes, please let me know so I can correct it!

Hakaslak figures usage instructions would be nice::rolleyes:

#
#-----[ OPEN ]------------------------------------------
#
Code:

login_inc.php
#
#-----[ FIND ]------------------------------------------
#
Code:

$totposts = vb_number_format($totposts);
#
#-----[ AFTER, ADD ]------------------------------------------
#
Code:

// get total number of members
$getstats_user_count = $db->query_read('SELECT COUNT(*) FROM ' .TABLE_PREFIX . 'user');
while ($forum_user_count = $db->fetch_array($getstats_user_count))
{
        $totusers += $forum_user_count['COUNT(*)'];
}
$totusers = vb_number_format($totusers);

#
#-----[ FIND ]------------------------------------------
#
Code:

$vbphrase[posts]: $totposts<br />
#
#-----[ AFTER, ADD ]------------------------------------------
#
Code:

$vbphrase[members]: $totusers<br />
All done!

Thanks for that, worked perfectly ;)

Sean James 06-06-2007 11:27 AM

Quote:

Originally Posted by Billspaintball (Post 1234651)
Ok,
I have finally had enougth time to play around with this and find the cause and solution.

Cause - When redirected for expired password you are redirected to the directory that your login script is located in, not your forums root.

Fix - Edit phrase called
Code:

passwordexpired
Your current phrase should be
Code:

Your password is {1} days old, and has therefore expired.<br />
<br />
Please change your password using <a href="profile.php?{2}do=editpassword">this page</a>.

change it to

Code:

Your password is {1} days old, and has therefore expired.<br />
<br />
Please change your password using <a href="../forums/profile.php?{2}do=editpassword">this page</a>.

where ../forums/ is your forums directory.

Ive only tested this for expired passwords, not for expired vbplaza, but I would think you would have to edit the expiring vbplaza phrases in the same manner.

Sorry one last thing, i am trying to apply this to my forum but cannot find this phrase in my 'phrase manager'

consolegaming 06-06-2007 12:09 PM

Quote:

Originally Posted by Billspaintball (Post 1261005)
I havent tested it with a banned group, but it should not prevent them from accessing the pages this is used on.

I actually made my post because it did happen lol. We implemented it not even thinking about the issue and then about 5 minutes later we had many complaints from our users that they could no longer access the ladders (we're an online competition website i.e. ladders, and tournaments for online games). It was telling them they were banned and with their ban reason just like the forum bans would be I presume.

So we naturally had to revert back to our old pre-made solution which is just a custom script which just uses cookies and sends the login info to the login.php page when logging in. Though as some of our users have been having problems (particularly Mac Safari users) staying logged in we were looking for a more foolproof system which included sessions (as we presumed that was at least part of the issue).

Any help that could be given on the being banned situation would be greatly appreciated.


All times are GMT. The time now is 09:09 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.01422 seconds
  • Memory Usage 1,761KB
  • 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
  • (13)bbcode_code_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