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)

ar15dcm 05-02-2013 10:51 AM

Thank you Lynne.

TheRealso0sick 05-09-2013 09:10 AM

Hey thanks for this guide but i'm still having problems with it.
I managed to set up the template for the php page but it won't output vb template codes like
"{vb:raw user.musername}"

When i enter this, it shows only a blank space in the php page.

What have i done wrong?

Lynne 05-09-2013 04:30 PM

Quote:

Originally Posted by TheRealso0sick (Post 2420835)
Hey thanks for this guide but i'm still having problems with it.
I managed to set up the template for the php page but it won't output vb template codes like
"{vb:raw user.musername}"

When i enter this, it shows only a blank space in the php page.

What have i done wrong?

Did you make sure to register the variable $user to be used in the template? Did you make sure to define the variable $user in the php code prior to rendering the template?

TheRealso0sick 05-09-2013 04:56 PM

Quote:

Originally Posted by Lynne (Post 2420906)
Did you make sure to register the variable $user to be used in the template? Did you make sure to define the variable $user in the php code prior to rendering the template?

Oh, no..
To be honest i'm not so familiar with php. I only know my way around in the VB templates
and i followed your guide step by step and was wondering why it's not working.

Could you give me a step by step instruction on how to make this work?

:(

Lynne 05-09-2013 10:51 PM

Quote:

Originally Posted by TheRealso0sick (Post 2420919)
Oh, no..
To be honest i'm not so familiar with php. I only know my way around in the VB templates
and i followed your guide step by step and was wondering why it's not working.

Could you give me a step by step instruction on how to make this work?

:(

I suggest you make a thread in the main forums and post your exact php file (in php tags) and template code (in tags also) and then we can help you easier.

omriamos 05-14-2013 09:51 AM

Hi,

I have a custom page (test.php for example) and I want to include a search results - specifically "search.php?do=getnew" - as a part of it.

e.g.
I want to have a custom header/code of some kind, like the subscribed-threads list, and afterwards to show the list of all the new posts from the forum (search.php?do=getnew).

Is it possible in any way?

Thanks

Lynne 05-14-2013 02:57 PM

Quote:

Originally Posted by omriamos (Post 2421932)
Hi,

I have a custom page (test.php for example) and I want to include a search results - specifically "search.php?do=getnew" - as a part of it.

e.g.
I want to have a custom header/code of some kind, like the subscribed-threads list, and afterwards to show the list of all the new posts from the forum (search.php?do=getnew).

Is it possible in any way?


Thanks

Sure it's possible if you code it. Are you asking if I have the code? No, I do not. You will need to code it yourself.

omriamos 05-14-2013 04:58 PM

Well, I was hoping for a little guidance on how to add search results to my custom php page...
:)

Lynne 05-14-2013 10:38 PM

You would need to create a search form (I would guess) and then write the queries to do the search and spit out the results. This really isn't a tutorial on how to write a form though or on how to code in PHP, so I really am not sure what you are wanting.

Crazer 05-19-2013 04:58 PM

I hope that I am not the only one clueless, but I have been trying to find out what people mean by creating a template. Do they mean a style template, or what? Can someone please let me know? Thanks!

Lynne 05-19-2013 06:41 PM

Quote:

Originally Posted by Crazer (Post 2422998)
I hope that I am not the only one clueless, but I have been trying to find out what people mean by creating a template. Do they mean a style template, or what? Can someone please let me know? Thanks!

Yes, a style template. Admincp > Styles & Languages > find your style > Add Template (make sure you add the template to all styles on your site that you want the page to show up on).

joeychgo 06-03-2013 05:49 AM

Is there a way to make this a fixed width box?

Lynne 06-03-2013 04:57 PM

To make what a fixed width box - the whole page? And just this page but not the rest of the forum? You really need to be a bit more specific.

joeychgo 06-03-2013 07:33 PM

The box below the navbar - the content area

Lynne 06-03-2013 09:26 PM

Then if it's in a div, just set a width using css and make sure your left/right margins are set to auto.

joeychgo 06-03-2013 11:58 PM

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


where? how? I tried adding width=”1000″ align=”center” with no luck

Digital Jedi 06-04-2013 06:23 PM

Quote:

Originally Posted by joeychgo (Post 2425673)
<h2 class="blockhead">Title</h2>
<div class="blockbody">
<div class="blockrow">


where? how? I tried adding width=”1000″ align=”center” with no luck

This should technically be asked in it's own thread, since it's not a custom page question. But you set the width via CSS. This should get you started. http://www.w3schools.com/cssref/pr_dim_width.asp

joeychgo 06-04-2013 06:39 PM

Quote:

Originally Posted by Digital Jedi (Post 2425817)


It doesn't. If it was any help to me at all I am sure I wouldn't have had to ask the question.

I don't want to spend hours trying to learn and understand something one of you could probably tell me how to accomplish in 5 minutes.

And it is about this custom page --

Lynne 06-04-2013 09:31 PM

Quote:

Originally Posted by joeychgo (Post 2425673)
<h2 class="blockhead">Title</h2>
<div class="blockbody">
<div class="blockrow">


where? how? I tried adding width=?1000″ align=?center? with no luck

I said to use CSS.

style="width: 1000px; margin-left:auto; margin-right: auto;"

Dax IX 06-04-2013 09:48 PM

Give a man a fish, etc...

joeychgo 06-04-2013 09:57 PM

Thank you Lynne - we're getting closer now.

Trouble is - its still not quite right.

I used this code:

Code:

    {vb:raw navbar}
    <div id="pagetitle" style="width: 1000px; margin-left:auto; margin-right: auto;">
      <h1>{vb:raw pagetitle}</h1><br />
    </div>
 
    <h2 class="blockhead" style="width: 1000px; margin-left:auto; margin-right: auto;">Title</h2>
    <div class="blockbody" style="width: 1000px; margin-left:auto; margin-right: auto;">
      <div class="blockrow" style="width: 1000px; margin-left:auto; margin-right: auto;">

and get this: http://www.lincolnvscadillac.com/tech/test.php

Lynne 06-04-2013 10:12 PM

You get that because the other classes you are calling (block*) have their own CSS associated with the class.

Code:

    <div class="blockbody" style="width: 1000px; margin-left:auto; margin-right: auto; padding: 10px;">
      <div class="blockrow">

CSS is really not that hard to learn and then you wouldn't have to rely on others to fix any styling issues that come up on your site.

joeychgo 06-04-2013 10:27 PM

Quote:

Originally Posted by Lynne (Post 2425853)
CSS is really not that hard to learn and then you wouldn't have to rely on others to fix any styling issues that come up on your site.


From what I hear Xenforo isn't too hard to learn either. Probably take me less time. I cant understand why you cant just tell me what to put instead of all this aggravation. I asked a simple question, why cant you just help?

pelican 06-05-2013 07:35 AM

by following the instructions, i successfully created a custom vb page, pull info and display it.

i am intending to create a custom file upload function with this custom page.
how can i post the info/data and capture it.

i know how to do it in normal php coding but not sure how in vbulletin environment.

assuming my custom page is fileupload.php

do i post back to the same page (fileupload.php) or another custom page (fileupload2.php) to capture the data?

what should be the form url to post to?

thanks.

Lynne 06-05-2013 04:29 PM

Quote:

Originally Posted by joeychgo (Post 2425855)
I cant understand why you cant just tell me what to put instead of all this aggravation. I asked a simple question, why cant you just help?

I did tell you exactly what to change.

Quote:

Originally Posted by pelican (Post 2425901)
by following the instructions, i successfully created a custom vb page, pull info and display it.

i am intending to create a custom file upload function with this custom page.
how can i post the info/data and capture it.

i know how to do it in normal php coding but not sure how in vbulletin environment.

assuming my custom page is fileupload.php

do i post back to the same page (fileupload.php) or another custom page (fileupload2.php) to capture the data?

what should be the form url to post to?

thanks.

You can do it either way. I usually like to have just one page for a form because it seems 'cleaner' to me.

MacroPhotoPro 06-06-2013 01:09 AM

Hello there;

I have got this page to work just fine, so long as my target page is in the main directory.

However, when I moved my page to a new (/imagehosting) directory it will no longer display.

What do I need to do to fix this?

Thanks,

Jack

Lynne 06-06-2013 05:07 PM

Quote:

Originally Posted by MacroPhotoPro (Post 2426033)
Hello there;

I have got this page to work just fine, so long as my target page is in the main directory.

However, when I moved my page to a new (/imagehosting) directory it will no longer display.

What do I need to do to fix this?

Thanks,

Jack

I have not found a way to make that work. I think some default vbulletin files would need to be modified to get that to work, but I haven't spent much time looking into it.

MacroPhotoPro 06-06-2013 08:37 PM

Anyone else have any ideas?

Thanks.

Digital Jedi 06-08-2013 07:37 AM

Quote:

Originally Posted by joeychgo (Post 2425855)
From what I hear Xenforo isn't too hard to learn either. Probably take me less time. I cant understand why you cant just tell me what to put instead of all this aggravation. I asked a simple question, why cant you just help?

XenForo/vB/IPB. Basic CSS knowledge would still be required to edit raw HTML. Lynn's answer is pretty straightforward. Problem is, if you don't really understand the principle behind CSS, then it's almost impossible to make you understand it without typing out what's explained in any given CSS tutorial. And no, it wouldn't take five minutes to explain. Given the chance, it certainly won't take 5 hours to understand the width property.

joeychgo 06-08-2013 08:33 AM

Quote:

Originally Posted by Digital Jedi (Post 2426579)
XenForo/vB/IPB. Basic CSS knowledge would still be required to edit raw HTML. Lynn's answer is pretty straightforward. Problem is, if you don't really understand the principle behind CSS, then it's almost impossible to make you understand it without typing out what's explained in any given CSS tutorial. And no, it wouldn't take five minutes to explain. Given the chance, it certainly won't take 5 hours to understand the width property.


It took someone else 5 minutes to explain it to me. They took the time.

http://www.lincolnvscadillac.com/tech/test.php

grey_goose 06-09-2013 12:25 PM

I've added a new page, no problem. What do I need to do to be able to display custom profile fields on this new page?

Lynne 06-09-2013 06:47 PM

Quote:

Originally Posted by grey_goose (Post 2426842)
I've added a new page, no problem. What do I need to do to be able to display custom profile fields on this new page?

You probably need to run a query and then you need to assign variable names to the results, register them for use in the template, and then enter/format them into your template.

Digital Jedi 06-10-2013 10:41 PM

Quote:

Originally Posted by joeychgo (Post 2426587)
It took someone else 5 minutes to explain it to me. They took the time.

http://www.lincolnvscadillac.com/tech/test.php

I'm glad it worked out for you. But we took the time to give you an answer that would help you with more than just your one question. And, again, you weren't real clear the first time as to what you wanted. Which took more than five minutes to figure out ourselves. Since we didn't know what you didn't understand to start with. And we continued to help, even though it still had nothing to do with creating a custom page.

Spangle 06-24-2013 03:14 PM

I've got this as my HTML 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} - {vb:raw pagetitle}</title>
    {vb:raw headinclude}
    {vb:raw headinclude_bottom}
  </head>
  <body>
   
    {vb:raw header}
   
    {vb:raw navbar}
   
    <div id="pagetitle">
      <h1>{vb:raw pagetitle}</h1>
    </div>
   
    <h2 class="blockhead">Page not found</h2>
    <div class="blockbody">
      <div class="blockrow">
        <h1> OOOPs </h1>
                <h2>  You've either made a typo, or tried to find a page that doesn't exist!
                </br>
                Now you have a choice, you can either look at this all day.
                Or click  <a href="http://www.primodoux.com/index.php"><span style =color:Red><h1>HERE</h1></span></a> to take you back to the index page. <br/>
               
                <br/>
      </div>
    </div>
   
    {vb:raw footer}
  </body>
</html>

and I have this as the php :

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('notfound',
);

// 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('' => 'notfound'));
$navbar = render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'Page not found';

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

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

?>

What I get from that is this :

{vb:stylevar htmldoctype} {vb:raw headinclude} {vb:raw headinclude_bottom} {vb:raw header} {vb:raw navbar}
{vb:raw pagetitle}
Page not found
OOOPs
You've either made a typo, or tried to find a page that doesn't exist!
Now you have a choice, you can either look at this all day. Or click
HERE
to take you back to the index page.

{vb:raw footer}


I think I need some help.

I'm using 4.2.1 if thats any help, and I'm trying to create a friendly 404 redirect page

TIA

Digital Jedi 06-24-2013 03:49 PM

At first glance, at least one instance of "test" was not changed to your template name in your PHP code.

Lynne 06-24-2013 04:01 PM

Is the page within the vbulletin directory?

Spangle 06-24-2013 05:03 PM

Quote:

Originally Posted by Digital Jedi (Post 2430201)
At first glance, at least one instance of "test" was not changed to your template name in your PHP code.

Thanks

Fixed that one but still not working

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

Quote:

Originally Posted by Lynne (Post 2430208)
Is the page within the vbulletin directory?


All the directories/files are uploaded to the root

ie :

public_html is my root directory

Lynne 06-25-2013 12:13 AM

Can we get a link to view the problem?

Spangle 06-25-2013 04:42 PM

Quote:

Originally Posted by Lynne (Post 2430280)
Can we get a link to view the problem?


Go to

www.primodoux.com/faeries

Lynne 06-26-2013 12:31 AM

You saved the template in the Style Manager, right? You didn't think we were talking about a Dreamweaver template hopefully.


All times are GMT. The time now is 07:49 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.02603 seconds
  • Memory Usage 1,853KB
  • 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
  • (19)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