vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Custom Field Apperance (hard to explain so please read) (https://vborg.vbsupport.ru/showthread.php?t=53026)

SouledOut 05-16-2003 10:06 PM

Custom Field Apperance (hard to explain so please read)
 
1 Attachment(s)
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:
Code:

if ($post[customtitle]==2) {
                        $post[usertitle] = htmlspecialchars($post[usertitle]);
                }

Below it add:
Code:

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:


Code:

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.


All times are GMT. The time now is 09:08 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00938 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete