View Full Version : Custom Field Apperance (hard to explain so please read)
SouledOut
05-16-2003, 10:06 PM
I'm beginning new work on my forums. We have a custom field ($post[field5]) and it's applied threw the Admin CP. As you can see, it's at the bottom of the postbit (it says Stardust Executive, in bold). Now, I want to move that to one field below the avatar, and have it appear only if the person has a custom title (I was able to do that with the Online Status, it's gone unless the user is online). Now, I've been having alot of trouble. From looking at the other templates, I made a new one called 'postbit_status'. I tried including varibles $post[status], $postbit_status, and just $status. I also edited the showthread.php to get the information from that template in the varible $postbit_status, and nothing. I'm hoping there's some easy, magical way to do this in PHP Include. Please help me out.
-Eric
(Note: I orginally posted this at vbt.com, but they said it needs to be hacked, like I feared....)
SouledOut
05-16-2003, 10:47 PM
Heh, you consider it a request I see. I wouldn't have...
SouledOut
05-17-2003, 12:42 AM
I really hate to bump, but I really need this help.
EvilLS1
05-17-2003, 10:53 AM
I'm not sure I understand exactly what you're asking. Do you mean that you just want the word "status" with the custom field (field5) to only appear in the postbit if the user has entered something in the field? Something like Status: $post[field5] ?
If so, thats easy enough..
In admin/functions.php find:
if ($post[customtitle]==2) {
$post[usertitle] = htmlspecialchars($post[usertitle]);
}
Below it add:
if ($post[field5]!="") {
$status="<smallfont><b>Status:</b> $post[field5]</smallfont><br>";
} else {
$status="";
}
Then go to your postbit template and put $status below the avatar or where ever you want it to appear.
EvilLS1
05-17-2003, 11:53 AM
Ah, I think I know what you're asking for now.. You want to call a template that contains $post[field5] along with some html (table tags) right?
If thats what you mean, instead of using the code that I posted above, use this:
if ($post[field5]!="") {
eval("\$status = \"".gettemplate("Your_Template_Name")."\";");
} else {
$status="";
}
Change the 'Your_Template_Name' to whatever template you want to show. Then put $status in your postbit where you want it to display. It will only show up if the user has entered something in the field.
Hope that helps.
SouledOut
05-17-2003, 08:51 PM
YES!!! It worked! If I get your permission, can I make a hack for it (it'd be a hack on how to have tables appear only if a user has info to input, or some other crazy name)
gmarik
05-17-2003, 09:27 PM
EvilLS1 - make amini hack of it, I beg you!
EvilLS1
05-17-2003, 10:58 PM
Post it if you want but I'm pretty sure this has already been posted numerous times here in the request forum.
BTW, you guys should check out Logician's Dynamic Templates hack. It allows you to do several things like this with only template edits which makes small hacks like this one obsolete.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.