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)

ilanyon 07-31-2011 10:45 PM

Quote:

Originally Posted by Lynne (Post 2227310)
Ian, can we get a link to the custom page to see the problem? The custom pages I found through your navtabs all look fine to me. Or, is this a problem only when you are logged in?


Hi Lynne, and thank-you for the quick response.

It only appears to be occuring when viewing with IE8 (yep, agree that it is crap, but unfortunately most of the government departments here in Oz are still using it)...

Also only occurs when not logged on (ie. as a guest) and is okay once logged in. :confused:

Specific pages are:

http://www.aiyj.org/vb/about_aiyj.php
http://www.aiyj.org/vb/aiyj_news.php
http://www.aiyj.org/vb/faq.php
http://www.aiyj.org/vb/aiyj_associate.php
http://www.aiyj.org/vb/aiyj_member.php

Cheers,

Ian

Lynne 08-01-2011 02:25 AM

Your navtab template is all messed up. Your html is totally incorrect. firefox and other browsers are most likely "correcting" it for you and IE is giving you exactly the mess you are outputting. This is the html you have for what should be the third tab (you have a blank <li> </li> for the second tab, and your fourth tab, according to your html, is the About Us tab).

HTML Code:

                        <li class="selected" style="padding:0px">
                                <ul class="floatcontainer">

                                       
                                       
                                       
                                       
                                       
                                        <li><a rel="help" href="faq.php" accesskey="5">FAQ</a></li>
                                       

                                       

                                       
                                       
                                                <ul class="popupbody popuphover">
                                                        <li>
                                                                <a href="forumdisplay.php?do=markread&amp;markreadhash=guest" onclick="return confirm('Are you sure you want to mark all forums as being read? This cannot be undone.')">Mark Forums Read</a>
                                                        </li>
                                                       
                                                </ul>
                                        </li>
                                                <ul class="popupbody popuphover">

                                                       
                                                       
                                                        <li><a href="showgroups.php" rel="nofollow">
               
                        Fellows & Board members
               
        </a></li>
                                                       
                                                       
                                                       
                                                       
                                                       
                                                       
                                                </ul>
                                        </li>
                                       
                                </ul>

                        </li>

I suggest you redo your navbar template and correct whatever is supposed to show up here.

If you need more help, you really need to post int he main forums as this isn't a thread for fixing html problems in your navbar template.

EquinoxWorld 08-02-2011 12:32 AM

Lynne what approach should we take when wanting to create a custom admin panel options page say for a custom product? I know how to crate an new options group but I don't want all the settings to be under one setting group. I want subgroups to not appear in the main settings menu, rather a submenu in the admin panel with custom pages like so:
https://vborg.vbsupport.ru/

The first one (General Settings take you to http://xxxxxxxxx.xxxx/admincp/option...p=oftw.options ) but the others I want separate custom pages for the rest of the options. I am assuming that these pages differ some what of the pages mentioned in this thread but I thought I'd ask anyway to get some sense of direction if you had any to offer. I didn't mean to bogard the thread so my apologize ahead of time. :) Any help I could get will be very much appreciated. Thanks.

HMBeaty 08-02-2011 12:43 AM

Quote:

Originally Posted by EquinoxWorld (Post 2227943)
Lynne what approach should we take when wanting to create a custom admin panel options page say for a custom product? I know how to crate an new options group but I don't want all the settings to be under one setting group. I want subgroups to not appear in the main settings menu, rather a submenu in the admin panel with custom pages like so:
http://aniworlds.net/gallery/files/2...nav_group2.png

The first one (General Settings take you to http://xxxxxxxxx.xxxx/admincp/option...p=oftw.options ) but the others I want separate custom pages for the rest of the options. I am assuming that these pages differ some what of the pages mentioned in this thread but I thought I'd ask anyway to get some sense of direction if you had any to offer. I didn't mean to bogard the thread so my apologize ahead of time. :) Any help I could get will be very much appreciated. Thanks.

There's a separate article on how to create custom pages for the admincp. Might be in the 3.x articles, but it still works for 4.x

EquinoxWorld 08-02-2011 01:27 AM

Quote:

Originally Posted by HMBeaty (Post 2227949)
There's a separate article on how to create custom pages for the admincp. Might be in the 3.x articles, but it still works for 4.x

Would it be this one? https://vborg.vbsupport.ru/showthread.php?t=83122

So I can use this method even though it's dated over 6 years ago?

HMBeaty 08-02-2011 01:29 AM

Quote:

Originally Posted by EquinoxWorld (Post 2227968)
Would it be this one? https://vborg.vbsupport.ru/showthread.php?t=83122

So I can use this method even though it's dated over 6 years ago?

Yes and yes

EquinoxWorld 08-02-2011 01:38 AM

Quote:

Originally Posted by HMBeaty (Post 2227970)
Yes and yes

Thanks HMBeaty, it's very very helpful, I already got one up and running! :) Have a great night and thanks again for your help.

HMBeaty 08-02-2011 01:40 AM

Quote:

Originally Posted by EquinoxWorld (Post 2227973)
Thanks HMBeaty, it's very very helpful, I already got one up and running! :) Have a great night and thanks again for your help.

;) (typo)

EquinoxWorld 08-02-2011 02:50 AM

Quote:

Originally Posted by HMBeaty (Post 2227974)
;) (typo)

xD Corrected, sorry :)

Reycer 08-02-2011 01:28 PM

I'm hoping someone can point me in the right direction here. I am needing to align an Iframe on the same line as a flash object. I created a new page via Lynne's incredible article. Now I'm just needing to set these two objects side by side instead of being one above the other. Here's the code:

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">TTD Radio</h2>
    <div class="blockbody">
      <div class="blockrow">
      <P ALIGN="left"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="296" id="utv521869"><param name="flashvars" value="autoplay=false&amp;brand=embed&amp;cid=8959895&amp;v3=1"/><param name="allowfullscreen" value="true"/><param name="allowscriptaccess" value="always"/><param name="movie" value="http://www.ustream.tv/flash/viewer.swf"/><embed flashvars="autoplay=false&amp;brand=embed&amp;cid=8959895&amp;v3=1" width="480" height="296" allowfullscreen="true" allowscriptaccess="always" id="utv521869" name="utv_n_511451" src="http://www.ustream.tv/flash/viewer.swf" type="application/x-shockwave-flash" /></object><br /><a href="http://www.ustream.tv/producer" style="padding: 2px 0px 4px; width: 400px; background: #ffffff; display: block; color: #000000; font-weight: normal; font-size: 10px; text-decoration: underline; text-align: center;" target="_blank">Free desktop streaming application by Ustream</a></P><P ALIGN="right"><iframe width="468" scrolling="no" height="586" frameborder="0" style="border: 0px none transparent;" src="http://www.ustream.tv/socialstream/8959895"></iframe></P>
      </div>
    </div>
   
    {vb:raw footer}
  </body>
</html>


kh99 08-02-2011 02:24 PM

Quote:

Originally Posted by mdelcour (Post 2228170)
I'm hoping someone can point me in the right direction here. I am needing to align an Iframe on the same line as a flash object. I created a new page via Lynne's incredible article. Now I'm just needing to set these two objects side by side instead of being one above the other.

I'm not the best person for these kinds of questions, but I think <p> starts a new line, so maybe if you just took those out? Or replace them with <span>...</span>?

Reycer 08-02-2011 02:57 PM

Quote:

Originally Posted by kh99 (Post 2228179)
I'm not the best person for these kinds of questions, but I think <p> starts a new line, so maybe if you just took those out? Or replace them with <span>...</span>?

I got it figured out.

ilanyon 08-03-2011 05:59 AM

Quote:

Originally Posted by Lynne (Post 2227491)
Your navtab template is all messed up. Your html is totally incorrect. firefox and other browsers are most likely "correcting" it for you and IE is giving you exactly the mess you are outputting. This is the html you have for what should be the third tab (you have a blank <li> </li> for the second tab, and your fourth tab, according to your html, is the About Us tab)...

If you need more help, you really need to post int he main forums as this isn't a thread for fixing html problems in your navbar template.

Thanks Lynne,
Fixed it. Actually had nothing to do with the navbar template being "all messed up" as you so eloquently put it (and given that you just took the page source code, not sure that you could say so with such confidence as you did...)

The problem was that I had placed an 'if member' condition around some java while trying to restrict the sub-navbar to members only...my bad...

I'm really sorry that I inconvenienced you so, as I was just looking for some help from more experienced people like yourself.

Regards,

Ian

cellarius 08-03-2011 09:59 AM

Quote:

Originally Posted by ilanyon (Post 2228551)
Actually had nothing to do with the navbar template being "all messed up" as you so eloquently put it (and given that you just took the page source code, not sure that you could say so with such confidence as you did...)

That's funny. What would you suggest other than looking at the page source to determine wether what's being send to the browser is a mess? Having looked at it myself just now, be assured: it is a mess, and Lynne even told you why.

maxie 08-16-2011 11:55 AM

i install pretty cool but i have problem on this two plugins '

hook location - online_location_process:

and

hook location online_location_unknown:

where do i put this two codes ?

how can i add this code to my template

kh99 08-16-2011 01:23 PM

Quote:

Originally Posted by maxie (Post 2234147)
...i have problem on this two plugins '

hook location - online_location_process:

and

hook location online_location_unknown:


where do i put this two codes ?

You need to create two new plugins, by going to "Plugins & Products" -> "Add New Plugin". The code goes in the large text box and you need to select the hook location from the dropdown menu. You also need to enter a title, and to select the "Yes" radio button to actuvate the plugin.

Diwanalk 08-18-2011 12:40 AM

1 Attachment(s)
Hello Lynne and all,

I'm rather new to VB and trying to learn. Your tutorial was a great help and following it I managed easily to create a page which works very well, thanks a lot for it. But I have a slight problem which I can't explain : at the top of this particular test page are some strange characters which don't appear on other pages. I join an image so that you can see it.

I verified that there was absolutely nothing before the <?php in the php page and before the {vb:stylevar htmldoctype} in the template, and I made the pages with Notepad.

Any idea ?

Thanks for your very useful help

Attachment 132056

kh99 08-18-2011 12:09 PM

I've seen that before but can't remember what was causing it. But you have to remember, vb works by collecting up all the output into a string and printing it at the end. So those characters could come from any code that's executed, and not just from the very beginning of the script.

cellarius 08-18-2011 01:26 PM

And notepad is not a suitable editor for web used files. Use notepad++ instead to edit and save files.

Diwanalk 08-18-2011 06:23 PM

Quote:

Originally Posted by kh99 (Post 2234913)
I've seen that before but can't remember what was causing it. But you have to remember, vb works by collecting up all the output into a string and printing it at the end. So those characters could come from any code that's executed, and not just from the very beginning of the script.

I tried removing completely the content of the template, it's still there. I tried removing line after line the content of the php file, it's still there. The only way to have it gone is to remove the whole content of the php file between <?php and ?> :(

@Cellarius : it's Notepad++ I meant, of course ^^

Thanks for your answers anyway

Edit : I just tried to use a hook instead of an external php file, following the method of Cellarius
Code:

$templater = vB_Template::create('my_own_template');
$templater->register_page_templates();
print_output($templater->render());

and there are no more extra characters.

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.

Digital Jedi 10-05-2011 06:01 AM

I'm not sure what your going for, but this for creating a vB powered page. So having to use the exact URL to get to it, is kind of the point. If you want a new tab, that's another tutorial altogether.

If there's no navbar, then you haven't copied all the code into your template. Putting in a video would be as simple as putting the embed code in place of the word "Text" in the sample template.

pwhitehead 10-07-2011 12:55 AM

What im wonder is; how would i pull a certain thread like headline use and post that on my home page as a custom page? I want it to loose similar to mmo-champion.com if you dont mind looking at that website and getting the idea of what i mean. I really dont feel like using strange php scripts just to post news on my site. Even though i want my forum separate from my entire site, i would like to integrate a part of my forum so certain threads show up on my home page and i can the use vbulletin to post a thread and then use that thread and post a custom page on my site showing only that thread and not the whole forum.

Lynne 10-07-2011 01:08 AM

Quote:

Originally Posted by pwhitehead (Post 2254167)
What im wonder is; how would i pull a certain thread like headline use and post that on my home page as a custom page? I want it to loose similar to mmo-champion.com if you dont mind looking at that website and getting the idea of what i mean. I really dont feel like using strange php scripts just to post news on my site. Even though i want my forum separate from my entire site, i would like to integrate a part of my forum so certain threads show up on my home page and i can the use vbulletin to post a thread and then use that thread and post a custom page on my site showing only that thread and not the whole forum.

That page is just the vBulletin CMS with several widgets and some articles posted. It's not a custom page.

pwhitehead 10-07-2011 02:44 AM

Quote:

Originally Posted by Lynne (Post 2254171)
That page is just the vBulletin CMS with several widgets and some articles posted. It's not a custom page.

So how do they use a certain thread as their home news and post just that 1 thread on their home page? How is this done? I would like to use this feature has home news announcements on my site instead of using strange scripts i dont trust. Please explain how to do this or turn me into the right direction on where to find the information my self. Lynne not to be rude but i have been searching on how to do this for months and i'm asking on here as a last resort only because i ran out of options. Please help ;)

Lynne 10-07-2011 08:37 PM

Quote:

Originally Posted by pwhitehead (Post 2254213)
So how do they use a certain thread as their home news and post just that 1 thread on their home page? How is this done? I would like to use this feature has home news announcements on my site instead of using strange scripts i dont trust. Please explain how to do this or turn me into the right direction on where to find the information my self. Lynne not to be rude but i have been searching on how to do this for months and i'm asking on here as a last resort only because i ran out of options. Please help ;)

This is the wrong thread to be asking about how to set up your CMS. You should ask this question out in the forums. I'd suggest posting a link to your current CMS and an image to show what you want (or a link) and be specific about what you can't see to do that is on the page you like.

vbresults 10-07-2011 09:14 PM

If I have an application `/app/`, separate from the forum `/forum/` but I want to wrap the output of `/app/` in vBulletin's page template.

Problem is, none of the images show up. They are using the current path, `/app/` to get the CSS and images, and since they don't exist, they don't show up. How can I fix this?

Thank you. :)

EDIT: The fix was a base tag. I also forgot vB_Template::register_page_templates.

Lynne 10-07-2011 09:43 PM

Perhaps use the <base> tag to point to the different directory?

vbresults 10-07-2011 09:56 PM

Quote:

Originally Posted by Lynne (Post 2254481)
Perhaps use the <base> tag to point to the different directory?

I think it is another problem now. Thank you! :)

Edit: I forgot vB_Template::register_page_templates. xD

sharpkiller 10-10-2011 11:25 PM

I'm not really sure search for, so I apologize if this has already been asked and answered in this thread:

Is it possible to make it so vBulletin does not display when someone is viewing my custom page on the who's online list? I'm creating a 404 page which is integrated into vBulletin so the entire website is seamless and it's rather annoying right now to see a list of "Unknown Location <insert url to non-existant file>" on the Who's Online list.

Digital Jedi 10-11-2011 09:14 AM

Quote:

Originally Posted by sharpkiller (Post 2255741)
I'm not really sure search for, so I apologize if this has already been asked and answered in this thread:

Is it possible to make it so vBulletin does not display when someone is viewing my custom page on the who's online list? I'm creating a 404 page which is integrated into vBulletin so the entire website is seamless and it's rather annoying right now to see a list of "Unknown Location <insert url to non-existant file>" on the Who's Online list.

Is there any reason you don't want to create the location, as per the instructions, so that, at least, Who's Online will show something like "Viewing 404 Error" or "Viewing Error Page' or whatever you want it to say? Seems like that would be far easier.


All times are GMT. The time now is 05:08 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.02411 seconds
  • Memory Usage 1,988KB
  • 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
  • (8)bbcode_code_printable
  • (1)bbcode_html_printable
  • (23)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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