The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#92
|
||||
|
||||
lastpost info shouldn't be shown in private forums
|
#93
|
|||
|
|||
Problem - It shows posts from a private forum.
Category -Forum 1 -Forum 2 - Private If the last post was in Forum 2, it shows it for the last post of category, even though access is denied. |
#94
|
|||
|
|||
i'll look into this as soon as i have sobered up o_O
|
#95
|
||||
|
||||
hint:
index.php line 277 |
#96
|
|||
|
|||
I've tried to edit the code to make the title NOT appear for all forums where the user don't have access to, copying a couple of lines from forumdisplay.php (I'm no hacker, i'm simply a user, and know very little of PHP).
It works perfectly for me (but TEST IT AT YOUR OWN RISK, im no php coder ), but: A) I'm sure there is a better way to implement it... i RECHECK permissions, while probably permissions are already checked and i should just pull them out from the right variable... but i dont know how B) I'm not sure at all if the title will display or not, in the case Category - Private subforum - Non private subforum I think this mini edit i did just remove the title in the case the forum is VISIBLE from homepage, and NOT in the case the title is in a category visibile, but comes from a private subforum you shouldnt have access to (that's because i simply check if the user can enter the forum, and display nothing if he can't... the user can access that category, so the title is shown, even if the title comes from a "non accessible for the user" forum Yet, it works, it doesn't show the title for the forums you don't have access to I tested it, but USE IT AT YOUR OWN RISK. Code:
// Last post hack + check for view $titleperm=getpermissions($forumid,-1,-1,$foruminfo['parentlist']); if ($titleperm[canview]) { $showtitle=1; } if ($showtitle) { $forum['lasttitle']=unhtmlspecialchars($forum['lasttitle']); if (strlen($forum['lasttitle']) > 25) { $forum['lasttitle'] = substr($forum['lasttitle'], 0, 23); $forum['lasttitle'] .= '..'; } } else { $forum['lasttitle']=''; } |
#97
|
|||
|
|||
Ah, i noticed i made the width of the text a bit smaller than PPN original hack, because i want to have the title with the link, and in bold
If you want it back original, just replace 25 with 30 and 23 with 28 in the code above... (the higher number is max number of chars of visibile title... if it's higher than that, it cuts it at 2 less than maximum and add ".." at the end so 30-28 is fine for plain title, 25-23 is fine for bold title ) |
#98
|
|||
|
|||
Updates:
A) I checked: yes it removes the title only when the "inaccessible" forum is visible from main page, NOT when it is under another forum, that is accessible. In that case it still shows the title... well it's better than nothing Can someone help me out here? Maybe a loop checking the same thing for each subforum... dunno. B) I'd like to manually update all the "lasttitle"... which query do I have to run in order to write all the "lasttitle", without having to wait for each forum to get updated with a new post? Thanks for info, and thanks to PPN for the wonderful hack, which I'm trying with my VERY LOW knowledge, to improve a bit (or make it worse, we'll see ) |
#99
|
|||
|
|||
update forum info in the control panel and thanks for pointing out that the problem was with subforums I'll have a look into it today now that it is clarified.
|
#100
|
|||
|
|||
Quote:
Your hack shows EVERY post, also from main private forums My small edit fix it for private forums directly under the mainpage, but not for subforums of visible forums I think that could be fix adding another field in the db lasttitle (that's what you use) lasttitleforumid (with this you can check if the user has the permission to see that forum... if that's the case show the title, otherwise show " " ) I'll try this tonite |
#101
|
|||
|
|||
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 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|