vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   How to create your own vBulletin-powered page! (uses vB templates) (https://vborg.vbsupport.ru/showthread.php?t=62164)

wolf32 08-05-2007 06:32 PM

I posted it about halfway up the page ^^^^.

Antivirus 08-06-2007 01:50 AM

Try changing THIS_SCRIPT to just about_us, no complete url address

wolf32 08-06-2007 02:05 AM

Quote:

Originally Posted by Antivirus (Post 1310804)
Try changing THIS_SCRIPT to just about_us, no complete url address

Aggg!! Same error.

Adrian Schneider 08-06-2007 05:46 AM

Your code parsed fine for me, so post your exact code. :)

RockMTP 08-06-2007 09:25 AM

Hi all!

This looks like exactly what i need!

The only problem is I just spent an hour editing the php & template and then trying to get them to work without much luck! I don't know much about doing this kind of thing as you could probably guess.

I changed all the 'Test' areas to 'MORE'

I added the php to the root

I created the template and added 'MORE' where applicable

I made sure the global path was correct

and nothing worked! Have I overlooked something!



Quote:

Originally Posted by dpakman91 (Post 482566)
alright, hopefully someone can help me with this:

i have some large files i want to make available to certain usergroups, but not other. the files are way too large to upload as "attachments" with vb so i would have to upload them via ftp and then just post a link in a thread...of course this means the only way to prevent people from downloading it is to prevent them from seeing the thread at all, which is not my intention.

with this new way of making a vb page, is there any way to do what i am trying to do?

any help would be great.


Quote:

Originally Posted by Gary King (Post 482607)
Try something like:

PHP Code:

<?php

require_once('./global.php');

if (
$_REQUEST[filename])
{
    if (
$bbuserinfo[usergroupid] == 6)
    {
        
header("Location: $_REQUEST[filename]");
    }
}

?>

Be sure to change the path to the global.php and the usergroupid as well (currently it's 6 for admins only).

Also, save this code in a file such as download.php and then you can use the file by linking to it like http://www.example.com/forum/downloa...=something.php which will download www.examlpe.com/forum/files/something.php if the user is an administrator.

The above is exactly what I want to do. Can someone tell me where I should add the new php code please. Also how would I FTP into these pages...just a little confused at the moment!

Thanks

wolf32 08-06-2007 02:36 PM

Quote:

Originally Posted by SirAdrian (Post 1310901)
Your code parsed fine for me, so post your exact code. :)

Edit: It's working. I was using Wordpad and switched to Notepad and that fixed it. Some formatting problems :dunno:

Thanks for the help guys.

Yours Truly 08-08-2007 05:18 PM

I know this has probably been answered a 1000 times but i get a blank page. My PHP file and template are :

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') . '");');

?>

Template: 'test'

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>

Any help? :)

radarhunter 08-08-2007 05:41 PM

i also had the same problem

try editing this TEST to test in ur last line of php file

Code:

eval('print_output("' . fetch_template('TEST') . '");');

?>


Everything shall be fine........ the code is not wrong anywhere else

Adrian Schneider 08-08-2007 06:40 PM

Template names are case sensitive. :)

Yours Truly 08-08-2007 08:34 PM

Quote:

Originally Posted by radarhunter (Post 1312896)
i also had the same problem

try editing this TEST to test in ur last line of php file

Code:

eval('print_output("' . fetch_template('TEST') . '");');

?>

Everything shall be fine........ the code is not wrong anywhere else

Ahhh didn't know that had to be edited works a treat now thank you :)

Quote:

Originally Posted by SirAdrian (Post 1312951)
Template names are case sensitive. :)


Yes i was aware of that but wasn't aware that line needed editing :) Thanks anyway :)


All times are GMT. The time now is 08:28 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.02212 seconds
  • Memory Usage 1,764KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (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