vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Users Select Logo (https://vborg.vbsupport.ru/showthread.php?t=272563)

Fluke667 10-22-2011 09:21 PM

Users Select Logo
 
I want my users can Select the Logo Image on Top...

My Settings on Profile Field:

https://vborg.vbsupport.ru/external/2011/10/22.png


and in my header template:

PHP Code:

<img src="images/header/$bbuserinfo[field5].png" border="0" alt="$vboptions[bbtitle]/> 


Its work but there are 2 Problems:


01. No Image is show up for Guests
02. No Image is show up to New Registered Users ?!?

kh99 10-22-2011 09:32 PM

You could do this:

Code:

<if condition="empty($bbuserinfo[field5])">
<img src="images/header/default_img.png" border="0" alt="$vboptions[bbtitle]" /> 
<else/>
<img src="images/header/$bbuserinfo[field5].png" border="0" alt="$vboptions[bbtitle]" /> 
</if>


of course you'd want to change default_img to some actual image name. That should give everyone the default unless they have made a choice.

Also, I'm not sure but maybe if you set the field Required to "Yes", new users will have to choose something or go with the default.

Fluke667 10-22-2011 10:37 PM

hmm this is not working, my header is empty and nothing shown up on Forumhome :O

... no idea why

kh99 10-22-2011 10:58 PM

There must be an error in that template. I guess try taking out what I posted above, and make sure you're not getting any errors when you save the template.

Fluke667 10-22-2011 11:19 PM

Can not find Error ... i try out the Original Template...


PHP Code:


<!-- logo -->
<
a name="top"></a>
<
table border="0" width="$stylevar[outertablewidth]cellpadding="0" cellspacing="0" align="center">
<
tr>
        <
td>
              <
table border="0" width="$stylevar[outertablewidth]cellpadding="0" cellspacing="0" align="center">
              <
tr>
                      <
td align="$stylevar[left]style="background-image:url($stylevar[imgdir_misc]/top_x.gif)"><img src="$stylevar[imgdir_misc]/top_left.gif" align="$stylevar[left]alt="" /></td>
                      <
td align="$stylevar[right]style="background-image:url($stylevar[imgdir_misc]/top_x.gif)"><img src="$stylevar[imgdir_misc]/top_right.gif" align="$stylevar[right]alt="" /></td>
              </
tr>
              <
tr>
                  <
td align="$stylevar[left]"  style="background-image:url($stylevar[imgdir_misc]/black_logo_x.gif)"><a href="$vboptions[forumhome].php$session[sessionurl_q]">

 


<if 
condition="empty($bbuserinfo[field5])">
<
img src="images/header/Deejay1.png" border="0" alt="$vboptions[bbtitle]/>  
<else/>
<
img src="images/header/$bbuserinfo[field5].png" border="0" alt="$vboptions[bbtitle]/>  
</if>



</
a></td>
                  <
td align="$stylevar[right]"  style="background-image:url($stylevar[imgdir_misc]/black_logo_x.gif)">
                      &
nbsp;
                  </
td>
              </
tr>
              <
tr>
                      <
td align="$stylevar[left]style="background-image:url($stylevar[imgdir_misc]/nav_x.gif)" height="22"><img src="$stylevar[imgdir_misc]/nav_left.gif" align="$stylevar[left]alt="" />
                          <
table border="0" cellpadding="0" cellspacing="0" align="left">
                                 <
tr>
                                     <
td><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/link_forum.gif" border="0" alt="" /></a></td>
                                     <
td><if condition="$show['member']"><a href="usercp.php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/link_usercp.gif" border="0" alt="" /></a></if></td>
                                     <
td><if condition="$show['registerbutton']"><a href="register.php$session[sessionurl_q]rel="nofollow"><img src="$stylevar[imgdir_misc]/link_register.gif" border="0" alt="" /></a></if></td>
                                     <
td><a href="memberlist.php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/link_members.gif" border="0" alt="" /></a></td>
                                     <
td><a href="calendar.php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/link_calendar.gif" border="0" alt="" /></a></td>
                                     <
td><a href="faq.php$session[sessionurl_q]accesskey="5"><img src="$stylevar[imgdir_misc]/link_faq.gif" border="0" alt="" /></a></td>
                                     <
td><if condition="$show['member']"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]onclick="return log_out()"><img src="$stylevar[imgdir_misc]/link_logout.gif" border="0" alt="" /></a></if></td>
                                     <
td><img src="$stylevar[imgdir_misc]/link_rs.gif" border="0" alt="" /></td>
                                 </
tr>
                          </
table>
                      </
td>
                      <
td align="$stylevar[right]style="background-image:url($stylevar[imgdir_misc]/nav_x.gif)"><img src="$stylevar[imgdir_misc]/nav_right.gif" align="$stylevar[right]alt="" /></td>
              </
tr>
              <
tr>
                      <
td colspan="2">
                          <
table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#1B1B1B">
                            <
tr>
                              <
td width="12" align="left" valign="top"><img src="$stylevar[imgdir_misc]/upper_left.gif" width="12" height="11" alt="" /></td>
                              <
td width="100%" align="left" valign="top"><img src="$stylevar[imgdir_misc]/upper_middle.gif" width="100%" height="11" alt="" /></td>
                              <
td width="12" align="left" valign="top"><img src="$stylevar[imgdir_misc]/upper_right.gif" width="12" height="11" alt="" /></td>
                            </
tr>
                            <
tr>
                              <
td width="12" align="left" valign="top" style="background-image:url($stylevar[imgdir_misc]/left_middle.gif)" height="100%"><img src="$stylevar[imgdir_misc]/left_middle.gif" width="12" height="100%" alt="" /></td>
                              <
td>

<!-- 
content table -->





$spacer_open

$_phpinclude_output

$ad_location
[ad_header_end]

<
script type="text/javascript">
<!-- 
Begin


var startTime=new Date();

function 
currentTime(){
  var 
a=Math.floor((new Date()-startTime)/100)/10;
  if (
a%1==0a+=".0";
  
document.getElementById("endTime").innerHTML=a;
}

window.onload=function(){
  
clearTimeout(loopTime);
}

// End -->
</script



EDIT: Is not working on the Original Template too... but that one in the first Posting works...

Simon Lloyd 10-22-2011 11:44 PM

Quote:

Originally Posted by kh99 (Post 2260311)
You could do this:

Code:

<if condition="empty($bbuserinfo[field5])">
<img src="images/header/default_img.png" border="0" alt="$vboptions[bbtitle]" /> 
<else/>
<img src="images/header/$bbuserinfo[field5].png" border="0" alt="$vboptions[bbtitle]" /> 
</if>


of course you'd want to change default_img to some actual image name. That should give everyone the default unless they have made a choice.

Also, I'm not sure but maybe if you set the field Required to "Yes", new users will have to choose something or go with the default.

Are you sure that works? shouldn't it look like this
Quote:

<if condition="empty($bbuserinfo[field5])">
<img src="./images/header/default_img.png" border="0" alt="$vboptions[bbtitle]" />
<else/>
<img src="./images/header/$bbuserinfo[field5].png" border="0" alt="$vboptions[bbtitle]" />
</if>
so either ./ before the word images or just / as it stands it seems you're showing the folder images to be above public_html

kh99 10-22-2011 11:48 PM

Quote:

Originally Posted by Simon Lloyd (Post 2260350)
Are you sure that works? shouldn't it look like thisso either ./ before the word images or just / as it stands it seems you're showing the folder images to be above public_html

Well, I assume that you're asking Fluke667 since all I did was copy the code from the OP. But I was under the impression that "images/..." would be the same as "./images/...", where "/images/..." would be at your web server root. (That's how filenames work in the OS, maybe that's what I'm thinking of).

Simon Lloyd 10-23-2011 12:18 AM

@KH99, it was aimed at the OP, i have had trouble in the past with that kind of declaration for folders :)

Fluke667 10-23-2011 12:28 AM

not working with images and not with /images and not with ./images

This from my OP:

PHP Code:

<img src="images/header/$bbuserinfo[field5].png" border="0" alt="$vboptions[bbtitle]/> 

Is working without dot or slash.. Mustbe other Error

--------------- Added [DATE]1319338172[/DATE] at [TIME]1319338172[/TIME] ---------------

some thing is wrong with that line:

PHP Code:

<if condition="empty($bbuserinfo[field5])"

if i change this line to:

PHP Code:

<if condition="$bbuserinfo[field5]"

Than the Images is Display 2x times

--------------- Added [DATE]1319338408[/DATE] at [TIME]1319338408[/TIME] ---------------

hmm


Can i use this:

<if condition="$bbuserinfo['fieldX'] == empty">
or
<if condition="$bbuserinfo['fieldX'] == 0">
or
<if condition="$bbuserinfo['fieldX'] == null">
or
<if condition="!empty($bbuserinfo[field5])">
or...

kh99 10-23-2011 12:50 PM

Hmm...it seems like empty should work, and in any case I can't see how changing the condition could cause it to display twice. Can you post the entire template you're using?

I guess you could try $bbuserinfo[field5] != '' - BTW, are you sure it's field5? The screen grab you posted above shows it as id=10.


All times are GMT. The time now is 09:47 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.01823 seconds
  • Memory Usage 1,844KB
  • 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
  • (2)bbcode_code_printable
  • (5)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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