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); 



All times are GMT. The time now is 11:15 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.03298 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_html_printable
  • (2)bbcode_php_printable
  • (5)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