Previous Thread
Next Thread
Print Thread
Rate Thread
#271826 04/01/2004 4:46 PM
Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
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

Sponsored Links
Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
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

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
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.

eslmix #271829 04/02/2004 10:14 PM
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
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.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
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 />

Sponsored Links
Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
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

eslmix #271832 04/03/2004 10:15 PM
Joined: Jun 2000
Posts: 190
Enthusiast
Enthusiast
Joined: Jun 2000
Posts: 190
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


Artificial Intelligence is no match for natural stupidity!
Tachyon #271833 04/04/2004 12:19 AM
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
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.

eslmix #271834 04/04/2004 12:37 AM
Joined: Jun 2000
Posts: 190
Enthusiast
Enthusiast
Joined: Jun 2000
Posts: 190
[]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".


Artificial Intelligence is no match for natural stupidity!
Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
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

Sponsored Links
Joined: Aug 2000
Posts: 1,290
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,290
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 = "";
}


- Custom Web Development
http://www.JCSWebDev.com
chrisX #271837 04/05/2004 10:14 PM
Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
Works like a charm, thanks J.C.

chrisX #271838 04/05/2004 10:22 PM
Joined: Jun 2000
Posts: 190
Enthusiast
Enthusiast
Joined: Jun 2000
Posts: 190
Thanks, J.C.... that mod works perfectly!! []http://www.the-highway.com/Smileys/BigThumbUp.gif[/]

Jeff


Artificial Intelligence is no match for natural stupidity!
Tachyon #271839 04/05/2004 10:33 PM
Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
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.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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>";


Daine #271841 04/06/2004 9:39 AM
Joined: Aug 2000
Posts: 1,290
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,290
Thanks Josh, feel free to edit my post to make sure there are no more probs..


- Custom Web Development
http://www.JCSWebDev.com
Joined: Dec 2003
Posts: 123
Junior Member
Junior Member
Offline
Joined: Dec 2003
Posts: 123
Beauty... once and for all (w/vs. 6.4.2) I can say it works like a charm! Thanks guys.

J

Joined: Jun 2000
Posts: 190
Enthusiast
Enthusiast
Joined: Jun 2000
Posts: 190
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


Artificial Intelligence is no match for natural stupidity!
Tachyon #271844 04/15/2004 11:22 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Joined: Mar 2004
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2004
Posts: 118
[]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


Kind regards,
PaNTerSan
Joined: Sep 2000
Posts: 159
Member
Member
Offline
Joined: Sep 2000
Posts: 159
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.

Joined: Jul 2001
Posts: 1,157
Likes: 82
coffee and code
coffee and code
Joined: Jul 2001
Posts: 1,157
Likes: 82
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 />


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)