Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-23-2012, 12:17 PM
John Diver John Diver is offline
 
Join Date: Nov 2003
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Cant call an external script twice on a page - Example included

Hey,

I am trying to show weather for 4 different cities for 4 islands on my homepage.

I have tried using 3 different websites so I think this must be a problem with vBulletin.

The first call works and shows the info but the others show the background but not the actual info for the weather from the script.

Here is an example:

<div style='width: 180px; height: 150px; background-image: url( http://vortex.accuweather.com/adcbin...180x150_bg.jpg ); background-repeat: no-repeat; background-color: #D0ADAA;' ><div id='NetweatherContainer' style='height: 138px;' ><script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2ex.asp?partner=netweather&tStyle=norma l&logo=1&zipcode=EUR|ES|SP018|LAS PALMAS DE GRAN CANARIA|&lang=uke&size=8&theme=summer2&metric=1&ta rget=_self'></script></div>

If I try to add this more than once it only works the first time.

Does anyone know why its happening or what I can do to display more than 1?

Thanks!
Reply With Quote
  #2  
Old 04-23-2012, 12:36 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know for sure, but it could be that the script is just written to work only once per page. For example I notice that part of the code is "<div id='NetweatherContainer'", it could be that the js code looks for that div by id to insert the weather image.

You could use something like FireBug to see if the script is actually making more than one request to the weather server.

ETA: I looked at the js script a little, and you could try taking out the id='NetweatherContainer' from the code (in all four places). It looks like that makes the script write the output instead of insert it in an existing element.
Reply With Quote
  #3  
Old 04-23-2012, 02:07 PM
John Diver John Diver is offline
 
Join Date: Nov 2003
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the reply

I tried but unfortunately it's not working at all when thats taken out.

Here is another script from another site that I tried:

<div id="c_860c094892b99c0a1be9ce4b571be233" class="delgado"></div><script type="text/javascript" src="http://www.eltiempo.es/widget/widget_loader/860c094892b99c0a1be9ce4b571be233"></script>

Same thing happening with that, I'm not sure why they aren't working.

Thanks again!

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

I got it working doing what you suggested, I just made a mistake the first time!

It is showing up now but just a bit out of place - Not sure if the div is effecting it at all ( Http://www.NorthWestSocial.com/canary )

There is a large space above the table - I am using a bbcode module and just have the table in the module.

Thanks again
Reply With Quote
  #4  
Old 04-24-2012, 09:44 AM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could always create seperate html pages for each & add them on you home page in iframes to get them all to show all at once.
Reply With Quote
  #5  
Old 04-24-2012, 10:25 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by John Diver View Post
There is a large space above the table - I am using a bbcode module and just have the table in the module.

Thanks again

For some reason the code looks like:

Code:
<table><br />
    <tr><br />
      <td><br/>

and you can't have <br/> tags between table tags like that, so when it's done the <br/> tags end up above the table and create the gap. I don't know where those tags are coming from. Could be you have something converting newlines to <br/> somewhere.
Reply With Quote
  #6  
Old 04-24-2012, 01:57 PM
John Diver John Diver is offline
 
Join Date: Nov 2003
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know why it was showing <br />, like you said, something must be converting the code and adding that.

I changed it to a template instead of bbcode and it is showing up just how I wanted it.
For some reason though it is making the recent threads section 100% with if a template is used.

It could be a problem with CMPS, again I just have the table code in the template:

HTML Code:
<table border="0" cellpadding="1" cellspacing="1">
            <tbody>
                <tr>
                    <td>
                        <div style="width: 180px; height: 150px; background-image: url(&quot;http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/summer1_180x150_bg.jpg&quot;); background-repeat: no-repeat; background-color: rgb(108, 178, 235);">
<script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2ex.asp?partner=netweather&tStyle=normal&logo=1&zipcode=EUR|ES|SP018|GRAN CANARIA|&lang=uke&size=8&theme=summer1&metric=1&target=_self'></script>                            <div style="text-align: center; font-family: arial,helvetica,verdana,sans-serif; font-size: 10px; line-height: 12px; color: rgb(0, 0, 255);">
                                <a href="http://www.accuweather.com/world-index-forecast.asp?partner=netweather&amp;locCode=EUR|ES|SP018|GRAN CANARIA|&amp;metric=1" style="color: rgb(0, 0, 255);">Weather Forecast</a> | <a href="http://www.accuweather.com/maps-satellite.asp" style="color: rgb(0, 0, 255);">Weather Maps</a></div>
                        </div>
                    </td>
                    <td>
                        <div style="width: 180px; height: 150px; background-image: url(&quot;http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/summer1_180x150_bg.jpg&quot;); background-repeat: no-repeat; background-color: rgb(108, 178, 235);">
<script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2ex.asp?partner=netweather&tStyle=normal&logo=1&zipcode=EUR|ES|SP018|TENERIFE|&lang=uke&size=8&theme=summer1&metric=1&target=_self'></script>                            <div style="text-align: center; font-family: arial,helvetica,verdana,sans-serif; font-size: 10px; line-height: 12px; color: rgb(0, 0, 255);">
                                <a href="http://www.accuweather.com/world-index-forecast.asp?partner=netweather&amp;locCode=EUR|ES|SP018|TENERIFE|&amp;metric=1" style="color: rgb(0, 0, 255);">Weather Forecast</a> | <a href="http://www.accuweather.com/maps-satellite.asp" style="color: rgb(0, 0, 255);">Weather Maps</a></div>
                        </div>
                    </td>
                    <td>
                        <div style="width: 180px; height: 150px; background-image: url(&quot;http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/summer1_180x150_bg.jpg&quot;); background-repeat: no-repeat; background-color: rgb(108, 178, 235);">
<script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2ex.asp?partner=netweather&tStyle=normal&logo=1&zipcode=EUR|ES|SP018|ARRECIFE|&lang=uke&size=8&theme=summer1&metric=1&target=_self'></script>                            <div style="text-align: center; font-family: arial,helvetica,verdana,sans-serif; font-size: 10px; line-height: 12px; color: rgb(0, 0, 255);">
                                <a href="http://www.accuweather.com/world-index-forecast.asp?partner=netweather&amp;locCode=EUR|ES|SP018|ARRECIFE|&amp;metric=1" style="color: rgb(0, 0, 255);">Weather Forecast</a> | <a href="http://www.accuweather.com/maps-satellite.asp" style="color: rgb(0, 0, 255);">Weather Maps</a></div>
                        </div>
                    </td>
                    <td>
                        <div style="width: 180px; height: 150px; background-image: url(&quot;http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/summer1_180x150_bg.jpg&quot;); background-repeat: no-repeat; background-color: rgb(108, 178, 235);">
<script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2ex.asp?partner=netweather&tStyle=normal&logo=1&zipcode=EUR|ES|SP018|FUERTEVENTURA|&lang=uke&size=8&theme=summer1&metric=1&target=_self'></script>                            <div style="text-align: center; font-family: arial,helvetica,verdana,sans-serif; font-size: 10px; line-height: 12px; color: rgb(0, 0, 255);">
                                <a href="http://www.accuweather.com/world-index-forecast.asp?partner=netweather&amp;locCode=EUR|ES|SP018|FUERTEVENTURA|&amp;metric=1" style="color: rgb(0, 0, 255);">Weather Forecast</a> | <a href="http://www.accuweather.com/maps-satellite.asp" style="color: rgb(0, 0, 255);">Weather Maps</a></div>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
Something must be changing when CMPS is adding the template / code to display when the site is loading..

Thanks once again Kevin!

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

It was a problem with how CMPS uses the code through a template, fixed

Thanks very much for all the help!
Reply With Quote
Reply


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 02:53 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.09486 seconds
  • Memory Usage 2,243KB
  • 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
  • (1)bbcode_code
  • (1)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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