vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Last post on forum home, working version (https://vborg.vbsupport.ru/showthread.php?t=28561)

danielillo 11-29-2001 02:02 AM

Does it work with subforums?

Longbow 12-05-2001 05:35 PM

reported as there is no "lasttitle" field in my forum table.

any hint?

Recon_Boy 12-06-2001 04:54 AM

First line of the instructions tells you to add that column to the forum table...

Scott MacVicar 12-06-2001 02:38 PM

danielillo

yes it does as long as you remember to add the code to forumdisplay.php as well as it says in the bottom of the instructions.

h4p3 12-19-2001 03:37 PM

@PPN

There is still one little Bug. If you make "" in your threadtitle, then it will display (&q ... on the forum home.

I think there should be something enabled, that allows special chars.

floleb7 12-20-2001 01:20 AM

any news for adding posticon ?

pgowder 12-29-2001 12:38 AM

I'm getting this error:

Quote:

Database error in vBulletin 2.2.1:

Invalid SQL: UPDATE user SET lastactivity=1009592618,inforum='19' WHERE userid='2'
mysql error: Incorrect key file for table: 'user'. Try to repair it

mysql error number: 1034

Date: Friday 28th of December 2001 09:23:39 PM
Script: http://www.powwows.com/gathering/gathering/newreply.php
Referer: http://www.powwows.com/gathering/ne...ly&postid=14569

Scott MacVicar 12-29-2001 12:47 AM

h4p3
-------------
the only problem i noticed is that   counts as 6 chracters from the limit so if you have "Something"

it becomes  Something 

and thats 23 characters so if its limited to 20 characters you will get "Something&nbs shown
it does allow for special characters.

floleb7
-------------
The post icon would really require you adding another field and then adding to the sql query as its not practicle to pull it from the database each time.

pgowder
-------------
My hack doesn't touch anything within that section and it doesn't edit the user table, i'd have a look at other hacks you have installed or try the vBulletin.com support forums

pgowder 12-29-2001 01:27 PM

It wasn't the hack. It was a problem with a power outage and my database became corrupted.

floleb7 12-29-2001 06:56 PM

Quote:

Originally posted by PPN


floleb7
-------------
The post icon would really require you adding another field and then adding to the sql query as its not practicle to pull it from the database each time.



oki :)

nuno 12-29-2001 08:52 PM

lastpost info shouldn't be shown in private forums :rolleyes:

DarkReaper 01-01-2002 08:07 PM

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.

Scott MacVicar 01-01-2002 08:10 PM

i'll look into this as soon as i have sobered up o_O

nuno 01-01-2002 11:54 PM

hint:

index.php line 277 ;)

Omero 02-03-2002 07:14 AM

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 :D), 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']='';
          }


Omero 02-03-2002 07:18 AM

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 ;) )

Omero 02-03-2002 07:33 AM

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 ;) )

Scott MacVicar 02-03-2002 08:56 AM

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.

Omero 02-03-2002 08:16 PM

Quote:

Originally posted by PPN
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.
NOTE: The problem is NOT ONLY with subforum, but with all private forums (im speaking about your original hack)

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 ;)

Omero 02-04-2002 06:10 AM

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 :D)

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

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

Scott MacVicar 02-04-2002 11:03 AM

I don't recommend using this as it will increase mysql load alot as it will increase the load of the page as it access' the getpermissions function which is more queries to the database, if they have alot of forums then alot of extra queries, I will release a completely fixed updated version tongiht hopefully.

Omero 02-04-2002 03:06 PM

THanks :) I know my version wasn't the best thing.... i'm no coder ;)

I'll wait for yours :) Please provide an "update" txt also :D

LuBi 02-06-2002 08:39 PM

Any word on the updated code?

Omero 02-07-2002 05:35 AM

Not yet, i hope PPN release it...

Scott MacVicar 02-07-2002 02:08 PM

I've spent ages lookin at the code and there is no easy way to get past the first level of forums without running another sql query and well i'm against running other sql queries.

I'll release the small modifications I have made to stop it showing private forums in that level of the forums. Though i highly recommend setting in the control panel that users can't view private forums.

NYI Fan 02-15-2002 09:31 PM

Ok, Im feeling might foolish right now
I installed this awesome hack with no trouble on 2.2.0
I upgraded to 2.2.2 the other day and was just now getting to re-installing hacks - for some very bizzare reason, I cannot make this one work on 2.2.2

I've gone thru it 3 or 4 times now, each time i end up with parse errors. I should have been copying them down, but i was so sure it was just me being an idiot and missing something, i didnt bother.

Im gonna try again sometime tonight, but i was wondering if anyone else had any trouble getting it to work after they upgraded to 2.2.2?

If it fails again later, i will document my errors - I know you cant offer help without specifics... i'm just miffed cuz this is such a great addition, and not only do I miss it, my members are asking for it back...
Thanks!

Omero 02-16-2002 06:47 AM

I have 2.2.2 and the hack is working perfectly ;)

Scott MacVicar 02-16-2002 10:54 AM

I've installed this fine on everything from 2.0 RC1 to 2.2.2
I'll gladly help if your having problems though.

NYI Fan 02-16-2002 11:28 AM

Thanks PPN
I will be trying again later today
i finished putting everything else back in so now this is the only one I'm missing
i have "real world" stuff to do today (i need an errand boy LOL)
but when i try again later i will post if im still experiencing fits of stupidity ;)

x28 02-22-2002 10:29 AM

PPN

Every thing was working great untill i moved a topic form a main forum to a sub-form. Title shows but after a member posted to it when you click on the link it reads

"No thread specified. If you followed a valid link, please notify the webmaster"

url shows "www.myaddress/community/showthread.php?s=&threadid="

Also added this piece

https://vborg.vbsupport.ru/showthrea...306#post175306

What do i need to do?

Omero 02-22-2002 11:49 AM

PPN btw im still running my "modified" version of your hack. Could you come up with the final version, even if that means an added query, as I did? I would love to see your version instead of my crappy mod :)

bigmo 03-12-2002 08:30 PM

After installing the hack I get these errors if I try to post, to reply and to update froum info:

Database error in vBulletin 2.2.4:

Invalid SQL: SELECT forumid,threadcount,replycount,parentlist,parentid ,lastpost,lastposter,lasttitle FROM forum WHERE INSTR(CONCAT(',',parentlist,','),',10,')>0
mysql error: Unknown column 'lasttitle' in 'field list'

mysql error number: 1054

Date: Tuesday 12th of March 2002 11:29:33 PM
Script: http://64.239.47.216/vb/vb/postings.php
Referer: http://64.239.47.216/vb/postings.php...d&threadid=186

Some ideas ???

THX for help

So long...
BigMo

Mystics 03-12-2002 08:35 PM

Quote:

Originally posted by bigmo
Some ideas ???
Just read the Instructions from the beginning ;)
Quote:

first thing to do is to run this mysql query :P
ALTER TABLE `forum` ADD `lasttitle` VARCHAR(100) NOT NULL AFTER `lastposter`
You need phpMyAdmin (for example) to run this Query.

Scott MacVicar 03-12-2002 08:48 PM

Sorry i never posted the changes..
here they are

look for
PHP Code:

      if (!$hideprivateforums) {
        
$forumperms['canview']=1;
      } 

above it add

PHP Code:

$trueperm['canview'] = $forumperms['canview']; 

now use

PHP Code:

          if($trueperm['canview']) {
            
$forum['lasttitle']=unhtmlspecialchars($forum['lasttitle']);
            if (
strlen($forum['lasttitle']) > 30) {
              
$forum['lasttitle'] = substr($forum['lasttitle'], 028);
              
$forum['lasttitle'] .= '..';
            }
          } 

i've updated the main file now.

inetd 03-13-2002 03:13 AM

In what file it is necessary to make these changes?

bigmo 03-13-2002 09:04 AM

@Mystics

Hihi...sorry I didnt see it...

THX

@ppn
Quote:

i've updated the main file now.
Where can I get these main file ???

Scott MacVicar 03-13-2002 10:28 AM

index.php and forumdisplay.php and look at the very first post for the main hack file :)

bigmo 03-13-2002 12:11 PM

what is the diference betwen vb_last_title.txt and vb_last_title_new.txt ??

Scott MacVicar 03-13-2002 02:57 PM

the vb_last_title_new.txt was by Omero, though it runs an extra query for each forums, I'll go remove it in a minute.
Anyway my version doesn't run the extra query and is therefore ideal :P

TWTCommish 03-13-2002 03:00 PM

Therefore ideal? Hardly. I find mine are always getting mucked up...moved threads, deleted threads, stuff like that. There is definitely something to be said for another query here or there if it helps keep the integrity of the last post display.


All times are GMT. The time now is 04:53 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.01563 seconds
  • Memory Usage 1,841KB
  • 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_code_printable
  • (3)bbcode_php_printable
  • (6)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
  • (40)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