vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   site integration? (https://vborg.vbsupport.ru/showthread.php?t=186516)

DarkGizmo 07-27-2008 09:59 PM

site integration?
 
How would I go about integrating my forum installation to be used as a CMS into a layout I have?

Any help is appreciated. :)

Could someone give me a basic script example I can work with? :)

RLShare 07-28-2008 12:27 AM

Include global.php and then you can check to see if someone is logged in using something like..
PHP Code:

if($vbulletin->userinfo['userid']){
//User is logged in


You can use the login form from the navbar if you want just make sure you change the location of the action attribute if your page is not located in the same directory of the forum itself.


^^Thats for the users aspect of it.

Now you said CMS too, so Im guess you would also want to use VB as the base of posting content for it as well. The easiest way I have done that in the past was just to create a couple of hidden forums for the different categories and then draw in threads from those forums to be displayed as content.

robertpro2a 07-28-2008 01:14 AM

Along the lines of creating a basic template for other use, this the basic script:

Source: https://vborg.vbsupport.ru/showthread.php?t=62164

In test.php

PHP Code:

<?php

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

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''test'); // 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(
    
'TEST',
);

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

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

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

$navbits = array();
$navbits[$parent] = 'Test Page';

$navbits construct_navbits($navbits);
eval(
'$navbar = "' fetch_template('navbar') . '";');
eval(
'print_output("' fetch_template('TEST') . '");');

?>

Now create a template called "TEST".

PHP Code:

$stylevar[htmldoctype]
<
html dir="$stylevar[textdirection]lang="$stylevar[languagecode]">
<
head>
<
title>$vboptions[bbtitle]</title>
$headinclude
</head>
<
body>
$header

$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" align="center">
<
tr>
    <
td class="tcat">Title</td>
</
tr>
<
tr>
    <
td class="alt1">Text</td>
</
tr>
</
table>

$footer
</body>
</
html


RLShare 07-28-2008 03:23 AM

^To note: That code is to create custom pages that use the forums style options. But you can use templates to store the HTML for your 'other layout' as well

DarkGizmo 07-28-2008 04:28 PM

Thanks for the help guys. :) I'll try it out sometime. :)

DarkGizmo 07-31-2008 06:44 PM

I have a template http://rnaforums.net/absolute_zero/


I wanna have my content driven from forums.....how would i make posts from the announcements forum, etc. appear on the index and such?

Any help is appreciated.


All times are GMT. The time now is 04:05 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.00975 seconds
  • Memory Usage 1,741KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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