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)

kh99 06-21-2012 10:16 PM

Quote:

Originally Posted by kkinsey (Post 2341850)
Doh! Too much stuff this week for brain to function properly!


I looked at it twice without noticing, it was only after going back and reading the part where you said the footer string was OK that I thought it had to be something to do with the template.

jderouen 06-29-2012 07:13 PM

I followed all the directions and got this to work for me! Yay! One question that's only indirectly related - on this custom page I've just created, I don't want to display ads. We have ads on the other parts of the forum, but I can't figure out how to tell vBulletin NOT to display ads on museumlinks.php, the page I just created.

GameOverViper 07-01-2012 09:20 PM

I have the page working, thanks!

I'd like to know how to pull RSS from certain forums to different custom pages as well if someone can help me. I've searched google, found something but it doesn't work with vb4. Any help would be appreciated.

Lynne 07-02-2012 03:46 PM

See these threads for methods to pull threads via javascript:
[HowTo] Display your latest threads on an external page using an RSS2 feed
[HowTo] Display your latest threads on an external page using an XML feed
[HowTo] Display your latest threads on an external page using an RSS feed

You may need to change the html output a bit.

GameOverViper 07-04-2012 07:35 PM

Quote:

Originally Posted by Lynne (Post 2344524)

Thanks for the links. However I'm having a issue with that still. After placing the code at the top of the php page, then adding echo $rss_output; to the template, it doesn't show an RSS feed.

Nothing says what to do from there, so I'm kind of clueless on how to get the actual feed to show. What do I need to wrap around the echo $rss_output;?

I placed it inside of the following code, but I'm no expert on this.

HTML Code:

    <h2 class="blockhead">Popular Games</h2>
    <div class="blockbody">
      <div class="blockrow">

{vb:raw rssfeed}

          </div>
    </div>


kkinsey 07-05-2012 12:47 PM

Quote:

Originally Posted by Americanbang
What do I need to wrap around the echo $rss_output;?

Are you feeding the rssfeed variable into the template?
PHP Code:

$templater vB_Template::create('my_page');
        
$templater->register_page_templates();
        
$templater->register('pagetitle'$pagetitle);
        
$templater->register('rssfeed'$my_rs_feed_variable_here);
print_output($templater->render()); 

If you are and it's not working, I'd wonder if the variable is null for some reason.

Thread addendum:

Suppose you wanted to feed a $_SERVER variable into the template? Is there a native vBulletin function I could use to clean it prior to feeding it to $templater->register()?

kh99 07-05-2012 02:37 PM

Quote:

Originally Posted by kkinsey (Post 2345256)
Suppose you wanted to feed a $_SERVER variable into the template? Is there a native vBulletin function I could use to clean it prior to feeding it to $templater->register()?

You could use $vbulletin->input->clean_gpc('s', 'varname', TYPE_NOHTML) (or whatever type you want, of course).

kkinsey 07-05-2012 04:23 PM

Hmm, doesn't seem like I can. I had already discovered clean_gpc in the developer's guide; tried it with 'r' and 'p' ... null string result. And 's' is also null.

Guess I'll need to hunt down the location of clean_gpc (obviously in the input class ... wherever that is) and see what I can figure out.

kh99 07-05-2012 07:18 PM

Quote:

Originally Posted by kkinsey (Post 2345314)
Guess I'll need to hunt down the location of clean_gpc (obviously in the input class ... wherever that is) and see what I can figure out.

Yeah, it's in includes/class_core.php. I haven't tried it, but it looks to me like 's' should get variables from $_SERVER.

kkinsey 07-06-2012 02:05 PM

Indeed, it does.

I just wasn't thinking inside the framework ;)

PHP Code:

//this won't work
$foo $vbulletin->input->clean_gpc('s',$_SERVER['SOME_VAR'],TYPE_NOHTML);
// this is correct!
$bar $vbulletin->input->clean_gpc('s','SOME_VAR',TYPE_NOHTML); 


bzcomputers 07-11-2012 09:15 AM

I first want to state I have read through this whole thread and tried to fix my issues but couldn't...

First issue I have is I'm trying to call up a template within a template. I've tried numerous codes but with no results. I have created pages based off the code presented here which I have working great pulling up single templates.

PHP Code:

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

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

?> 

What I am trying to do now is call up another template named "ccl_navigation" within the first template shown above "ccl_infoandtips". I've tried numerous things here in the php and also in the original template but still couldn't get the second template to render at all.

--------------------------------------
Second issue I'm having is with custom pages that are residing outside of the forum subdirectory. Everything with relative links is showing multiple errors in cpanel for every page. They include /clientscript, /images/misc, images/buttons, etc. I do see how they are referenced by a relative link but I have this:

PHP Code:

<base href="{vb:raw basepath}" /><!--[if IE]></base><![endif]--> 

in the headinclude template and thought that should of stopped the issue from occurring in the first place, but as you can see it hasn't. I don't actually see any visual problems with these pages, just the hundreds of errors recorded every hour.

Thanks for any help.

kh99 07-11-2012 09:46 AM

Quote:

Originally Posted by bzcomputers (Post 2346912)
First issue I have is I'm trying to call up a template within a template.

You should be able to render one template, save the result in a string, then register it as a variable in another template, like:

Code:

// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('ccl_navigation');
// register whatever variables ccl_navigation needs here
$ccl_navigation = $templater->render();

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

?>


Then in the ccl_infoandtips template, put {vb:raw ccl_navigation} wherever you want it.

I don't know the answer to the second question, but I'd try using Firefox with Firebug to see what your page is trying to load.

bzcomputers 07-11-2012 07:15 PM

Thanks kh99 for the help on the template within a template - worked perfectly! ..now lots of templates to edit

angeljs 07-13-2012 11:06 AM

So helpful, thank you!

owning_y0u 07-14-2012 02:46 PM

How do i make a tab in the navbar selected when using custom pages? have tried to use THIS_SCRIPT as condition for the navigation but it wont work.

Lynne 07-14-2012 04:02 PM

Quote:

Originally Posted by owning_y0u (Post 2348050)
How do i make a tab in the navbar selected when using custom pages? have tried to use THIS_SCRIPT as condition for the navigation but it wont work.

If THIS_SCRIPT is unique, then it should work. But, that is really something you should post in the main forums for help with since this article isn't about tabs.

KGodel 07-21-2012 03:58 AM

Hey all! Sorry if this is answered, but after reading this thread I may have missed the answer. When adding custom pages to your location code using the location hooks, I have yet to figure out how to distinguish between pages when you have one file which becomes a "different page" based on a variable, i.e. page.php?page=1. In the online_location_process hook, how can I get 'page' variable to distinguish between pages to give different results when viewing Who is Online? I have tried both $_GET and $_REQUEST switches, but they do not seem to work.

Lynne 07-21-2012 04:21 PM

$_GET should work. But, you really should start your own thread in the programming forum and include your code so we can take a look at it.

PrivateFTA 07-25-2012 01:41 AM

very good song

omega79 09-26-2012 03:46 PM

may sound stupid ... but how do i add a grid to that ne page?

Lynne 09-26-2012 04:05 PM

A grid? You would just use <div> tags with classes and then set widths and float them left or right depending on what you want. You could probably google the html you would need.

omega79 09-26-2012 04:11 PM

ah okay so i have to do all the code ... i thought there is maybe just a line with that i could add a grid that i created in the cms ...

i think it is a big missing point that you can not just create a new page within the cms ...

but thanks for this tutorial :D

//edit
it looks like this now
http://www.crafters-united.de/vbb/server.php?tabid=37
would like to have it look like this
http://www.crafters-united.de/vbb/content.php

my point is that i have to change the code over and over again for the custom page (if i want to test different positions of the boxes)
while for the start page i just drag and drop in the "acp>cms>Layout" section and push "save"

i hope you know what i mean ... i wisch i could do this with the custom php files also

Lynne 09-26-2012 04:47 PM

Why are you using this tutorial if all you want to do is add articles to your CMS? This article has nothing to do with the CMS.

omega79 09-26-2012 06:41 PM

i not want articles...
i want to open a new site on wich i will show something like the server-rules ...
it only should have the look of the front page ...
there is no need for articles on that new site ...

but while reading i thought i could open like a new section or something and just post one article ...
(just do not know how to do that ...yet ... have to figure that one out ... tomorrow)

i am really new to this and i am reading hours after hours, but thats hard if you not know anything about things like css and php
and only have basic htm skills ...

i am not a coder, i just run a small community site with a view hundert members ...

so please bear with me ... i know this "RTFM" or "use google" attitude is wide spread around any sort of coding community ... i hope this one is not like those others

Lynne 09-26-2012 08:52 PM

Well, I honestly don't know what you are trying to do. If you want this to be in the CMS, and look like the CMS, then you should put this article into the CMS. If you want this to be a separate page, but you want it to look like the CMS, then you would need to find the CMS grid template and paste that code into the page (and possibly add some CSS to the template also). There are really no instructions anywhere on how to make your custom page look like a CMS page. And certainly, adding any widgets to the page is going to take custom coding and I can't point you to any article about that either.

Bluefin221 09-27-2012 08:55 PM

How many times can I use this, can I make multiple pages using this method?

Also what was strange is that I had to add my content to the style manager as when I called this part the page was pure white.

define('THIS_SCRIPT', 'test');

Obviously changed test to the page I was calling but it wouldn't call anything.

As you can see reverted to normal and it will not call the page: http://www.fpcforums.com/forums/stream.php

I'm trying to call this: http://www.fpcforums.com/forums/streams/livestream1.php

What I want to do is have a landing page which lists all the streams then when you click on a link it takes you into that streams page.

Lynne 09-27-2012 10:03 PM

define('THIS_SCRIPT', 'test'); does not "call" anything. I don't know what you are talking about at all.

You may create as many pages as you want using this method as long as you use a different template (if needed) and different script names for each page.

DefiantComplex 10-10-2012 01:23 AM

Ok so i gave it a shot, works great.

However i do have a question. I own forum classic and i want a portal, however i want to build my own.

Now i have my page sitting @ root, and the forums @ forum. , not a problem session works and all.

The problem is, when i login from the root not forum. i get a url invalid redirect. Anyone know how to fix this?

Thanks.

aryung 11-02-2012 06:16 AM

My forum have no Content view access for guests
to view content visitor must have to register first
but on this test.php custom page i want to allow guests to read content

how i setup this please help

cellarius 11-02-2012 06:42 AM

Have you tried it? Just do nothing, i.e create the page as described. You would have to add permission checking if you wanted it.

aryung 11-02-2012 02:57 PM

Quote:

Originally Posted by cellarius (Post 2377736)
Have you tried it? Just do nothing, i.e create the page as described. You would have to add permission checking if you wanted it.

yes i do as described works well
the only problem is that it redirects to login page due to no guest access of whole forum
i check register.php and its template thoroughly to check which line of code pass permissions but did not found anything

so on this page how i add permissions for guests ?

Lynne 11-02-2012 03:30 PM

What is the content of your php page? (Please use the code tags.)

aryung 11-02-2012 05:47 PM

Content of the page is simple text not code lines
Which tells
Why unregistered or not logedin users are not able to access Forum
Why our forum is private to registered members only
actually these are Lessons for students and forum only allow our academy students to view threads

Lynne 11-03-2012 01:41 AM

Quote:

Originally Posted by aryung (Post 2377879)
Content of the page is simple text not code lines
Which tells
Why unregistered or not logedin users are not able to access Forum
Why our forum is private to registered members only
actually these are Lessons for students and forum only allow our academy students to view threads

This article is about writing a php page which is code. Are you saying that your problem has nothing to do with a php page you created? If so, then you shouldn't be posting in this thread. If it does have to do with the php page you created, then you need to post the code.

ARNK 11-03-2012 11:54 PM

Quote:

1. Create the php page:
Where do you put this file specifically?

Quote:

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 (WARNING: the template name is CASE SENSITIVE!!!) with the following content:
Where does this file go specifically? Where does the code go?

What should it be named?

I need this in layman's terms please ;)

cellarius 11-04-2012 07:35 AM

What file? There is no file involved. You create a new template for your style in the Style Manager.
http://www.vbulletin.com/docs/html?m...rsion=40200603

aryung 11-04-2012 08:10 PM

Quote:

Originally Posted by Lynne (Post 2377956)
This article is about writing a php page which is code. Are you saying that your problem has nothing to do with a php page you created? If so, then you shouldn't be posting in this thread. If it does have to do with the php page you created, then you need to post the code.

We know Register.php loads if registration is enable no mater forum is open or private the line
Code:

define('THIS_SCRIPT', 'register');
makes it happen. it seems Permissions for Register dot php/Template setup in a file to bypass CanView restrictions for not logedin / not registered usergroup

i do not need to do anything with test.php i put my Text Here
Code:

<h2 class="blockhead">Title</h2>
    <div class="blockbody">
      <div class="blockrow">
        Our Forum is Private to our Academy Students Only
      </div>
    </div>


ARNK 11-05-2012 03:26 AM

Quote:

Originally Posted by cellarius (Post 2378249)
What file? There is no file involved. You create a new template for your style in the Style Manager.
http://www.vbulletin.com/docs/html?m...rsion=40200603

Quote:

1. Create the php page:
- Create a new file, whatever you want to call it (let's say test.php).
- Open up test.php and add the following (replace TEST with whatever template you want to show - WARNING: the template name is CASE SENSITIVE!!!):
If we're to create a new PHP page, does it not have to go somewhere?

kh99 11-05-2012 12:52 PM

You can name your php file whatever you want, as long as it ends in .php and isn't named the same as one fo the existing vbulletin files. It should go in your forum directory, the same directory with fourm.php, showthread.php, etc.

aryung 11-07-2012 05:33 AM

i am waiting for response according to non registered / not logedin users permissions


All times are GMT. The time now is 05:55 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.05932 seconds
  • Memory Usage 1,864KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_html_printable
  • (4)bbcode_php_printable
  • (14)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