Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-20-2017, 07:40 AM
Nocturnal222 Nocturnal222 is offline
 
Join Date: Dec 2006
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 06-20-2017, 03:56 PM
grey_goose grey_goose is offline
 
Join Date: Jun 2009
Posts: 284
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 06-21-2017, 08:12 AM
Nocturnal222 Nocturnal222 is offline
 
Join Date: Dec 2006
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 06-21-2017, 10:00 PM
grey_goose grey_goose is offline
 
Join Date: Jun 2009
Posts: 284
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 06-21-2017, 11:27 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Nocturnal222 View Post
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.
Reply With Quote
  #6  
Old 06-22-2017, 09:51 AM
Nocturnal222 Nocturnal222 is offline
 
Join Date: Dec 2006
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by grey_goose View Post
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.
Reply With Quote
  #7  
Old 06-22-2017, 01:41 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 06-23-2017, 03:20 AM
Nocturnal222 Nocturnal222 is offline
 
Join Date: Dec 2006
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 06-23-2017, 03:40 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Nocturnal222 View Post
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.
Reply With Quote
  #10  
Old 06-23-2017, 03:50 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Attached Files
File Type: zip MarkFL - Rise News v1.0.zip (3.6 KB, 7 views)
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:50 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04838 seconds
  • Memory Usage 2,283KB
  • 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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete