View Single Post
  #1  
Old 05-02-2014, 01:18 AM
SoHelpMe SoHelpMe is offline
 
Join Date: Apr 2014
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Posting Variable Data On Form? Display/Run .html

Hello,
I have a forum that I am putting together and it would really be an awesome feature if on the page header I could display some variable data from another source that changes daily. I have some html written and attached below that I can execute in a browser to go to another page and parse out the data I would want to display. I just have very little vbulletin experience and I was wondering what options you guys might come up with to allow me to pull this off. I have even considered looking into the source code for a calendar plug in to see if I might be able to leverage it's approach to doing this. Just to be clear basically I want to display some custom variable txt in the header on all my pages, just think it as a custom quote for the day or a number of stock quotes that change daily. Here is the code that I can run to pull my data note the page reference within the htm is just for an example.

example.html
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$.support.cors = true;
$( document ).ready(function() {
$.ajax(
{
url: 'http://www.forwebexample.com/downone/rrm.php',
type: 'GET',
success: function (result) {
var localContent = $(result).find('#localcontent');
var table = $(localContent).find('table:nth-child(2)');

$(table).find('tr').each(function(){
var row = $(this);
if(row.find('td:eq(0)').html() === 'LOOKUP KEY')
{
var itema = row.find('td:eq(1)').html();
var itemb = row.find('td:eq(2)').html();
var itemc = row.find('td:eq(3)').html();
var itemd = row.find('td:eq(4)').html();
var iteme = row.find('td:eq(5)').html();
var itemf = row.find('td:eq(6)').html();
/*display only*/
var data = 'itema: ' + itema + '<br/> itemb: ' + itemb + '<br/> itemc:' + itemc +
'<br/>itemd: ' + itemd + '<br/>iteme: ' + iteme + '<br/>itemf: ' + itemf;
$('#content').html(data);
/*end display*/
}
});
},
error: function(xhr, status, errorThrown) {
alert(errorThrown);
}
})
});
</script>
</head>
<body>
<!--html element for display-->
<div id='content'></div>
</body>
</html>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01084 seconds
  • Memory Usage 1,765KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete