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

Reply
 
Thread Tools Display Modes
  #1  
Old 05-03-2009, 08:34 PM
PirateTinman PirateTinman is offline
 
Join Date: May 2009
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default External Data Provider, possible to collect post text?

Hi

I have been playing allot arround with this whole vBulletin, and I have just figured out how to use the External Data Provider option to write data to the external.php file, I also figured out how to collect that information with a JavaScript so that I can display that on any website.

The thing I wanted to know is if it is possible to get the text from the first message in a post?
Right now the code on my website looks like this:

Code:
<script type="text/javascript" src="http://www.my-site.com/forums/external.php?forumids=2&fulldesc=1&type=js"></script> 
<script language="" type="text/javascript">
<!--
for (x = 0; x < 1; x++)
{
document.writeln("<a href=\"http://www.my-site.com/forums/showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a> (Posted By: "+threads[x].poster+" "+threads[x].threaddate+" "+threads[x].threadtime+")<br />");
}
//-->
</script>
That displays a text like this on my website:
News (Posted By: User 01-01-1970 00:00 AM)
What I would like then is the rest of the post displaying under it (right here) and not only the title and who and when posted it.
I guess there can be a way to querry that as it knows the link to the page where the post is.

Any response would be very appreciated and if you require any more information I will be happy to help.

Thanks!
Reply With Quote
  #2  
Old 05-03-2009, 08:50 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The full post text is not available via the external.php page. You may be able to grab the "description", but I think that is only x amount of characters. You can try it and see what you get - threads[x].description would be the term, I think.
Reply With Quote
  #3  
Old 05-03-2009, 08:58 PM
PirateTinman PirateTinman is offline
 
Join Date: May 2009
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank for the reply on this matter, but I think that the threads[x].description only works on RSS2 and not JS as I only get a undefined message.

What I ghotugh was if there is a way to use the information threads[x].threadid collects and then use some sort of script to collect the text from that post, it is probably possible, but also not easy :S
Reply With Quote
  #4  
Old 05-03-2009, 09:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, looking at the external.php page shows me that the only variables available for javascript are threadid, title, poster, threaddate, and threadtime.

If you don't mind using code, then you can just make a query in your page and spit out the results. You can find a modification that puts the Lastest X Threads on a page and grab the query/code from there for your page.
Reply With Quote
  #5  
Old 05-03-2009, 09:11 PM
PirateTinman PirateTinman is offline
 
Join Date: May 2009
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any suggestions on how I will go about doing this, I actually started learning all of this last night
I had some .html know how and just plaied arround with everything else, if you could just point me in the right directions I would be very grateful.
Reply With Quote
  #6  
Old 05-03-2009, 09:23 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you do a search for a modification like I said? If you find a modification, it will have the query info in it. Then, you can make a php page by reading this article - [How-To] vBulletin API Basics: Creating Custom Pages & Misc.
Reply With Quote
  #7  
Old 05-03-2009, 09:27 PM
PirateTinman PirateTinman is offline
 
Join Date: May 2009
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, I will see if I can figure this out, I will get back to this if I figure it out or not.

Thanks allot again!
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:55 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.09785 seconds
  • Memory Usage 2,214KB
  • Queries Executed 11 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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_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