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)

CrumbDown 02-10-2012 08:36 AM

Noob question.

I have created a terms.php file, but how to add words in that file. Well...I can add words but the formatting is not working such as <li> </li>. Is there something Im missing?

Rocket2009 02-10-2012 01:27 PM

Quote:

Originally Posted by CrumbDown (Post 2298171)
I have created a terms.php file, but how to add words in that file. Well...I can add words but the formatting is not working such as <li> </li>. Is there something Im missing?

If you are saying that the formatting does not look right in your editor while putting in code into terms.php, it shouldn't since the code is contained within a string variable that is passed to the template.

When I use this method to create external pages I will frequently develop the html within a separate file and test it prior to bringing to this template passing system.

CrumbDown 02-10-2012 03:05 PM

Format looks perfect in DreamWeaver.

This does not work in the template:
Code:

<ul>
<li>blah blah</li>
</ul>

Nor:
Code:

<p>blah blah</p>

Rocket2009 02-10-2012 07:47 PM

Quote:

Originally Posted by CrumbDown (Post 2298269)
This does not work in the template:

Are you saying the code you developed doesn't work in the custom template you built (TEST according to the tutorial) or in the page (test.php according to this tutorial).

CrumbDown 02-11-2012 10:49 AM

Quote:

Originally Posted by Rocket2009 (Post 2298377)
Are you saying the code you developed doesn't work in the custom template you built (TEST according to the tutorial) or in the page (test.php according to this tutorial).

What code? I have followed the above instructions to create a new template and a new .php file. All is ok. I got a new template: www.mywebsite.com/newpage.php. Perfect yes. But I need to add words/content on that page. By doing so I need to add it in the template which works perfect. But trying to get a paragraph or bullet points does not work. It's like viewing sentences in notepad without word wrap selected.

Regards

cellarius 02-11-2012 11:51 AM

If you followed the tutorial, you created
1. a php file
2. a template in AdminCP.

Where do you add your html code, to 1 or 2? You need to add it to 2. It may be that you need to put a div-container around your html, since the formatting of unordered lists and the like will be reset by vB in order to format the page layout.

Do
HTML Code:

<div class="mytext">
<ul>
<li>blah blah</li>
</ul>
</div>

Add, for example, this to additional.css:
HTML Code:

.mytext ul {
        whatever css formatting you want
        }

But this really leads away from this tutorial.

CrumbDown 02-11-2012 12:31 PM

Hi

I have added the first HTML code below:
Code:

<div class="block row">
and no bullet point.

And yes, I have edited the template.

Rocket2009 02-11-2012 03:38 PM

Quote:

Originally Posted by CrumbDown (Post 2298171)
I have created a terms.php file, but how to add words in that file. Well...I can add words but the formatting is not working such as <li> </li>. Is there something Im missing?

First of all, it works! So it's tough to help without seeing your code. I will show you my approach. I put all of the content into the .php page so I can have the smallest number of templates (2) for doing dozens of pages. Here is the php code with simple content similar to what you want to send:

Code:

// ###### YOUR CUSTOM CODE GOES HERE #####

$pagetitle = 'My Page Title';

$bartitle = 'Bar Sub-Title';

$linkcss = '';

$linksjava = '';
       
$pagescript = '';
       
$introstuff = '<div class="article cms_clear restore postcontainer">

        <div style="padding-top: 6px; padding-bottom: 6px;">Upon joining the website each user shall be classified by their experience level as follows:</div>
       
        <div style="line-height: 140%; margin-left: 30px;">
        <ul>
                <li style="margin-bottom:5px;">0 to 5 forum posts:  New User</li>
                <li style="margin-bottom:5px;">5 to 100 forum posts:  Proficient User</li>
                <li style="margin-bottom:5px;">More than 100 forum posts:  Expert User</li>
                </ul>
        </div>
<br />
</div>';

$graphix = '<div style="text-align: center;" ><A HREF="/index.php">
                        <IMG SRC="/pics/under_construction_02.jpg" ALT="Under Construction"></A>
                        </div>';

As a reminder you need to put this content on the page such as:

Code:

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

$templater = vB_Template::create('TMGApage');
$templater->register_page_templates();

$templater->register('navbar', $navbar);

//$templater->register('pagetitle', $pagetitle);
//$templater->register('bartitle', $bartitle);

$templater->register('linkcss', $linkcss);
$templater->register('linksjava', $linksjava);
$templater->register('pagaescript', $pagescript);
$templater->register('introstuff', $introstuff);
$templater->register('graphix', $graphix);

print_output($templater->render());


MatiasCandy 02-15-2012 04:46 AM

Okay I might have missed this in the sea of posts.

I created my basic page but now I want to include the Widgets on it so it will match the entire website.

How do I add the Widgets and be able to change with the layout manager?

Lynne 02-15-2012 03:36 PM

Quote:

Originally Posted by MatiasCandy (Post 2299809)
Okay I might have missed this in the sea of posts.

I created my basic page but now I want to include the Widgets on it so it will match the entire website.

How do I add the Widgets and be able to change with the layout manager?

I don't think it has ever been discussed. There is another article in this forum about adding widgets to any page, so you should go read that one.

MatiasCandy 02-16-2012 09:16 PM

Quote:

Originally Posted by Lynne (Post 2299954)
I don't think it has ever been discussed. There is another article in this forum about adding widgets to any page, so you should go read that one.

searching cannot find it, do you have a link?

GameOverViper 02-17-2012 11:10 PM

Hello, I'm starting on a project and I'm not exactly sure how to make it so in the bread crumbs, it shows another page that I made that is only viewable from the first created page.

I'm trying to make a few pages actually that will work off of others. I'm just curious as to how the bread crumbs work.

appsfinder 03-03-2012 10:43 AM

works great

brishi 03-18-2012 07:48 PM

OK, like a few other beginners have more than likely done I started out by using the coding from the vB3 posting which was pointed out to me by cellarius and I was getting a 3 line error. Now that I have switched over to this template I no longer get anything except a white page and if I vie the source code all I get is this :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type></HEAD>
<BODY></BODY></HTML>

I have looked through 154-20 pages of replies here and could not find an answer to correct myself, so need some help please. I am just using the basic 2 files used on the first page of this article and then will change the basic name to what I need when I know it is working properly.

NEVERMIND - Just kept checking and testing and found my silly error, I had the template as "Test" when it should have been "TEST"...Dohhhh!!! Great article btw Lynne and thanks for sharing!

Cheers,
BriShi

MacroPhotoPro 03-20-2012 01:01 PM

I have a Paid Subscription website, where I am able to ascribe permissions to my forums as well as to my CMS articles. The only parties who can see these pages are me, the Administrator (User Group 6), as well as my Subscribed Members (User Group 9). With this in mind, I have a few questions that I would be grateful for some clarification on:
1. Are these pages considered CMS pages and, if so, are they manageable under the Content Manager of CMS control in the ACP?;
2. If not, will creating these new pages be manageable anywhere in the ACP?;
3. If not, is there some coding that can be done in the default template to where only User Groups 6 and 9 are able to view the constructed pages?
Thank you for your time and for creating this valuable tutorial!

Jack

Rocket2009 03-20-2012 02:46 PM

I don't know about methods (1) and (2). As suggested elsewhere in this thread I effectively use a little code in the php page (not the vBulletin template). Mine looks like:

PHP Code:

// #######################################################################

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

// #######################################################################

if (!is_member_of($vbulletin->userinfo67515139111612))  
{
// give no permission unless in usergroup x, y, or z
        
print_no_permission();
}  

$navbits construct_navbits(array('' => 'TMGA Logos'));

$navbar render_navbar_template($navbits);



// ###### YOUR CUSTOM CODE GOES HERE ##### 


Lynne 03-20-2012 06:27 PM

Quote:

Originally Posted by MacroPhotoPro (Post 2311349)
I have a Paid Subscription website, where I am able to ascribe permissions to my forums as well as to my CMS articles. The only parties who can see these pages are me, the Administrator (User Group 6), as well as my Subscribed Members (User Group 9). With this in mind, I have a few questions that I would be grateful for some clarification on:
1. Are these pages considered CMS pages and, if so, are they manageable under the Content Manager of CMS control in the ACP?;
2. If not, will creating these new pages be manageable anywhere in the ACP?;
3. If not, is there some coding that can be done in the default template to where only User Groups 6 and 9 are able to view the constructed pages?
Thank you for your time and for creating this valuable tutorial!

Jack

1. No
2. They are manageable in the Style Manager where you may edit the templates.
3. See the post above this one.

MacroPhotoPro 03-21-2012 01:35 PM

Thank you both for your time, I appreciate it.

slammz 03-24-2012 04:52 AM

Quote:

Originally Posted by Lynne (Post 2311466)
1. No
2. They are manageable in the Style Manager where you may edit the templates.
3. See the post above this one.

How can I put certain forums on this page?

Lynne 03-24-2012 04:16 PM

Quote:

Originally Posted by slammz (Post 2312749)
How can I put certain forums on this page?

Just add the html in the template to link to the forums.

<a href="forumdisplay.php?f=xx">Form xx</a>

slammz 03-24-2012 05:30 PM

Quote:

Originally Posted by Lynne (Post 2312858)
Just add the html in the template to link to the forums.

<a href="forumdisplay.php?f=xx">Form xx</a>

No, I want to be able to display them like if I was on the homepage. How can I do that? I know it's possible somehow.

Lynne 03-24-2012 09:24 PM

Quote:

Originally Posted by slammz (Post 2312876)
No, I want to be able to display them like if I was on the homepage. How can I do that? I know it's possible somehow.

Copy the php code from the forum.php file and copy the needed template/html from the FORUMHOME template into your custom template.

slammz 03-25-2012 07:02 PM

Quote:

Originally Posted by Lynne (Post 2312949)
Copy the php code from the forum.php file and copy the needed template/html from the FORUMHOME template into your custom template.

I don't want all the forums displayed though, only my VIP forums.

Lynne 03-26-2012 03:21 PM

Quote:

Originally Posted by slammz (Post 2313229)
I don't want all the forums displayed though, only my VIP forums.

Then modify the php code to only show those forums.

SavSin 03-28-2012 09:42 PM

So i have finally gotten the hang of working with this type of page haha.. Thanks Lynn.

My question is Is there away to use say a contact form created on a custom page to send a pm to a couple hard coded users and also to post in a specified section of the forums?

"Not the original Contact Us Form from VB"

Lynne 03-28-2012 11:09 PM

Quote:

Originally Posted by SavSin (Post 2314466)
So i have finally gotten the hang of working with this type of page haha.. Thanks Lynn.

My question is Is there away to use say a contact form created on a custom page to send a pm to a couple hard coded users and also to post in a specified section of the forums?

"Not the original Contact Us Form from VB"

Of course there is, but you have to code it yourself and I don't have that code handy to just copy/paste it for you. If you need help with that, you should post in the Programming forum with the code you have already written and the problem you are running into.

MacroPhotoPro 03-29-2012 03:00 AM

This may have been covered, but will the Search (and Advanced Search) features work in these new pages?

If not, is there a way to configure this to have it work?

Lynne 03-29-2012 03:18 AM

It will work as far as you may still search posts. But, the information on these pages will not be searchable unless you do something to make them so. (Not anything that is covered in this tutorial.)

MacroPhotoPro 03-29-2012 03:31 AM

Quote:

Originally Posted by Lynne (Post 2314552)
It will work as far as you may still search posts. But, the information on these pages will not be searchable unless you do something to make them so. (Not anything that is covered in this tutorial.)

Thanks for your response. What would that "something" be :)

If this is not the place for that, where would such a question be posted?

Lynne 03-29-2012 02:16 PM

Quote:

Originally Posted by MacroPhotoPro (Post 2314556)
Thanks for your response. What would that "something" be :)

If this is not the place for that, where would such a question be posted?

That something would be to write some code to index the text in the search_core (and other) tables. You would probably need to create a new contenttype in the contenttype table in order to index it correctly. If you are unsure how to do this, then you should post in the main vB4 General Discussions forum. You should probably have a little bit of php experience if you are going to write this code.

MacroPhotoPro 03-30-2012 06:17 PM

Quote:

Originally Posted by Rocket2009 (Post 2311385)
I don't know about methods (1) and (2). As suggested elsewhere in this thread I effectively use a little code in the php page (not the vBulletin template). Mine looks like:

PHP Code:

// #######################################################################

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

// #######################################################################

if (!is_member_of($vbulletin->userinfo67515139111612))  
{
// give no permission unless in usergroup x, y, or z
        
print_no_permission();
}  

$navbits construct_navbits(array('' => 'TMGA Logos'));

$navbar render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE ##### 




How about a variation on this that also employs create/edit/delete permissions?

For example, in the other custom pages I want to design, these are going to be for an image-hosting service I am making. I want people to pay a fee to host their images, and I want "everyone" to be able to "see" these images, but where only the Administrator and Paid Subscibers can edit, delete, or create new pages.

Further, the permissions should be configured to where Paid Subscribers are only able to edit/delete their own self-created pages, but to where they can't edit/delete the pages of other Paid Subscribers, while the Administrator can edit/delete anyone's pages.

I know how to do this with my CMS Manager, but because these custom pages we're here aren't controlled by that, how would they be thus-configured by hand?

Thanks!

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

Quote:

Originally Posted by Lynne (Post 1915364)
2. Create the Template:
- If you are in debug mode, create the template in your MASTER STYLE so it shows up in all your styles, otherwise make sure you create the template in the style you are using. If following the page above, call the template TEST

How do I operate in debug mode, and will this still work if I am not?

cbiweb 04-03-2012 01:02 PM

I've created the page, and everything works except that users are no longer logged in when visiting the custom page. Clicking any tab or link to navigate away from the page brings me back to the normal logged in state, but the custom page is logged out. How do I fix that?

edit: Found the problem. It's a privacy policy page, and in Options > Site Name / URL / Contact Details the link to the page was the full path (http://sitename.com/forums/privacy.php) instead of relative (privacy.php). Once I made it relative it worked fine.

MacroPhotoPro 04-03-2012 03:58 PM

Code:

<?php

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

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

define('THIS_SCRIPT', 'scrImages');
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('IMAGE_HOSTING',
);

// 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
// chdir ('/path/to/your/forums');
require_once('./global.php');

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

$navbits = construct_navbits(array('' => 'Macro Image Hosting'));
$navbar = render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = '';
echo 'I am here';

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

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

?>


Okay, I have followed your instructions in this tutorial to the letter and am getting a blank test page to generate just fine.

However, the moment I try to add custom code to it, the setup fails. I just did a basic "I am here" insertion, but where you have indicated Your Custom Code Goes Here is generating the quote at the TOP of my test page, rather than in the body where it should be, as follows:


What am I doing wrong and why is the "I am here" quote being displayed at the top of the page, rather than in the body where it should be going?

Thanks for any help!

Jack

Lynne 04-03-2012 04:27 PM

You need to insert any text you want on the page into the template. You cannot use echo. You would need to do something like:
PHP Code:

$message 'I am here'

and in the appropriate place near the bottom, add:
PHP Code:

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

And then in the template, put this where you want the text to appear:
HTML Code:

{vb:raw message}

MacroPhotoPro 04-03-2012 05:38 PM

Okay, I have that bit working right now, thank you.

In order to create an actual page now, can I just use HTML tags, or do I have to register more code with the template?

Thanks again.

Lynne 04-03-2012 11:39 PM

If you have static content for your page, you may just want to type it into the template directly. Using variables is usually something you'd only want to do if you are using php to define some text.

MacroPhotoPro 04-04-2012 01:57 AM

Quote:

Originally Posted by Lynne (Post 2316554)
If you have static content for your page, you may just want to type it into the template directly. Using variables is usually something you'd only want to do if you are using php to define some text.

Okay thank you. Moving on from a basic block of text, what if I just want to make a basic HTML template within my custom page? For example:

Code:

<h1>My Title</h1>

My text

<ul>
  <li>Cameras</li>
    <ul>
      <li>DSLRs</li>
      <li>Point & Shoot</li>
    </ul>
  <li>Lenses</li>
  <li>Etc.</li>
</ul>

More text.

<a href="mailto:myemail">My Email</a>

How would I set the template/php page up? In other words, you had me place {vb:raw imghost_content} just to put "I am here," what kind of variable would I need to add to construct a basic HTML page?

Thanks again!!

cellarius 04-04-2012 05:15 AM

Use the template code given in the article to create a custom vBulletin page. To just create any html page (without showing the forum framework) use standard html page architecture (basically, you'll find that in the template code in the article, too).

MacroPhotoPro 04-04-2012 12:59 PM

Quote:

Originally Posted by cellarius (Post 2316603)
Use the template code given in the article to create a custom vBulletin page. To just create any html page (without showing the forum framework) use standard html page architecture (basically, you'll find that in the template code in the article, too).

I placed the simple code I put up top in the "your code goes here" element of the .php page, and my text showed up, but my HTML did not.

I assume I am missing something :confused:

Lynne 04-04-2012 02:05 PM

Quote:

Originally Posted by MacroPhotoPro (Post 2316673)
I placed the simple code I put up top in the "your code goes here" element of the .php page, and my text showed up, but my HTML did not.

I assume I am missing something :confused:

Please give us a URL to view the page. My guess is the HTML did show up, but your CSS is causing it to not do what you want.

Search this article for discussions on the problems using <li> on this page and the CSS you need to add to fix it.


All times are GMT. The time now is 05:05 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.02969 seconds
  • Memory Usage 1,885KB
  • 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
  • (3)bbcode_html_printable
  • (4)bbcode_php_printable
  • (21)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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