Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: May 2001
Posts: 32
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 32
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

Last edited by flyingcrow; 07/21/2002 6:17 PM.
Sponsored Links
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
There is no way to do it easily, but I'll give it a shot and try to do a hack for you.

Joined: May 2001
Posts: 32
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 32
That would be awesome!

FC

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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>

Joined: May 2001
Posts: 32
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 32
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

Last edited by flyingcrow; 07/22/2002 3:32 AM.
Sponsored Links
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: May 2001
Posts: 32
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 32
I was able to add the same to the threaded view without any problem.
FC


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
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 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 20240430)