PDA

View Full Version : Added info under avatars


Smallville
01-16-2002, 08:12 PM
I think this has been done, but can't find it.

How do you add other info below a user's name and avatar in each post. I notice here you have the regulars Location, etc. but you also have Hacks: ##

How do I add certain stuff. I'm not sure all I want to add yet, but if you could tell me and set a place for me to change with what I want, that would be great.

Rose
01-16-2002, 08:31 PM
You'll need to edit the 'postbit' template. Sorry I can't offer much more help, though.

Shenlong
01-16-2002, 09:08 PM
Make a new User Profile field, call it for example:


Hacks


the description is irrelivant, field, etc. make sure it is ordered right, so it is a specific 9 or whatever.

Then, go to postbit and add your field name, the code in your postbit will look a little like:

<table bgcolor="{pagebgcolor}" width="{tablewidth}" cellpadding="0" cellspacing="0" border="0"><tr><td width="10"><img width="10" height="1" src="{imagesfolder}/space.gif" alt=""></td><td width="100%"><!-- spacer -->

<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr>
<td bgcolor="$post[backcolor]" width="175" valign="top" nowrap>
<a name="post$post[postid]"></a>
$post[firstnewinsert]
<normalfont><b>$post[username]</b></normalfont><br>
<smallfont>$post[usertitle]</smallfont><br>
$post[avatar]<p>
<smallfont>Registered: $post[joindate]<br>
Location: $post[field2]<br>
Posts: $post[posts]</smallfont><br>
<smallfont><a href="moderator.php?s=$session[sessionhash]&action=points&userid=$userinfo[userid]" target=_blank>Points:</a> $post[field8]<br></smallfont>
<smallfont>Style: <a href='index.php?styleid=$post[styleid]'>$post[styletitle]</a></smallfont></td>

<td bgcolor="$post[backcolor]" width="100%" valign="top">
<smallfont>$post[icon] <b>$post[title]</b></smallfont>
<p><normalfont>$post[message]</normalfont></p>
$post[attachment]
<p>$post[signature]</p>
<p>$post[editedby]</p>
<p align="right"><smallfont><a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a> | $post[iplogged]</smallfont></p>
</td>
</tr>
<tr>
<td bgcolor="$post[backcolor]" width="175" height="16" nowrap><smallfont>$post[foldericon]
$post[postdate] <font color="{timecolor}">$post[posttime]</font></smallfont></td>

<td bgcolor="$post[backcolor]" width="100%" valign="middle" height="16">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="bottom">
<td><smallfont>$onlinestatus
$post[profile] $post[pmlink] $post[useremail] $post[homepage] $post[search] $post[buddy]
<!-- $ post[icqicon] --> <!-- $ post[aimicon] --> <!-- $ post[yahooicon] -->
</smallfont></td>
<td align="right" nowrap><smallfont>
<a href="editpost.php?s=$session[sessionhash]&action=editpost&postid=$post[postid]"><img src="{imagesfolder}/edit.gif" border="0" alt="Edit/Delete Message"></a>
<a href="newreply.php?s=$session[sessionhash]&action=newreply&postid=$post[postid]"><img src="{imagesfolder}/quote.gif" border="0" alt="Reply w/Quote"></a>
</smallfont></td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr></table>

<!-- spacer --></td><td width="10"><img width="10" height="1" src="{imagesfolder}/space.gif" alt=""></td></tr></table>
[QUOTE]

Just basically like that, find:

[QUOTE]<a name="post$post[postid]"></a>
$post[firstnewinsert]
<normalfont><b>$post[username]</b></normalfont><br>
<smallfont>$post[usertitle]</smallfont><br>
$post[avatar]<p>
<smallfont>Registered: $post[joindate]<br>
Location: $post[field2]<br>

And you can add your stuff. For example, look at registered, it is looking off of a field in your add profile fields (apparently, field 2) to find your joindate. You can do something like this if you are a more advanced hacker and make it link to a php file you edit:

<smallfont><a href="moderator.php?s=$session[sessionhash]&action=points&userid=$userinfo[userid]" target=_blank>Points:</a> $post[field8]<br></smallfont>


For example thats the post/karma hack, he is using the point field, this is a very very baisc overview. It does require certain work on the hacking side though

Smallville
01-17-2002, 01:54 AM
Gotcha. One question. If I just want to add stuff from my custom profile fields there, can I just past <smallfont><a href="moderator.php?s=$session[sessionhash]&action=points&userid=$userinfo[userid]" target=_blank>Points:</a> $post[field8]<br></smallfont>

and edit the Points:</a> $post[field8] part to the name I want where Points: is, and the field number?

That would be easy.

bobbydavro
01-17-2002, 02:09 PM
This looks a bit like what I was about to ask.

i have a custom field called support (football team a user supports) and I want to display that under avatar etc like what this post dicusses.

Can someone just break it down a bit more basic for me as I'm struggling to follow it.

bobbydavro
01-17-2002, 02:16 PM
Ok the last bit what Smallville has put works thats fine,

Does it not cause any problems to have several of these things at the side? Bandwidth/Server etc?

Shenlong
01-17-2002, 06:26 PM
youd have to edit the action also, moderator.php is basically sourcing off of the points script. Not very sure of the biography variable (ex).

Smallville
01-17-2002, 09:49 PM
Think I got it.

So change the ><a href="moderator.php?s=$session[sessionhash...... part to the specific link?

Where do I find that specific link?

Coolj
01-20-2002, 08:49 PM
I want to add registration number anyone know the variable for that?

Where is postbit?

Smallville
01-20-2002, 09:12 PM
I believe the variable is $userid for their registration number. Try sending an e-mail to yourself through the admin Control Panel just to you, with the $userid variable somewhere in that. If you get the e-mail with a number in that place, it will be right.

Coolj
01-20-2002, 09:15 PM
heh, thanks.. Im still lost though... On implementing that.

thesteveco
01-29-2002, 11:48 PM
Hey CoolJ, I just got this working on my site in about 10 minutes after finding this thread.

Add the field you'd like at the admin Control Panel under User Fields. Find out the profilefieldid through MySQL or by hovering the mouse over the link to edit that new field... you'll see it in the URL.

Now go to Templates // Modify, expand the template list, expand the Postbit templates, edit the postbit template. Search for Posts: and change it from

Posts: $post[posts]</smallfont></td>

to

Posts: $post[posts]<br>
NewField: $post[fieldx]</smallfont></td>

Note that fieldx would be field5, field21, etc, based on your profilefieldid mentioned earlier.

Hope that helps.

Coolj
02-10-2002, 02:46 PM
Hey Thanks dude.. I just saw this and got it to work instantly.