UBB.Dev
Posted By: Sky YYZ Mouse-over Display - 04/01/2004 11:46 PM
In the "Last Post" column on the "Main Index" page, lengthly topic headers are cut off with "..." trailing the last acceptable character.

Is it possible to make it so that when you hold your mouse over the topic line it will display the full text header in the little box above the pointer for IE users?

Hope this makes sense... worked all day on only 5 hours sleep.

Jason
Posted By: Sky YYZ Re: Mouse-over Display - 04/01/2004 11:52 PM
For example, here is a current "Last Post" topic:

Re: Useful MySQL Queries f...

but the full topic header is:

Re: Useful MySQL Queries for UBB.Threads
Posted By: AKD96 Re: Mouse-over Display - 04/03/2004 4:16 AM
In ubbthreads.php, try changing this:
[]
$lastpost = "<img src="{$config['images']}/icons/$Icon" $imagesize $imagestyle alt="*" /> <a href="{$config['phpurl']}/$linker.php?Cat=$Cat&Number=$lastnumber&Main=$lastmain#Post$lastnumber"> $Subject</a>";
[/]
to this:
[]
$lastpost = "<img src="{$config['images']}/icons/$Icon" $imagesize $imagestyle alt="*" /> <a href="{$config['phpurl']}/$linker.php?Cat=$Cat&Number=$lastnumber&Main=$lastmain#Post$lastnumber" alt="$Subject"> $Subject</a>";
[/]

Not tested, but it should work. Should be stock, IMHO.
Posted By: AKD96 Re: Mouse-over Display - 04/03/2004 5:14 AM
Okay, no, that doesn't work. I haven't delved into raw HTML in a while. I put it on the image, but it seems the $Subject variable is being truncated beforehand, so I have to pinpoint that.
Posted By: AKD96 Re: Mouse-over Display - 04/03/2004 9:07 AM
Okay, this WILL work.

In ubbthreads.php find:
Code
 <br />      // If we have a last post for this board we link to it <br />         $lastpost = ""; <br />         if ($Poster) { <br />			   $append = ""; <br />				if (strlen($Subject) > 26) { <br />				   $append = "..."; <br />				} <br />				$Subject = substr($Subject,0,26); <br />				$Subject .= $append; <br />            if (!$Icon) { $Icon = "blank.gif"; } <br />            $imagesize = $images['icons']; <br />            $lastpost = "<img src=\"{$config['images']}/icons/$Icon\" $imagesize $imagestyle alt=\"*\" /> <a href=\"{$config['phpurl']}/$linker.php?Cat=$Cat&amp;Number=$lastnumber&amp;Main=$lastmain#Post$lastnumber\"> $Subject</a>"; <br />            $lastposter = "($Poster)"; <br />         } <br />         else { <br />            $lastposter = ""; <br />         } <br />


and replace it with:

Code
 <br />      // If we have a last post for this board we link to it <br />         $lastpost = ""; <br />	   $SubjectLong = "$Subject"; <br />         if ($Poster) { <br />			   $append = ""; <br />				if (strlen($Subject) > 26) { <br />				   $append = "..."; <br />				} <br />				$Subject = substr($Subject,0,26); <br />				$Subject .= $append; <br />            if (!$Icon) { $Icon = "blank.gif"; } <br />            $imagesize = $images['icons']; <br />            $lastpost = "<img src=\"{$config['images']}/icons/$Icon\" $imagesize $imagestyle alt=\"$SubjectLong\" /> <a href=\"{$config['phpurl']}/$linker.php?Cat=$Cat&amp;Number=$lastnumber&amp;Main=$lastmain#Post$lastnumber\"> $Subject</a>"; <br />            $lastposter = "($Poster)"; <br />         } <br />         else { <br />            $lastposter = ""; <br />         } <br />
Posted By: Sky YYZ Re: Mouse-over Display - 04/04/2004 3:09 AM
Hi DLW,

Thanks for the suggestion! Unfortunately when I made the changes it didn't work. I have Josh's spider code installed and a couple of other mods, maybe that has something to do with it since it seems to work for you. Maybe it will be stock in 6.5 final.

Anyway, I appreciate your obvious effort... thank you.

Jason
Posted By: Pilgrim Re: Mouse-over Display - 04/04/2004 5:15 AM
Well, I tried it too and it didn't work for me either. What happened when I added the mod was the "Last Post" text changed to: etc...?? and no mouseover text. I too appreciate the effort even though it wouldn't work for me. []http://www.the-highway.com/Smileys/sad02.gif[/]

Jeff
Posted By: AKD96 Re: Mouse-over Display - 04/04/2004 7:19 AM
Does the stock code I posted look the same as yours? I too have PetJoshs' spider code, but that's not an issue since the code of it is not involved here.
Posted By: Pilgrim Re: Mouse-over Display - 04/04/2004 7:37 AM
[]DLWebmaestro said:
Does the stock code I posted look the same as yours? I too have PetJoshs' spider code, but that's not an issue since the code of it is not involved here. [/]
[]http://www.the-highway.com/Smileys/yep.gif[/] Looks the same as what I have. And, I don't have the "spider code".
Posted By: Sky YYZ Re: Mouse-over Display - 04/04/2004 12:36 PM
DLW,

Yes, stock code is the same... I thought maybe a [modified] dependent php module might depend on ubbthreads.php or something. In any case I do appreciate the effort.

Jason
Posted By: J.C. Re: Mouse-over Display - 04/06/2004 2:32 AM
Here's how I did it on mine..


// If we have a last post for this board we link to it
$lastpost = "";
if ($Poster) {
$append = "";
$Subject_full = $Subject;
if (strlen($Subject) > 26) {
$append = "...";
}
$Subject = substr($Subject,0,26);
$Subject .= $append;
if (!$Icon) { $Icon = "blank.gif"; }
$imagesize = $images['icons'];
$lastpost = "<img src="{$config['images']}/icons/$Icon" $imagesize $imagestyle alt="*" /> <a href="{$config['phpurl']}/$linker.php{$var_start}Cat{$var_eq}$Cat{$var_sep}Number{$var_eq}$lastnumber{$var_sep}Main{$var_eq}$lastmain{$var_extra}#Post$lastnumber" title="$Subject_full" alt="$Subject_full"> $Subject</a>";
$lastposter = "($Poster)";
}
else {
$lastposter = "";
}
Posted By: Sky YYZ Re: Mouse-over Display - 04/06/2004 5:14 AM
Works like a charm, thanks J.C.
Posted By: Pilgrim Re: Mouse-over Display - 04/06/2004 5:22 AM
Thanks, J.C.... that mod works perfectly!! []http://www.the-highway.com/Smileys/BigThumbUp.gif[/]

Jeff
Posted By: Sky YYZ Re: Mouse-over Display - 04/06/2004 5:33 AM
Whoops! Not compatible with the spider mod... oh well, maybe it'll be stock in 6.5 since it's supposed to include the spider mod. Thanks anyway, J.C.
Posted By: JoshPet Re: Mouse-over Display - 04/06/2004 7:59 AM
Change this line like this and it should work:

href="{$config['phpurl']}/$linker.php/Cat/$Cat/Number/$lastnumber/Main/$lastmain/#Post$lastnumber" title="$Subject_full" alt="$Subject_full"> $Subject</a>";

Posted By: J.C. Re: Mouse-over Display - 04/06/2004 4:39 PM
Thanks Josh, feel free to edit my post to make sure there are no more probs..
Posted By: Sky YYZ Re: Mouse-over Display - 04/07/2004 12:21 AM
Beauty... once and for all (w/vs. 6.4.2) I can say it works like a charm! Thanks guys.

J
Posted By: Pilgrim Re: Mouse-over Display - 04/15/2004 7:32 PM
I just got a complaint that when you click on the linked subject in that "Last Post" column, after installing this hack.... (both JC's and Josh's tried) you get a 404 Error Page not Found (w/JC's version) and a Board error, Cannot find the file (w/Josh's version).

I don't have the "spider mod" installed, so I'm not surprised that Josh's version didn't work, either in displaying the mouseover etc. But JC's version does fix the mouseover display as I reported earlier, but I never bothered to click on any of the links in that column myself []http://www.the-highway.com/Smileys/duh2.gif[/].

So, I'm wondering if anyone else using 6.4.1 who has tried this fix has the same problem?

Jeff
Posted By: JoshPet Re: Mouse-over Display - 04/16/2004 6:22 AM
Copy the URL that it's trying to go to - make sure that's a valid link. Might be a typo or invalid tag. Looking at what link is producing the 404 error will give you a clue.
Posted By: PaNTerSan Re: Mouse-over Display - 04/23/2004 10:31 AM
[]J.C. said:
$lastpost = "<img src="{$config['images']}/icons/$Icon" $imagesize $imagestyle alt="*" /> <a href="{$config['phpurl']}/$linker.php{$var_start}Cat{$var_eq}$Cat{$var_sep}Number{$var_eq}$lastnumber{$var_sep}Main{$var_eq}$lastmain{$var_extra}#Post$lastnumber" title="$Subject_full" alt="$Subject_full"> $Subject</a>";
[/]
I guess we should define $var_eq, $var_sep and $var_extra
Posted By: Ellen Re: Mouse-over Display - 04/27/2004 2:33 PM
I just changed the "26" number in the code to "50" or some other number large enough to get in all the chracters you want.
Posted By: isaac Re: Mouse-over Display - 03/23/2005 11:29 PM
Small revision and my final code...

this removes that "Re: " from the subject replies.. and also get rid of the the special charactors such as Quotes and Apostraphies that may mess with html.

in ubbthreads.php, find...

Code
<br />         if ($Poster) {<br />			   $append = "";<br />				if (strlen($Subject) > 26) {<br />				   $append = "...";<br />				}<br />				$Subject = substr($Subject,0,26);<br />				$Subject .= $append;<br />            if (!$Icon) { $Icon = "blank.gif"; }<br />


replace with...
Code
<br />         if ($Poster) {<br />			   $append = "";<br />				$Subject = str_replace("Re: ", "", $Subject);<br /><br />		   $Subject_full = $Subject;<br />		   $Subject_full = strip_tags($Subject_full); <br />		   $Subject_full = htmlspecialchars($Subject_full); <br /><br />				if (strlen($Subject) > 26) {<br />				   $append = "...";<br />				}<br />				$Subject = substr($Subject,0,26);<br />				$Subject .= $append;<br />            if (!$Icon) { $Icon = "blank.gif"; }<br />



and just under that line, at "$lastpost =", replace...
Code
<br />> $Subject</a>";<br />


with...
Code
<br />title=\"$Subject_full\" alt=\"$Subject_full\">$Subject</a>";<br />
© UBB.Developers