vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Adding the latest threads block as a separate page. (https://vborg.vbsupport.ru/showthread.php?t=325255)

Nocturnal222 06-20-2017 07:40 AM

Adding the latest threads block as a separate page.
 
Hello

I'm not sure how to explain best what I am trying to do, but I'll try to be clear.

I am currently running a game server. I host my community and post my updates on my vBulletin forums. To keep the players up to date, I have to manually add the news to my launcher page via FTP, which I sometimes forget to do.

On the forums, I use the default "Latest Threads" block set to my News & Information section to have a news stream. Is there a way I can re-create that block with it's whole code on a new page, and place that as my game-launcher page? I don't want the header, navbar and so on present in the launcher, as the window size is pretty constrictive. Just the news feed.

The idea is that when I post a news thread on my forum, it will be automatically displayed(on the next block refresh) in the game launcher.

Any help is appreciated.

grey_goose 06-20-2017 03:56 PM

This is an excellent resource for creating custom/new pages:
https://vborg.vbsupport.ru/showthread.php?t=228112

You'd then need to do a plugin query and register it for use in a template:
https://vborg.vbsupport.ru/showthread.php?t=228078

You learn what's in those two links, and you can do darn near anything.

Nocturnal222 06-21-2017 08:12 AM

I've managed to create the page fine using those guides, and it displays as per the template, but what would I need to place(and where) in order to get this to display instead of this.

I'm currently running everything in the default style until I figure it out.

I essentially want to link the new page I've created to someone and all they would see is the latest new threads in a few sections I've nominated, much like I currently have the sideblock setup.

Keep in mind that this is for external users, who play the game server I am hosting, but aren't really the forum type. To view the page, it should not require a login. I will also be removing the header and footer so the announcement page is straight to the point, as the display window I am working with is rather small(and cannot be resized) so adding headers+ extra stuff will simply push the information down.

grey_goose 06-21-2017 10:00 PM

You'll need to write a query (see second link) and register it for use in that template. If you're not familiar with SQL queries, then you're probably best off just finding a mod like this.

MarkFL 06-21-2017 11:27 PM

Quote:

Originally Posted by Nocturnal222 (Post 2587655)
I've managed to create the page fine using those guides, and it displays as per the template, but what would I need to place(and where) in order to get this to display instead of this.

I'm currently running everything in the default style until I figure it out.

I essentially want to link the new page I've created to someone and all they would see is the latest new threads in a few sections I've nominated, much like I currently have the sideblock setup.

Keep in mind that this is for external users, who play the game server I am hosting, but aren't really the forum type. To view the page, it should not require a login. I will also be removing the header and footer so the announcement page is straight to the point, as the display window I am working with is rather small(and cannot be resized) so adding headers+ extra stuff will simply push the information down.

If you'll post the content of your external script, I'll add the necessary query to it, along with a threadbit template and product settings so you can control how many latest threads are displayed, and which forum(s) they are selected from, and any other settings you want. :)

Nocturnal222 06-22-2017 09:51 AM

Quote:

Originally Posted by grey_goose (Post 2587678)
You'll need to write a query (see second link) and register it for use in that template. If you're not familiar with SQL queries, then you're probably best off just finding a mod like this.

That modification is basically what I'm trying to do, but I need it to be lightweight. The launcher is pretty ancient and I'm not sure how well it would handle such a news feed.

Mark, if you are referring to the content of my .php file, it is as Lynne suggested for a start.
PHP Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT''rmulauncher');
define('CSRF_PROTECTION'true);  
// change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array('rmulauncher',
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
// chdir ('/path/to/your/forums');
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits construct_navbits(array('' => 'Rise News'));
$navbar render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle 'Rise News';

// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

$templater vB_Template::create('rmulauncher');
$templater->register_page_templates();
$templater->register('navbar'$navbar);
$templater->register('pagetitle'$pagetitle);
print_output($templater->render());

?>

I'm not very familiar with scripts, so this is basically what I need help with right now till I get my head around it a bit more. Someone else had been doing this for me up until recently.

The script I'm using for this block is the default vBulletin 4 Latest Threads script.

MarkFL 06-22-2017 01:41 PM

Okay, I will put everything together tonight and post the end result when I'm done. :)

edit: Unfortunately, an issue has come up that I must address immediately, and so there will be a delay on this. I do apologize for the inconvenience, but the delay shouldn't be more than a day or two.

Nocturnal222 06-23-2017 03:20 AM

That's fine. I'm getting someone helping me out, I can't be picky about it as well. :P

I've been doing it manually for years now, a few days won't hurt me.

MarkFL 06-23-2017 03:40 AM

Quote:

Originally Posted by Nocturnal222 (Post 2587705)
That's fine. I'm getting someone helping me out, I can't be picky about it as well. :P

I've been doing it manually for years now, a few days won't hurt me.

I'm actually working on it now. I expect to have something for you tomorrow. :)

MarkFL 06-23-2017 03:50 PM

1 Attachment(s)
Okay, I have attached a preliminary product for you to test out, and let me know if there are any issues or features you want added. :)


All times are GMT. The time now is 07:20 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.02040 seconds
  • Memory Usage 1,759KB
  • 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_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete