php forum
php mysql forum
php mysql smarty
 
Page 1 of 3 1 2 3 >
Topic Options
#234597 - 01/30/03 08:31 AM Alt tags for preview of thread....?
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989
Has anyone done something simliar to:<br /><br />http://www.eclipseforums.org/forumdisplay.php?s=&forumid=15<br /><br />where the alt tags are set to the first 100 characeters of so of a post to "preview" it before clicking on it?
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#234598 - 01/30/03 12:59 PM Re: Alt tags for preview of thread....? [Re: gailg]
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989
I did it here, pretty easy actually. Just add $Body in postlist.php and then add a title tag to the a href line.<br /><br />I did add something to clean up the $Body (strip_tags and htmlspecialcharacters) and then chopped it off at 100 characters.<br /><br />http://www.viperalley.com/postlist.php?Cat=&Board=offtopic
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#234599 - 01/30/03 03:19 PM Re: Alt tags for preview of thread....? [Re: gailg]
MTO Offline
Addict

Registered: 01/31/00
Posts: 1524
Loc: Burgos, Spain.
Looks great. <img src="/forum/images/graemlins/smile.gif" alt="" /> Can you tell if it slows down the page?
_________________________
Mateo Byler
CruceDeCaminos.com

Top
#234600 - 01/30/03 07:04 PM Re: Alt tags for preview of thread....? [Re: D_Wolfwood]
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989
Not at all - no additional queries are done and it just adds a title tag to the a href link. I only had to add like 5 lines to postlist.php: <br /> <br />[]SELECT t1.B_Number,t1.B_Parent,t1.B_Username,t1.B_Posted,t1.B_Last_Post,t1.B_Last_Number,t1.B_Last_Name,t1.B_Last_Approved,t1.B_Subject,t1.B_Main,t1.B_Status,t1.B_Approved,t1.B_Icon,t1.B_Reged,t1.B_Counter,t1.B_Sticky,t1.B_Replies,t1.B_Rating,t1.B_Rates,t1.B_RealRating,t2.U_Color,t2.U_Status,t1.B_PosterId,t1.B_File,t1.B_Body[/] <br /> <br />[]list($Number,$Parent,$Username,$Posted,$Last_Post,$Last_Number,$Last_Name,$Last_Approved,$Subject,$Main,$Open,$Approved,$icon,$Reged,$Counter,$Sticky,$Replies,$Rating,$Rates,$stars,$Color,$PostStatus,$posterid,$file,$Body) = $dbh -> fetch_array($sth); <br /> <br /> // ------------------------- <br /> // Standard icon is the note <br /> if (!$icon) { <br /> $icon = "book.gif"; <br /> } <br /> <br /> $Body = strip_tags($Body); <br /> $Body = htmlspecialchars($Body); <br /> if ( strlen($Body) > 100 ) { <br /> $Body = substr($Body, 0, 100); <br /> $Body .= " ..."; <br /> }[/] <br /> <br />down a bit where $postlist is being set, add this above the line that sets $Subject: <br /> <br />[]$postrow[$i]['Body'] = $Body; [/] <br />then this to postlist.thtml: <br /> <br />[]<a href="{$config['phpurl']}/$mode.php?Cat=$Cat&amp;Board=$Board&amp;Number={$postrow[$i]['Number']}&amp;page=$page&amp;view=$view&amp;sb=$sb&amp;o=$o&amp;fpart={$postrow[$i]['fpart']}{$postrow[$i]['jumper']}" title="{$postrow[$i]['Body']}">[/]
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#234601 - 01/30/03 07:52 PM Re: Alt tags for preview of thread....? [Re: gailg]
MTO Offline
Addict

Registered: 01/31/00
Posts: 1524
Loc: Burgos, Spain.
Cool! Does it grab the body of the first post? Or the first unread post? It's really cool anyhow it be. <img src="/forum/images/graemlins/applause.gif" alt="" />
_________________________
Mateo Byler
CruceDeCaminos.com

Top
#234602 - 01/30/03 08:21 PM Re: Alt tags for preview of thread....? [Re: D_Wolfwood]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
Okay we sure there is not a step missing <img src="/forum/images/graemlins/wink.gif" alt="" /><br /><br />I did these simple couple lines and I get no box that comes up when I mouse over them like I see on the example forum.<br /><br />I double checked my copy and paste hacking. <img src="/forum/images/graemlins/smile.gif" alt="" /> Everything was copied right.
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#234603 - 01/30/03 08:27 PM Re: Alt tags for preview of thread....? [Re: sf49rminer]
PhotoPost Offline
Hacker

Registered: 02/03/02
Posts: 989
Oh, yes, one more thing.... Down below where the $postrow gets setup; above the $Subject, put this:<br /><br />$postrow[$i]['Body'] = $Body;
_________________________
[]http://www.danasoft.com/vipersig.jpg[/]
Viper Alley - http://www.viperalley.com
Extreme Fitness - http://www.extremefitness.com[/b]

Top
#234604 - 01/30/03 09:02 PM Re: Alt tags for preview of thread....? [Re: gailg]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
I seem to be the one who finds the missing parts <img src="/forum/images/graemlins/wink.gif" alt="" /> <br /> <br />Thanx Michaels works very well now.
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#234605 - 02/03/03 06:43 PM Re: Alt tags for preview of thread....? [Re: sf49rminer]
cstaber Offline
Journeyman

Registered: 08/17/02
Posts: 124
Loc: Tampa, FL
haha wow, that's too cool <img src="/forum/images/graemlins/cool.gif" alt="" />

Top
#234606 - 02/04/03 07:36 AM Re: Alt tags for preview of thread....? [Re: ]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
Very Cool!!<br />This coming out as a finished mod? Seems pretty basic but could use some documentation.<br /><br />For idiots like myself <img src="/forum/images/graemlins/smile.gif" alt="" />

Top
#234607 - 02/05/03 05:16 AM Re: Alt tags for preview of thread....? [Re: gailg]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
Ok got it working.. took me a bit to catch the bold changes <br /><br />This is a cool one for sure!!<br />TY TY TY

Top
#234608 - 02/05/03 05:37 AM Re: Alt tags for preview of thread....? [Re: gailg]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
This only works properly in flat mode... when it expanded mode it translates the tags to the wrong threads. still like the hack but a fix? or did I miss something

Top
#234609 - 02/05/03 06:03 AM Re: Alt tags for preview of thread....? [Re: Kelly]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
flat mod threaded mod. No such animal here. This is the postlist screen <img src="/forum/images/graemlins/wink.gif" alt="" /><br /><br />This is not designed to work on replies. (expanded mod)<br />It will work for about two and break. <img src="/forum/images/graemlins/frown.gif" alt="" /><br /><br />I will look into it and see what I can come up with but all in all Michael did a great job. Quite a small mod but very useful and teasing.
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#234610 - 02/07/03 10:02 AM Re: Alt tags for preview of thread....? [Re: gailg]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
I added this alt text code to the search area here while adding another modification. Hope you don't mind. <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#234611 - 02/07/03 10:51 AM Re: Alt tags for preview of thread....? [Re: sjsaunders]
Dave_L_dup1 Offline
Addict

Registered: 04/23/02
Posts: 1929
Loc: Virginia, USA
Slightly off-topic, but is there any limit to the length of the alt or title text?
_________________________
UBB.threads beta tester / threadsdev.com moderator
Software consulting services including UBB.threads problem resolution / installs / upgrades / customization.

Top
#234612 - 02/07/03 11:12 AM Re: Alt tags for preview of thread....? [Re: joeuser]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
I looked around w3c.org briefly and didn't find any specific references to the length.<br /><br />Just playing around I believe I got over a 1000 characters into it. (IE 6.0)
_________________________
~Dave
ChattersOnline.com

Top
#234613 - 02/07/03 11:57 AM Re: Alt tags for preview of thread....? [Re: gailg]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
I added to the code a bit. I replaced the <br /> tags with new line characters \n before stripping the html so that the tool tip/title display looked more like the actual post. <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />
Code:
<br />		$Body = str_replace("&lt;br /&gt;","\n",$Body);	<br />		$Body = strip_tags($Body); <br />		$Body = htmlspecialchars($Body); <br />		if ( strlen($Body) &gt; 150 ) { <br />			$Body = substr($Body, 0, 150); <br />			$Body .= " ..."; <br />		}<br />
<br /><br />
_________________________
~Dave
ChattersOnline.com

Top
#234614 - 02/07/03 03:35 PM Re: Alt tags for preview of thread....? [Re: sjsaunders]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
Scratch that. Only IE seems to be able to use the new line characters. Mozilla/Netscape and Opera do not. <img src="/forum/images/graemlins/crazy.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#234615 - 02/07/03 03:37 PM Re: Alt tags for preview of thread....? [Re: joeuser]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
Dave_L the size of the "tool tip" varried between IE/Mozilla/Opera. IE was able to display the most.
_________________________
~Dave
ChattersOnline.com

Top
#234616 - 02/07/03 06:27 PM Re: Alt tags for preview of thread....? [Re: sjsaunders]
Dave_L_dup1 Offline
Addict

Registered: 04/23/02
Posts: 1929
Loc: Virginia, USA
Thanks, I was just curious. I'm working on something that may put a lot of text there, and I was wondering if there were any sort of specified limit.
_________________________
UBB.threads beta tester / threadsdev.com moderator
Software consulting services including UBB.threads problem resolution / installs / upgrades / customization.

Top
#234617 - 02/07/03 07:11 PM Re: Alt tags for preview of thread....? [Re: joeuser]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
It seems about a 100 max or so for Opera/Mozilla. <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#234618 - 02/07/03 08:57 PM Re: Alt tags for preview of thread....? [Re: sjsaunders]
Dave_L_dup1 Offline
Addict

Registered: 04/23/02
Posts: 1929
Loc: Virginia, USA
Thanks <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
UBB.threads beta tester / threadsdev.com moderator
Software consulting services including UBB.threads problem resolution / installs / upgrades / customization.

Top
#234619 - 02/08/03 12:36 AM Re: Alt tags for preview of thread....? [Re: sjsaunders]
Lisa_P Offline
Enthusiast

Registered: 03/09/02
Posts: 329
Loc: Michigan, USA
[]Just playing around I believe I got over a 1000 characters into it. (IE 6.0) [/] <br /> <br /> <br />I believe the limit is 1036 (though I can't remember where I saw that now! <img src="/forum/images/graemlins/crazy.gif" alt="" />). Of course that doesn't necessarily mean a browser will display 1036 though, as you've found out. <img src="/forum/images/graemlins/laugh.gif" alt="" /> (oops, it's 1024)


Edited by Lisa_P (02/08/03 12:47 AM)
_________________________
[:"red"]Lisa[/]

Top
#234620 - 02/08/03 12:46 AM Re: Alt tags for preview of thread....? [Re: sjsaunders]
Lisa_P Offline
Enthusiast

Registered: 03/09/02
Posts: 329
Loc: Michigan, USA
[]I looked around w3c.org briefly and didn't find any specific references to the length.<br /><br />Just playing around I believe I got over a 1000 characters into it. (IE 6.0) [/]<br /><br />Ah ha! (Trying to find it was driving me nuts <img src="/forum/images/graemlins/laugh.gif" alt="" />)<br /><br />from w3c: The preliminaries are taken from the HTML DTD and declares the character set as Latin-1, disables markup minimisation and sets limits for tag/attribute names to 34 characters, and attribute values to a maximum of 1024 characters.<br /><br />I was off by 12. <img src="/forum/images/graemlins/crazy.gif" alt="" />
_________________________
[:"red"]Lisa[/]

Top
#234621 - 02/08/03 12:48 AM Re: Alt tags for preview of thread....? [Re: JacquiL]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Go Lisa! <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#234622 - 02/08/03 05:23 AM Re: Alt tags for preview of thread....? [Re: gailg]
Liahona_dup1 Offline
Member

Registered: 12/05/02
Posts: 177
Loc: Scotland
Hi extremebikini<br /><br />[] down a bit where $postlist is being set, add this above the line that sets $Subject: <br /><br /><br /><br />Quote:<br />--------------------------------------------------------------------------------<br /><br />$postrow[$i]['Body'] = $Body; <br /><br /> [/] <br /><br />I have looked for 2 hrs now and can for the life of me find the place to add the above ....<br /><br />down a bit....how long is your string.......<br /><br />can't you do it like the other parts and put in the addition in bold <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />Has anyone out there guessed where this goes, if so could you let us in on the secret....:)<br /><br />I apologise for my thickness but I don't want to %^%$^%$ up my site with trial and error with one line.<br /><br />Could it be this bit which is a long long way down?<br /> // Setup the postrow array<br /> $postrow[$z]['color'] = $rowcolor;<br /> $postrow[$z]['indentsize'] = "0";<br /> $postrow[$z]['icon'] = $icon;<br /> $postrow[$z]['imagesize'] = $imagesize;<br /> $postrow[$z]['Number'] = $Number;<br /> $postrow[$z]['Subject'] = $Subject;<br /><br />Thanks
_________________________
Thanks

Liahona

Top
#234623 - 02/08/03 08:49 AM Re: Alt tags for preview of thread....? [Re: JacquiL]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
LoL you must have some great study habits Lisa!<br /><br />I didn't spend to much time scanning their site. I do recommend it to those that can't sleep though... LoL<br /><br />Thanks for finding the specs! <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#234624 - 02/13/03 11:43 AM Re: Alt tags for preview of thread....? [Re: gailg]
Liahona_dup1 Offline
Member

Registered: 12/05/02
Posts: 177
Loc: Scotland
Hi anybody that's got this working <br /> <br />I still can't get this to work, can anyone explain more what has to be done, as I think I have got lost somewhere on the lines.......... <br /> <br />1..... <br />down a bit where [:"red"] $postlist [/] is being set, add this above the line that sets $Subject: <br /> <br />$postrow[$i]['Body'] = $Body; <br /> <br />And this............................. <br /> <br />2....... <br />Oh, yes, one more thing.... Down below where the [:"red"] $postrow [/] gets setup; above the $Subject, put this: <br /> <br />$postrow[$i]['Body'] = $Body; <br /> <br />Are these the same and if so where do they go??? <br />and if not then where do they both go??? <br /><img src="/forum/images/graemlins/confused.gif" alt="" /> <br /> <br />Also I take it ....this <br /> <br />"then this to postlist.thtml" <br /> <br />should read .......this <br /> <br />"then this to postlist.tmpl" <br />


Edited by Liahona (02/13/03 12:17 PM)
_________________________
Thanks

Liahona

Top
#234625 - 02/13/03 12:23 PM Re: Alt tags for preview of thread....? [Re: jfrosch]
Liahona_dup1 Offline
Member

Registered: 12/05/02
Posts: 177
Loc: Scotland
Hi<br /><br />To late<br /><br />Done it
_________________________
Thanks

Liahona

Top
#234626 - 02/13/03 03:00 PM Re: Alt tags for preview of thread....? [Re: jfrosch]
dimopoulos Offline
Kahuna

Registered: 08/18/02
Posts: 1271
Loc: Vienna, Austria
At least you gave it a try and it worked out in the end. I personally like it when that happens. It gives me more satisfaction.<br /><br />Sorry that I was late George <img src="/forum/images/graemlins/smile.gif" alt="" />
_________________________
Nikos

Top
#234627 - 02/13/03 03:02 PM Re: Alt tags for preview of thread....? [Re: Hal_dup2]
Liahona_dup1 Offline
Member

Registered: 12/05/02
Posts: 177
Loc: Scotland
Thanks anyway Nikos<br /><br />
_________________________
Thanks

Liahona

Top
#234628 - 02/13/03 03:21 PM Re: Alt tags for preview of thread....? [Re: sf49rminer]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
Any luck with (expanded mod)?

Top
#234629 - 02/16/03 06:56 AM Re: Alt tags for preview of thread....? [Re: Kelly]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
Oh boy... replaced one of my files with a original. Whoops..<br /><br />Now I can't get this one working again. I look forward to some better documentation on this one. Will try again tonight if nobody gets to this one. Perhaps the adjustments to the search page could be added too. Thanks for all the hard work and creativity.

Top
#234630 - 02/16/03 08:05 PM Re: Alt tags for preview of thread....? [Re: Kelly]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
I installed YASM and it put the alt tags in the search.

Top
#234631 - 02/16/03 08:12 PM Re: Alt tags for preview of thread....? [Re: Kelly]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
SmilesforU,<br /><br /> The way this hack is designed it will work for expanded view or flat. However the way its coded the default number of entries that this handles is your postlist default each user or the board has as a default. If you have it set to 20 posts on the postlist screen it will do 20 at a time. So the problem is when you go to expanded it will do the first 20 then stop. So it is not a bug when you switch to expanded.<br /><br /> Maybe one of the guru's can think of a better way to get more but like extremebikini said this is a quick and dirty hack that does exactly what it was designed to do.
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#234632 - 02/17/03 12:11 AM Re: Alt tags for preview of thread....? [Re: sf49rminer]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
thanks Chuck... I just need to get it working again.<br /> <br />Having trouble finding the right lines to insert... ugh

Top
#234633 - 02/17/03 01:23 AM Re: Alt tags for preview of thread....? [Re: Kelly]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
(Scripts Removed)


Edited by JoshPet (02/17/03 01:26 AM)

Top
#234634 - 02/17/03 01:26 AM Re: Alt tags for preview of thread....? [Re: Kelly]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Sorry, we can't post whole threads scripts here on the board as they are copyrighted. <img src="/forum/images/graemlins/wink.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#234635 - 02/17/03 01:55 AM Re: Alt tags for preview of thread....? [Re: Daine]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
my bad sorry..

Top
#234636 - 02/21/03 01:05 AM Re: Alt tags for preview of thread....? [Re: joeuser]
Storm_dup1 Offline
Member

Registered: 08/03/02
Posts: 263
Loc: Somewhere above Texas
Has anyone wr