View Single Post
  #101  
Old 02-04-2002, 06:10 AM
Omero Omero is offline
 
Join Date: Oct 2001
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hack update: with these updates down here, your hack will show the forum title ONLY for forums that the users can actually see, and has the permission to get in, and not for private forums he isn't able to see.

KNOWN BUG: it still shows the title for private forums that are under a public forum. (well i know it sux, but still better than viewing ALL the titles of private forums )

****************************

EXAMPLE:

MAINPAGE
|_ PUBLIC CATEGORY A
|_ _ PUBLIC FORUM A1
|_ _ PUBLIC FORUM A2
|_ _ _ (PUBLIC FORUM A2.1)
|_ _ _ (PRIVATE FORUM A2.2)
|_ _ PRIVATE FORUM A3


A2.1 and A2.2. don't get shown on mainpage, and if the last post was in A2.2. the title would be show in A2 even if A2.2 is private... A3 title instead don't get displayed, since it's not under a public fourm, and its visible directly, and the bug doesn't affect it

***************************

This bug is because of the fact that I check the permission to see if the forum is accessible by the user, and if it is, then I display the title, otherwise I display " ".

BUT the title doesn't necessarily come from the forum I'm checking the permission, it could come from a subforum which has DIFFERENT permissions than the forum I'm checking... examples:

PUBLIC FORUM (i'm checking this forum and I therefore display the title... but...
-- PRIVATE SUBFORUM (... the last title comes from here so shouldn't be seen)

Presently there is NO way to know the forumid of the forum that "lasttitle" is from... i see 2 solutions of this, an easy but slow (adding a query) and a bit harder but fast:

A) EASY BUT SLOW: do a query and search where that title is from. When you get the forumid, you check permissions on THAT forum, and decide if displaying or not the title

B) HARDER BUT QUICK: add another field to the db... "lasttitleforum" which stores the "forumid" of the forum the "lasttitle" comes from, so we can check permissions on the right forum and decide if displaying or not the title, correctly.

I include here the new version of this hack, with improved (but not yet *final*) check for private forums... if you want something better that getting all the titles displayed get this, if you instead need that bug im speaking about fixed (this hits especially those who have a lot of "public forum-private subforum"), wait for PPN to release the real update

Here it is, use it at your own risk (but it works).

Attachment removed by PPN, i've released a patch for it
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01179 seconds
  • Memory Usage 1,768KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete