vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   latest threads in forumdisplay.php? (https://vborg.vbsupport.ru/showthread.php?t=38355)

TECK 05-08-2002 04:17 AM

i was wondering if any of the big guns can look at the file ensemble and let me know if there is some wierd code i have in there?
i have a modified forumdisplay.php file that does what it shows in this pic:
News Page

for some reason, even with the right perms set for a usergroup, it will still show the last threads in the hidden forums.
also, i added comments in that file so you can easy follow the changes i did and evaluate better the code.
firefly or PPN, i would apreciate your help on this. if interested, let me know and i will PM the modified file.

thanks.

Scott MacVicar 05-08-2002 05:06 AM

email me then
scott.macvicar@vbulletin.org

Just leaving for school I will check in once i get there.

try setting $bbuserinfo[usergroupid] to 1 in the query

TECK 05-08-2002 05:17 AM

thanks PPN. i emailed you the file.

Scott MacVicar 05-08-2002 05:35 AM

PHP Code:

$doperms=$DB_site->query("SELECT canview,forumid FROM forumpermission WHERE usergroupid='$bbuserinfo[usergroupid]'");
while (
$doperm $DB_site->fetch_array($doperms)) {
  
$perms["$doperm[forumid]"] = $doperm;
}
$DB_site->free_result($doperms);
unset(
$doperm);

$forum=$DB_site->query("SELECT forumid FROM forum");
while (
$forums=$DB_site->fetch_array($forum)) {
  if(
$perms["$forums[forumid]"]["canview"] == || !isset($perms["$forums[forumid]"]["canview"])) {
    
$forumperms[]=$forums["forumid"];
  }
}
$DB_site->free_result($forum);
unset(
$forums);
if(!empty(
$forumperms)) {
  
$forumperms='AND forumid='.implode(' OR forumid=',$forumperms);


i had a variable name wrong

TECK 05-08-2002 05:38 AM

thanks alot scott. when you have a chance, can you look at the file and let me know if there is any unbalanced code? i shrinked alot the forumdisplay.php file. just making sure someone with php experince can give me the ok on that.

i'm concerned about some unset queries and also about some errors that might be in there without knowing (for example the access array)...

KuraFire 05-08-2002 07:43 AM

Thanks Scott, your new code works just fine, I've included it in my newsportal hack and will give you credit. :)

Scott MacVicar 05-08-2002 09:38 AM

sure no problem, just glad to help.


All times are GMT. The time now is 10:39 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.01555 seconds
  • Memory Usage 1,736KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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