Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Mod Name: Alt Body Preview 1.0

Description: As you mouse over the subjects on the postlist page, the tool tip will pop up and show you the list of the first 100 characters of the post.

Author: extremebikini

Credits: written up by JoshPet

Date: 1/30/03

Demo: It's in use here... check out the postlist page.

Working Under: 6.2

Files Modified: postlist.php, postlist.tmpl

New Files: none

Database Modifications: None

Note: I take no credit for this. Michael (extremebikini) created it, but the thread where it got created got confused, and most folks couldn't extract the directions from the thread. I'm just good at writing them up.
Attachments
75631-AltBodyPreview1.0.txt (0 Bytes, 107 downloads)

Sponsored Links
Daine #242592 04/14/2003 4:04 PM
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
Why this hack dont work in[6.1.1] ??? I cant understand this. I did all steps and nothing What is add to 6.2 that allready work correctly? Please tell me...

Dawg_dup1 #242593 04/14/2003 4:10 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Well.. you can't use the whole lins, as the Database field names are somewhat different in 6.1. In 6.2 several of the DB fields were dropped in relation to the Username thing.

You'd need to add the bits U_Body and $Body to the end of the lines like those.... but you won't find those lines in 6.1.

Daine #242594 04/14/2003 4:50 PM
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
Yes, I added only t1.B_Body and $body, not whole lines...
It doesnt work far.

Dawg_dup1 #242595 04/14/2003 5:51 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Make sure you used $Body. Variables are case sensitive.

For 6.1.1. I think you'd need to change this:

$query = "
SELECT t1.B_Number,t1.B_Parent,t1.B_Username,t1.B_Posted,t1.B_Last_Post,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


To this:

$query = "
SELECT t1.B_Number,t1.B_Parent,t1.B_Username,t1.B_Posted,t1.B_Last_Post,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


And this:

list($Number,$Parent,$Username,$Posted,$Last_Post,$Subject,
$Main,$Open,$Approved,$icon,$Reged,$Counter,$Sticky,$Replies,$Rating,
$Rates,$stars,$Color,$PostStatus,$posterid,$file) = $dbh -> fetch_array($sth);

// -------------------------
// Standard icon is the note
if (!$icon) {
$icon = "book.gif";
}


To this:

list($Number,$Parent,$Username,$Posted,$Last_Post,$Subject,
$Main,$Open,$Approved,$icon,$Reged,$Counter,$Sticky,$Replies,$Rating,
$Rates,$stars,$Color,$PostStatus,$posterid,$file,$Body) = $dbh -> fetch_array($sth);

// -------------------------
// Standard icon is the note
if (!$icon) {
$icon = "book.gif";
}

// -------------------
// Limit the number of characters in the Body - by extremebikini
$Body = strip_tags($Body);
$Body = htmlspecialchars($Body);
if ( strlen($Body) > 100 ) {
$Body = substr($Body, 0, 100);
$Body .= " ...";
}



The postrow[$z] step and the changes to the tmpl file are the same.



Sponsored Links
Daine #242596 04/15/2003 10:54 AM
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
hmm... I think that I did exactly You wrote, but it doent work

Dawg_dup1 #242597 04/15/2003 11:50 AM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You had $body instead of $Body.

Daine #242598 04/15/2003 12:15 PM
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
Ok.. I see...

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
thanks for the writeup josh


- Allen wavey
- What Drives You?
Joined: Jun 2002
Posts: 160
Member
Member
Offline
Joined: Jun 2002
Posts: 160
Yes, thank you very much for consolidating and clarifying this.

Sponsored Links
Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
Yes, thanks Josh!

:lol:

Joined: Jun 2002
Posts: 160
Member
Member
Offline
Joined: Jun 2002
Posts: 160
Uhm, something of a problem with your direction - the text you have listed for some of the replacements seems to presume that the "Last Post By" mod is installed, as it speficially references database elements unique to that script. I tried installing the Alt Body Preview mod, and didn't have the Last Post By mod installed, and it wreaked all havoc and generated major mysql errors.

As a suggestion, either clean up the instructions to not list those please, or list the Last Post By mod as a pre-req.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
>>As a suggestion, either clean up the instructions to not list those please, or list the Last Post By mod as a pre-req.

Duh

LastPost mod should NOT be a requirement for this. I thought I had made this using a clean copy of 6.2. But let me check. I might have used a clean copy of 6.3.

At a glance I don't see it. What error did you get or what step do you think has LastPost by code? The 6.2 version or the 6.1 version?

Joined: Jun 2002
Posts: 160
Member
Member
Offline
Joined: Jun 2002
Posts: 160
Here's an example of what I was getting for postlist.php after trying to install this mod as it's documented:

Unable to do_query: SELECT t1.B_Number,t1.B_Parent,t2.U_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_Replies,t1.B_Rating,t1.B_Rates,t1.B_RealRating,t2.U_Color,t2.U_Status,t1.B_PosterId,t1.B_File,t2.U_Number,t1.B_Sticky,t1.B_AnonName,t1.B_Body FROM w3t_Posts AS t1, w3t_Users AS t2 WHERE t1.B_Topic = 1 AND t1.B_Board = 'main' AND t1.B_PosterId = t2.U_Number AND (t1.B_Last_Post > 1049229624 OR t1.B_Sticky = '1') ORDER BY t1.B_Sticky DESC,t1.B_Last_Post DESC LIMIT 21 - Unknown column 't1.B_Last_Number' in 'field list'

The version I was using was the original attachment, which I believe is the 6.2 version.

Last edited by ZealotOnAStick; 04/15/2003 9:27 PM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
[]ZealotOnAStick said:
As a suggestion, either clean up the instructions to not list those please, or list the Last Post By mod as a pre-req. [/]

As a suggestion... don't make suggestions unless you know what you're talking about. Particularly when someone took the time out of a busy day to put them together for others (you) who had difficulty following the other posted instructions.

I just double checked again...
These instructions are written for a clean copy of 6.2.3. There is no Last Post by hack code that I see in the attached instructions.

If you can be more specific than "wreaked all havoc" (post errors you receive etc...) I might be able to help you get it installed if I have time to do so. Otherwise my assumption is that you did it wrong.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
This is the query you are doing:

SELECT t1.B_Number,t1.B_Parent,t2.U_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_Replies,t1.B_Rating,t1.B_Rates,t1.B_RealRating,t2.U_Color,t2.U_Status,t1.B_PosterId,t1.B_File,t2.U_Number,t1.B_Sticky,t1.B_AnonName,t1.B_Body

This is the query in my instructions:

SELECT t1.B_Number,t1.B_Parent,t2.U_Username,t1.B_Posted,t1.B_Last_Post,t1.B_Subject,t1.B_Main,t1.B_Status,t1.B_Approved,t1.B_Icon,t1.B_Reged,t1.B_Counter,t1.B_Replies,t1.B_Rating,t1.B_Rates,t1.B_RealRating,t2.U_Color,t2.U_Status,t1.B_PosterId,t1.B_File,t2.U_Number,t1.B_Sticky,t1.B_AnonName,t1.B_Body



You are trying to query last post by mod fields.... but they are not in my instructions. The word "last" appears in the attachment only 4 times.

You did it wrong. Start with a fresh copy and try again.

Joined: Jun 2002
Posts: 160
Member
Member
Offline
Joined: Jun 2002
Posts: 160
My apologies, then. Something got screwed up somewhere.

Joined: Jun 2002
Posts: 160
Member
Member
Offline
Joined: Jun 2002
Posts: 160
[] As a suggestion... don't make suggestions unless you know what you're talking about. Particularly when someone took the time out of a busy day to put them together for others (you) who had difficulty following the other posted instructions. [/]

Sorry. I'm very frazzled after spending a couple of hours repairing things after I managed to do whatever it was I did to screw things up so badly on the HP forums. I've taken flak from one of the other users, and I managed to hit the wrong tab on a paste, and promptly overwrite the backup of postlist.php I'd made before starting the mod. I didn't mean to be rude to you.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369

Accepted. I understand.

A bunch of us donate our time here and post stuff for others to use, purely because we want to be helpful and for the good of the "community".

It's discouraging when people criticize you for doing so... makes it seem alot easier to keep your mods to yourself so that you don't need help people and take abuse.

We don't want that to happen as the more mods shared, the more mods that get posted, the more cool toys we get to play with.

Joined: Aug 2002
Posts: 239
Member
Member
Joined: Aug 2002
Posts: 239
I'm glad you said that Josh....

Being a non-programmer for sure, you have helped me out pretty much every time I've been lost and I've watched you and the others do the same. Chuck helped me with something as well. Good thing there are a lot more of us out here who are thankful for all the stuff you all do than what we saw above....


Some people read their stars..... I choose to write my own
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Updated this for 6.3 and posted here.


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
isaac
isaac
California
Posts: 1,157
Joined: July 2001
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)