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)

maxxxxxx 02-19-2003 01:03 PM

Quote:

Originally posted by Omero
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']='';
          }


Hello... at wich plase i must paste with code in.... sorry my english is not the best and i dont understand all that you write...

Best regards
maxxxxxx

Boofo 03-02-2003 08:05 PM

Sometimes when I click on the last title on the forum home I get the dreaded no thread specified error. I have narrowed it down to this piece of code (which is an addon to this hack posted by PPN elsewhere in this thread).

PHP Code:

// goto newest thread
if ($goto=="newthread") {
  if (isset(
$forumid) and $forumid!=0) {
    
$foruminfo=verifyid("forum",$forumid,1,1);
    
$forumid=$foruminfo['forumid'];
    
$lastthread=$DB_site->query_first("SELECT threadid FROM post WHERE username='".addslashes($foruminfo[lastposter])."' AND dateline='$foruminfo[lastpost]'");
//    $lastthread=$DB_site->fetch_array($DB_site->query("SELECT threadid FROM post WHERE username='".addslashes($foruminfo[lastposter])."' AND dateline='$foruminfo[lastpost]'"));
    
header("Location: showthread.php?s=$session[sessionhash]&threadid=$lastthread[threadid]");
    exit;
  }


and here is the line to replace in the "forumhome_lastpostby" template:

Quote:

<a href="showthread.php?s=$session[sessionhash]&goto=newthread&forumid=$forum[forumid]" title="Go to first post">$forum[lastthread]</a>
Can anyone please tell me why the threadid will not update at times? If I go into the Admin CP and use the update counters, then it works fine.

MetroSports82 03-02-2003 08:44 PM

I've actually come really close to fixing that very issue. but unfortunately, i only had it working for some usergroups, while it was not updating for the others, is this the same problem your having? i'm using v2.2.9.

Metro.

Boofo 03-02-2003 09:08 PM

I am using 2.2.9, also. I "think" I might have it fixed, but not sure. In the code above, try changing:

PHP Code:

$forumid=$foruminfo['forumid']; 

to:

PHP Code:

$forumid=$threadinfo['forumid']; 

and let me know if that fixes it for you.

webhost 03-02-2003 09:19 PM

What file is that in?

Boofo 03-02-2003 09:23 PM

The showthread.php, but you must be using the addon by PPN. ;) If anyone can verify this fixes it, I would appreciate it.

webhost 03-03-2003 08:22 AM

I lloked in showthread php and that is not in the file, could you tell me where the add on is located at

Boofo 03-03-2003 09:10 AM

That code is the addon. It changes the last title to go to the first post in the thread instead of going to the last post like the arrow already does.

iggemonster 04-01-2003 06:24 PM

hi !

does this hack work with 2.3.0 ?

greetz

Kianor 04-03-2003 01:38 PM

i was trying this hack for 2.3.0 but i did't appear to wrk, cause it shows the last title for everyone even if you are not logged in or the forum is a private one.

There's no support for this hack anymore?

Mr. X 04-08-2003 05:32 AM

I installed this hack on my public forum finally (after an upgrade to 2.3.0) and so far I've had no errors at all, same with my localhost test forum. I wish there was a way to disable lastpost for a forum that only registered members can see, but thats my only gripe. I'd really like to get that icon addon though, so I'll install that tomorrow on my test board and see how it goes.

For my private forum, I have that set that only admins/mods can view it, so it doesnt appear to anyone else, so no problems there.

kms 04-08-2003 03:58 PM

i've had it working on 2.26/7/8&9 but its not straight forward on 2.3 because
Code:

$lastposts=$DB_site->query_first("SELECT MAX(lastpost) AS lastpost FROM thread WHERE forumid=$forumid AND visible=1 AND open<>10");
  if ($lastposts['lastpost']>$lastpost) {
  $lastposts=$DB_site->query_first("
      SELECT lastpost,lastposter
      FROM thread
      WHERE forumid = $forumid AND lastpost = '$lastposts[lastpost]'");
  $lastpost=$lastposts['lastpost'];
  $lastposter=$lastposts['lastposter'];
  }

  $lastpostquery=",lastpost='$lastpost',lastposter='".addslashes($lastposter)."'";

isnt in v2.3 /functions/admin/functions.php. How did you get your v2.3.0 working? TIA

Boofo 04-08-2003 04:05 PM

This code was taken straight out of the 2.3.0 functions.php ;)

PHP Code:

  $lastposts=$DB_site->query_first("SELECT MAX(lastpost) AS lastpost FROM thread WHERE forumid=$forumid AND visible=1 AND open<>10");
  if (
$lastposts['lastpost']>$lastpost) {
    
$lastposts=$DB_site->query_first("
            SELECT lastpost,lastposter
            FROM thread
            WHERE forumid = 
$forumid AND lastpost = '$lastposts[lastpost]'");
    
$lastpost=$lastposts['lastpost'];
    
$lastposter=$lastposts['lastposter'];
  }

  
$lastpostquery=",lastpost='$lastpost',lastposter='".addslashes($lastposter)."'"


kms 04-08-2003 04:12 PM

odd ? but thnx, will try again. Yours works ok?

Boofo 04-08-2003 04:28 PM

I'm using 2.2.9, but I took that straight out of the functions.php for 2.3.0. I little tip...if you can't find a block of code, try looking for a single line of code and check it out for the rest of it. Sometimes the formatting is different which will throw things off.

kms 04-08-2003 04:36 PM

thnx. Ignore me btw, its all there, works a treat. Not sure what iwas doing b4? :)

Mr. X 04-08-2003 07:38 PM

"if you can't find a block of code, try looking for a single line of code and check it out for the rest of it. Sometimes the formatting is different which will throw things off."

Yep, thats exactly what I do. Ultraedit's search isnt great, so I just search for the first line, but if its a line that appears a bunch of times in a file, I move to the next and narrow it down, then compare the block of code.

It sucks, wish I could find blocks of code in Ultraedit though.

Boofo 04-08-2003 07:48 PM

Try EditPlus2. You can find whole blocks of code with it, no matter how big. The one line search is why I ditched Ultra-Edit and switched to EditPlus2. Far better editor. ;)

Mr. X 04-10-2003 12:10 AM

Hmm yeah I've been looking into it. UE does have alot of stuff I like, but I might consider switching.

Does the Icon addon work? I get alot of lines that dont appear in 2.3.0 code so Im guessing its a no go now. Bummer, an Icon addition would be nice with this hack.

Oblivion Knight 04-16-2003 10:04 AM

Thanks Scott, it's working flawlessly on 2.3.0 RC3 :)
This is one of those modifications that I believe vBulletin should have as default..

[high]* Oblivion Knight clicks install.[/high]

XP Kid 86 04-18-2003 04:19 PM

hmm odd no matter where i put the
Quote:

<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]">$forum[lastthread]</a>

i cant get it to work .. can you help me out maybe by takin a look at my forum or something .. the hacking went smoothly enough .. im runnin' 2.3.0 .. so can someone please help me this is like a must for a vB


- Speedy

Holidazed 04-22-2003 02:50 PM

I am getting a parse error when trying to delete in posts.

It says:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parse error: parse error in /home2/webbhelp/webbhelper-www/mb/postings.php on line 837
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

It does not give any more information. When deleting a post from within the "Edit Post" section, all is cool, but after viewing the thread (showthread.php) and choosing "Delete Thread / Post" from the " Admin Options" menu, it give me the error above.

See for yourself

http://www.dungeonkeepersdomain.com/mb/postings.php

Help

Alien 05-06-2003 03:55 AM

Just installed this on 2.3.0, and it worked flawlessly SO FAR.

Tested deleting threads (using edit post AS WELL AS deleting directly from the admin options menu inside showthread), moving threads, etc. So far so good...

I'll keep poking around and see if I crash it, heh.

-Jason

Emrys 05-06-2003 04:27 PM

Installed this and everything seems to work fine. Although I cannot figure out how to get a last post with the 25 characters to be even with a last post with say 15 characters.

In other words, everytime that the script adds the "..."s the title is out of line with the non "..."s posts. Example at : http://www.mac-forums.com.

I have tried to edit the template and changing the length of the string. Nothing has an effect on the alignment. Also tried it with bold and not bold. This one is just messing with me.

Any ideas?

I've noticed some boards don't have this issue, so I know it can be fixed. I just can't remember which ones, and I'm not gonna re-read a 25 page thread. I've already read it twice :)

Added an example for quick reference :)

http://mac-forums.com/images/example.gif

See how the top post is a little left of the red line and the other 2 are right on the redline?

It is easier to see when you are looking at whole page.

Alien 05-07-2003 05:14 PM

I'd recommend going over the steps again, as that issue does NOT happen on my side of things...?

Anyone else get this problem?

Alien 05-07-2003 05:22 PM

Wow, I have one site that doesn't have it happen but on my other it certainly does! Hmmmmmmm...

-Jason

Emrys 05-07-2003 05:49 PM

I've seen the problem on other boards.

I have already installed this hack 3 different times. Still no change.

I am thinking it is the way that it would be placed in the template, but everything I've tried that has anything to do with the template does nothing for me.

Thanks though...

Alien 05-07-2003 06:05 PM

Okay, I'll see if I spot something that causes this in the code instead...

-Jason

subu1 05-12-2003 02:20 PM

fine Hack it works on my 2.2.8, but who can i make it, i want to go to the last Posting not to the first Posting in the thread.

thxxx

Austin Dea 05-12-2003 04:02 PM

Quote:

05-07-03 at 12:49 PM Emrys said this in Post #347
I've seen the problem on other boards.

I have already installed this hack 3 different times. Still no change.

I am thinking it is the way that it would be placed in the template, but everything I've tried that has anything to do with the template does nothing for me.

Thanks though...

Try messing with your td widths. If it's a little too small, it'll smush the content into the sides.

I know that seems obvious, but that was my problem. More specifically, my lastpost template width was bigger than the td in forum_level2_post, so it was getting smushed. Make sure everything;s the same and see if it fixes it.

Emrys 05-12-2003 04:10 PM

I don't have any widths specified in the <td>'s.... So I guess everything is the same :)

Austin Dea 05-12-2003 07:55 PM

I think waht's happening is you have the characters displayed set just right so it doesn't stretch the td, but goes a little into the cellpadding. To fix it you either need to widen that cell or shorten the character's displayed length.

Emrys 05-12-2003 07:59 PM

Yeah, I shortened it to 25... I will try to bring it down and see what happens... thanks

The Wedge 05-17-2003 03:37 PM

this hack is great but how do I make the link go to the first post in the thread, not the last. I suck at code, I'm a designer!

Boofo 05-17-2003 04:41 PM

Quote:

Today at 11:37 AM The Wedge said this in Post #354
this hack is great but how do I make the link go to the first post in the thread, not the last. I suck at code, I'm a designer!
The answer to your question is in the thread here somewhere. I remember seeing that posted a while back.

Austin Dea 05-17-2003 05:46 PM

The default hack already does that o_O... Just make sure the forumhome_lastpostby says &goto=$lastpost&forumid=$forum[forumid] in the url.

sonic3d 05-28-2003 05:37 PM

worked flawlessly.

l8er
sonic

MrNase 06-05-2003 12:56 PM

*licking install*

cool lil thing...


has anyone found a way to display "today" instead of the today's date? Why should there be 06-05-03, today looks better :)

Raptor 06-12-2003 04:56 PM

got a problem, 2.3.0 installed and the thread title doesnt appear - anyone know a way around this?

ajk 06-30-2003 03:58 AM

Hi,

I followed the instrucions to the letter.

My problem is this line:

Code:

<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]">$forum[lastthread]</a>
Did not redirect to the correct topic. Also, the user name did not get refreshed to the correct poster either.


I'm using vB 2.3.0 and would love to use this hack. Can someone explain to me what to fix?

Thanks in advance


All times are GMT. The time now is 12:49 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.01600 seconds
  • Memory Usage 1,844KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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