vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Custom hack probs (https://vborg.vbsupport.ru/showthread.php?t=34388)

drives fast 01-23-2002 03:58 AM

Hello again folks.

A little history first if I may......

I am trying to make a private files page integrate with my forum. I previously did the chat hack that basically adds a complete extra set of templates renamed and created a forum called "Private Files"....put my code in the forumdisplay template...and used access masks to allow access.

I recently found an updated process for integrating jIRC into the vbulletin with a simple php script and one custom template. This works perfect at checking for logged in status for entry. I also made my regular files page by using this method which works perfect too at ensuring that the visitor be a logged in member.

I now am trying to make my private files page use this method but I needed to be able to control who could access it.

Here's what I did.....

1) I created a custom template named "main_privatefiles"
2) I created a usergroup called "Site Supporter/Files" (I already have the perks hack installed with a usergroup called "Site Supporter")
3) I added in the modified perks hack code to recognise the new usergroup and it worked perfectly.
4) I tried to modify the main_chat.php script to authorize usergroupid 11 (which is the :Site Supporter/Files" usergroup but there is where the problem came up.

This is what the php script that looks for logged in or error_nopermission...I apologise to the author because I don't remember who it was to give credit
PHP Code:

<?php
require("global.php"); 



if(
$bbuserinfo[usergroupid] == or $bbuserinfo[usergroupid] == or $bbuserinfo[usergroupid] == or $bbuserinfo[usergroupid] == 11) {

$user $DB_site->query_first"SELECT username FROM user WHERE userid = $bbuserid);
$bbusername $user[username];
eval(
"dooutput(\"".gettemplate('main_privatefiles')."\");");
} else {
eval(
"dooutput(\"".show_nopermission()."\");"); 
// end if 
?>

FWC helped me with the part to look for certain usergroups.

This allows admin, mods, super mods and my new "Site Supporter/Files" usergroups to access the page and every other group gets the nopermission page.

I have created two new templates called "error_nopermission_private_loggedin" and "error_nopermission_private_loggedout" and added the evals to the global.php in the "parse other global templates" area. It looks like this:
PHP Code:

eval("\$error_nopermission_private_loggedin = \"".gettemplate('error_nopermission_private_loggedin')."\";");

eval(
"\$error_nopermission_private_loggedout = \"".gettemplate('error_nopermission_private_loggedout')."\";"); 

What I have been trying to do is have the script above use the new nopermission templates instead of the default ones. I got it to use the "error_nopermission_private_loggedin" one by making the script look like this:
PHP Code:

<?php
require("global.php"); 



if(
$bbuserinfo[usergroupid] == or $bbuserinfo[usergroupid] == or $bbuserinfo[usergroupid] == or $bbuserinfo[usergroupid] == 11) {

$user $DB_site->query_first"SELECT username FROM user WHERE userid = $bbuserid);
$bbusername $user[username];
eval(
"dooutput(\"".gettemplate('main_privatefiles')."\");");
} else {
eval(
"dooutput(\"".gettemplate('error_nopermission_private_loggedin')."\");");
// end if


?>

and that works but if someone that is logged out tries to access the main_privatefiles.php page directly it shows the new "error_nopermission_private_loggedin" template with the login information but no login button

Can anyone help me make it use both templates like it should?

drives fast 01-26-2002 01:43 PM

nobody?


All times are GMT. The time now is 08:42 AM.

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.01169 seconds
  • Memory Usage 1,729KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete