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 11-21-2009 07:39 PM

Quote:

Originally Posted by Anseur (Post 1918480)
Ok, Can't immagine why an iframe would do that.

Well thanks for your time anyway.

Did you add the template to the MASTER STYLE or just to one of your styles? And is that style the default style for unregistered users?

Quote:

Originally Posted by Parture (Post 1918486)
What's the CSS page for this page? Is it vbulletin.css

It's all the defaults that you get from the headinclude template. Yes, vbulletin.css is one of them.

Anseur 11-21-2009 07:55 PM

Quote:

Originally Posted by Lynne (Post 1918511)
Did you add the template to the MASTER STYLE or just to one of your styles? And is that style the default style for unregistered users?

Of course! Your a genius! I could kiss you right now! (but I wont!)

a thousand thankyous!

EidolonAH 11-24-2009 11:50 AM

Can anyone please help me to understand why the html tags such as h2 ul and li are not working in my custom pages?

This is the TOS page:
http://www.eidolonmh.com/vbskinsxtre....php?styleid=3

This is how it's coded:
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>
<h2 class="blockhead">vBSkinsXtreme Terms of Service</h2>
<div class="blockbody">
    <div class="blockrow">
        <h2>Terms of Service</h2>
        <ul>
            <li>vBSkinsXtreme is a private web club and visiting this website or being a member is a privilege, NOT a right.</li>
            <li>vBSkinsXtreme has full liberty to choose its members. We reserve our rights to accept or reject any member signups, remove or banish any member from the site, grant and revoke any privileges to members within the site without warning, prior notice or giving any reason and in anytime we find appropriate.</li>
            <li>vBSkinsXtreme can anytime stop or suspend its services without prior notice.</li>
            <li>The information published in this website may be outdated or wrong in one way or another, so no information should be used without consulting it with a professional.</li>
            <li>All content sent to vBSkinsXtreme by its members and visitors can be rejected, deleted, modified, edited by site administration.</li>
            <li>Legal rights of the content sent to vBSkinsXtreme by its members or visitors belongs to Site administration when they are submitted to the site unless it is clearly mentioned otherwise in the submit page. Site visitors/members can not ask the submitted content to be removed or unpublished from the site later.</li>
            <li>All site visitors who visit this website are obligated to obey site rules & site agreement and respect site principals and goals.</li>
        </ul>
                       
        <h2>Limitation of Liability and Disclaimer</h2>
                       
        Site visitor agrees that the use of vBSkinsXtreme's services is entirely at visitor's own risk. vBSkinsXtreme's services are provided on an "as is" basis without warranties of any kind, either expressed or implied, constructive or statutory, including, without limitation, any implied warranties of merchantability, non-infringement or fitness for a particular purpose.
                       
        $vboptions[bbtitle] makes no guarantee of availability, continuity or quality of its service and reserves the right to change, withdraw, suspend, or discontinue any functionality or feature of vBSkinsXtreme's services. In no event will vBSkinsXtreme be liable for any damages, including, without limitation, direct, indirect, incidental, special, consequential, or punitive damages arising out of the use of or inability to use vBSkinsXtreme's services or any content thereon.
                       
        This disclaimer applies, without limitation, to any damages or injury, whether for breach of contract, tort, or otherwise, caused by any failure of performance; error; omission; interruption; deletion; defect; delay in operation or transmission; computer virus; file corruption; communication-line failure; network or system outage; or theft, destruction, unauthorized access to, alteration of, or use of any record.
                       
        <h2>Indemnity and Legal exemption</h2>
                       
        <strong>User agrees to indemnify and hold vBSkinsXtreme harmless from any loss, liability, claims, damages and expenses, including attorneys fees, arising from or related to the content, use, or deletion of User's Files, messages or use of any other feature or service in this site. This expressly includes:</strong>
        <ul>
            <li>User's responsibility for any and all liability arising from the violation or infringement of proprietary rights or copyrights.</li>
            <li>Any defamatory or unlawful material contained within User's messages, private messages, emails, attachments, images and files.</li>
            <li>Content submitted to the site by the user</li>
            <li>Other content in the site</li>
            <li>Communication with site administration</li>
        </ul>
                       
        <h2>Legal Policy and Notice</h2>
                       
        vBSkinsXtreme's Terms of Service, site agreement, disclaimer, forum rules, site rules, indemnity clause, copyright notice and privacy policy are subject to change, but changes shall be announced. Such changes are reflected in the relevant pages of the site upon alteration and due when they are published in the site.
                       
        <h2>Copyright Notice:</h2>
        All rights of this website is reserved. This includes the rights to its name, domain name, trademark, concept, format, content, style, skin, code, database and every other element in this website. No part of this website, its content, name, applications, documents, programs, texts, design elements, images, posts, look, feel, atmosphere or format can be copied, shared, moved, published or used without prior and explicit consent of its Author.<br />
        Except where diligently implied, absolutely NO part of vBSkinsXtreme may be reproduced or recreated without explicit written permission by site owner of vBSkinsXtreme and certified with written verification.
    </div>
</div>
{vb:raw footer}
</body>
</html>


Lynne 11-24-2009 01:55 PM

Quote:

Originally Posted by EidolonAH (Post 1920085)
Can anyone please help me to understand why the html tags such as h2 ul and li are not working in my custom pages?

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.

Calash 11-25-2009 01:34 PM

Perfect, thank you so much for posting this.

I do have a general question. For my eFiction bridge mod I have been exporting the templates into variables that I can then use in the external template system. I figured out how to make this work by using the following code.


Code:

$templater = vB_Template::create('header');
$header = $templater->render(); 

$templater = vB_Template::create('footer');
$footer = $templater->render(); 

$templater = vB_Template::create('headinclude');
$headinclude = $templater->render(); 


$templater = vB_Template::create('navbar');
$navbar = $templater->render();

This ends up being a lot of repetitive code. Is there a better way to get the templates into the variables?

Lynne 11-25-2009 01:44 PM

You should not have to create/render any of those you posted there. When you go to render your own template, you would have this second line here to render those templates automatically for your page:
PHP Code:

$templater vB_Template::create('your_template');
    
$templater->register_page_templates();
    
$templater->register('your_variable'$your_variable);
print_output($templater->render()); 


Calash 11-25-2009 02:03 PM

The problem is that I need the individual templates in variables. eFiction uses it's own template system and, barring a major rewrite of that code, the best solution I have is to export the templates, then import them into it's system.

cellarius 11-25-2009 02:23 PM

... forget it, missed the answers on the next page :)

Adem GEN? 11-28-2009 03:12 PM

What I can not run

In this thread the

created tes.php
created test template

did not change anything

Can not demonstrate this
PHP Code:

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

How do I show?

Regards

Lynne 11-28-2009 03:22 PM

Whoops. Find this line in test.php
PHP Code:

$templater->register('pagetitle''Test Page'); 

And change to:
PHP Code:

$templater->register('pagetitle'$pagetitle); 


Adem GEN? 11-28-2009 04:13 PM

This does not exist
PHP Code:

$templater->register('pagetitle''Test Page'); 


I want to show here is a variable
Example:
PHP Code:

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

$adem 'Hello World'

HTML - template test
HTML Code:

    <h2 class="blockhead">Title</h2>
    <div class="blockbody">
      <div class="blockrow">



        Text


{vb:raw adem}



      </div>
    </div>

Does not appear on the page

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

First message changed?

I have to add the following for $adem variable is?

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

Lynne 11-28-2009 05:16 PM

Quote:

Originally Posted by AdemGEN? (Post 1922108)
I have to add the following for $adem variable is?

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

Yes, you must register any variable you plan to use in your template.

Adem GEN? 11-28-2009 06:13 PM

Thank you very
Now okay

BBR-APBT 11-28-2009 11:26 PM

How to show Whats going on Box on this new page?

Lynne 11-29-2009 02:06 AM

Quote:

Originally Posted by BBR-APBT (Post 1922252)
How to show Whats going on Box on this new page?

I don't know, that article hasn't been updated. I would think the instructions are pretty much the same though.

willy888 12-03-2009 01:36 PM

Thanks I use this article its very helphull for me
Can we add a widjet with a collum in the new page ?

Dave-ahfb 12-10-2009 01:57 PM

Ok I have tried every which way from sunday to understand how to be able to use this with a certain group of my scripts with no luck. Keep in mind any responses may have to be "dumbed down" ;)

Here is an example of how these scripts are set up.

page is originally called as such
PHP Code:

testpage.php?sub=gen_form 

testpage.php would contain code
PHP Code:

<?php
include_once('/path/to/test.class.php');
$gen_test = new test_gen;
?>

as well as

PHP Code:

<?php 

if($_GET['sub'] == 'gen_form')
{    
    
$gen_test->gen_test_form(); 
}
if(
$_POST['sub'] == 'Generate Test')
{
    
$gen_test->gen_test();
}
if(
$_POST['sub'] == 'Preview Test')
{
    
$gen_test->preview_test();
}

?>

Of course all of the true scripting is located at /path/to/test.class.php

can anybody be of help? I am hoping with an example I can finish the rest of my scripts which are similar and maybe get a better understranding so that I may do my other scripts which are different.

muratmunich 12-15-2009 09:46 AM

And what if i have more than 10 Variables in a Template?
Do i have to register each variable ?

PHP Code:

$templater->register('your_variable'$your_variable);
$templater->register('your_variable2'$your_variable2);
$templater->register('your_variable3'$your_variable3);
.
.
$templater->register('your_variable10'$your_variable10); 

Does this way loose Performance (Many Class calls) ?
Or is there a Array ?

In my opinion the old way was more easier than this !

ragtek 12-15-2009 10:03 AM

You could put all youre variables into an array. Then you have only to register the arrayvariable.

Lynne 12-15-2009 03:27 PM

Quote:

Originally Posted by ragtek (Post 1931039)
You could put all youre variables into an array. Then you have only to register the arrayvariable.

Yep, that is what I did to a few of my mods. I had $variable1 and $variable2 and $variable3, etc. and just through them all into an array - $myarray['variable1'] and $myarray['variable2'] and $myarray['variable3'], etc. Then I just registered $myarray.

muratmunich 12-15-2009 07:32 PM

Thanks...

Ok nice, but do you know the Advantage of this way to use Variables in a Template ?

ragtek 12-15-2009 07:58 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=228078" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=228078</a>

anthony parsons 12-16-2009 10:35 PM

1 Attachment(s)
I like it Lynne... between this and the nav plugin, my life is now made a lot easier than having to sit down and come up with it myself. Very much appreciated. Custom page with menu... excellent.

https://vborg.vbsupport.ru/attachmen...1&d=1261010072

nubian 12-17-2009 05:07 AM

  1. Is is mandatory that I have the text case of there vars to be all in caps in the test.php and in the name of the template?
    PHP Code:

    $globaltemplates = array('TEST',); 

    PHP Code:

    $templater vB_Template::create('TEST'); 

    How do I get it so that I can retain the case of my test.php but change the case in the template from TEST to test?
  2. I plan on making quite a few custom pages so would it be possible to place these php files in another directory?

Lynne 12-17-2009 03:52 PM

1. No, you don't need all caps. You just need to be consistent when you use it. If it's in all small letters in the $globaltemplates area, then use all small letters in the $templater.
2. Sure, but you'll have to make sure when you include the global.php page, or any other scripts, you'll have to make sure the path to them are correct.

turtile 12-19-2009 04:22 PM

I get the error:

Code:

Warning: require_once(./global.php) [function.require-once]: failed to open stream: No such file or directory in /home1/riptidep/public_html/unusualplants/index.php on line 27

Fatal error: require_once() [function.require]: Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home1/riptidep/public_html/unusualplants/index.php on line 27

I tried the other global method from the posts and I get a blank page. My template is under my default page.

Code:
Code:

<?php

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

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

define('THIS_SCRIPT', 'index.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('INDEX',
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');


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

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

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'Unusual Plants Home Page';

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

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

?>

Thanks

Lynne 12-19-2009 04:58 PM

And are you putting this file in the same directory as all your other vbulletin files? If not, you need to do a chdir to get the global.php file.

turtile 12-19-2009 05:33 PM

My index file is in unusualplants.net/
The forum is located at unusualplants.net/forums

I tried changing the directory at the beginning of the code (never changing back), right before the global line(never changing back), at the beginning and changing the directory back after the global line, and right before the global line and changed it back after. I get a blank page for each one.

I used this for changing the directory:
Code:

chdir('forums');
and this for moving back:
Code:

chdir('../');
Thanks

Lynne 12-19-2009 05:51 PM

When you added the template, did you add it to the style you are currently using to browse your forum?

turtile 12-19-2009 05:53 PM

Quote:

Originally Posted by Lynne (Post 1933635)
When you added the template, did you add it to the style you are currently using to browse your forum?

Yes

Lynne 12-19-2009 06:17 PM

Quote:

Originally Posted by turtile (Post 1933638)
Yes

First, make sure the path is correct - it should be the full path to your vb forums directory.

Check your error_logs (if you don't know where they are, ask your host) to see if anything is in there.

turtile 12-19-2009 06:45 PM

Quote:

Originally Posted by Lynne (Post 1933649)
First, make sure the path is correct - it should be the full path to your vb forums directory.

Check your error_logs (if you don't know where they are, ask your host) to see if anything is in there.

the forum.php file is located @ unusualplants.net/forums/

(I'm not sure which time this is set on)


For PHP:
/home1/riptidep/public_html/unusualplants/error_log:
[19-Dec-2009 17:45:25] PHP Warning: require_once(./global.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /home1/riptidep/public_html/unusualplants/index.php on line 27
[19-Dec-2009 17:45:25] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home1/riptidep/public_html/unusualplants/index.php on line 27

Thanks for all of your help

Lynne 12-19-2009 06:49 PM

It looks like you didn't do your chdir correctly. You need to do the FULL path:
PHP Code:

chdir ('/path/to/your/forums'); 


ExTincTi0N 12-19-2009 07:35 PM

Okay Lynne I am in need of your assistance.

https://vborg.vbsupport.ru/external/2009/12/33.png

How do i get it so that the nav button "Game Nights" is selected?

Lynne 12-19-2009 07:44 PM

If you defined THIS_SCRIPT at the top of your page, you should use it in your condition for your tab. You should post for help regarding this in the thread where you got the tab code.

ExTincTi0N 12-19-2009 07:56 PM

Thanks for the help lynne, and next time I will say which one i used, btw it was yours lol.

turtile 12-19-2009 07:58 PM

Quote:

Originally Posted by Lynne (Post 1933674)
It looks like you didn't do your chdir correctly. You need to do the FULL path:
PHP Code:

chdir ('/path/to/your/forums'); 


I tried:
Code:

chdir('/home1/riptidep/public_html/unusualplants/forums');
...and still a blank page.

I don't get anything in the error log either.

Lynne 12-19-2009 08:26 PM

And is your template named INDEX (*exactly* - capital letters too).

turtile 12-19-2009 08:34 PM

Quote:

Originally Posted by Lynne (Post 1933721)
And is your template named INDEX (*exactly* - capital letters too).

I had it as index. Works perfect - thanks a lot!

I.am 12-21-2009 05:02 PM

Have you tried to validate it? http://validator.w3.org/


All times are GMT. The time now is 12:50 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.02322 seconds
  • Memory Usage 1,889KB
  • 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
  • (7)bbcode_code_printable
  • (2)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
  • (3)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