UBB.Dev
To my ubbclassic UBB I added a hack that allowed users to add a personal quote which would show up just above their personal image on the left column of their messages.

How do I do this in ubbthreads? I am able to use one of the extra profile fields for their personal quote, but haven't figured out how to add it on the left column.

Thanks in advance,

FC
There is no way to do it easily, but I'll give it a shot and try to do a hack for you.
That would be awesome!

FC
OK, I've finished the hack and it seems to work fine on my board. I'm using the Extra2 field, but you can change it to any of the others. I've only done it on the flat view at the moment, if you are happy with how it works I'll fix it for the threaded view as well.

Open up the file showflat.php and do the following:

Find a line that looks like this (at line 638):
code:
SELECT t1.B_Number,t1.B_Username,t1.B_Posted,t1.B_IP,t1.B_Subject,t1.B_Body,t1.B_File,t1.B_Status,t1.B_Approved,t2.U_Picture,t1.B_Reged,t2.U_Title,t1.B_Sticky,t2.U_Color,t1.B_Icon,t1.B_Poll,t1.B_ParentUser,t1.B_Parent,t2.U_Status,t2.U_Signature,t1.B_LastEdit,t1.B_LastEditBy,t2.U_Location,t2.U_TotalPosts,t2.U_Registered,t2.U_Rating,t2.U_Rates,t2.U_RealRating,t2.U_PicWidth,t2.U_PicHeight,t2.U_Number



And change it to this, change the U_Extra1 to the extra field that you want to use.
code:
SELECT t1.B_Number,t1.B_Username,t1.B_Posted,t1.B_IP,t1.B_Subject,t1.B_Body,t1.B_File,t1.B_Status,t1.B_Approved,t2.U_Picture,t1.B_Reged,t2.U_Title,t1.B_Sticky,t2.U_Color,t1.B_Icon,t1.B_Poll,t1.B_ParentUser,t1.B_Parent,t2.U_Status,t2.U_Signature,t1.B_LastEdit,t1.B_LastEditBy,t2.U_Location,t2.U_TotalPosts,t2.U_Registered,t2.U_Rating,t2.U_Rates,t2.U_RealRating,t2.U_PicWidth,t2.U_PicHeight,t2.U_Number,t2.U_Extra2



Then find this line (at 652):
code:
list ($Number,$Username,$Posted,$IP,$Subject,$Body,$File,$Open,$Approved,$Picture,$Reged,$Title,$Sticky,$Color,$Icon,$Poll,$Parent,$ParentPost,$PostStatus,$Signature,$LastEdit,$LastEditBy,$Location,$TotalPosts,$Registered,$Rating,$Rates,$stars,$picwidth,$picheight,$usernum) = $dbh -> fetch_array($sth);



And change it into this:
code:
list ($Number,$Username,$Posted,$IP,$Subject,$Body,$File,$Open,$Approved,$Picture,$Reged,$Title,$Sticky,$Color,$Icon,$Poll,$Parent,$ParentPost,$PostStatus,$Signature,$LastEdit,$LastEditBy,$Location,$TotalPosts,$Registered,$Rating,$Rates,$stars,$picwidth,$picheight,$usernum,$userextra2) = $dbh -> fetch_array($sth);



Then find this line (at 656):
code:
if ( ($Reged == 'y') && ($usernum != 1)){



And add this line AFTER it:
code:
$postrow[$i]['Extra2'] = $userextra2;




You should now be able to add "{$postrow[$i]['Extra2']}" where you want it to show up in the showflat.tmpl template.
To add it above the user picture, find this code:
<tr>
<td class="small">
{$postrow[$i]['Picture']}
<br />
</td>
</tr>

And add the following BEFORE it:
<tr>
<td class="small">
{$postrow[$i]['Extra2']}
<br />
</td>
</tr>
Hi Gardener,

I updated my board and it works flawlessly. I presume that the changes to the threaded view are similar to these? I'll take a look.

I suppose a check could be added so if there is no data in the field, nothing happens. Although if the field is blank, it inserts a blank line which cosmetically speaking looks okay to me. Also, is there a limit on the amount of text allowed?

This is a much appreciated hack. Thanks much for your time and effort!

FC
Yeah, it should be about the same for the threaded view, the query will look a bit different though.

I'll make the changes needed for the threaded view, tidy up the instructions and release it as a new mod. I think I'll make it read all the Extra-info so that it's possible to add the ones you want to the template. I could add the <br>-tag to the string and only if it's not empty, which would stop it from being an empty line. But then if someone don't want there to be a <br> at all? Tricky question.

The Extra-fields are limited to 200 characters each in the database, so that is maximum. You can alter the database so that the fields are TEXT instead, then you would have a lot more.

I'm glad to be able to help, I was bored and I thought it would be nice to be able to use the Extra-info on posts.
I was able to add the same to the threaded view without any problem.
FC
© UBB.Developers