vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Assistance Hiding Gif (https://vborg.vbsupport.ru/showthread.php?t=12133)

Bane 03-23-2001 02:28 PM

Bear with me, as I sometimes don't make much sense.

I have created a custom field, settable by admin/mod only, and would like to have the Post and Member information show a .gif with the name of the field. I accomplised this by using

<img src="{ imagesfolder }/$post[field5].gif">

Now my problem is, if the field is blank, it shows a large red blank image x. Which I must say is quite counterproductive to my needs.

So what I need is a way to hide this if the field is blank. but I am not sure how to go about this. I'm guessing I need to edit the showthread.php and member.php files, but I'm not sure where or how. I tried a little tampering but was unsuccessful.

03-23-2001 03:59 PM

Code:

if ($post[field5] != ""):
    $customfield5 = "<img src='{ imagesfolder }/$post[field5].gif'>";
else:
    $customfield5 = "";
endif;

In showthread.php, find
Code:

    if ($post[yahoo]!="") {
      eval("\$post[yahooicon] = \"".gettemplate("yahoo")."\";");
    } else {
      $post[yahoo]="";
    }

and add my code directly below that.
In member.php, find
Code:

  if ($userinfo[yahoo]!="") {
    eval("\$userinfo[yahooicon] = \"".gettemplate("yahoo")."\";");
  } else {
    $userinfo[yahoo]="&nbsp;";
  }

and add my code directly below that.

HTH :)

Edit: *smacking my head vigorously* I forgot. Add $customfield5 where you want it to appear in the showthread templates (postbit, etc.) and the member profile templates (getinfo, etc.).

03-24-2001 09:16 AM

I get a parse error.. Is VB displaying something different in the code?

03-24-2001 03:30 PM

I made another boo-boo. :) I changed the code in the post above - just replace what I had given you before with what's there now. Should work now. :D

03-24-2001 05:33 PM

Appreciate the help tubedogg :) Thanks a bunch


All times are GMT. The time now is 05:51 AM.

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.00983 seconds
  • Memory Usage 1,715KB
  • 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
  • (5)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