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 a own vBulletin page (without plugin and php file) (https://vborg.vbsupport.ru/showthread.php?t=229194)

Allan 11-29-2009 10:00 PM

[HOW TO - vB4] Create a own vBulletin page (without plugin and php file)
 
1 Attachment(s)
Here is a trick that allows you to create vBulletin pages without plugin or php files.
  • Create one template named "custom_wazaaaa", add in:
PHP 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">Titre de la page (title page)</h2>
    <
div class="blockbody">
      <
div class="blockrow">
        
Le texte que vous souhaitez mettre (the text)
      </
div>
    </
div>
    
    {
vb:raw footer}
  </
body>
</
html

  • It'll just create a link to this url: /forum/misc.php?do=page&template=wazaaa
  • The template MUST be named custom_xxxxxx - change xxxxxx to whatever you want.
  • When call the page, you enter template=xxxxxx where xxxxxx is the part of the template name after custom_
PS: You are free to customize the text in the template ;)

Zaiaku 12-01-2009 01:40 AM

I was wondering if this changed or not. Best to use this with a mod rewrite so it just don't look wierd.

Brandon Sheley 12-01-2009 02:26 AM

Great info Allan!

Adem GEN? 12-01-2009 10:29 AM

without php file, mytest.php -->plugin

/forum/mytest.php --> /forum/misc.php???????????

Is this possible?

VonDoom 12-01-2009 11:11 AM

I dont know but, ive worked this code ten ways from Sunday and it just reverts to the smilie list. Either that or the instructions are geared towards somebody with more experience then me, and im missing something.

Lynne 12-02-2009 02:48 AM

Works just fine for me guys.

Allan, perhaps something you need to emphasize here....
- The template MUST be named custom_xxxxxx - change xxxxxx to whatever you want.
- When call the page, you enter template=xxxxxx where xxxxxx is the part of the template name after custom_

Allan 12-02-2009 04:55 AM

Quote:

Originally Posted by Lynne (Post 1923808)
Works just fine for me guys.

Allan, perhaps something you need to emphasize here....
- The template MUST be named custom_xxxxxx - change xxxxxx to whatever you want.
- When call the page, you enter template=xxxxxx where xxxxxx is the part of the template name after custom_

Yes, i will add ;)

VonDoom 12-02-2009 03:40 PM

Quote:

where xxxxxx is the part of the template name after custom_
haha there it is.

betty02 12-03-2009 10:05 AM

Having problems with this,

Put the code in a custom template called custom_shoutbox but when you navigate to it then nothing loads?

http://www.twingooc.com/misc.php?do=...plate=shoutbox


EDIT: SORTED!!

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

Ok i have done a test template for a simple homepage layout here

Can you see the second ''block'' how would i alight that to the right of the first block and also create a block to the left of that as well?

So works out like a 3 column template?

Lynne 12-03-2009 01:41 PM

Quote:

Originally Posted by betty02 (Post 1924620)
Ok i have done a test template for a simple homepage layout here

Can you see the second ''block'' how would i alight that to the right of the first block and also create a block to the left of that as well?

So works out like a 3 column template?

You'll use divs and float:right and float:left . You should google "css help" and you'll find several good places that will help you with your css.

niake 12-03-2009 08:20 PM

:up: Thanks

betty02 12-09-2009 11:43 AM

I created a new nav link to my custom page, how do i make that link selected/highlighted as if its on that page? Currently keeps my Forum tab highlighted/selected?

Dave-ahfb 12-09-2009 12:45 PM

I was thinking this might make an easier way to integrate my current php scripts, using this article to create header and footer templates. I should have known somehow some way things would screw up, it just seemed to easy.
PHP Code:

<?php
include_once('/home/ahfb/public_html/ahfb2000.com/public/4test/misc.php?do=page&template=css2header');
?>


Gives me the error
Quote:

Warning: include_once(/home/ahfb/public_html/ahfb2000.com/public/4test/misc.php?do=page&template=css2header) [function.include-once]: failed to open stream: No such file or directory in /home/ahfb/public_html/ahfb2000.com/public/4test/cssgenerator2.php on line 2

Warning: include_once() [function.include]: Failed opening '/home/ahfb/public_html/ahfb2000.com/public/4test/misc.php?do=page&template=css2header' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/ahfb/public_html/ahfb2000.com/public/4test/cssgenerator2.php on line 2
Not being a programmer, my guess is that .......I am clueless ;)


UPDATE

I found that due to the variables
(/home/ahfb/public_html/ahfb2000.com/public/4test/misc.php?do=page&template=css2header will not work, it must be done with the url
Code:

include('http://www.ahfb2000.com/4test/misc.php?do=page&template=css2header');
which leads to error "URL file-access is disabled in the server configuration " in addition to the previous errors. To solve this you are supposed to change php.ini to read

allow_url_fopen = On
and
Allow_url_include = On

Still have all 3 errors ...hmmm


oops, forgot to reload apache, now my errors are
Quote:

Warning: include(http://www.ahfb2000.com/4test/misc.p...ate=css2header) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in [path]/cssgenerator2.php on line 3

Warning: include() [function.include]: Failed opening 'http://www.ahfb2000.com/4test/misc.php?do=page&template=css2header' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in [path]/cssgenerator2.php on line 3

Lynne 12-09-2009 01:33 PM

Quote:

Originally Posted by betty02 (Post 1927751)
I created a new nav link to my custom page, how do i make that link selected/highlighted as if its on that page? Currently keeps my Forum tab highlighted/selected?

For the condition used for the tab, did you try this?
PHP Code:

if (THIS_SCRIPT == 'misc'

or, you may have to do:
PHP Code:

if (THIS_SCRIPT == 'misc' AND $_REQUEST['template'] == 'whatever'

Something like that should work. Play with it.

Quote:

Originally Posted by Dave-ahfb (Post 1927769)
I was thinking this might make an easier way to integrate my current php scripts, using this article to create header and footer templates. I should have known somehow some way things would screw up, it just seemed to easy.
.....

Not being a programmer, my guess is that .......I am clueless ;)

Exactly what are you trying to do? You don't want to include the whole misc.php page in another script. Where are you adding the php code to include the misc.php page? If you have other php pages already, you probably would do better following this - [HOW TO - vB4] Create a own vBulletin page

Dave-ahfb 12-09-2009 01:35 PM

update..again
removing the htaccess, now it works perfect!!

Problem is how can I have a secret hidden test folder to get everything setup :(

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

Lynne,

I used your tutorial on my static pages, it is very well writtin and was easy to follow, worked a charm :). On my scripts, well that is a different issue. I read 3 or 4 different tutorials and just could not get my pea-brain wrapped around the concept. Once this one was published I knew that though it may not be the optimal method to use, I could probably make it suit my needs.

Yes, it does have downfalls, I must either go live and do the work on the live pages without htaccess or find a way for the include to send the htpasswd (thinking it can be done but have not investigated yet). The biggest possible downfall is potential security issues having Allow_url_fopen and Allow_url_include = On. I have read there could be issues but have not read what these issues could be. Is it possible you could enlighten me to these issues and any others I may not be aware of?

thanks

Lynne 12-09-2009 02:22 PM

Quote:

Originally Posted by Dave-ahfb (Post 1927788)
Yes, it does have downfalls, I must either go live and do the work on the live pages without htaccess or find a way for the include to send the htpasswd (thinking it can be done but have not investigated yet). The biggest possible downfall is potential security issues having Allow_url_fopen and Allow_url_include = On. I have read there could be issues but have not read what these issues could be. Is it possible you could enlighten me to these issues and any others I may not be aware of?

thanks

You should probably post that sort of question out in the general forums. I'm really not a security expert (I know just enough for my little site!), but there are some server guys around who could probably answer your question.

Dave-ahfb 12-09-2009 03:25 PM

I am about to give up, using my method the login does not work. Lynne, this particular script I am working on is a very simple proprietary tool. I hate to post this here for help as there are many attempts on the net to copy it. Do you mind if I pm you?

Adem GEN? 12-13-2009 08:47 PM

For Privacy Policy the very good :up:
Thank you very much

Ted Clore 12-14-2009 07:45 PM

I've read and reread this article and completely do not understand it. Could someone give a step by step and explain things for a neophyte like myself. I am trying to wrap my site pages with vB headers, footers and widgets, and I think this is what this is supposed to do.

Any help is appreciated. Thank you.

nubian 12-15-2009 04:02 AM

Any way to make these URL friendly?
Like mydomain.com/aboutus ?

Lynne 12-15-2009 03:41 PM

Quote:

Originally Posted by Ted Clore (Post 1930729)
I've read and reread this article and completely do not understand it. Could someone give a step by step and explain things for a neophyte like myself. I am trying to wrap my site pages with vB headers, footers and widgets, and I think this is what this is supposed to do.

Any help is appreciated. Thank you.

What exactly have you done? The article is pretty straightforward. Did you create any templates? Did you make sure to name them custom_whatever ? Exactly what have you done so far?

Quote:

Originally Posted by nubian (Post 1930947)
Any way to make these URL friendly?
Like mydomain.com/aboutus ?

Google "htaccess mod_rewrite"

nubian 12-15-2009 03:53 PM

Quote:

Originally Posted by Lynne (Post 1931165)
Google "htaccess mod_rewrite"

Oh cool, all's that needed it a mod rewrite.
I'm currently using Mattyasia's.

Thanks for replying

Ted Clore 12-15-2009 10:08 PM

Quote:

Originally Posted by Lynne (Post 1931165)
What exactly have you done? The article is pretty straightforward. Did you create any templates? Did you make sure to name them custom_whatever ? Exactly what have you done so far?

Well..., I have moved on in a different direction, which seems to be working for me. Sorta.

What I am doing now is making a widget with HTML code in a Static HTML widget. Then I make a new layout with the Layout manager and place the widget into the center of the layout, just below the Primary Content. Then I go to to the Section Manager and make a new section naming it accordingly. And with the Layout window in the Layout editor, I select the layout I created earlier. This puts the content of the widget on the center of a page all by itself, if I want.

The only problem that I am having is that not all of the HTML codes work in the widgets. Headers and Navigational commands within the widget either don't work at all or take you to the Home page in CMS.

For instance, I have a very long article that is in a widget and navigation code that will take you to a section heading so that you don't have to scroll through a lot of text to get to that section. And after you have read that section you can click a TOP button that should take you back to the top of the page where the Contents are listed. Either link takes you to the Home page in CMS.

Here it is:

http://www.light-after-darkness.org/...ssion-of-Faith

Clicking on a title in the Contents section should take you to that section, it doesn't it takes you Home.

Clicking on "TOP" at the end of a section should take you back to the Contents portion of the article, it doesn't.

Any ideas, after this long post?

Lynne 12-15-2009 10:31 PM

Quote:

Originally Posted by Ted Clore (Post 1931409)
Clicking on a title in the Contents section should take you to that section, it doesn't it takes you Home.

Clicking on "TOP" at the end of a section should take you back to the Contents portion of the article, it doesn't.

Any ideas, after this long post?

Google "anchor html". You have your anchor links incorrect which is why they aren't going to the correct place. I've gotta run right now, but you should be able to google it and see what is wrong (hover over your links in the page to see where they are currently going).

Ted Clore 12-15-2009 11:35 PM

Quote:

Originally Posted by Lynne (Post 1931421)
Google "anchor html". You have your anchor links incorrect which is why they aren't going to the correct place. I've gotta run right now, but you should be able to google it and see what is wrong (hover over your links in the page to see where they are currently going).

The code works OK if it isn't in a widget:

SEE ME

So I don't think it is something wrong with the code.

Lynne 12-16-2009 03:18 AM

Quote:

Originally Posted by Ted Clore (Post 1931443)
The code works OK if it isn't in a widget:

SEE ME

So I don't think it is something wrong with the code.

You can see that the links are different, right? In the standalone code above, the link for the first article is:
Code:

http://www.light-after-darkness.org/forums/articles/WCF1.php#I
- notice the url for that page and then the anchor at the end.

On the CMS page, the link for the first article is:
Code:

http://www.light-after-darkness.org/forums/#I
- notice that url is incorrect for the page, it should be something like:
Code:

http://www.light-after-darkness.org/forums/content.php?59-The-Westminster-Confession-of-Faith#I
It needs the page name and section name in there.

nubian 12-16-2009 03:37 AM

Would it be possible to get rid of what I have attached here in yellow?

https://vborg.vbsupport.ru/external/2009/12/79.jpg

I'm finding it to be quite redundant and also I'm unable to separate the words about and us like I can in the blockhead.

Lynne 12-16-2009 04:33 AM

I suppose you could, but you'll have to edit your template. To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code.

nubian 12-16-2009 04:48 AM

Quote:

Originally Posted by Lynne (Post 1931522)
I suppose you could, but you'll have to edit your template. To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code.

Hi Lynne.

My apologies, I'm understanding what you told me but I'm not understanding why you told me and how this would get rid of the aboutus text? :confused:

I've create a template called, "custom_aboutus".
If I were viewing this in firebug, I could see that the line for the aboutus text is this:
Code:

<span>aboutus</span>
This is what the code looks like.
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">About Us</h2>
    <div class="blockbody">
      <div class="blockrow">
        Test here
      </div>
    </div>
   
    {vb:raw footer}
  </body>
</html>

I thought maybe getting rid of this...
Code:

{vb:raw navbar}
would do it but that removes my entire menu.

Thanks

I.am 12-16-2009 10:27 AM

I can't see the text when i write on this template what stylevar color i have to edit?

betty02 12-16-2009 02:18 PM

Quote:

Originally Posted by Lynne (Post 1927787)
For the condition used for the tab, did you try this?
PHP Code:

if (THIS_SCRIPT == 'misc'

or, you may have to do:
PHP Code:

if (THIS_SCRIPT == 'misc' AND $_REQUEST['template'] == 'whatever'

Something like that should work. Play with it.


Exactly what are you trying to do? You don't want to include the whole misc.php page in another script. Where are you adding the php code to include the misc.php page? If you have other php pages already, you probably would do better following this - [HOW TO - vB4] Create a own vBulletin page

Had a play around with that mate and nothing has worked - say my page is called shoutbox i have tried putting that in aswell and instead of misc etc and still nothing. Thanks for help so far though but any other will be really appreciated!

Lynne 12-16-2009 02:55 PM

Quote:

Originally Posted by nubian (Post 1931526)
Hi Lynne.

My apologies, I'm understanding what you told me but I'm not understanding why you told me and how this would get rid of the aboutus text? :confused:

I've create a template called, "custom_aboutus".

....
I thought maybe getting rid of this...
Code:

{vb:raw navbar}
would do it but that removes my entire menu.

Thanks

You would have to actually edit the navbar itself. That part is called the breadcrumbs. If you remove it in the navbar, it will be removed everywhere that you use that style (like in the forums and threads also).

Quote:

Originally Posted by I.am (Post 1931595)
I can't see the text when i write on this template what stylevar color i have to edit?

Please see this article on how to find stylevars - HOW TO Find what Stylevar you need to edit
Quote:

Originally Posted by betty02 (Post 1931679)
Had a play around with that mate and nothing has worked - say my page is called shoutbox i have tried putting that in aswell and instead of misc etc and still nothing. Thanks for help so far though but any other will be really appreciated!

You'll have to look at your shoutbox page and find out what THIS_SCRIPT is defined as. I have no idea and can't help with that since I don't have the mod.

Ted Clore 12-16-2009 08:45 PM

Quote:

Originally Posted by Lynne (Post 1931494)
You can see that the links are different, right? In the standalone code above, the link for the first article is:
Code:

http://www.light-after-darkness.org/forums/articles/WCF1.php#I
- notice the url for that page and then the anchor at the end.

On the CMS page, the link for the first article is:
Code:

http://www.light-after-darkness.org/forums/#I
- notice that url is incorrect for the page, it should be something like:
Code:

http://www.light-after-darkness.org/forums/content.php?59-The-Westminster-Confession-of-Faith#I
It needs the page name and section name in there.

Thank you Lynne, your help was truly appreciated. Got it under control and working like a charm now. :)

nubian 12-17-2009 05:27 AM

Would it be possible to get "aboutus" to display "About Us"?

https://vborg.vbsupport.ru/external/2009/12/79.jpg

betty02 12-17-2009 06:32 AM

Quote:

Originally Posted by Lynne (Post 1931693)
You would have to actually edit the navbar itself. That part is called the breadcrumbs. If you remove it in the navbar, it will be removed everywhere that you use that style (like in the forums and threads also).


Please see this article on how to find stylevars - HOW TO Find what Stylevar you need to edit

You'll have to look at your shoutbox page and find out what THIS_SCRIPT is defined as. I have no idea and can't help with that since I don't have the mod.

Heres my current code if this helps mate?

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} Shoutbox</title>
    {vb:raw headinclude}
    {vb:raw template_hook.headinclude}

  </head>
  <body>
   
    {vb:raw header}
   
    {vb:raw navbar}
   
    <div id="pagetitle">
      <h1>{vb:raw pagetitle}</h1>
    </div>

<!--SHOUTBOX-->

    {vb:raw footer}
  </body>
</html>


dtommy79 12-17-2009 11:52 AM

It doesn't work for me on RC4.
I get an object not found 404 error.

I named the template custom_banners and i use this url: http://localhost/vb4scifiw/forum/mis...mplate=banners

betty02 12-17-2009 01:14 PM

That URl wont work, as it's not a web link the http://localhost bit should be your website e.g my website is www.twingooc.com localhost wont work as a URL iirc?

dtommy79 12-17-2009 02:05 PM

Quote:

Originally Posted by betty02 (Post 1932230)
That URl wont work, as it's not a web link the http://localhost bit should be your website e.g my website is www.twingooc.com localhost wont work as a URL iirc?

It doesn't really matter that it is on localhost. Just figured I didn't need to use the forum dir.

Lynne 12-17-2009 03:10 PM

Quote:

Originally Posted by dtommy79 (Post 1932183)
It doesn't work for me on RC4.
I get an object not found 404 error.

I named the template custom_banners and i use this url: http://localhost/vb4scifiw/forum/mis...mplate=banners

Did you put the template in that particular style?

Quote:

Originally Posted by betty02 (Post 1932090)
Heres my current code if this helps mate?

That's just the template. THIS_SCRIPT is defined in the php page.

nubian 12-17-2009 03:22 PM

Quote:

Originally Posted by betty02 (Post 1932090)
Heres my current code if this helps mate?

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} Shoutbox</title>
    {vb:raw headinclude}
    {vb:raw template_hook.headinclude}

  </head>
  <body>
   
    {vb:raw header}
   
    {vb:raw navbar}
   
    <div id="pagetitle">
      <h1>{vb:raw pagetitle}</h1>
    </div>

<!--SHOUTBOX-->

    {vb:raw footer}
  </body>
</html>


betty02,

Thanks for your reply.
You code removes the blockhead, I want to retain it.
Actually what I'm looking to do is change the text from this...

https://vborg.vbsupport.ru/external/2009/12/68.jpg

to this...

https://vborg.vbsupport.ru/external/2009/12/69.jpg

Any idea on how to accomplish this?
I plan on creating a massive amount of customized pages, like 50+ pages, so I'm debating on whether I should go this route or go with Lynne's method of using actual php files.


All times are GMT. The time now is 09:03 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.01761 seconds
  • Memory Usage 1,897KB
  • 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
  • (13)bbcode_code_printable
  • (6)bbcode_php_printable
  • (26)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