vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Create your own vBulletin page (https://vborg.vbsupport.ru/showthread.php?t=228112)

Lynne 03-08-2010 08:31 PM

Quote:

Originally Posted by Joseph Witchard (Post 1999590)
I just meant that all the pages in the Admin area have a common theme with each other (the navigation menu on the left, the same colors, same style of buttons, etc.). In the same way, the main forum area has its own theme with its pages (same colors and buttons, etc.). What I was asking is what do you do to get your custom pages to go with the theme of the area they're in. If you're making a page to run in the Admin CP, how do you get it to look similar to the other pages in the Admin CP? If you're making a page for the main forum area, how do you make it where it looks like the rest of your forum pages?

In the case of the forums, using the template system with common templates is what makes the pages look the same. In the case of the admincp, it's a frame, so you don't need to do much to make it look the same.

Joseph Witchard 03-09-2010 12:10 AM

What are the common templates in your example? And do you mean that you have to build an Admin page from scratch? There are no common templates for it?

CoZmicShReddeR 03-09-2010 12:41 AM

Hello Lynne, could you please help meh figure out how to fix inframe page for this setup? I tried but the information is posting above the header...

http://www.cozworld.com/hlstatsx.php

Code:

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'HLstatsX';
echo "<iframe src =\"http://www.cozworld.com/hlxstats/hlstats.php\" frameborder=0 width=100% height=800 scrolling=yes> \n";
echo "</iframe> \n";
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

Here is the actual link http://www.cozworld.com/hlxstats/hlstats.php

Thanks...

Lynne 03-09-2010 01:44 AM

Quote:

Originally Posted by Joseph Witchard (Post 2000140)
What are the common templates in your example? And do you mean that you have to build an Admin page from scratch? There are no common templates for it?

The header, headinclude, footer, and navbar are all used in the test template I posted. You don't have to include them, but if you don't, then you won't get the look of the forums.

This article is really not about the admin cp. The admin cp doesn't use templates at all.

Quote:

Originally Posted by CoZmicShReddeR (Post 2000147)
Hello Lynne, could you please help meh figure out how to fix inframe page for this setup? I tried but the information is posting above the header...

http://www.cozworld.com/hlstatsx.php

Code:

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'HLstatsX';
echo "<iframe src =\"http://www.cozworld.com/hlxstats/hlstats.php\" frameborder=0 width=100% height=800 scrolling=yes> \n";
echo "</iframe> \n";
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

Here is the actual link http://www.cozworld.com/hlxstats/hlstats.php

Thanks...

echo just echos the info wherever the code happens to be called in the page - which is not somewhere in the middle of the template where you want it to go. If you look at my example, output is entered into a variable and the variable is placed in the template where you want the output to go.

CoZmicShReddeR 03-09-2010 07:41 AM

Wow, thanks so much I was going nutz! :)

Joseph Witchard 03-10-2010 02:05 AM

All right then. Thanks, Lynn. Appreciate it:)

Affixxx 03-11-2010 01:24 AM

Hey Lynne,
Whats wrong with using the GENERIC_SHELL?

Heres a function I made that uses it

PHP Code:

function generatePage($pagetitle$navbar$content$template='GENERIC_SHELL')
{
        
//Page Generation Function by Affix
    
$templater vB_Template::create($template);
    
$templater->register_page_templates();
    
$templater->register('navbar'$navbar);
    
$templater->register('pagetitle'$pagetitle);
    
$templater->register('HTML''<br />' $content);
    
print_output($templater->render());


That way all you really need to do is

PHP Code:

$content 'Your Content';
$pagetitle 'Test Content';
$navbits construct_navbits(array('' => 'Test Page'));
$navbar render_navbar_template($navbits);
generatePage($pagetitle$navbar$content); 

Fairly Simple and it will save space in your Database and it uses what vBulletin already provides you.

Joseph Witchard 03-11-2010 02:08 AM

Quote:

Originally Posted by Affixxx (Post 2001258)
Hey Lynne,
Whats wrong with using the GENERIC_SHELL?

Heres a function I made that uses it

PHP Code:

function generatePage($pagetitle$navbar$content$template='GENERIC_SHELL')
{
        
//Page Generation Function by Affix
    
$templater vB_Template::create($template);
    
$templater->register_page_templates();
    
$templater->register('navbar'$navbar);
    
$templater->register('pagetitle'$pagetitle);
    
$templater->register('HTML''<br />' $content);
    
print_output($templater->render());


That way all you really need to do is

PHP Code:

$content 'Your Content';
$pagetitle 'Test Content';
$navbits construct_navbits(array('' => 'Test Page'));
$navbar render_navbar_template($navbits);
generatePage($pagetitle$navbar$content); 

Fairly Simple and it will save space in your Database and it uses what vBulletin already provides you.

Speaking of functions, are you not required to preRegister them as you are with variables?

Lynne 03-11-2010 02:25 AM

The GENERIC_SHELL would be fine. Some people like to fill their template with a bunch of html and would rather type it out in the template rather than assign it all to a variable to be output. You are welcome to put up an article on how to do this using the GENERIC_SHELL - users welcome having options to pick from when they do things.

desi-boy 03-15-2010 07:14 PM

thnxxxx Excellent!

can u help me
how can i add an iframe ( it's A html Page) in this ... i mean in Test.php

ChangeFive 03-19-2010 02:01 PM

Quote:

Originally Posted by Lynne (Post 1920141)
They are working as defined - both of these are from the reset-fonts.css file:
HTML Code:

h1, h2, h3, h4, h5, h6 {font-size:100%;font-weight:normal;}body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td {margin:0;padding:0;}
If you want it different, give it a class and define it yourself.

Could you explain this a little more? I finally got my test page working (a terms of service page) and tags like <p>, <h2>, <ol>, <ul>, and <strong> do not appear to work, although <b> and <br> do work for me. Thanks!

Lynne 03-19-2010 02:32 PM

You might want to read up on CSS and how you can change the properties of a tag via a few lines of CSS. When you say <p> doesn't appear to work, what is it doing? It's hard to help when we aren't getting any specifics.

Adan0s 03-21-2010 12:12 PM

could someone please point me to a tutorial or something like that on how to add existing things like a sidebar-block to my own page?
e.g. i create a sidebar block with the newest posts and i want that block to be rendered in my own page.

spartan1123 03-27-2010 02:49 PM

What do i need to add to make the page show as selected if I add a tab for it?

Lynne 03-27-2010 05:40 PM

You'd just need to change the code for the tab to show as selected when THIS_SCRIPT = 'test' or whatever you put in this line:
PHP Code:

define('THIS_SCRIPT''test'); 


Sworm 04-01-2010 03:57 PM

Hi lynne,
i have maded all the above steps and the page is ok, but there's a solution to integrate this html meta code in it?

Code:

<html><head><title>myforum.it - Informativa sulla Privacy e Termini d'uso</title>



<meta name="Rating" content="Safe for kids">
<meta name="Distribution" content="local">
<meta name="Identifier-URL" content="http://www.myforum.it">
<meta name="Author" content="Sworm">
<meta http-equiv="Expires" content="never">
<meta name="Robots" content="All">
<meta http-equiv="content-language" content="ITALIAN">
<meta name="Description" content="myforum.it Privacy Statement e Termini d'uso">
<meta name="Keywords" content="privacy,statement">

<style type="text/css">
BODY{
background-image:url
background-repeat: no-repeat;
background-position:  left top;
background-attachment: fixed;
}

</style></head><body bgcolor="#B0E0E6" vlink="blue">
<div align="center">
  <center>
<p></p>

  </center>
  <p align="left"></p>
  <p>&nbsp;</p>
  <center>
<table class="sub" style="border-color: rgb(0, 0, 128); border-collapse: collapse;" bgcolor="#00FFFF" border="20" cellpadding="7" cellspacing="0" width="69%">
  <tbody><tr>
    <td width="100%"><h1><font color=red>Privacy e Termini
    d'uso</font></h1>
    <dl>
            <dt><b><font color=red>Termini d'uso</font></b>
            </dt><dd> Software Upgrade fornisce le informazioni riguardanti l'utilizzo dei dati personali per l'iscrizione alla community di www.myforum.it e ai diversi servizi al suo interno, nel rispetto dei principi di protezione della privacy stabiliti dal Decreto Legislativo n. 196 del 30 giugno 2003 e dalle altre norme vigenti in materia.</dd><dt>

        <b><span lang="it">Informativa sulla Privacy</span></b>
            </dt><dd>I dati forniti dall'utente al momento dell'iscrizione a Software Upgrade ed ai suoi servizi saranno registrati su database elettronici di propriet? di Software Upgrade che ne sar? titolare per il trattamento.
I dati personali dell'utente saranno utilizzati da Software Upgrade nel rispetto dei principi di protezione della privacy stabiliti dal Decreto Legislativo n. 196 del 30 giugno 2003 e dalle altre norme vigenti in materia.
La presente informativa riguarda i dati personali inviati dall'utente al momento della registrazione, nonch? quelli ricavati dalle visite e navigazioni nel nostro Sito e successivamente forniti dall'utente per l'attivazione dei servizi offerti all'interno del sito.
I dati personali richiesti sono suddivisi in due categorie: obbligatori e facoltativi, come risulta nella procedura di iscrizione e di richiesta di attivazione dei servizi offerti. Il conferimento dei dati obbligatori ed il relativo trattamento per le finalit? sopra indicate sono strettamente funzionali all'esecuzione dei servizi indicati. L'eventuale rifiuto dell'Utente a fornire tali dati o l'eventuale rifiuto di consentire al loro trattamento comporter? l'impossibilit? di usufruire del servizio offerto da Software Upgrade .Gli altri dati raccolti servono ad aiutare Software Upgrade ad offrire un servizio sempre migliore. Rispetto ad essi, l'Utente ? libero di fornirli o meno.
Software Upgrade sottopone i dati personali degli utenti a tutte le operazioni di trattamento individuate dal D. lgs 196/2003 - ovvero, alla raccolta, registrazione, organizzazione, conservazione, elaborazione, modifica, selezione, estrazione, raffronto, utilizzo, interconnessione ed ogni altra operazione utile alla fornitura dei servizi richiestici, ivi compresa la comunicazione a terzi, ove necessaria - prevalentemente con modalit? automatizzate ed informatizzate. Tali dati potranno anche essere organizzati in banche dati o archivi. In particolare, le finalit? del trattamento dei dati personali sono le seguenti:</dd><dt>
</dt><dd>1) fornire i servizi previsti;
</dt><dd>2) fornire le informazioni e/o inviare comunicazioni relative al servizio;
</dt><dd>3) risalire ad autori di eventuali illeciti solo in caso di specifiche richieste e per conto delle autorit? competenti.
Qualora l'utente abbia prestato idoneo consenso (obbligatorio per i nostri servizi totalmente free)
</dt><dd>4) fornire le informazioni e/o offerte sui servizi che Software Upgrade e/o societ? affiliate e/o controllate, cos? come partners commerciali ed outsourcers che possono essere ritenute di interesse per l'utente, senza che ci? determini la cessione dei dati personali a soggetti terzi. <font color=red><b>Software Upgrade si impegna a non cedere mai i dati dei propri utenti  a terzi</b></font>;
</dt><dd>5) inviare comunicazioni ed informazioni di carattere puramente informativo relative a programmi e applicativi ed iniziative proprie e di terzi;
</dt><dd>6) soddisfare indagini di mercato e statistiche, marketing e preferenze sui prodotti.</dd><dt>
</dt><dd>7)L'Utente potr? accedere ai propri dati in qualsiasi momento ed esercitare i diritti di cui all'art. 7, D. lgs . 196/2003.


</dd><dt><b><span lang="it">Software Upgrade informa che, ai sensi dell'art. 7 della D. lgs . 196/2003:</span></b>
l' Utente ha diritto di ottenere la conferma dell'esistenza o meno di dati personali che lo riguardano, anche se non ancora registrati, e la loro comunicazione in forma intelligibile. L' Utente ha diritto di ottenere l'indicazione:
            </dt><dd>a) dell'origine dei dati personali;
</dt><dd>b) delle finalit? e modalit? del trattamento;
</dt><dd>c) della logica applicata in caso di trattamento effettuato con l'ausilio di strumenti elettronici;
</dt><dd>d) degli estremi identificativi del titolare, dei responsabili e del rappresentante designato ai sensi dell'articolo 5, comma 2;
</dt><dd>e) dei soggetti o delle categorie di soggetti ai quali i dati personali possono essere comunicati o che possono venirne a conoscenza in qualit? di rappresentante designato nel territorio dello Stato, di responsabili o incaricati.

L' Utente ha diritto di ottenere:
</dt><dd>a) l'aggiornamento, la rettificazione ovvero, quando vi ha interesse, l'integrazione dei dati;
</dt><dd>b) la cancellazione, la trasformazione in forma anonima o il blocco dei dati trattati in violazione di legge, compresi quelli di cui non ? necessaria la conservazione in relazione agli scopi per i quali i dati sono stati raccolti o successivamente trattati;
</dt><dd>c) l'attestazione che le operazioni di cui alle lettere a) e b) sono state portate a conoscenza, anche per quanto riguarda il loro contenuto, di coloro ai quali i dati sono stati comunicati o diffusi, eccettuato il caso in cui tale adempimento si rivela impossibile o comporta un impiego di mezzi manifestamente sproporzionato rispetto al diritto tutelato.
L'utente ha diritto di opporsi, in tutto o in parte:
</dt><dd>a) per motivi legittimi al trattamento dei dati personali che lo riguardano, ancorch? pertinenti allo scopo della raccolta;
</dt><dd>b) al trattamento di dati personali che lo riguardano a fini di invio di materiale informativo (newsletter) o per il compimento di ricerche di mercato o di comunicazione commerciale.
L'Utente, inoltre, avr? sempre diretto accesso via web ai propri dati, come in possesso di Software Upgrade, attraverso i propri codici di accesso ("Username" e "Password"). L'Utente in questo modo potr? integrare, modificare o richiedere la cancellazione dei propri dati, in qualsiasi momento tramite questi link:
Modifica o aggiorna i tuoi dati: Modifica dati dal <a href="http://www.myforum.it/forums/profile.php?do=editprofile">Pannello di controllo Utente</a>

Cancellazione definitiva utente: Richiedere Cancellazione mediante il form <a href="http://www.myforum.it/forums/sendmessage.php">Contattaci</a> al titolare del sito.
   
   
   
   
       
    <p align="center"><span lang="it">[
    <a title="HomePage" href="http://www.myforum.it/">Torna in Software Upgrade</a>
    ]</span></p>
   
   
   
   
   
   
    </td>
 
    </tr>
  </tbody></table>

  </center>
  </div>

</body></html>

If i try to add it, is showed bad, not formatted with the <h2> and the text don't start after some space , and the CSS integrated in this html don't work..... if would be a solution , should be great..... if no i'll still to use this html page not vb integrated.

Thanks in advance

ddaybofb 04-01-2010 05:23 PM

I need some help, ive been working on this for like the past day.

http://www.clutchtimesports.net/foru...20Athletes.php

Notice how the writing is above the template, i can't get it to the middle


This is the custom file
PHP Code:

<?php

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

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

define('THIS_SCRIPT''CTS Athletes.php');
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('CTS Athletes',
);

// 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('' => 'CTS Athletes'));
$navbar render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle 'CTS Athletes';

include(
'twitter-rss-to-html.php');

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

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

?>

This is whats showing up on the page that i want in the middle

PHP Code:

<?
/* twitter-rss-to-html.php


// a PHP script to display Twitter updates from a user's RSS feed on a web page

require_once("magpie/rss_fetch.inc");

// set up script variables
// the user's RSS feed on Twitter
$remote_url = "http://twitter.com/statuses/user_timeline/2557521.rss";
// the number of tweets to display (or -1 to display all)
$tweets_to_display = -1;
// the page where the tweet(s) will be displayed
$page = "http://www.clutchtimesports.net/forums/CTS%20Athletes.php";
// the user's Twitter username
$username = "ESPN";

$rss = fetch_rss($remote_url);

// start buffering output
ob_start();

$count = 1;
$now = time();
foreach ($rss->items as $item) {
    // limit the number of tweets displayed
    if ($tweets_to_display > 0) {
        if ($count > $tweets_to_display) {
            continue;
        }
    }
    $tweet = $item['description'];
    // ignore tweets linking back to page (if it is defined)
    if ($page != "") {
        if (!strpos($tweet, $page) === false) {
            continue;
        }
    }
    // figure out how recently the tweet was posted
    $when = ($now - strtotime($item['pubdate']));
    $posted = "";
    if ($when < 60) {
        $posted = $when . " seconds ago";
    }
    if (($posted == "") & ($when < 3600)) {
        $posted = "about " . (floor($when / 60)) . " minutes ago";
    }
    if (($posted == "") & ($when < 7200)) {
        $posted = "about 1 hour ago";
    }
    if (($posted == "") & ($when < 86400)) {
        $posted = "about " . (floor($when / 3600)) . " hours ago";
    }
    if (($posted == "") & ($when < 172800)) {
        $posted = "about 1 day ago";
    }
    if ($posted == "") {
        $posted = (floor($when / 86400)) . " days ago";
    }
    // filter the user's username out of tweets
    $tweet = str_replace($username . ": ", "", $tweet);
    // turn URLs into hyperlinks
    $tweet = preg_replace("/(http:\/\/)(.*?)\/([\w\.\/\&\=\?\-\,\:\;\#\_\~\%\+]*)/", "<a href=\"\\0\">Link</a>", $tweet);
    // link to users in replies
    $tweet = preg_replace("(@([a-zA-Z0-9\_]+))", "<a href=\"http://www.twitter.com/\\1\">\\0</a>", $tweet);
    // add the time posted
    $tweet = $tweet . " <span class=\"tweetwhen\">" . $posted . "</span>";
    echo ("\n\n<p>" . $tweet);
    $count++;
}
    

// display output
ob_end_flush();
?>

How do i get the writing on my page to the middle?

Yonatan 04-02-2010 06:13 PM

Lynne,

Can you check my post?

I still have a problem with the section condition.

Thanks!

wynode 04-03-2010 10:11 AM

Thanks for this. Very handy.

Just one issue I'm having is with ordered lists. There is some content which has the following HTML tags:

Code:

<ol>
<li> Item 1</li>
<li> Item 2</li>
</ol>

etc

It used to come up with numbers with the 3.8.x version but doesn't seem to do it for this vb4 versions. Any thoughts on how to implement numbering easily?

Lynne 04-03-2010 02:57 PM

Quote:

Originally Posted by wynode (Post 2015070)
Thanks for this. Very handy.

Just one issue I'm having is with ordered lists. There is some content which has the following HTML tags:

This was already covered. See page 10 (may continue onto page 11, I don't remember).

ddaybofb 04-04-2010 03:03 PM

Quote:

Originally Posted by ddaybofb (Post 2014182)
I need some help, ive been working on this for like the past day.

http://www.clutchtimesports.net/foru...20Athletes.php

Notice how the writing is above the template, i can't get it to the middle


This is the custom file
PHP Code:

<?php

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

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

define('THIS_SCRIPT''CTS Athletes.php');
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('CTS Athletes',
);

// 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('' => 'CTS Athletes'));
$navbar render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle 'CTS Athletes';

include(
'twitter-rss-to-html.php');

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

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

?>

This is whats showing up on the page that i want in the middle

PHP Code:

<?
/* twitter-rss-to-html.php


// a PHP script to display Twitter updates from a user's RSS feed on a web page

require_once("magpie/rss_fetch.inc");

// set up script variables
// the user's RSS feed on Twitter
$remote_url = "http://twitter.com/statuses/user_timeline/2557521.rss";
// the number of tweets to display (or -1 to display all)
$tweets_to_display = -1;
// the page where the tweet(s) will be displayed
$page = "http://www.clutchtimesports.net/forums/CTS%20Athletes.php";
// the user's Twitter username
$username = "ESPN";

$rss = fetch_rss($remote_url);

// start buffering output
ob_start();

$count = 1;
$now = time();
foreach ($rss->items as $item) {
    // limit the number of tweets displayed
    if ($tweets_to_display > 0) {
        if ($count > $tweets_to_display) {
            continue;
        }
    }
    $tweet = $item['description'];
    // ignore tweets linking back to page (if it is defined)
    if ($page != "") {
        if (!strpos($tweet, $page) === false) {
            continue;
        }
    }
    // figure out how recently the tweet was posted
    $when = ($now - strtotime($item['pubdate']));
    $posted = "";
    if ($when < 60) {
        $posted = $when . " seconds ago";
    }
    if (($posted == "") & ($when < 3600)) {
        $posted = "about " . (floor($when / 60)) . " minutes ago";
    }
    if (($posted == "") & ($when < 7200)) {
        $posted = "about 1 hour ago";
    }
    if (($posted == "") & ($when < 86400)) {
        $posted = "about " . (floor($when / 3600)) . " hours ago";
    }
    if (($posted == "") & ($when < 172800)) {
        $posted = "about 1 day ago";
    }
    if ($posted == "") {
        $posted = (floor($when / 86400)) . " days ago";
    }
    // filter the user's username out of tweets
    $tweet = str_replace($username . ": ", "", $tweet);
    // turn URLs into hyperlinks
    $tweet = preg_replace("/(http:\/\/)(.*?)\/([\w\.\/\&\=\?\-\,\:\;\#\_\~\%\+]*)/", "<a href=\"\\0\">Link</a>", $tweet);
    // link to users in replies
    $tweet = preg_replace("(@([a-zA-Z0-9\_]+))", "<a href=\"http://www.twitter.com/\\1\">\\0</a>", $tweet);
    // add the time posted
    $tweet = $tweet . " <span class=\"tweetwhen\">" . $posted . "</span>";
    echo ("\n\n<p>" . $tweet);
    $count++;
}
    

// display output
ob_end_flush();
?>

How do i get the writing on my page to the middle?

Any help with this?

Lynne 04-04-2010 03:18 PM

Quote:

Originally Posted by ddaybofb (Post 2015644)
Any help with this?

Well, you don't actually start the page with just <? , right?

ddaybofb 04-04-2010 03:31 PM

Quote:

Originally Posted by Lynne (Post 2015653)
Well, you don't actually start the page with just <? , right?

no, sorry, <?php

--------------- Added [DATE]1270419490[/DATE] at [TIME]1270419490[/TIME] ---------------

nvm, found another way

balkanboy 04-06-2010 04:40 AM

i created a custom login page for a front page but how can i set it to check if already logged in and if so to forword to for example forum.php....

Cip 04-06-2010 05:53 PM

I'm a little bit unsatisfied with the template that you suggest, mainly because the sub-title suggests that the content should be inside of a box. Other than that, great advice (as always ;)).

xAVx 04-07-2010 02:28 PM

Well, i have the same problem as ddaybofb, i need to get my included PHP to the middle...How do i do it?

zelnik 04-12-2010 10:27 AM

Brilliant guide Lynne, thanks ever so much worked a treat... now to try and it get on the menus! :)

pmk_1992 04-21-2010 10:17 AM

1 Attachment(s)
Hi
i get blank page when do this tut

can you tell me where i have to go to create the template in MASTER STYLE ?

i did like the picture but it not work

Lynne 04-21-2010 01:42 PM

The template doesn't get posted into the plugin code area - it gets put into the templates. Style Mananger > find your style (or if you are in debug mode, you may select MASTER STYLE) > Add Template.

TheSupportForum 04-21-2010 01:46 PM

Quote:

Originally Posted by pmk_1992 (Post 2024823)
Hi
i get blank page when do this tut

can you tell me where i have to go to create the template in MASTER STYLE ?

i did like the picture but it not work


Admincp >> Styles & Templates >> Style Manager >>

Click on All style Options
Click add new template

to enable this for master templates you enable debug mod in config.php located in /includes

to enable debug add the following


Code:


$config['Misc']['debug'] = true;


pmk_1992 04-21-2010 02:06 PM

it working now
thank so much

toolmanwill 04-22-2010 12:07 PM

Lynne, thanx again so much for this tut. i'm creatin' pages like a madman now!! :D

Khan_ 04-23-2010 11:27 PM

can we give access permissions to particular usergroups and deny for some ..

If yes where do i set the permissions .. ?? Lil confused .. i used logicans webtemplates when i was on vB 3.8.2 and it has its own settings .. now i upgraded to 4.0.3 and never used custom pages so lil confused with it .. Need little support or suggest me any particular mod as logicans webtemplates for 3.8.x series ..

Lynne 04-23-2010 11:46 PM

Under the Start Main Script area, you may deny some usergroups:
PHP Code:

if (!is_member_of($vbulletin->userinfoxyz))  
{
// give no permission unless in usergroup x, y, or z
        
print_no_permission();



Khan_ 04-23-2010 11:59 PM

guess i dont want registered users and moderators to access this page so do i do it this way below in the start main script?

PHP Code:

if (!is_member_of($vbulletin->userinfo27,))  
{
// give no permission unless in usergroup 6, or 5
        
print_no_permission();


Do i have to edit it this way .. check the php code please ..

2 = registered user <=> should not have access
7 = moderator <=> should not have access
6 = super admin. <=> should have access
5 = global moderator <=> should have access

Lynne 04-24-2010 12:13 AM

If you want to exclude usergroups 2 & 7, then you would do:
PHP Code:

if (is_member_of($vbulletin->userinfo27))  
{
// give no permission to usergroup 2 & 7
        
print_no_permission();



Khan_ 04-24-2010 12:18 AM

PHP Code:

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

if (is_member_of($vbulletin->userinfo27))  
{
// give no permission to usergroup 2 & 7
        
print_no_permission();
}  

$navbits construct_navbits(array('' => 'Test Page'));
$navbar render_navbar_template($navbits); 

This is how i add it under start main script ..

P.S i want more groups to be excluded from it .. like 2,11,13,9,7 etc etc .. do i have to do it 2, 11, 13, 9, & 7 ? i am getting confused here on the second part.
PHP Code:

// give no permission to usergroup 2, 11, 13, 9 &  7 


David Regimbal 04-24-2010 01:13 AM

child directory does not seem to work for me :(
I'm very sure I'm doing something wrong though:

Quote:

<?php

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

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

define('THIS_SCRIPT', 'noble6');
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('noble6',
);

// 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
$curdir = getcwd ();
chdir('/path/to/forums');
require_once('./global.php');
chdir ($curdir);

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

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

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'INTEL';

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

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

?>
In a folder such as "/pages." My forum is in the root.

Error:

Quote:



Warning: require_once(./includes/functions_user.php) [function.require-once]: failed to open stream: No such file or directory in [path]/includes/class_bootstrap.php(283) : eval()'d code on line 52

Fatal error: require_once() [function.require]: Failed opening required './includes/functions_user.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /path/to/public_html/includes/class_bootstrap.php(283) : eval()'d code on line 52


arilukes 04-26-2010 12:55 AM

Great tutorial, and thanks to everyone who's input went into this.

I was able to create the page template and plugins with no issues.

FCS-Webmaster 05-02-2010 10:59 AM

How do I include Widgets to my own vBulletin page?


All times are GMT. The time now is 05:32 AM.

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.02742 seconds
  • Memory Usage 1,985KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_html_printable
  • (14)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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