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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 03:40 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.08337 seconds
  • Memory Usage 2,491KB
  • Queries Executed 12 (?)
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
  • (2)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.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_threaded
  • showthread_threaded_construct_link
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete