View Full Version : Users Select Logo
Fluke667
10-22-2011, 09:21 PM
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:
<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 ?!?
You could do this:
<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
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...
<!-- 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)">
</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&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==0) a+=".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
You could do this:
<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<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
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:
<img src="images/header/$bbuserinfo[field5].png" border="0" alt="$vboptions[bbtitle]" />
Is working without dot or slash.. Mustbe other Error
--------------- Added 1319338172 at 1319338172 ---------------
some thing is wrong with that line:
<if condition="empty($bbuserinfo[field5])">
if i change this line to:
<if condition="$bbuserinfo[field5]">
Than the Images is Display 2x times
--------------- Added 1319338408 at 1319338408 ---------------
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...
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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.