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)

Reycer 08-21-2011 07:05 PM

ok, about to pull my hair out here. I need for the content (in this case a podcast) to show up on a RSS Feed. Just like the forums would, but for this custom page. How do I go about doing that?

Lynne 08-21-2011 10:57 PM

Quote:

Originally Posted by Reycer (Post 2236286)
ok, about to pull my hair out here. I need for the content (in this case a podcast) to show up on a RSS Feed. Just like the forums would, but for this custom page. How do I go about doing that?

You would need to edit the external.php page to do this. That is beyond the scope of this article though.

Raeven 08-28-2011 07:00 PM

//edit: Sorry used the wrong Tab to post, should be in another topic.

stevectaylor 08-30-2011 06:56 AM

Anyone have an idea why I can't get this script warking with this page but can on main forum section?

Code:

<body>
<form name="form" id="form">

<label for="day">day</label>
<select id="day" name="day" onchange="updateDept();"></select>
 
 
<label for="month">month</label>
<select id="month" name="month" onchange="updateDay(this.value);updateDept();">       
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>

<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>

</select>
 
<label for="year">year</label>
<select id="year" name="year" onchange="updateDept();">
<option value="2011">2011</option>
<option value="2012">2012</option>
</select>
 
       
<input type="hidden" name="departureDate" id="departureDate" value="" />
<p>
<label for="duration">Duration</label>

<select name="duration" id="duration">
<option value="7">1 week</option>
<option value="14">2 Weeks</option>
<option value="1">1 day</option>
<option value="2">2 days</option>
<option value="3">3 days</option>
<option value="4">4 days</option>
<option value="5">5 days</option>
<option value="6">6 days</option>

<option value="7">7 day</option>
<option value="8">8 days</option>
<option value="9">9 days</option>
<option value="10">10 days</option>
<option value="11">11 days</option>
<option value="12">12 days</option>
<option value="13">13 day</option>
<option value="14">14 days</option>
<option value="15">15 days</option>

<option value="16">16 days</option>
<option value="17">17 days</option>
<option value="18">18 days</option>
<option value="19">19 day</option>
<option value="20">20 days</option>
<option value="21">21 days</option>
<option value="22">22 days</option>
<option value="23">23 days</option>
<option value="24">24 days</option>

<option value="25">25 day</option>
<option value="26">26 days</option>
<option value="27">27 days</option>
<option value="28">28 days</option>
</select>
</p>
       
<input type="hidden" name="dateXSell" id="dateXSell" value="7" />
<p>
<label for="departureAirportCode">Departure airport</label>
<select name="departureAirportCode" id="departureAirportCode">
<option value="*LN">Any London Airports</option>

<option value="*SE">Any South-East</option>
<option value="*SW">Any South-West</option>
<option value="*MD">Any Midlands</option>
<option value="*NE">Any North-East</option>
<option value="*NW">Any North-West</option>
<option value="*WA">Any Wales</option>
<option value="*SC">Any Scotland</option>
<option value="*NI">Any Northern Ireland</option>
<option value="ABZ">Aberdeen</option>

<option value="BFS">Belfast Intl</option>
<option value="BHX">Birmingham Intl</option>
<option value="BLK">Blackpool</option>
<option value="BOH">Bournemouth</option>
<option value="BRS">Bristol</option>
<option value="CWL">Cardiff</option>
<option value="DSA">Doncaster Sheffield</option>
<option value="MME">Durham Tees Valley</option>

<option value="EMA">East Midlands</option>
<option value="EDI">Edinburgh Intl</option>
<option value="EXT">Exeter</option>
<option value="GLA">Glasgow Intl</option>
<option value="HUY">Humberside</option>
<option value="INV">Inverness</option>
<option value="LBA">Leeds Bradford</option>
<option value="LPL">Liverpool Intl</option>
<option value="LGW">London Gatwick</option>

<option value="LHR">London Heathrow</option>
<option value="LTN">Luton</option>
<option value="MAN">Manchester</option>
<option value="NCL">Newcastle</option>
<option value="NWI">Norwich</option>
<option value="PIK">Prestwick</option>
<option value="SOU">Southampton</option>
<option value="STN">Stansted</option>
</select>

</p>
<p>
<label for="tuiCtryCode">Destination</label>
<select name="tuiCtryCode" id="tuiCtryCode">
<option value="Any">Any Destinations</option>
<option value="BGR">Bulgaria</option>
<option value="BGR,002682">  -  Bourgas</option>
<option value="BGR,002683">  -  Varna</option>

<option value="HRV">Croatia</option>
<option value="HRV,001505">  -  Croatia</option>

<option value="CPV">Cape Verde</option>
<option value="CPV,003837">  -  Cape Verde</option>

<option value="CUB">Cuba</option>
<option value="CUB,000744">  -  Cuba</option>
<option value="CYP">Cyprus</option>
<option value="CYP,000791">  -  East</option>

<option value="CYP,001443">  -  West</option>
<option value="DOM">Dominican Republic</option>

<option value="DOM,001451">  -  East</option>
<option value="DOM,000832">  -  North</option>
<option value="DOM,001452">  -  South</option>
<option value="EGY">Egypt</option>

<option value="EGY,000846">  -  Nile</option>

<option value="EGY,001689">  -  Red Sea</option>
<option value="GMB">Gambia</option>
<option value="GMB,000862">  -  Gambia</option>

<option value="GRC">Greece</option>
<option value="GRC,000691">  -  Corfu</option>
<option value="GRC,000800">  -  Crete</option>
<option value="GRC,000840">  -  Halkidiki</option>
<option value="GRC,002554">  -  Ithaca</option>

<option value="GRC,000864">  -  Kefalonia</option>

<option value="GRC,000899">  -  Kos</option>
<option value="GRC,000910">  -  Lefkas</option>
<option value="GRC,003209">  -  Meganissi</option>
<option value="GRC,003211">  -  Messinia</option>

<option value="GRC,003215">  -  Monemvasia & Nauplion</option>

<option value="GRC,003218">  -  Paralio Astros</option>
<option value="GRC,000915">  -  Parga</option>
<option value="GRC,002173">  -  Paxos</option>

<option value="GRC,003684">  -  Pelion</option>
<option value="GRC,000923">  -  Rhodes</option>
<option value="GRC,000935">  -  Samos</option>

<option value="GRC,000939">  -  Santorini</option>
<option value="GRC,000941">  -  Skiathos</option>

<option value="GRC,000134">  -  Skopelos</option>
<option value="GRC,000947">  -  Thassos</option>
<option value="GRC,003236">  -  The Mani</option>
<option value="GRC,000952">  -  Zakynthos</option>

<option value="IND">India</option>

<option value="IND,001915">  -  Goa</option>
<option value="ITA">Italy</option>
<option value="ITA,003413">  -  Calabria</option>
<option value="ITA,003641">  -  Cilento</option>
<option value="ITA,000672">  -  Neapolitan Riviera</option>

<option value="ITA,002891">  -  Puglia</option>
<option value="ITA,000678">  -  Sardinia</option>
<option value="ITA,000681">  -  Sicily</option>
<option value="ITA,000687">  -  Tuscan Riviera</option>
<option value="ITA,002230">  -  Tuscany</option>

<option value="ITA,003023">  -  Umbria</option>
<option value="ITA,000695">  -  Venetian Riviera</option>
<option value="JAM">Jamaica</option>
<option value="JAM,000148">  -  Jamaica</option>
<option value="KEN">Kenya</option>

<option value="KEN,000132">  -  Kenya</option>

<option value="MDV">Maldives</option>
<option value="MDV,000548">  -  Maldives</option>
<option value="MLT">Malta</option>
<option value="MLT,000552">  -  Gozo</option>

<option value="MLT,000555">  -  Malta</option>
<option value="MEX">Mexico</option>
<option value="MEX,000577">  -  Caribbean Coast (Mexico)</option>

<option value="MAR">Morocco</option>
<option value="MAR,001005">  -  Agadir</option>

<option value="PRT">Portugal</option>
<option value="PRT,000154">  -  Algarve</option>
<option value="PRT,000157">  -  Madeira</option>
<option value="YUG">Serbia & Montenegro</option>

<option value="YUG,002760">  -  Montenegro</option>

<option value="SVN">Slovenia</option>
<option value="SVN,001009">  -  Slovenia</option>
<option value="ESP">Spain</option>
<option value="ESP,002894">  -  Andalucia</option>
<option value="ESP,000347">  -  Costa Blanca</option>

<option value="ESP,000351">  -  Costa Brava</option>
<option value="ESP,002150">  -  Costa De La Luz</option>
<option value="ESP,000365">  -  Costa Del Sol</option>
<option value="ESP,000372">  -  Costa Dorada</option>
<option value="ESP,000312">  -  Fuerteventura</option>

<option value="ESP,000318">  -  Gran Canaria</option>
<option value="ESP,000242">  -  Ibiza</option>
<option value="ESP,000329">  -  Lanzarote</option>
<option value="ESP,000122">  -  Majorca</option>
<option value="ESP,000127">  -  Minorca</option>

<option value="ESP,000335">  -  Tenerife</option>

<option value="TUN">Tunisia</option>
<option value="TUN,000431">  -  Tunisia</option>
<option value="TUR">Turkey</option>
<option value="TUR,001379">  -  Antalya</option>

<option value="TUR,001559">  -  Bodrum</option>
<option value="TUR,000442">  -  Dalaman</option>

<option value="USA">United States Of America</option>
<option value="USA,000207">  -  Florida</option>
</select>       
</p>

<input type="hidden" name="tuiDestCode" value="" />
<input type="hidden" name="tuiResortCode" value="" />
<input type="hidden" name="tuiAccomCode" value="" />

<p id="destCode"></p>
<input type="hidden" name="rating" value="0" />


<!-- Rooms -->

<p>
<label for="numberOfRooms">Number of rooms</label>
<select id="numberOfRooms" name="numberOfRooms" onchange="addRooms(this.value)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</p>

<div id="rooms">
  <div id="rooms1">

        <label>Room 1</label>
                <div id="adult1">
                Adults
      <select id="adultRooms1">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>

        <option value="4">4</option>
        <option value="5">5</option>
        <option value="6">6</option>
        <option value="7">7</option>
        <option value="8">8</option>
        <option value="9">9</option>

      </select>
                </div>
   
                <div id="child1">
                Children
      <select id="childRooms1" onchange="addChildAges(this.value,1)">
        <option value="0">0</option>
        <option value="1">1</option>
        <option value="2">2</option>

        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
        <option value="6">6</option>
        <option value="7">7</option>
        <option value="8">8</option>

      </select>
                </div>
  </div>
</div>

<input type="hidden" name="accommodationType" value="Any" />
<input type="hidden" name="theme" value="" />

<input type="hidden" name="numAdults" value="" />
<input type="hidden" name="numChildren" value="" />
<input type="hidden" name="childInfantAges" value="0"/>



<br />
<script type="text/javascript">
document.writeln('<a hr' + 'ef=\"#\" onclick=\"return removed();\">search<\/a>');
</script>
</form>

<script type="text/javascript" src="http://www.removed/scripts/affiliates/aol.js"></script>
<script>
function generate_url(){
var form = document.getElementById('form');
var url = 'http://www.removed/page/byo/search/dlresults.page?';
/* once all of the form values have been set append them to the url */
for(var i=3;i<form.elements.length;i++)
 {
        if(form.elements[i].name)
          {
                        url+=form.elements[i].name+'='+form.elements[i].value;
                        if(i!=form.length-1)
                        {
                          url+='&';
                        }
                }
 }
url = 'http://www.removedcode?SID=&URL=' + escape(url);
window.open(url);
}
</script>
</body>
</html><img src="http://www.removedcode" width="1" height="1" border="0"/>


Lynne 08-30-2011 04:29 PM

Quote:

Originally Posted by stevectaylor (Post 2239822)
Anyone have an idea why I can't get this script warking with this page but can on main forum section?

Code:

removed

What is that code supposed to be for? It doesn't follow the template example that I gave in the first post. And, it certainly isn't a proper html page, so exactly what is it and what does it have to do with this article?

nick1313 09-17-2011 03:54 AM

Lynn,

I can't get this to work. I am on vb 4.1.5. Here's what I have done.

PHP File Code:

Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT', 'devices');
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('devices',
);

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

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'Devices';
echo hi;
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

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

?>

My template code (Created in the admin control panel)

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">Title</h2>
    <div class="blockbody">
      <div class="blockrow">
        Text
      </div>
    </div>
   
    {vb:raw footer}
  </body>
</html>

And my plugin codes.

location process

Code:

switch ($filename)
{
    case 'devices.php':
        $userinfo['activity'] = 'Devices';
        break;
// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.
}

Location unknown
Code:

switch ($userinfo['activity'])
{
    case 'Devices':
        $userinfo['where'] = '<a href="devices.php?'.$vbulletin->session->vars[sessionurl].'">My Page</a>';
        $userinfo['action'] = "Viewing My Page";
        $handled = true;
        break;
// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.
}

When I go to my page it's just a blank page. Am I missing something? Shouldn't it look like the rest of my pages, just without content?

Thanks in advance

Digital Jedi 09-17-2011 03:59 AM

Quote:

Originally Posted by nick1313 (Post 2247033)
Lynn,

I can't get this to work. I am on vb 4.1.5. Here's what I have done.



When I go to my page it's just a blank page. Am I missing something? Shouldn't it look like the rest of my pages, just without content?

Thanks in advance

Did you add the template to each of your styles? If one style doesn't have it, and you're viewing the forum in that style, you'll just get a blank page.

Lynne 09-17-2011 04:05 PM

To add to Mark's comment, you cannot use echo in your php and have it show up in the correct spot in your template. You need to assign any output to a variable that you then register for use in your template.

nick1313 09-18-2011 01:57 AM

Quote:

Originally Posted by Digital Jedi (Post 2247034)
Did you add the template to each of your styles? If one style doesn't have it, and you're viewing the forum in that style, you'll just get a blank page.

No did not add it to each of the styles, however only one style is checked, but I will do this as well.

Quote:

Originally Posted by Lynne (Post 2247234)
To add to Mark's comment, you cannot use echo in your php and have it show up in the correct spot in your template. You need to assign any output to a variable that you then register for use in your template.

Yeah I just threw that echo in there to test it to make sure it was actually going to show something. I just forgot to take it out before i pasted the code.

Thanks for your replies, I will add the template to each of the styles to see what that does.

EDIT: Adding the template to all the styles fixed it...Thanks a lot!

dmandem 10-04-2011 01:57 PM

Sorry but I'm unable to follow these instructions, it's really confusing.

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

I want a navtab that displays a copy of my forumhome but without it's contents.

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

Ok I have created the new page but I can only see it when I type in the exact url in the address bar, there is no navbar tab.

This new page I want is just to display a single youtube int he center but I can't figure it out, any help?

Thanks.


All times are GMT. The time now is 10:12 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.02432 seconds
  • Memory Usage 1,839KB
  • 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
  • (6)bbcode_code_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