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 05-11-2010 01:58 AM

You would have to do something in here if you are in a loop:
PHP Code:

        {
            
$name $categories['name'];
            
$des $categories['des'];
$templater vB_Template::create('TEST_1');
$templater->register_page_templates();
$templater->register('name'$name);
$templater->register('des'$des);
$my_output .= $templater->render();
        }

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

I strongly suggest you take a look at some of the code in files like forum.php where there is a while loop.

EQmandingo 05-11-2010 03:43 AM

i was wondering..... is there a way i can add a forum to display on this custom page say for example the default main forum...or rather just the posts from that forum itself and if so how can i do this.

by the way.. this is by far one of my favorite things i have seen here at vb.org thank you so much.

Lynne 05-11-2010 03:46 AM

Quote:

Originally Posted by EQmandingo (Post 2034914)
i was wondering..... is there a way i can add a forum to display on this custom page say for example the default main forum...or rather just the posts from that forum itself and if so how can i do this.

You would just do a query to grab the threads/posts from that forum and then display them on the page. There is a thread here about this very thing that I answered today. It's out in the main forums, but I posted a basic query in there as an idea of how to do it. (Of course, you can just open up any vB file to see how to do it also.)

EQmandingo 05-11-2010 04:05 AM

Quote:

Originally Posted by Lynne (Post 2034916)
You would just do a query to grab the threads/posts from that forum and then display them on the page. There is a thread here about this very thing that I answered today. It's out in the main forums, but I posted a basic query in there as an idea of how to do it. (Of course, you can just open up any vB file to see how to do it also.)

WOW!! Could you please link me to said thread and possibly with the post # if its that hot of a thread ... would love to know exactly how to do that the right way.

Btw It is you I am thanking for this thread...I love to try out products but things like this is what helps me understand how to better operate and modify vbulletin. So a proper thank you for this thread and your lightning response to my question :-) :up:

Davidinh 05-11-2010 10:54 AM

thank you Lynne

from the post #291
that mean i have to create more tepmlate as TEST_1 for initial part of category. is it correct Lynne ! :)

i am going to try it and let you know thanks again Lynne

but how about template code

i will use {vb:raw my_output.part of loop}
(part of loop : $ name, $des right !!! or till the same
{vb:raw categories.whatever}
(whatever : name, des )

would you please ...... Lynne

Lynne 05-11-2010 02:02 PM

Quote:

Originally Posted by EQmandingo (Post 2034922)
WOW!! Could you please link me to said thread and possibly with the post # if its that hot of a thread ... would love to know exactly how to do that the right way.

All I've posted is some basic info to get started, I did not write the whole page for him - Help calling new threads to a custom page help

Quote:

Originally Posted by Davidinh (Post 2035084)
thank you Lynne

from the post #291
that mean i have to create more tepmlate as TEST_1 for initial part of category. is it correct Lynne ! :)

i am going to try it and let you know thanks again Lynne

but how about template code

i will use {vb:raw my_output.part of loop}
(part of loop : $ name, $des right !!! or till the same
{vb:raw categories.whatever}
(whatever : name, des )

would you please ...... Lynne

You need to get the info in order to spit it out. In your original code, you never got the info. You did a query, wrote a while loop to do something with the info from the query, but never actually did anything with it. So, there was nothing to output. Take a look at the forum.php page and how they grab the currently active users. You make a query, then go into a while loop and spit out the user info into a template, then after you get out of the while loop, you spit all that template info out into another template.

Davidinh 05-11-2010 03:34 PM

thanks Lynne
i got it, the way template work on VB4

Once again thanh you very much for your time Lynne
i thought i need one more step about how to use a file CSS or connected it into a template

i am going to create the TEST.css template (with google grids or kind of CSS for 2 or 3 columns) then
on the top (head part) of the main page of cust_page put this link in
Code:

<link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}TEST.css" />
  </head>

So, it should be completed your tutorial "How create a custom page for VB 4"


thanks for all who distribute this knowlege

Best regard,

alfanexus 05-14-2010 01:13 PM

Would it be possible to put a widget on such a page? If then how?

Lynne 05-14-2010 01:36 PM

Possible? Almost anything is possible if you code it. I do not know how to put a widget on the page, however, and I imagine it would be a lot more coding that just putting a custom block of your own on the page would be.

Davidinh 05-15-2010 04:12 PM

how to create multiple template under $_REQUEST[do] Lynne

i tried to get more template (on test.php)
but i don't understand how to make a second template for it

any help !


All times are GMT. The time now is 05:11 AM.

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.02291 seconds
  • Memory Usage 1,754KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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