vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   custom page wrapper (https://vborg.vbsupport.ru/showthread.php?t=92203)

Dream 07-13-2005 10:00 PM

custom page wrapper
 
This lets you create a vBulletin page by just creating a template.

Installation
- Upload "custom page wrapper 0.1.xml" plugin and activate it
- Create a "page_test" template with anything in it
- Test it out with "index.php?page=test"

To create pages, add a template that begins with "page_" in the title. You can change that prefix editing the plugin.

Enjoy :)


PHP Code:

if ( !empty($_REQUEST['page']) ) {
    
$template_prefix 'page_';
    
$page_template $template_prefix $_REQUEST['page'];
    
$page_title ucwordsstr_replace("_"" "$_REQUEST['page']) );
    
$navbits = array();
    
$navbits[] = $page_title;
    
$navbits construct_navbits($navbits);
    eval(
'$navbar = "' fetch_template('navbar') . '";');
    eval(
'$HTML = "' fetch_template($page_template) . '";');
    if (empty(
$HTML)) {
        eval(
standard_error("No such page."));
    }
    eval(
'print_output("' fetch_template('GENERIC_SHELL') . '");');



evenmonkeys 07-14-2005 09:42 PM

W00t! Thank you so much!!!

bigcurt 07-14-2005 11:04 PM

I need to make some custom pages with 3.0.X

Barakat 07-14-2005 11:14 PM

wowowowow u r Great i wonder how i was going to make something nice like that .

just want know how can i called a data from database not from a templete in 3.5.0 ?

this file i make it on 3.0.7 and it works when i call it from the browser

Code:

<?php
require_once('./global.php');
if ($id) {
function getcontent($contentid) {
$contents=mysql_query("SELECT content FROM bbs WHERE id='$contentid'");
$content = mysql_fetch_array($contents);
$contentid=$content[content];
$html=str_replace("\"","\\\"",$contentid);
return $html;
}
$que = "SELECT * FROM bbs WHERE id='$id'";
$result = mysql_query ($que)
  or die ("error on file");
$page = mysql_fetch_array($result);
$navbits = construct_navbits(array('' => $page[name]));
eval('$navbar = "' . fetch_template('navbar') . '";');
eval("print(\"".getcontent("$id")."\");");
}


Dream 07-14-2005 11:41 PM

Quote:

Originally Posted by bigcurt
I need to make some custom pages with 3.0.X

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

Quote:

Originally Posted by Barakat
wowowowow u r Great i wonder how i was going to make something nice like that .

just want know how can i called a data from database not from a templete in 3.5.0 ?

this file i make it on 3.0.7 and it works when i call it from the browser

not sure how to do that, post it in the modification questions forum so more people can see it. I think you would need a php file to do that, dunno how to do one

you could edit the plugin, but im not sure what you are trying to do

edit 2: check this post too might help
https://vborg.vbsupport.ru/showthread.php?t=92066

Chris M 07-15-2005 12:57 AM

Nice idea :)

However I'm going to alter this and use an Extension version, by placing the code in a pages.php file ;)

But still, nice idea :)

Satan

Dream 07-15-2005 01:06 AM

go for it, modify, reuse, rerelease, whatever

edit: would be nice if you released a "blank page" extension, some people seem to need it. i dont know what id need to include etc to make that or else id make one.

Chris M 07-15-2005 01:15 AM

How do you mean blank page? :)

And also - I've been toying with the idea of including a template-caching for the page generated...

The code I've been trying to use isn't working - I think it's a case of staring too long at vBulletin source code all day and I'm missing something :p

PHP Code:

    $globaltemplates array_merge($globaltemplates, array(' . $template_prefix . $_REQUEST[page] . ')); 

:)

Satan

Dream 07-15-2005 01:24 AM

dunno about cache, I think they are cached when you include global.php, so youd have to merge into the cache array before the script imports it... dont think there are hooks before a global.php include

Chris M 07-15-2005 01:26 AM

Of course - It has to be done via cache_templates :p

Satan


All times are GMT. The time now is 06:02 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.01236 seconds
  • Memory Usage 1,747KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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