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)

Verionia 01-04-2010 04:31 AM

Quote:

Originally Posted by Anseur (Post 1918381)
I've set this up on my test site, and it works OK while i'm logged in, but when I'm not logged in, and I visit this custom page, I just get a plain white screen.

looking at a source of this plain white pages shows me:
Code:

<!-- BEGIN TEMPLATE: dkp_template -->
 
<!-- END TEMPLATE: dkp_template -->

Here is the code currently used in the template for this custom .php page:

Code:

{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
  <head>
    <title>{vb:raw vboptions.bbtitle}</title>
    {vb:raw headinclude}
  </head>
  <body>
   
    {vb:raw header}
   
    {vb:raw navbar}
   
    <div id="pagetitle">
      <h1>{vb:raw pagetitle}</h1>
    </div>
  <li class="popupmenu">
    <h2 class="blockhead">The MCO DKP System</h2>
    <h2 class="blocksubhead"> <vb:if condition="$show['modcplink']">
                                <a href="javascript://" class="popupctrl">Administration</a>
                                <ul class="popupbody popuphover">
                                        <li><a href="/25manwrathplus/admin/" target=?dkp_frame?>Admin Index</a></li>
                                        <li><a href="sublink2.php">SubLink 2</a></li>
                                        <li><a href="sublink3.php">SubLink 3</a></li>
                                </ul>
                            </li>
</vb:if> </h2>
                         
    <div class="blockbody">
      <div {height:auto;}>

<iframe name="dkp_frame" width=100% height=1700px SCROLLING=no FRAMEBORDER=0 src="/25manwrathplus">dkp_frame</iframe>
               
      </div>
    </div>
   
    {vb:raw footer}
  </body>
</html>


How can I get the page to auto size the website in the frames so that I don't have to use scrolling or parts of the website is cut off?

SuperGLS 01-04-2010 11:03 PM

Quote:

Originally Posted by Lynne (Post 1946585)
I do my WOL a little different and just added the code to the first post.

That worked great (and thanks for color coding it for us, that's perfect). Thanks yet again Lynne.

RDX1 01-05-2010 04:16 AM

Great article, only issue is notices are showing up with no way to dismiss them, also the login box shows and won't go away even when logged in. Any idea how to remove this?

Lynne 01-05-2010 02:46 PM

Quote:

Originally Posted by RDX1 (Post 1947535)
Great article, only issue is notices are showing up with no way to dismiss them, also the login box shows and won't go away even when logged in. Any idea how to remove this?

Since those are both issues in the navbar and header which aren't touched in this article, I think it's an issue with the way you have your site set up.

pisymbol 01-11-2010 01:40 AM

Lynne, anyone, I have copied pasted the exact tutorial and I see nothing. First off, where should I see the results?

I have test.php in my $ROOTIDR (permissions are 755), I have TEST registered in my MASTER style with the exact code above. I understand fundamentally waht I'm doing here but I see no results.

How to I test this? I see no error in my error_logs.

Code:

<?php

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

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

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

// 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
require_once('./global.php');

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

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

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'My Page Title';

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

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

?>

I created two plugins associated with the right hooks. The code is identical to what is shown on the first page.

The template is registered, if I customize/edit it:

Code:

{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
  <head>
    <title>{vb:raw vboptions.bbtitle} - {vb:raw pagetitle}</title>
    {vb:raw headinclude}
  </head>
  <body>
   
    {vb:raw header}
   
    {vb:raw navbar}
   
    <div id="pagetitle">
      <h1>{vb:raw pagetitle}</h1>
    </div>
   
    <h2 class="blockhead">Title</h2>
    <div class="blockbody">
      <div class="blockrow">
        Text
      </div>
    </div>
   
    {vb:raw footer}
  </body>
</html>

I am using latest 4.0 Gold PL1, php 5.3.0, apache 2.2.x (its installed on my local MBP (Snow Leopard)).

tafreeh 01-11-2010 07:45 PM

great article.. i was able to create the page... but my content doesnt support basic html tags .... why is that?????

mokujin 01-11-2010 08:17 PM

Does anyone how to disable all notices in custom page? Thank you

pisymbol 01-12-2010 01:05 AM

Alright, my code looks good but I have two questions:

1) To get to my test page I do:

http://localhost/test.php

I see my test page.

2) If I then go to WOL link, I see My Page underneath it. So that works though I guess I didn't understand the point of the test page.

However, I noticed that the link under WOL is:

http://localhost/test.php?

With no vbulletin session state passed to it. Is that right?

Lynne 01-12-2010 02:51 PM

There will not be a session state if you are logged in.

meissenation 01-12-2010 05:46 PM

Anyone know why
HTML Code:

<strong></strong> and <ul></ul><li></li>
tags do not work in the custom page? I've never seen HTML just be ignored like that. I can view it in the source code for the page so I know it's not my cache just not refreshing but yet it's not doing what the HTML tags say to do.

http://www.mifbody.com/vbulletin/advertise.php

If you view the source and then compare where it says "SOLD" in red - it should be strong. All the headings should be strong for that matter.


Edit:
Weird -
HTML Code:

<b></b>
works perfectly fine, though...


All times are GMT. The time now is 11:24 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03267 seconds
  • Memory Usage 1,755KB
  • 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
  • (2)bbcode_html_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)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