Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 10-22-2011, 09:21 PM
Fluke667 Fluke667 is offline
 
Join Date: Feb 2007
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Users Select Logo

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

My Settings on Profile Field:




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 ?!?
Reply With Quote
  #2  
Old 10-22-2011, 09:32 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 10-22-2011, 10:37 PM
Fluke667 Fluke667 is offline
 
Join Date: Feb 2007
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

... no idea why
Reply With Quote
  #4  
Old 10-22-2011, 10:58 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 10-22-2011, 11:19 PM
Fluke667 Fluke667 is offline
 
Join Date: Feb 2007
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #6  
Old 10-22-2011, 11:44 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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
Reply With Quote
  #7  
Old 10-22-2011, 11:48 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simon Lloyd View Post
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).
Reply With Quote
  #8  
Old 10-23-2011, 12:18 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@KH99, it was aimed at the OP, i have had trouble in the past with that kind of declaration for folders
Reply With Quote
  #9  
Old 10-23-2011, 12:28 AM
Fluke667 Fluke667 is offline
 
Join Date: Feb 2007
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #10  
Old 10-23-2011, 12:50 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05310 seconds
  • Memory Usage 2,342KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (5)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete