vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Display Posts on external page (https://vborg.vbsupport.ru/showthread.php?t=323964)

Twixted Chaox 12-02-2016 11:03 PM

Display Posts on external page
 
I'm looking to display my latest posts from a specific forum on a seperate page (using forum 'X' as a news forum)
I want to retrieve the 3 latest posts and display them in a beautifully formatted way.

So basically what I want to do is retrieve the 3 latest, return them to the php page and format the post to match my external page.

is there a way i can do this?

MarkFL 12-03-2016 12:30 AM

Sure, you could query your database to get the post content (including thread data, icon and prefix data), make certain the user has permission to view the post, run it (and the thread title) through the censor, parse the BBCodes, fetch the user avatar if you want...you'd likely want to use a custom template to format the posts and render each post appending it to a data string within your loop, and then pass the entire string to your custom page template.

blind-eddie 12-03-2016 01:08 AM

Wow Mark..... Great reply!

MarkFL 12-03-2016 01:18 AM

Quote:

Originally Posted by blind-eddie (Post 2579074)
Wow Mark..... Great reply!

I did something nearly identical with one of my products, except it was for the sidebar. :)

Twixted Chaox 12-15-2016 11:14 PM

I figured out a way to extend the external API to give me all of the information i was looking for. Then I simply passed it through my custom formatting and voila.. instant external posts the way i wanted them...

should i release this as an addon? plugin? hack? not sure what it classifies as...


All times are GMT. The time now is 08:22 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.01038 seconds
  • Memory Usage 1,713KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete