vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   [RELEASE] bList 1.0 (https://vborg.vbsupport.ru/showthread.php?t=2749)

08-29-2000 01:00 PM

Quote:

Originally posted by Stallion
Private forums are noted...

You won't be able to view those threads, but I guess the subject lines might be a little revealing.

OK, that's what I feared. So I'll have to wait till you release the next version with a fix for that, cos in my board, in many cases just seeing the subject itself can cause havoc...

08-29-2000 01:07 PM

Quick fix for private forums:
Look around line 108, and change the query to:
$posts = $DB_site->query("SELECT post.threadid, post.postid, thread.title FROM thread, post WHERE post.threadid=thread.threadid AND thread.forumid <> '2' AND thread.forumid <> '7' AND post.userid='".intval($split[0])."' ORDER BY post.dateline DESC LIMIT 5");

Where '2' and '7' should be replaced with private forum numbers. If you have more than two, just diplicate the "AND...'7'" format. If you only have one, just drop that part of the query.

More later.

08-29-2000 09:55 PM

you rule Stallion, thanks :)

08-30-2000 12:51 AM

Great hack you guys. Works great on my site.

I would like it to where those with administrator status are still able to see the messages in the private area though.

Thanks,
Parker

08-30-2000 12:58 AM

Quote:

Originally posted by Stallion
Quick fix for private forums:
Look around line 108, and change the query to:
$posts = $DB_site->query("SELECT post.threadid, post.postid, thread.title FROM thread, post WHERE post.threadid=thread.threadid AND thread.forumid <> '2' AND thread.forumid <> '7' AND post.userid='".intval($split[0])."' ORDER BY post.dateline DESC LIMIT 5");

Where '2' and '7' should be replaced with private forum numbers. If you have more than two, just diplicate the "AND...'7'" format. If you only have one, just drop that part of the query.

More later.

yep it works those private threads are hidden :D

08-30-2000 01:28 AM

Better fix(:)):

Use the built-in VB function to dynamically decide whether or not a user can see a forum (and subsequently a thread in that forum):

Code:

$getperms = getpermissions( $bbuserid, $bbusergroupid, $forumid );

if( $getperms[ canview ] == 0 ) {

  // user is not allowed to see

} else {

  // show the title, whatever

} // end if

So, this will allow mods / admins to see the mod forum / thread titles, whereas other user will see whatever you tell them to see.


[Edited by mrogish on 08-29-2000 at 10:29 PM]

08-30-2000 01:31 AM

Quote:

Originally posted by mrogish
Better fix(:)):

Use the built-in VB function to dynamically decide whether or not a user can see a forum (and subsequently a thread in that forum):

Code:

$getperms = getpermissions( $bbuserid, $bbusergroupid, $forumid );

if( $getperms[ canview ] == 0 ) {

  // user is not allowed to see

} else {

  // show the title, whatever

} // end if

So, this will allow mods / admins to see the mod forum / thread titles, whereas other user will see whatever you tell them to see.


[Edited by mrogish on 08-29-2000 at 10:29 PM]

now where would you add that bit ?

08-30-2000 02:16 AM

Quote:

Originally posted by eva2000
now where would you add that bit ?
Change this:

Code:

    if ($split[1]) {
        $posts = $DB_site->query("SELECT post.threadid, post.postid, thread.title FROM thread, post WHERE post.threadid=thread.threadid AND post.userid='".intval($split[0])."' ORDER BY post.dateline DESC LIMIT 5");
    }

to this:

Code:

    if ($split[1]) {
        $posts = $DB_site->query("SELECT post.threadid, post.postid, thread.title, thread.forumid FROM thread, post WHERE post.threadid=thread.threadid AND post.userid='".intval($split[0])."' ORDER BY post.dateline DESC LIMIT 5");
    }

This returns the forumID that the thread is living in...

Next replace:

Code:

                          while ($post=$DB_site->fetch_array($posts)) {
                                  $shorttitle = substr($post[2],0,35);
                                  if ($shorttitle!=$post[2]) { $shorttitle .= "..."; }
                                  ////// HTML //////
                          $postz .= "<tr><td width=\"100%\"><FONT SIZE="1" FACE="verdana,arial,helvetica">??<a href=\"showthread.php?threadid=".$post[0]."#post".$post[1]."\" target=_blank>$shorttitle</a></font></td></tr>\n";
                          ////// END //////
                          }

(argh, ugly indentation!)

to this:

Code:

if( $posts ) {
  while( $post = $DB_site->fetch_array( $posts ) ) {
     
    $shorttitle = substr( $post[ 2 ], 0, 35 );
         
    if( $shorttitle != $post[ 2 ] ) { $shorttitle .= "..."; }
         
    $getperms = getpermissions( $bbuserid, $bbusergroupid, $post[ 4 ] );
         
    if( $getperms[ canview ] == 0 ) {
   
      // User is not authorized to see this forum or any threads in it
   
      ////// HTML //////
      $postz .= "<tr><td width=\"100%\"><FONT SIZE="1" FACE="verdana,arial,helvetica">  Moderators-Only Thread</font></td></tr>\n";
      ////// END //////
 
    } else {
   
      ////// HTML //////
      $postz .= "<tr><td width=\"100%\"><FONT SIZE="1" FACE="verdana,arial,helvetica">  <a href=\"showthread.php?threadid=".$post[0]."#post".$post[1]."\" target=_blank>$shorttitle</a></font></td></tr>\n";
      ////// END //////
       
    } // end if

  } // end while
} // end if

This will replace the link with "Moderators-Only Thread". You can call it whatever you want.

According to my PHP parsing mind, this should work. However, we don't run this hack so I haven't tested it -- check it out and let me know.

BTW:
Buddy.php contains a lot of ugly code. :)

08-30-2000 02:19 AM

Quote:

Buddy.php contains a lot of ugly code.
You didn't see it before.....

08-30-2000 02:26 AM

I didn't mean to imply that you guys are bad programmers or anything, but it hurt my eyes to look at this code!! :)

And hey, don't read my "online user listing" thread -- talk about the pot calling the kettle black!! :)


All times are GMT. The time now is 08:29 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.01203 seconds
  • Memory Usage 1,748KB
  • 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
  • (6)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)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