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

Dream 07-15-2005 01:27 AM

maybe

Code:

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

Chris M 07-15-2005 01:36 AM

Heh I figured it out ;)

PHP Code:

if (THIS_SCRIPT == 'pages')
{
global 
$globaltemplates;

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


Place that in the cache_template hook location ;)

Whats this you were on about to do with a blank page?

Satan

Dream 07-15-2005 01:38 AM

this for 3.5

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

Chris M 07-15-2005 01:40 AM

I see - I've already got the file setup and ready to go ;)

If you don't mind me releasing it as an Extension / Code Mod then I shall :)

Satan

CMilne 07-15-2005 12:12 PM

VERY Cool! Much appreciated, I need a few extra pages :P

Edit: This could do WONDERS if used with custom code added in via the hooks system :P HUZZAH!

Brilliant.

Barakat 07-17-2005 11:37 AM

this is the hack which i told u on it before sooo i think u can make it

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

SouthernTn 07-18-2005 09:11 PM

Hey Im interested in installing but will this work with the Mod_Rewrite 3.5 , will the pages work with that or will it still have .php?= and etc.

Dream 07-19-2005 12:03 AM

Quote:

Originally Posted by SouthernTn
Hey Im interested in installing but will this work with the Mod_Rewrite 3.5 , will the pages work with that or will it still have .php?= and etc.

don't know, im not familiar with mod_rewrite, sorry

jesus likes pie 09-09-2005 01:54 AM

I dont get it...are there any pics for stupid people like myself?

Dream 09-09-2005 07:06 AM

Quote:

Originally Posted by jesus likes pie
I dont get it...are there any pics for stupid people like myself?

well say you wanted to make a "forum rules" page, it would look like this https://vborg.vbsupport.ru/showthrea...threadid=91645 , of course you would need to do the html

Vtec44 09-14-2005 01:21 AM

If you put the below in a template you create, it will look exactly like part of vB, with all the header and footer.

Code:


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

<!--TEXT HERE -->


THIS IS A TEST



<!--END TEXT-->

        </td>
</tr>
</table>


Mr Chad 09-27-2005 02:53 AM

Very nice!

Makes it soo much easier!

lylah 09-27-2005 08:06 AM

thaaaaanx

wtrk 09-29-2005 03:33 PM

is there anyway to make it so that only certain usergroups can view these new pages?

murrtex 10-24-2005 04:16 AM

i nstalled this plugin. i created page_test templates..but again again it says "No such page.
" what should i do??

Yorixz 10-24-2005 05:55 AM

Quote:

Originally Posted by wtrk
is there anyway to make it so that only certain usergroups can view these new pages?

You can use conditions in templates; not the best way but should work.

unknowngiver 10-24-2005 04:09 PM

Great mod
only if we could parse PHP thorugh templates...or some other way to use PHP in the custom pages :(

drex 10-25-2005 01:52 AM

quick question--

are any of the pages contents searchable via the search function?

ie if you 'search' the forums or sites, will it 'search' these pages as well?

thanks

Electrohead04 10-28-2005 04:37 PM

n00b question... What do i do with that PHP code?

Electrohead04 10-28-2005 04:39 PM

Ah, never mind, i figured it out... Sorry for double post

PowerStroke 10-28-2005 07:01 PM

Can we see a sample page?

Dream 11-01-2005 01:12 AM

Quote:

Originally Posted by drex
quick question--

are any of the pages contents searchable via the search function?

ie if you 'search' the forums or sites, will it 'search' these pages as well?

nope. only posts are indexed in vBulletin's search system. I wouldnt know how to add pages.

Quote:

Originally Posted by PowerStroke
Can we see a sample page?

https://vborg.vbsupport.ru/showthrea...threadid=91645

jugo 11-01-2005 02:33 AM

Quote:

Originally Posted by SouthernTn
Hey Im interested in installing but will this work with the Mod_Rewrite 3.5 , will the pages work with that or will it still have .php?= and etc.


You can achieve this by pointing the links to your files something like:

pagename.html

and using this rule in your .htaccess

Code:

RewriteRule ^(.*)\.html$ index.php?page=$1
I currently use this method at www.ejuan.com. I don't use this particualr hack, but i have written code to generate the pages within my page template.

This is also in use at www.freaks-network.com .

If you need help with it feel free to contact me.

Annie^.^ 02-06-2006 04:25 PM

I need a little help. I making a staff page and I would like to add the online status. How can I do that? $userinfo[onlinestatus] because right now it doesn't show up.

kafi 02-11-2006 07:54 AM

I am getting this error for guests (not signed users):

Unable to add cookies, header already sent.
File: /home/www/mysite.com/www/custompage.php
Line: 1

please hep .-) what am I doing wrong

vietkieu_cz 02-11-2006 08:53 AM

How do I change if index.php?page=1 => it will show term of thread id 1?

kafi 02-22-2006 06:22 AM

Quote:

Originally Posted by kafi
I am getting this error for guests (not signed users):

Unable to add cookies, header already sent.
File: /home/www/mysite.com/www/custompage.php
Line: 1


please hep .-) what am I doing wrong


pls nobody?

Annie^.^ 02-22-2006 06:48 AM

I don't there is much support here

Domenico 03-16-2006 08:39 PM

Quote:

Originally Posted by unknowngiver
Great mod
only if we could parse PHP thorugh templates...or some other way to use PHP in the custom pages :(

So, is there any other way we can parse PHP code this way?

Holidazed 05-31-2006 12:53 PM

How do I create a template and just tell it to include another file on my server? I use the "php include" statement but it does not work. It acts like the statement is not even there


All times are GMT. The time now is 07:44 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.01352 seconds
  • Memory Usage 1,826KB
  • 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
  • (4)bbcode_code_printable
  • (3)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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