View Full Version : [HOW TO - vB4] Create your own vBulletin page
Lynne
03-28-2011, 03:14 PM
Hello Lynne,
Thanks for response, tried that this is what I get, sorry I am a technical idiot
Mark
Parse error: syntax error, unexpected T_STRING in /var/www/clients/client11/web26/web/custom.php on line 3
You have a problem on line 3 of your custom file. Post the first 5 lines of your file (using code tags, please).
Mark4865
03-28-2011, 04:58 PM
We have fixed errors but now get a blank white page
Lynne
03-28-2011, 05:01 PM
We have fixed errors but now get a blank white page
Does the template for the page exist in the style you are using to view the page?
Mark4865
03-28-2011, 05:17 PM
yes
Lynne
03-28-2011, 05:22 PM
Then check your error_logs and see if something is in there. Otherwise, go through your php and debug as needed (remove/comment out stuff, etc.).
Mark4865
03-28-2011, 05:24 PM
our template is called new custom page but our php file is called custom, would that cause a problem
--------------- Added 1301338367 at 1301338367 ---------------
Sorry stupid question but where do I find the error log
Lynne
03-28-2011, 06:01 PM
It does not matter as long as you make sure to put the correct template name where needed.
If you don't know where your error_logs are, then you need to ask your host.
Mark4865
03-28-2011, 06:18 PM
this is the code we used
<?php
error_reporting(E_ALL);
define('THIS_SCRIPT', 'custom');
define('CSRF_PROTECTION',true);
$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array('custom',);
$actiontemplates = array();
require_once('./global.php');
$navbits = construct_navbits(array(''=>'Register'));
$navbar = render_navbar_template($navbits);
$pagetitle = 'Porsche Planet Register';
$templater = vB_Template::create('custom');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('page', $page);
print_output($templater->render());
?>
Lynne
03-28-2011, 08:43 PM
According to your code, the name of the template is "custom".
...
$globaltemplates = array('custom',);
...
$templater = vB_Template::create('custom');
...
SuperTaz
03-29-2011, 03:47 AM
I am not well versed with php, but I thought I would ask here for some help. I have a file on my site that is html and javascript. I used this article to convert it to a php file. Well, for the most part, it works. However, it shows adsense double and the footer is at the top. lol
Click here to see the php file (http://www.global-gamers.net/forums/pbss.php)
Where did I go wrong?
Mark4865
03-29-2011, 10:14 AM
Hello Lynne,
we have changed the names to match but still just a blank white page, any chance you would consider having a look??
regards
Mark
Update: Okay we seem to have something working here but just the header and footer but not the HTML we inserted, will fool around and see what we have done wrong here.
--------------- Added 1301403637 at 1301403637 ---------------
Have managed to get it sort of working, there is a problem with our background not showing through as it hides behind the standard white page.
I want to instert my custom HTML page between the header and the footer, I dont want the title or standard background to show, just the header and footer with all standard functions, but my own images and text in between the header and footer.
Can anyone help me here??
Another Update:
Okay we seem to have resolved most issues and this is a great mod Lynne thanks for all the hard work.
One issue, on this page I need a different background that my standard VB background that is preset for all the other pages. We tried to somehow have an image coded into the background via HTML but it then hides behind the standard VB page and does not cover it, still trying to work it out, any ideas anyone??
Lynne
03-29-2011, 04:28 PM
One issue, on this page I need a different background that my standard VB background that is preset for all the other pages. We tried to somehow have an image coded into the background via HTML but it then hides behind the standard VB page and does not cover it, still trying to work it out, any ideas anyone??
Post a link to the page so we can see it and post an image of what you want it to look like, that way we can make a CSS recommendation.
Click here to see the php file (http://www.global-gamers.net/forums/pbss.php)
Where did I go wrong?
I would guess it is a template issue. Can you post what your template looks like?
BF777
03-29-2011, 04:44 PM
Where does one create the template suggested in step #2?
Mark4865
03-29-2011, 05:14 PM
[QUOTE=Lynne;2178776]Post a link to the page so we can see it and post an image of what you want it to look like, that way we can make a CSS recommendation.
Hello Lynne,
site is not currently active I can pm you a test log in if you be prepared to check it for me
regards
Mark
SuperTaz
03-29-2011, 08:51 PM
Post a link to the page so we can see it and post an image of what you want it to look like, that way we can make a CSS recommendation.
I would guess it is a template issue. Can you post what your template looks like?
Sure can. Here you go:
{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 pbss_viewer}</title>
{vb:raw headinclude}
{vb:raw headinclude_bottom}
<link rel="stylesheet" type="text/css" href="pbss.css" />
</head>
<body>
{vb:raw header}
{vb:raw navbar}
<div id="pbss_viewer">
<h1>{vb:raw pbss_viewer}</h1>
</div>
<h2 class="blockhead">Punkbuster Screenshot Viewer</h2>
<div class="blockbody">
<div class="blockrow">
<div align="center"><form name=ipz><table style="font-size:11pt"
width=100% border=0><tr align=center><td colspan=2 bgcolor=#DBDBDB></div>
<table width="100%" border="3">
<tr>
<td height="83"><div align="center"><span class="stijl5"><a href="http://www.gameservers.com/?ref=1624059">
<img src="http://images.gameservers.com/image_3.gif?ref=1624059" width="120" height="60" border="0"></a></span><br><br><a href="http://www.punkbuster.com/"><img src="http://www.global-gamers.net/images/pb.png" width="120" height="60" border="0"></a><br><br><a href="http://www.pbbans.com"><img src="http://www.pbbans.com/images/banners/pbb_120x50.gif" alt="PBBans.com" title="Join the live banning revolution today!" width="120" height="60" border="0"></a></div></td>
<td><div align="center"><img src="http://www.global-gamers.net/images/global.png" alt="Global Gamers"><br>
<a href="http://www.punkbuster.com/"><b>Punkbuster</b></a>&trade Screen Shot
Viewer<br><a href="http://www.global-gamers.net/"><b>Global Gamers</b></a> Copyright© 2011<br><span style="color: #000000"><b>Disclaimer: All titles, names, images and logos are trademarks of their respective owners!</b></span><br>
<!-- Counter ----->
<table width="133" border="0" cellspacing="0" cellpadding="3"><tr><td align="center"><a href="http://www.website-hit-counters.com" target="_blank"><img src="http://www.website-hit-counters.com/cgi-bin/image.pl?URL=286611-1114" alt="hit counter" border="0" ></a></td></tr><tr><td align="center"><font style="font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 9px; color: #330006; text-decoration: none;"> <a href="http://www.website-hit-counters.com" target="_blank" style="font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 9px; color: #555556; text-decoration: none;" title="hit counter">hit counter</a></font></td></tr></table>
<!-- End Counter ---->
<hr align="center"></hr>
</div>
</div></td>
<td><div align="center"><span class="stijl5"><a href="http://www.gameservers.com/?ref=1624059">
<img src="http://images.gameservers.com/image_3.gif?ref=1624059" width="120" height="60" border="0"></a></span><br><br><a href="http://www.punkbuster.com/"><img src="http://www.global-gamers.net/images/pb.png" width="120" height="60" border="0"></a><br><br><a href="http://www.pbbans.com"><img src="http://www.pbbans.com/images/banners/pbb_120x50.gif" alt="PBBans.com" title="Join the live banning revolution today!" width="120" height="60" border="0"></a></div></td>
</tr>
</table>
<br>
Enter the IP of another server (without the port):
<input type="text" name="ipq" size="15" style="font-family:Courier New;font-size:11pt"
value="Game Server IP">
<br>
<br>
Start Number:
<input type=text value=1 name=ips size=2 style="text-align:right">
End Number:
<input
size=3 type=text value=100 name=ipe style="text-align:right">
<input type=button value="VIEW" onClick="show()"><br><br>
</span></div>
<hr align="center"></hr>
<br>
</div>
<tr align=center><td width=58% valign=top class="stijl1" ID=T2><div align="center"><br>
</div></td><td width=42% valign=top bgcolor="DBDBDB" class="stijl1">
<div ID=T4 style="background-color="DBDBDB"><br>
<div align="center"><span class="stijl6">pbsvss.htm file from the selected server:</span></div><br>
</div><iframe
height=10000 name=T3 width=100% scrolling=auto border=0></iframe></td></tr>
<div align="center">
<script type="text/javascript">
function show(){if(!ipz.ipq.value){return}aa=ipz.ipq.value; bb=eval(ipz.ips.value);bbx=eval(ipz.ipe.value)+1;z ="http://"+aa
+"/"+aa+"/pbsvss.htm";T4.innerHTML="<a href='"+z+"' style='color:000000' target=index><b>"+z+"</b></a>";T3.location.href=z;
x="<b style='color:000000'>PBSS from Server with IP = "+aa+"<hr>";for(cc=bb;cc<bbx;cc++){n=cc.toString();if
(n.length==1){n="0"+n}if(n.length==2){n="0"+n}if(n.length==3){n="0"+n}if(n.length==4){n="0"+n}if(n.length==5){n="0"+n}
nz="http://"+aa+"/"+aa+"/pb"+n;x+="<a style='cursor:hand;color:000000' href='"+nz+".htm' target="+n+">"+nz+".htm</a><br>"
+"<img src='"+nz+".png'><hr>"}T2.innerHTML=x+"</b><br>"}</script>
</div></div>
</div>
</div>
{vb:raw footer}
</body>
</html>
Lynne
03-30-2011, 01:50 AM
Where does one create the template suggested in step #2?
admin cp > style manager > find your style > add template in dropdown
Hello Lynne,
site is not currently active I can pm you a test log in if you be prepared to check it for me
regards
Mark
Sure. Please also email me a link to this thread/post so I know what you are PMing me about. :)
Sure can. Here you go:
I didn't check all of your html cuz I can tell you have problems right off the bat with a line like this:
<div align="center"><form name=ipz><table style="font-size:11pt"
width=100% border=0><tr align=center><td colspan=2 bgcolor=#DBDBDB></div>
You cannot have a div wrapped around just part of a form/table/row/column tag. All tags must be closed via last opened/first closed. You need to make sure you use valid html of your will have issues like what you are seeing.
BF777
03-30-2011, 06:12 PM
Can these pages be modified in a program like Dream Weaver and then saved in the template? Would that create any issues?
Lynne
03-30-2011, 07:18 PM
Can these pages be modified in a program like Dream Weaver and then saved in the template? Would that create any issues?
I have no idea since I don't use Dreamweaver. Try it and see.
BF777
03-30-2011, 09:05 PM
What have you used Lynne?
I was just hoping there's an easier way to add the break, bold, etc. tags to the page.
Lynne
03-30-2011, 09:43 PM
What have you used Lynne?
I was just hoping there's an easier way to add the break, bold, etc. tags to the page.
I do it by hand. I use a plain text editor (BBEdit) to write my php code and template code.
Mark4865
04-03-2011, 01:59 PM
Got everything working as we wanted thanks for all the help Lynne great support
Acoly
04-18-2011, 09:17 PM
Hi guys,
I have just created my first php vbulletin page following the instructions on the first page. Is there any way I can control the access to specific areas of my page according to the member's permission? If so can you point me to some code examples please?
TIA,
George
PS: Please be gentle PHP/vbulletin is fairly new to me :).
Lynne
04-18-2011, 10:36 PM
Hi guys,
I have just created my first php vbulletin page following the instructions on the first page. Is there any way I can control the access to specific areas of my page according to the member's permission? If so can you point me to some code examples please?
TIA,
George
PS: Please be gentle PHP/vbulletin is fairly new to me :).
You can use this function:
if (!is_member_of($vbulletin->userinfo, x, y, z)) {
// no permission if you aren't a member of usergroupid x, y, or z
print_no_permission();
}
Acoly
04-19-2011, 01:46 AM
Thank you so much Lynne, that worked :).
I have another question pertinent to this page--I want to use it to add a form that only contains a type=file input field and upload that file on the server.
I have created the form but when trying to submit, I get the following error:
Your submission could not be processed because a security token was invalid.
I am pretty sure that I will need to pass the credentials as well--do you know how I can accomplish this?
TIA,
George
--------------- Added 1303235753 at 1303235753 ---------------
I got it! I am adding the code for the whole form below:
<form action="test.php" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
</form>
These two hidden fields is what is needed.
George
Lynne
04-19-2011, 05:11 PM
Yep, you got it. Thanks for sharing it. :)
ivan_wc3
04-19-2011, 10:58 PM
Hi all,
there is a way to set in a specific navtab a different style?
I would to set for each navtab a different style? How it's possible?
Thanks a lot :)
Lynne
04-20-2011, 03:56 AM
Hi all,
there is a way to set in a specific navtab a different style?
I would to set for each navtab a different style? How it's possible?
Thanks a lot :)
This article has nothing to do with navtabs. If you have a question about navtabs, I suggest you post in the appropriate forum.
ivan_wc3
04-20-2011, 06:22 AM
sorry,
this is a misunderstanding....
I've add my ownvBulletin page using my MASTER style... It's possibile create my own vBulletin page with another different style...
In this way i've differents style in differents page?
Thanks you a lot
Lynne
04-20-2011, 08:17 PM
You may change the template for the different styles.
ivan_wc3
04-21-2011, 04:12 PM
Sure,
but in this way user must change style and all the page will have the same style.
I would to create page with different style. It's possible?
wowautoauctions
05-02-2011, 03:40 AM
Is it possible to change the template to work exactly like the front-page cms (create menu and everything).. So for it to look like this :
https://vborg.vbsupport.ru/external/2011/05/49.png
Lynne
05-02-2011, 04:04 AM
Is it possible to change the template to work exactly like the front-page cms (create menu and everything).. So for it to look like this :
If you put all the code into the php page and then the html into the template, then sure.
wowautoauctions
05-02-2011, 04:30 AM
If you put all the code into the php page and then the html into the template, then sure.
So I have to find each template that the cms uses and combine them all into one template?
Lynne
05-02-2011, 04:51 PM
So I have to find each template that the cms uses and combine them all into one template?
You need at least the template code for the areas you want to show. You could use the same templates, but you will need to render them in your php code in order to use them.
mintman72
05-03-2011, 04:11 PM
Ok, so I know I've got to be doing something wrong, but I cannot figure it out for the life of me. I've loaded the php file into my root directory, added the template into my style, but whenever I try to key in the URL for the php, I get a 404 error.
I've checked my spelling, capitalization, and file location. Made sure everything is lined up, but I just cannot seem to clear the 404 error. Any suggests?
Lynne
05-03-2011, 04:48 PM
How about a URL?
mintman72
05-03-2011, 04:51 PM
http://www.ourcouponhome.com/coupons.php
is supposed to be where you can pull it up
--------------- Added 1304454436 at 1304454436 ---------------
OK, figured out what was going on! Thanks for the willingness to help out!
Mark4865
05-06-2011, 01:28 PM
Hello Lynne,
we managed to use this fantastic mod to create the perfect custom page using this mod and wanted to thank you for all your hard work and great support, much appreciated. We want to use our new custom page as the first page (log in page) people see when they type in our website URL, how do we change things in VB so we can make this happen. When they log in they are then taken to the front page in the CMS as per normal. We have set all the log in places and links to do this all I need to know is where to change things to make this the 1st log in page please.
thanks again for a great mod and great support
Lynne
05-06-2011, 03:28 PM
Hello Lynne,
we managed to use this fantastic mod to create the perfect custom page using this mod and wanted to thank you for all your hard work and great support, much appreciated. We want to use our new custom page as the first page (log in page) people see when they type in our website URL, how do we change things in VB so we can make this happen. When they log in they are then taken to the front page in the CMS as per normal. We have set all the log in places and links to do this all I need to know is where to change things to make this the 1st log in page please.
thanks again for a great mod and great support
Have you tried just naming this new page index.php so that is the first page people go to?
Mark4865
05-06-2011, 04:18 PM
Heh Lynne,
thanks for response. No I am a total technical idiot so would never have thought of that. I assume I would then have to name orignal index.php something else or is there not currently a file called index.php
Lynne
05-07-2011, 03:57 AM
Have you tried looking at the default vbulletin index.php page? It just points to another page. Replace it with whatever you want (keep a copy in case you don't like your new page).
Mark4865
05-07-2011, 05:21 AM
Hello Lynne,
Sorry another stupid question, where do I find this and how do I do that. Sorry as mentioned total technical idiot, need clear step by step instructions so I dont break it.
Thanks in advance
Mark4865
05-11-2011, 02:25 PM
Hello Lynne,
any chance you can give me the instructions to sort out above issue.
regards and thanks
Mark
Lynne
05-11-2011, 02:57 PM
Hello Lynne,
any chance you can give me the instructions to sort out above issue.
regards and thanks
Mark
I really don't understand what you want. If you want your custom page to be the main page when people go to your site, then rename it to be index.php. Rename the old index.php file to be oldindex.php so you still have it around.
albanah
05-13-2011, 05:44 PM
Thanks Lynne.
I tried to get it to work, but I get blank page.
I am using vb4.1.2
I saw your earlier responses to similar problems, bu I am sure I have the template added to all styles including the master.
Any help ?
Lynne
05-13-2011, 05:49 PM
Thanks Lynne.
I tried to get it to work, but I get blank page.
I am using vb4.1.2
I saw your earlier responses to similar problems, bu I am sure I have the template added to all styles including the master.
Any help ?
If you did *exactly* what I posted in the first post, then you should not get a blank page. Double check any changes you made to the php page and template.
Mark4865
05-14-2011, 05:28 PM
thanks Lynne I will give it a try
albanah
05-14-2011, 05:37 PM
If you did *exactly* what I posted in the first post, then you should not get a blank page. Double check any changes you made to the php page and template.
I did not change any thing. I named the page (test.php) and tempalate (Test)
Just copy and paste of your exact codes.
But it did not work.
Lynne
05-14-2011, 07:43 PM
I did not change any thing. I named the page (test.php) and tempalate (Test)
Just copy and paste of your exact codes.
But it did not work.
The template is not named "Test", it is named "TEST".
albanah
05-15-2011, 07:10 AM
The template is not named "Test", it is named "TEST".
Yes, I used TEST of course.
Any idea why I am getting blank page ?
--------------- Added 1305448785 at 1305448785 ---------------
Yes, I used TEST of course.
Any idea why I am getting blank page ?
I have checked in vb 4.0.2 ---> it is working fine.
Can you then update it to work with 4.1.2 and higher.
Many thanks in advance.
Lynne
05-15-2011, 04:32 PM
There is no need to update it. It works perfectly fine in 4.1.2 an 4.1.3. The basic page structure hasn't changed at all in the 4.x series.
setjo1980ya
05-25-2011, 01:59 PM
I have created custom page in vbulletin forum but don't know how to link it from navigation bar.
Please help
Lynne
05-25-2011, 03:54 PM
I have created custom page in vbulletin forum but don't know how to link it from navigation bar.
Please help
There are several modifications to do this and a few articles if you try a search. [HOW TO - vB4] Create a New Tab in the navbar (https://vborg.vbsupport.ru/showthread.php?t=226914)
setjo1980ya
06-02-2011, 10:43 AM
I have created new page in vbulletin using the following code but is it blank
Please let me know the issue
First I prepared new custom page in named we-support.php
<?php
error_reporting(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'we-support');
$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array(
'test'
);
$actiontemplates = array();
require_once('./global.php');
if ($vbulletin->options['ctab_enable'])
{
$noaccessgids = explode(",", $vbulletin->options['limit_groups']);
if (is_member_of($vbulletin->userinfo, $noaccessgids))
{
print_no_permission();
}else{
$content = $vbulletin->options['content'];
}
$pagetitle = $vbulletin->options['custom_title'];
$navbits = array();
$navbits[$parent] = $vbphrase['custom_message_title'];
$navbits = construct_navbits($navbits);
$navbar = render_navbar_template($navbits);
$templater = vB_Template::create('test');
$templater->register_page_templates();
$templater->register('content', $content);
$templater->register('navbar', $navbar);
print_output($templater->render());
}
?>
============================
And Prepared new template named test
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header
$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">Title</td>
</tr>
<tr>
<td class="alt1">Text</td>
</tr>
</table>
$footer
</body>
</html>
But When I opened it I found blank page
http://college-chat-rooms.gradchat.net/we-support.php
--------------- Added 1307024721 at 1307024721 ---------------
Issue solved
After deleting these lines the issue solved
if ($vbulletin->options['ctab_enable'])
{
$noaccessgids = explode(",", $vbulletin->options['limit_groups']);
if (is_member_of($vbulletin->userinfo, $noaccessgids))
{
print_no_permission();
}else{
$content = $vbulletin->options['content'];
}
Dave-ahfb
06-04-2011, 01:29 PM
Is there any way to have each custom page have its own custom meta tags? I guess I could add about 100 if conditionals in the headinclude, but would this not bog things down?
Lynne
06-04-2011, 03:21 PM
You may add your own meta tags into the pages. Just put it up where the headinclude template gets included.
Dave-ahfb
06-04-2011, 10:33 PM
That is half the solution.
The problem then would be the second set of "default" meta tags also served up. To combat this I created a template which copies headinclude minus all the meta info, which is placed into the page templates.
This is the first time I have pulled out vb4 since the "not ready for prime time" release. Luckily after my 3rd attempt to locate my old test backups, I finally found them :).
Dave
temsamane
06-07-2011, 08:57 AM
This is an updated article on how to create your own vbulletin powered page. It's only for use with vB4.
This is NOT my work. I'm posting this from another thread where vB Style (https://vborg.vbsupport.ru/member.php?u=215438) took the time to write this out. And his work is based on the article by Gary King (https://vborg.vbsupport.ru/member.php?u=5183) here - How to create your own vBulletin-powered page! (uses vB templates) (https://vborg.vbsupport.ru/showthread.php?t=62164)
Instructions to Create your Own Page:
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)
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.
i am a newby. I made step one and uploaded the file to forum root. but how can i create the template? can you tell me the steps i have to follow please?
Lynne
06-07-2011, 04:47 PM
i am a newby. I made step one and uploaded the file to forum root. but how can i create the template? can you tell me the steps i have to follow please?
Styles & Templates > Style Manager > find style > Add New Template
d19rnyxx
06-07-2011, 11:36 PM
what condition can I use to only have a certain forum shown on a new .php page.
cellarius
06-08-2011, 03:49 AM
You'd need much more than a simple variable. You basically need the code to get all the forum data from database.
KW802
06-08-2011, 04:36 PM
That is half the solution.
The problem then would be the second set of "default" meta tags also served up. To combat this I created a template which copies headinclude minus all the meta info, which is placed into the page templates.
This is the first time I have pulled out vb4 since the "not ready for prime time" release. Luckily after my 3rd attempt to locate my old test backups, I finally found them :).
I find myself in the same situation with trying to override a few of the default meta tags as well. Would've been good if there was a hook in headinclude for that purpose.
Lynne
06-08-2011, 05:26 PM
I find myself in the same situation with trying to override a few of the default meta tags as well. Would've been good if there was a hook in headinclude for that purpose.
There is no reason you cannot write a plugin that changes a meta tag for a page. As long as you are able to write a valid condition, you should be able to change it.
KW802
06-10-2011, 04:45 PM
There is no reason you cannot write a plugin that changes a meta tag for a page. As long as you are able to write a valid condition, you should be able to change it.
Lynne, would you mind giving an example of dynamically changing, for example, a pages meta tag (eg: description)? For example, using the code in the first post of this thread, if I was to generate a random value every time the page loads then how would I go about using that dynamic random value as the page meta description?
I can see that I can the style_fetch hook & a few other locations to have a constant meta tag override but I'm not seeing how to get a dynamic one in there for a custom page. :o
Thanks
Lynne
06-10-2011, 04:56 PM
Just add this to your test.php page:
$vbulletin->options['description'] = "This is a test";
That will set the description for that page.
KW802
06-10-2011, 05:08 PM
Just add this to your test.php page:
$vbulletin->options['description'] = "This is a test";That will set the description for that page.
Hhhhhmm.... was one of the first things I tried but was still getting the generic vB description out of the ACP. I'll try again using a more simplistic page tonight. :o
scubasteve3
06-11-2011, 12:22 AM
For some reason all of my text goes above the template, above the template header. I am putting my coding after:
// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
$navbits = construct_navbits(array('' => 'Test Page'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'This is a Test Page';
Lynne
06-11-2011, 02:13 AM
You should have no echo statements in your coding or it will go above the template header. All output in your page should be assigned to a variable, that variable registered for use in a template, and then the variable put in the template where you want your output to show.
NgocTam
06-15-2011, 01:39 PM
how to support php
CouponWCents
06-16-2011, 02:57 PM
I know how to create a template but how do you "create a new file"?
Lynne
06-16-2011, 03:12 PM
I know how to create a template but how do you "create a new file"?
Use a plain text editor such as notepad or bbedit and create a file and save it as xxxx.php Then upload it to your site.
CouponWCents
06-16-2011, 03:20 PM
Ok, yay! I got that. What I am trying to do is link an amazon store to a page. I have uploaded your code in the OP to the ftp and created a template. I guess what I am having trouble with is linking my amazon store to that template. Does that make sense?
Lynne
06-16-2011, 03:29 PM
Then in your template, using proper html, link to the store.
CouponWCents
06-16-2011, 03:31 PM
This is what I put but when I type in www.mysite.com/amazon.php, it is just a blank page
{vb:stylevar htmldoctype}
<html xmlns="<iframe src="http://astore.amazon.com/coupo002-20" width="90%" height="4000" frameborder="0" scrolling="no"></iframe>"{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="amazon.php">
<h1>{vb:raw pagetitle}</h1>
</div>
<h2 class="blockhead">amazon</h2>
<div class="blockbody">
<div class="blockrow">
Text
</div>
</div>
{vb:raw footer}
</body>
</html>
Lynne
06-16-2011, 03:46 PM
This is what I put but when I type in www.mysite.com/amazon.php (http://www.mysite.com/amazon.php), it is just a blank page
Perhaps you are using a style that does not have that template included in it?
CouponWCents
06-16-2011, 04:21 PM
I created a template named Amazon under my style and added the code above into it.
Lynne
06-16-2011, 05:28 PM
I created a template named Amazon under my style and added the code above into it.
Then in your php file, you had better be calling the *exact* same template. Not "amazon", but "Amazon".
CouponWCents
06-16-2011, 09:09 PM
I finally got it! Thanks so much Lynne!
cellarius
06-17-2011, 11:17 AM
Lynne, may I make a suggestion, if you don't mind? Maybe it would be a good thing to add a big bold note in first post about the case sensivity. That seems to get people in trouble fairly regularly. (or have I missed that note? just took a quick look)
Lynne
06-17-2011, 04:49 PM
Lynne, may I make a suggestion, if you don't mind? Maybe it would be a good thing to add a big bold note in first post about the case sensivity. That seems to get people in trouble fairly regularly. (or have I missed that note? just took a quick look)
I think you are right. I tried to do it by just using colors to show it is the same, but I think I should be a bit more, um, blunt! If they don't see it now, well..... :/
GaRanT
06-18-2011, 12:06 PM
How do I delete a just created 'test' template?
Thank you
HMBeaty
06-18-2011, 12:30 PM
Go to your template you just created in Styles & Templates and revert that template
Mark4865
06-25-2011, 10:37 AM
Hello Lynne,
We renamed index.php to oldindex.php and named our custom page index.php as instructed, worked perfectly and looks great, thanks for all the help on this. One issue, when someone logs in they are then taken back to the same new index.php custom page and not the standard content.php page they used to be taken to with the old index.php file.
How do we fix this please.
thanks in advance for the help
Lynne
06-25-2011, 03:29 PM
Hello Lynne,
We renamed index.php to oldindex.php and named our custom page index.php as instructed, worked perfectly and looks great, thanks for all the help on this. One issue, when someone logs in they are then taken back to the same new index.php custom page and not the standard content.php page they used to be taken to with the old index.php file.
How do we fix this please.
thanks in advance for the help
You will have to either modify the code or write a plugin to modify the code. I know people have asked about how to redirect to another page after login before, so try a search in the forums and you should hopefully find the code posted.
Bandit8007
06-25-2011, 04:09 PM
this was very helpfull :)
but i find it myself tricky to show this on mainpage
you guys can help me on how to show test.php on main page below navbar?
because it will be a tiny php file.....
i also did read up Lynne his link to it.... but that making me more confused how to do this...
a little hand would be very apprciated :)
thank you..
Lynne
06-25-2011, 04:42 PM
This is an article about how to create a whole page, not how to create a little bit of text to show on existing pages.
Bandit8007
06-25-2011, 05:13 PM
its is a page m8!
i dint say its txt though.....
Mark4865
06-25-2011, 06:11 PM
You will have to either modify the code or write a plugin to modify the code. I know people have asked about how to redirect to another page after login before, so try a search in the forums and you should hopefully find the code posted.
Thanks Lynne, appreciate the feedback.
I will try and find a coder to take a look at this for me
Bandit8007
06-26-2011, 08:13 AM
well ive fixed it on how to show the page on main page..:)
but im wonder how i can add the collapse button to it..
anyone has an idea on how to adcive that?
gracias :)
cellarius
06-26-2011, 01:58 PM
When you add the result of this tutorial to another page, you end up with invalid source code.
Regarding the collapse button: Just do a search. I did a tutorial for vB4 on this.
HMBeaty
06-26-2011, 02:01 PM
Just do a search. I did a tutorial for vB4 on this.
Or just check your profile under your "Articles" section lol ;)
LordEd
06-29-2011, 10:26 AM
Will this actually work for the CMS aswell?
I have added a dropdown box to my menu, but using static pages bugs me off a little as when I first make it, I end up using html to show things properly. But editing the static page afterwards, make it all wonky.
cellarius
06-29-2011, 10:34 AM
Will this actually work for the CMS aswell?
No.
LordEd
06-29-2011, 10:50 AM
No.
Meh, there seems to be a distinct lack of good articles about modding the CMS. So far I've managed to add buttons, and dropdowns to the navbar, but as I do that other problems arises, like when I go to edit a static page which one of the drop down items links to it basicly removes the html code I've added, replacing it with some stuff i really dont know what is.
Like <br> turning into <br>
Thanks for the answer tho, I was actually going to try it and see how it ended up, probably saved me quite a bit of cursing :) As a total sidenote, any idea where I could find some good information about modding the CMS?
cellarius
06-29-2011, 12:02 PM
If it exists, it would be on vbulletin.org. I'm afraid there's not much yet, tho, as you have noted.
radiofranky
06-30-2011, 07:24 PM
after creating the external page. What happens if i want to list latest 5 threads from each of my forums?
thanks
cellarius
07-01-2011, 03:41 AM
You add the code for that, but that's clearly not part of this tutorial and you should create your own thread for that. Also, you seem to be not quite sure what version of vB you are using (https://vborg.vbsupport.ru/showpost.php?p=2215294&postcount=1331)?
rtyagis
07-03-2011, 05:32 PM
I am creating a TEST page (with Test.php code in the first page) in my sub domain (faqs.policywala.com).
Link to my TEST page is - faqs.policywala.com/TEST.PHP
Getting error -
Warning: require_once(./global.php) [function.require-once]: failed to open stream: No such file or directory in /home/policywa/public_html/faqs/TEST.PHP on line 31
Fatal error: require_once() [function.require]: Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/policywa/public_html/faqs/TEST.PHP on line 31
Path to my forum - /home/policywa/public_html/forum
Please help what am I doing wrong? :confused:
flbutterflyz
07-04-2011, 01:13 AM
This tutorial worked perfectly for me. Thanks. :)
kevin.kool
07-04-2011, 07:05 AM
Thank you for this perfect article.
Just 1 question, how can i parse special characters in username? My members using some special char like ®... in their usernames, it doesn't showing up correctly when output.
mohammad6006
07-06-2011, 09:39 AM
i create a page with this learning
now how can i change this page to a product?
Lynne
07-06-2011, 10:51 PM
i create a page with this learning
now how can i change this page to a product?
You cannot includes files in a product xml file. You need to include them separately. And then to include the templates, you need to be in debug mode (there is an article about this) and then add the template to the product.
scubasteve3
07-11-2011, 03:21 AM
You should have no echo statements in your coding or it will go above the template header. All output in your page should be assigned to a variable, that variable registered for use in a template, and then the variable put in the template where you want your output to show.
Sorry, I am not a coder and am still trying to figure out vbulletin.
So I went into my PHP code and replaced the echo with:
$test1 = "..."
I then tested it by adding echo "$test1" and that worked.
So then I tried adding this variable to the template but this is where I am having no luck. Here is what I have in the template:
{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>
<h1> Test 1 </h1>
{vb:raw test1};
{vb:raw footer}
</body>
</html>
I'm not sure if I got this wrong
Adrian Schneider
07-11-2011, 04:29 AM
You need to pass it to the template.
Add this before the print_output($templater->render()); line:
$templater->register('test1', $test1);
scubasteve3
07-11-2011, 05:08 AM
You need to pass it to the template.
Add this before the print_output($templater->render()); line:
$templater->register('test1', $test1);
Ah, great that worked somewhat. I think maybe I'm using the wrong command. Basically I am trying to pull out threads from the forum and put the links onto an external page. Here is my PHP Code:
<?
//print Today's threads
$query = "SELECT * from vbthread where dateline >". $one_day_ago . " AND dateline <" . $today . " AND FORUMID in (2,4,6)";
$result = mysql_query($query . " ORDER BY (views+votetotal) DESC");
//print it
while ($row = mysql_fetch_assoc($result)) {
$test1 = "<a href='showthread.php?". $row["threadid"] . "'>". $row["title"] . " " . $row['postusername'] . " " . $row['votetotal']/$row['votenum'] . " avg score " . "|" . $row['votetotal'] . " votetotal" . " + " . $row['views'] . " views " . " = " . ($row['votetotal']+$row['views']) . "</a><br/>";
I added your $templater code to and that worked but it only shows the very last thread not all of the threads. I think I need to be using a different code in the template other than {vb:raw variable}?
Also if I want to then add another variable I can just do the same thing? Add another line
$templater->register('test2', $test2);[/QUOTE]
and add the vb code in the template?
cellarius
07-11-2011, 05:33 AM
Yes, you can do that for as many variables as you like.
Regarding your problem that only the last line is shown: In your while loop, you're overwriting your $test1 variable with every single loop, so only the result of the last one is returned in the end. You need not use $test1 = "whatever", but $test .= "whatever". This will not overwrite the existing value of the variable, but preserve the old value and add the new value at the end of the string.
scubasteve3
07-11-2011, 01:46 PM
Yes, you can do that for as many variables as you like.
Regarding your problem that only the last line is shown: In your while loop, you're overwriting your $test1 variable with every single loop, so only the result of the last one is returned in the end. You need not use $test1 = "whatever", but $test .= "whatever". This will not overwrite the existing value of the variable, but preserve the old value and add the new value at the end of the string.
Awesome! That works great!
One last problem I have. As I am trying to pull threads from X days ago, for some reason the date seems to be one day off. Here is what I have defined for x days ago:
$today = strtotime("now");
$one_day_ago = strtotime("-1 day");
$two_days_ago = strtotime("-2 day");
$three_days_ago = strtotime("-3 day");
$four_days_ago = strtotime("-4 day");
$five_days_ago = strtotime("-5 day");
$six_days_ago = strtotime("-6 day");
$seven_days_ago = strtotime("-7 day");
$eight_days_ago = strtotime("-8 day");
$nine_days_ago = strtotime("-9 day");
$ten_days_ago = strtotime("-10 day");
Its showing $today values as yesterdays threads instead of today's...seems like all of them are off by one day. I think it is because it is showing the threads that were posted exactly 24 hours, 48 hours, 72 hours, etc from the time the page is loaded. Is there a way to change that to just any threads there were posted on X Date regardless of the time.
cellarius
07-11-2011, 04:50 PM
You really need to open your own thread for this - this has nothing to do with this tutorial.
thunderclap82
07-13-2011, 02:35 AM
I've followed this tutorial to a 'T' (as far as I can tell) yet the php file I'm trying to call (a newsletter form submission) won't load within the template.
I created newssubscription.php and put it in my forum folder.
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'newslettersubscription');
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('newsletter_subscription',
);
// 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('' => 'Newsletter Subscription'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'Newsletter Subscription';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('newsletter_subscription');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('subscribe_newsletter', $subscribe_newsletter);
print_output($templater->render());
?>
I then created a template called newsletter_subscription.
{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>
<center><h2 class="blockhead">Newsletter Subscription</h2></center>
<div class="blockbody">
<div class="blockrow">
<center>{vb:raw subscribe_newsletter}</center>
</div>
</div>
{vb:raw footer}
</body>
</html>
Finally I created a vBulletin, global_start plug-in called subscribe_newsletter that is active.
ob_start();
include('/home/fpaul46/public_html/forum/newsletter_form/form.php');
$includedphp = ob_get_contents();
ob_end_clean();
I've checked and rechecked and everything seems to be entered correctly. Any thoughts on what's happening? What am I missing that is preventing this from working?
Lynne
07-13-2011, 02:51 AM
There are no plugins in the test.php page. You need to put the php into the test.php page. Plugins are for modifying files you don't want to actually modify. When you create your own php page, you need to put all php in there because they don't use plugins.
scubasteve3
07-13-2011, 04:39 AM
You really need to open your own thread for this - this has nothing to do with this tutorial.
You're right. Sorry about that. Figured it out.
On a side note, here is something related to this. So I was able to add a new page with the template. Looks great except one thing. There is some extra space on the top of the page so now my logo and login is moved down and there is about a 1/2" gap of nothing from the top. This is only on the new external php page I created. All my other pages look fine. Any suggestions?
cellarius
07-13-2011, 05:30 AM
That's either something in the PHP-Code or in the template you created, or some stray css. Without knowing the code and/or seeing the page that's just guesswork.
Lynne
07-13-2011, 03:43 PM
You're right. Sorry about that. Figured it out.
On a side note, here is something related to this. So I was able to add a new page with the template. Looks great except one thing. There is some extra space on the top of the page so now my logo and login is moved down and there is about a 1/2" gap of nothing from the top. This is only on the new external php page I created. All my other pages look fine. Any suggestions?
You would really need to post a link to the page in order for us to see what is going on.
thunderclap82
07-14-2011, 06:15 PM
I got my vB page working. It's a newsletter subscription form, real simple. A user enters an email address, enter the security code and that's it. Problem is vB bounces back with
"Your submission could not be processed because a security token was missing."
If I turn off CSRF_PROTECTION to FALSE the problem goes away, but I'm leery of disabling anything that is titled PROTECTION.
I found some posts saying that I should add
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
to my template. That doesn't seem to fix the problem though. Any thoughts?
(If this should be a new thread then I apologize for doing it here. Feel free to move if necessary.)
Lynne
07-14-2011, 08:50 PM
I got my vB page working. It's a newsletter subscription form, real simple. A user enters an email address, enter the security code and that's it. Problem is vB bounces back with
"Your submission could not be processed because a security token was missing."
If I turn off CSRF_PROTECTION to FALSE the problem goes away, but I'm leery of disabling anything that is titled PROTECTION.
I found some posts saying that I should add
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />to my template. That doesn't seem to fix the problem though. Any thoughts?
(If this should be a new thread then I apologize for doing it here. Feel free to move if necessary.)
In vB4 it would be this:
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
thunderclap82
07-14-2011, 08:54 PM
Does this go in the template I created or in the .php file? Because if it's the template it doesn't seem to be working. I have it in the blockrow area. Does it go somewhere else?
--------------- Added 1310697032 at 1310697032 ---------------
I've pinpointed the problem. It's value="$bbuserinfo[securitytoken]" that's causing the problem. If I change it to "guest" it works fine, but only if the user isn't logged in.
Is there a way to get this working so if it's a non-member/not logged in member or a logged in member it behaves the same way? What if I just disable CSRF_PROTECTION for this particular script?
Lynne
07-15-2011, 03:38 AM
The code I posted goes into the form which should be in the template. I took the code directly out of the header template - if you have written it correctly, it will work for a guest or member.
AusPhotography
07-15-2011, 03:46 AM
I wrote a simple product that allows you to embed Google Custom Search using this approach.
https://vborg.vbsupport.ru/showthread.php?t=266449
It is really just a page shell + tab, feel free to grab the code as you need.
Kym
thunderclap82
07-15-2011, 02:00 PM
The code I posted goes into the form which should be in the template. I took the code directly out of the header template - if you have written it correctly, it will work for a guest or member.
Well, I followed your code exactly so I have a feeling it's because it's calling another php file.
I wrote a simple product that allows you to embed Google Custom Search using this approach.
https://vborg.vbsupport.ru/showthread.php?t=266449
It is really just a page shell + tab, feel free to grab the code as you need.
I'll take a look. Thanks!
If I can't get it working I'll just go with turning off the protection. It works for both then, and the form has two security measures of it's own so I think it's fairly safe.
Well, I followed your code exactly so I have a feeling it's because it's calling another php file.
It didn't work because your form isn't in a template. You might be able to do it by editing your form code php file and adding:
<input type="hidden" name="securitytoken" value="<?php global $vbulletin; echo $vbulletin->userinfo['securitytoken']; ?>" />
This would be easier if, as someone pointed out in the other thread, you were to put your form in a template, but that would mean making more changes to the form code.
thunderclap82
07-15-2011, 05:34 PM
Thanks for the suggestion, but I get:
Parse error: syntax error, unexpected '"'
I tried it in the code starting the form, as well as by the submit button.
That could be because I'm an idiot and I did it to you again - I got the tags backward. I fixed it above if you want to try again. (This time I actually tried it myself).
thunderclap82
07-16-2011, 04:17 AM
That could be because I'm an idiot and I did it to you again - I got the tags backward. I fixed it above if you want to try again. (This time I actually tried it myself).
That did the trick! Thank you so much for your help!
EquinoxWorld
07-18-2011, 01:44 AM
Hello Lynne, sorry if this is off topic but is there any way anyone can point me in the right direction to be able to add options to these custom pages that we can control through the admin panel? I can't seem to find any documentation on that. I know how to add the setting group via debug mode through admin panel but that's as for as I go, I don't know how to implement them into my script. Any help or guidance to implement that into my custom pages would be very helpful. Thanks for your time everyone.
Lynne
07-18-2011, 02:41 AM
Hello Lynne, sorry if this is off topic but is there any way anyone can point me in the right direction to be able to add options to these custom pages that we can control through the admin panel? I can't seem to find any documentation on that. I know how to add the setting group via debug mode through admin panel but that's as for as I go, I don't know how to implement them into my script. Any help or guidance to implement that into my custom pages would be very helpful. Thanks for your time everyone.
Add options? That is all via php code. This isn't a tutorial about php. You'll need to post your own thread with a statement about what you want to do and with all your code in order for someone to help you out.
River J
07-18-2011, 02:45 AM
This is an updated article on how to create your own vbulletin powered page. It's only for use with vB4.
This is NOT my work. I'm posting this from another thread where vB Style (https://vborg.vbsupport.ru/member.php?u=215438) took the time to write this out. And his work is based on the article by Gary King (https://vborg.vbsupport.ru/member.php?u=5183) here - How to create your own vBulletin-powered page! (uses vB templates) (https://vborg.vbsupport.ru/showthread.php?t=62164)
Instructions to Create your Own Page:
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!!!):
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'test');
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('TEST',
);
// 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('' => 'Test Page'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'My Page Title';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('TEST');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());
?> - Be sure to change 'TEST' to the actual template name (WARNING: the template name is CASE SENSITIVE!!!), and change 'test' to the filename or a unique name for the page. Also, change 'Test Page' and 'My Page Title' to whatever you want to show in the navbits, such as 'Viewing Member Profile' (just an example).
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:
{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>.
Instructions to Add your Page to the Who's Online List (WOL):
Create two plugins using the following hooks. Replace mypage and similar with your information.
1. hook location - online_location_process:
switch ($filename)
{
case 'test.php':
$userinfo['activity'] = 'mypage';
break;
// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.
}.
2. hook location online_location_unknown:
switch ($userinfo['activity'])
{
case 'mypage':
$userinfo['where'] = '<a href="test.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.
}.
The colored part in the code above shows what you need to change in the plugins (both reds should be the same and both blues should be the same, whereas green can be whatever you want).
Please see this article for help with rendering templates - [vB4] Rendering templates and registering variables - a short guide (https://vborg.vbsupport.ru/showthread.php?t=228078)
how would you put forums in there if you wanted them not to be visible on the main forum homepage but you wanted to show them there?
Lynne
07-18-2011, 02:50 AM
You would put the code to put the forums in there. You need to be able to do some php if you want to create a php page. The code for forums is in the forum.php page. If you don't want forums to show on the main page, set the display value to 0.
River J
07-18-2011, 03:12 AM
You would put the code to put the forums in there. You need to be able to do some php if you want to create a php page. The code for forums is in the forum.php page. If you don't want forums to show on the main page, set the display value to 0.
Exactly what is the code only for the forums to show just for a section like this http://puu.sh/3r2k
in the forum.php? Also, where would I put that code in the test.php file above?
Lynne
07-18-2011, 03:27 AM
Exactly what is the code only for the forums to show just for a section like this http://puu.sh/3r2k
in the forum.php? Also, where would I put that code in the test.php file above?
That is really not something for this tutorial and you should post about what you want with a link to your forum and images of what you want in your own thread.
River J
07-18-2011, 06:07 AM
That is really not something for this tutorial and you should post about what you want with a link to your forum and images of what you want in your own thread.
alright i made a thread in general forums for vb4
ngphuc2k
07-18-2011, 06:23 PM
Thanks you very much
After searching this thread for keyword: navbar - I found I'm having the same issue as this person:
https://vborg.vbsupport.ru/showpost.php?p=2212685&postcount=585
The directions are excellent - I've encountered no errors.
But, I must be doing something wrong, because I can't get the page to appear in the navbar :confused:
I can pull it up -directly- just fine, by typing www.mydomain.com/test.php
Any help appreciated.
Thank you
Lynne
07-20-2011, 01:55 AM
After searching this thread for keyword: navbar - I found I'm having the same issue as this person:
https://vborg.vbsupport.ru/showpost.php?p=2212685&postcount=585
The directions are excellent - I've encountered no errors.
But, I must be doing something wrong, because I can't get the page to appear in the navbar :confused:
I can pull it up -directly- just fine, by typing www.mydomain.com/ (http://www.mydomain.com/)test.php
Any help appreciated.
Thank you
This article does not create a page that has it's own navtab. You need to add that separately.
MyLibary
07-27-2011, 02:50 PM
how do i close this page for only registered members?
Please help me.
Kind regard,
Marco.
HMBeaty
07-27-2011, 02:56 PM
how do i close this page for only registered members?
Please help me.
Kind regard,
Marco.
Add this to your php file:
if (!$vbulletin->userinfo['userid'])
{
print_no_permission();
}
MyLibary
07-27-2011, 02:57 PM
Add this to your php file:
if (!$vbulletin->userinfo['userid'])
{
print_no_permission();
}
Where to put it?
I mean exactly place in the php page.
HMBeaty
07-27-2011, 03:00 PM
Where to put it?
After:
// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
MyLibary
07-27-2011, 03:05 PM
Thanks alot my dear friend :)
ilanyon
07-30-2011, 07:10 AM
Hi all,
Great guide and created a number of pages for my site... However, when using IE8 there appears to be a problem with the navbar, but only for the pages that I have created using this tutorial... All others the navbar is fine...
(Unfortunately a lot of the government departments in Australia are still using IE8 - so this effects a lot of my users)
Attached are a couple of images...the first with the navbar display issues and the second of how they should be...
Funny thing is that this is only for 'guests' and once logged in as a registered user, it's all good...(as per the second screen shot)
Lynne - need your help please...issues only seem to be present when using pages created with your 'how to'...
site: www.aiyj.org
Any suggestions to fix this would be very much appreciated!
Cheers,
Ian
Lynne
07-31-2011, 05:11 PM
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?
ilanyon
07-31-2011, 10:45 PM
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).
<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&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/options.php?dogroup=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
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/screencpnav_group2.png
The first one (General Settings take you to http://xxxxxxxxx.xxxx/admincp/options.php?dogroup=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
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
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
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
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
;) (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:
{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&brand=embed&cid=8959895&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&brand=embed&cid=8959895&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>
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
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
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
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
...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
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
132056
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
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 (https://vborg.vbsupport.ru/showthread.php?t=228078)
$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
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?
<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
Anyone have an idea why I can't get this script warking with this page but can on main forum section?
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:
<?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)
{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
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
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
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
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.
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 1317740356 at 1317740356 ---------------
I want a navtab that displays a copy of my forumhome but without it's contents.
--------------- Added 1317748066 at 1317748066 ---------------
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
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
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
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
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
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.
sharpkiller
10-11-2011, 02:20 PM
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.
There's a couple of lingering 404 errors floating around as a result of some images being moved around or deleted that were originally stored on the local server (mostly in users signatures and posts, there's a few improperly formatted [img] tags floating around that are attempting to find images on the local server instead of external servers, etc).
So a lot of it is out of my hands, but it still records the hit on the php 404 page on missing images and vBulletin displays it on the Who's Online. There's always 4 or 5 people who are supposedly viewing a file doesn't exist. I'd rather keep that off the WOL.
On top of that, vBulletin is using the missing file name and not 404 page file name. On the Who's Online it'll say something like:
User1 Unknown Location
/images/1234.png
User2 Unknown Location
/signatures/abcd.png
So I can't simply create a case for 404.php to catch the 404 errors to display a message similar to the one's you suggested.
Digital Jedi
10-12-2011, 04:35 AM
I don't know if removing it is possible, at least, within the scope of the article. I was under the impression, though, that you could use a directory name for an online location. I might be wrong on that, but I thought I'd done that on my old board. Maybe someone can back me up.
satlazone
10-12-2011, 09:27 PM
I am having a little problem with encoding.
All goes fine but when I replace "My Page Title" with some Hebrew words I receive the following characters instead: ���� ����� ���� ���
UTF-8 encoding.
Raeven
10-13-2011, 12:02 PM
For some reason the 2 Pages I made a few weeks ago (under 4.1.5) don't work anymore under 4.1.7. The pages are now blank (also no source code in them).
//edit: Found the problem, for some reason, the update deleted the 2 Templates .......... (they are just gone, no where to find)
sivaganeshk
10-14-2011, 06:16 PM
what is the format of Template ??
I wanted to create about.php page with my template. The template style I use is White
If it is possible, can anyone upload files as an attachment ??
Digital Jedi
10-15-2011, 09:20 AM
what is the format of Template ??
I wanted to create about.php page with my template. The template style I use is White
If it is possible, can anyone upload files as an attachment ??
I'm not sure what you're asking. Is "White" the name of your style? If so, you would add the template to that style. The template has to be added to each style you plan on using.
sivaganeshk
10-15-2011, 11:23 AM
Ya white is the name of the style. Can u post an attachment of the two files ?
Digital Jedi
10-16-2011, 05:55 AM
An attachment of what two files? I don't understand what you're asking for.
sivaganeshk
10-16-2011, 06:03 AM
I copied the test php file and uploaded in the server. It is showing blank.
Sorry that I cant understand how to do this simple one.. :(
Raeven
10-16-2011, 08:36 PM
I guess you mean the Template? The Template is not a "file" directly.
You make your Template in your "Admin Control Panel" in your Forum (under Template and Styles). There you just make a new Template, give it the Name you want to have and it should work ;).
satlazone
10-17-2011, 06:16 PM
I am having a little problem with encoding.
All goes fine but when I replace "My Page Title" with some Hebrew words I receive the following characters instead: ���� ����� ���� ���
UTF-8 encoding.
any attention? thanks.
Lynne
10-18-2011, 04:29 PM
You are entering Hebrew words into the template and ending up with those characters? How about a link to your page.
satlazone
10-18-2011, 07:36 PM
Adding Hebrew words into my template will not end up with those characters.
Adding Hebrew words into the php file where I have to replace "My Page Title" with my own title description will end up with those characters.
link (http://www.satla-zone.co.il/forums/rules/)
UTF-8 encoding.
Do you mean you have your site configured for UTF-8 encoding?
Someone was having a similar problem recently, and the solution was to call utf8_decode() on the string.
sivaganeshk
10-19-2011, 02:21 PM
A sample video in creating php page - http://www.youtube.com/watch?v=jK3738agsg4
satlazone
10-20-2011, 02:44 PM
Do you mean you have your site configured for UTF-8 encoding?
Someone was having a similar problem recently, and the solution was to call utf8_decode() on the string.
I did try what you have said, characters where changed to question marks instead.
I have changed this line
$templater->register('pagetitle', $pagetitle);
to
$templater->register('pagetitle', utf8_decode($pagetitle));
Any other suggestions? :/
Any other suggestions? :/
OK, well, it's clearly some kind of encoding issue. I found this in the php manual: http://www.php.net/manual/en/language.types.string.php
Given that PHP does not dictate a specific encoding for strings, one might wonder how string literals are encoded. For instance, is the string "?" equivalent to "\xE1" (ISO-8859-1), "\xC3\xA1" (UTF-8, C form), "\x61\xCC\x81" (UTF-8, D form) or any other possible representation? The answer is that string will be encoded in whatever fashion it is encoded in the script file.
So do you happen to know how your script files are encoded (like what your OS or editor default encoding is, I guess). And how do you have your vb configured?
Or I suppose we could take another guess and try utf8_encode(). :)
RetroDreams
10-20-2011, 09:46 PM
Very helpful... thanks a million!
dany_danay
10-23-2011, 02:26 PM
The page is blank... www.foro-ptc.com/test.php
sivaganeshk
10-23-2011, 02:34 PM
@dany : check this video http://www.youtube.com/watch?v=jK3738agsg4
hope it helps you.
pjkcards
10-25-2011, 08:30 PM
How can I not show the footer advertisement (in AdminCP>Advertising>Manage Ads) on this custom vB page? Thanks!
Lynne
10-25-2011, 09:25 PM
How can I not show the footer advertisement (in AdminCP>Advertising>Manage Ads) on this custom vB page? Thanks!
You would need to put a condition around your footer add to not show it on this page.
pjkcards
10-27-2011, 04:36 AM
You would need to put a condition around your footer add to not show it on this page.
Thanks. So the page.php has this:
define('THIS_SCRIPT', 'thankyou');
So I setup this conditional:
<vb:if condition="THIS_SCRIPT != 'thankyou'">
the ad stuff here
</vb:if>
And when I visit page.php, the ad stuff still shows up. What am I missing here? Thanks
sivaganeshk
10-27-2011, 05:30 AM
(try this)
<vb:if condition="THIS_SCRIPT != 'page'">
the ad stuff here
</vb:if>
----------------------------------------------------------------------------------------------------------------------
did u put the code in Manage advertisement right?
Thanks. So the page.php has this:
define('THIS_SCRIPT', 'thankyou');
So I setup this conditional:
<vb:if condition="THIS_SCRIPT != 'thankyou'">
the ad stuff here
</vb:if>
And when I visit page.php, the ad stuff still shows up. What am I missing here? Thanks
That all looks right to me, you shouldn't be seeing the ad stuff on that page. Where did you put the define() line? It needs to be before the require_once('global.php') line.
pjkcards
10-27-2011, 06:55 PM
sivaganeshk: I tried what you suggested and it didn't work.
kh99: Yep, it is before the require_once('global.php'). Here is the code for the page:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'thankyou');
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('custom_thankyou',
);
// 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('' => 'Order Complete'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'Order Complete';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('custom_thankyou');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());
?>
I put the conditions in the AdminCP > Advertising > Manage Ads, and in the ad HTML box. Here is the text in the ad HTML box
<vb:if condition="THIS_SCRIPT != 'thankyou'">
<center>
script to display advert
</center>
</vb:if>
Any ideas as to why this isn't working? I'm stumped.
I put the conditions in the AdminCP > Advertising > Manage Ads, and in the ad HTML box.
Oh, that's probably it - you can only use conditions in a template. You'd need to find the ad variable in the footer template and put the condition tags around that instead.
Edit: this was wrong - you *can* use conditions in the ad code, as it says on the ad editing page.
pjkcards
11-02-2011, 06:56 AM
Oh, that's probably it - you can only use conditions in a template. You'd need to find the ad variable in the footer template and put the condition tags around that instead.
Edit: this was wrong - you *can* use conditions in the ad code, as it says on the ad editing page.
I thought I could, but I don't know of any other reason for this not working. If you have any other ideas, please let me know. Thanks.
Lynne
11-02-2011, 03:59 PM
I added an ad to my test site with that condition around it (only my test page has THIS_SCRIPT set to test) and it worked just fine. Do you have any other conditions set for the ad?
Krosi1906
11-06-2011, 02:11 PM
edit
---
for delete
---
rokslide
11-19-2011, 12:17 PM
OK, this may be a dumb question, but here goes:
I followed the instructions of creating a new tab. Worked perfectly. Then, I followed these directions to create a new page in vBulletin and it worked perfectly. Now, I would like to incorporate all of my existing html pages (outside of vBulletin) I have created for my website within vBulletin. How do I link up the new page I created within Vbulletin to my existing pages? I want all of my pages to be within vBulletin so thatall of the formatting remains exactly the same. Do I copy and paste all of the html into the new template I just created, or can you simply direct the new template to point at the existing html file? Hope I didn't confuse everyone.
Thanks,
Lynne
11-19-2011, 03:02 PM
You will need to copy your page html into a new template that is called in the php page you make.
cellarius
11-21-2011, 09:39 PM
And make sure you have valid html afterwards - you need to copy just stuff between the body tags, not the head etc., or you will end up with doubles.
Shadow666
12-02-2011, 03:54 AM
Hi,
I have this:
test.php
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'test');
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('TEST',
);
// 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('' => 'Test Page'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'My Page Title';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('TEST');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('includebody', $includebody);
print_output($templater->render());
?>
template TEST
{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>
{vb:raw includebody}
{vb:raw footer}
</body>
</html>
Plugin global_start
if (THIS_SCRIPT == 'test')
{
ob_start();
include('./test/game/start.php');
$includebody = ob_get_contents();
ob_end_clean();
}
I want to upgrade the plugin from global_start to global_bootstrap_init_start, as global_start has been deprecated since 4.0.2.
When I changed the global_start to global_bootstrap_init_start the php file that was been called no longer displayed.
Can anyone help with this please.
Hi,
I have this:....
I think your problem is that global_bootstrap_init_start code is called inside a function, so your $includebody variable is not global. You could fix it by adding a "global $includebody" statement.
But if that plugin is only being executed when your custom script is running, you could also just move the plugin code to in to your test.php script. It will work exactly the same - there's no reason that code has to be at the global_start hook, it's just that that's a good place to put it if you want to include an external file when you're not writing a custom php script.
Shadow666
12-02-2011, 07:53 PM
I think your problem is that global_bootstrap_init_start code is called inside a function, so your $includebody variable is not global. You could fix it by adding a "global $includebody" statement.
But if that plugin is only being executed when your custom script is running, you could also just move the plugin code to in to your test.php script. It will work exactly the same - there's no reason that code has to be at the global_start hook, it's just that that's a good place to put it if you want to include an external file when you're not writing a custom php script.
Thank you that fixed it. :)
satlazone
12-04-2011, 11:34 AM
OK, well, it's clearly some kind of encoding issue. I found this in the php manual: http://www.php.net/manual/en/language.types.string.php
So do you happen to know how your script files are encoded (like what your OS or editor default encoding is, I guess). And how do you have your vb configured?
Or I suppose we could take another guess and try utf8_encode(). :)
I did try to use utf8_encode
It did change the characters but it's still not written in Hebrew.
example: ???? ????? ???? ???
I didn't understand how I can solve it via the link you have provided.
Do you have any other suggestions?
Rocket2009
12-08-2011, 12:49 AM
Over the past day I have used this tutorial and thread and others to create pages that link to menu options and it is working exactly as expected.
Now I want to embed a knowledge base tool (KBPublisher) within a vb4 page so it has the vb menus over it and vbstyles. I did this in vb3 and am now working the vb4 issues with this tutorial.
I am at the 98% point. The kb tool integrates and works well all with the vb menus. The problem is that it doesn't recognize the user login information and I am having trouble figuring out how to pass the information through the rendering process. All of my test cases recognized the user including the php file if called directly rather than through the kb tool, including highlighting the added buttons. So most of the information is getting through.
I am hoping to get help on how to pass the userinfo through the rendering process so I can display the kb system within this vbpage. It looks pretty awesome, but just keeps asking my sign-up even though I am logged in and any page I shift to recognizes me.
My php code is pretty vanilla and is called knowledgebase.php:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'knowledgebase');
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('KBPublisher',
);
// 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 ('/home/touring7/public_html/');
require_once('./global.php');
// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
$navbits = construct_navbits(array('' => 'Test Page'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'My Page Title';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('KBPublisher');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
// $templater->register('pagetitle', $pagetitle);
print_output($templater->render());
?>
My template follows the tutorial plus uses the template provided by the KBPublisher software and is naturally called KBPublisher (my template):
{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}
<title>{meta_title}</title>
<meta http-equiv="content-type" content="text/html; charset={meta_charset}" />
<meta http-equiv="content-language" content="{meta_content_lang}" />
<meta name="keywords" content="{meta_keywords}" />
<meta name="description" content="{meta_description}" />
<meta name="robots" content="{meta_robots}" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="{common_ie_css}" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="{common_css}" />
<link rel="stylesheet" type="text/css" href="{common_view_css}" />
{style_css_links}
{rss_head_links}
<script src="{base_href}client/jscript/common.js" type="text/javascript"></script>
</head>
<body>
{vb:raw header}
{vb:raw navbar}
<div id="pagetitle">
<h1>{vb:raw pagetitle}</h1>
</div>
<h2 class="blockhead">Title</h2>
<div class="blackbody">
{content}
</div>
{vb:raw footer}
</body>
</html>
The key aspect is that the KBPublisher knowledgebase software requires a minimum of three tags in the html code of the kbpublisher system template file
{style_css_links}, {rss_head_links}, and {content}
as shown in the default kbpublisher template file shown here:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>{meta_title}</title>
<meta http-equiv="content-type" content="text/html; charset={meta_charset}" />
<meta http-equiv="content-language" content="{meta_content_lang}" />
<meta name="keywords" content="{meta_keywords}" />
<meta name="description" content="{meta_description}" />
<meta name="robots" content="{meta_robots}" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="{common_ie_css}" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="{common_css}" />
<link rel="stylesheet" type="text/css" href="{common_view_css}" />
{style_css_links}
{rss_head_links}
<script src="{base_href}client/jscript/common.js" type="text/javascript"></script>
</head>
<body>
your html here
{content}
your html here
</body>
</html>
then the KBPublisher system renders the page replacing the {tags} with the appropriate code. Obviously the {content} tag is where the KB software gets inserted (it's great).
KBPublisher is open source and I can modify the index.php file if needed. I did it for the VB3 integration but naturally I need to minimize the number of hacks to make support easy. However, inside the index.php file for KBPublisher is the following comment:
// example of adding global variable to template
// in template you should have a template tag - {global_test}
//$page->assign('global_test', '<b>test global variable</b>');
So I could potentially assign a value to 'global test' inside the index.php file for KBPublisher say and then add a {global test} tag within the template to pass a value to it. In the KB3 implementation I used this pass different HTML based upon user status.
The way the kb software works is that when I call its index.php I have already specified in a configuration file the name of the template file, in this case knowledgebase.php, which uses the vb rendering system which calls the vb template.
Everything displays just the way I want, but it keeps showing the user as not logged in. I know this is a long entry, but I wanted to be complete for the help. Plus, if we get this solved, others might like to know how to integrate a comprehensive knowledgebase tool within a vb page.
I have experimented with various incarnations of input security token but I either didn't get the format correct, the location correct, or was otherwise unsuccessful
Check your "Path to Save Cookies" setting under Settings > Options > Cookies and HTTP Header Options in the adminCP. Like it says in the comments, this must be set to / if you want the vb cookies to be sent no matter which directory your custom page is in.
Rocket2009
12-08-2011, 03:00 AM
Check your "Path to Save Cookies" setting under Settings > Options > Cookies and HTTP Header Options in the adminCP. Like it says in the comments, this must be set to / if you want the vb cookies to be sent no matter which directory your custom page is in.
Yes, at
admincp -> options -> cookies and HTTP Header Options
Path to Save Cookies is set to a ; /
I also experimented with Cookie domain selected .touringmotorgliders.org as well as the default 'blank' to my domain .touringmotorgliders.org with no difference.
Incidentally, I can put knowledgebase.php into the same directory as the forum and it doesn't make a difference. The index.php file for the kbpublisher system needs to be in its directory. I can add the global cast in that file, but it doesn't make any difference, unless I can find a way to pass the user information.
Thanks.
So I am still experimenting ...
I guess it wasn't cookies then - it was just a thought.
Rocket2009
12-08-2011, 03:46 PM
Thanks for the try:
As Lynne suggested, I tried adding:
<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
near the top of my template. When the page is rendered and I view the page source it gets implemented as:
<input type="hidden" name="securitytoken" value="guest" />
And consistent with not being properly logged in on this page I see the following in the page source.
<script type="text/javascript">
<!--
var SESSIONURL = "";
var SECURITYTOKEN = "guest";
var IMGDIR_MISC = "images/misc";
var IMGDIR_BUTTON = "images/buttons";
var vb_disable_ajax = parseInt("0", 10);
var SIMPLEVERSION = "418";
var BBURL = "http://www.touringmotorgliders.org";
var LOGGEDIN = 0 > 0 ? true : false;
var THIS_SCRIPT = "knowledgebase";
var RELPATH = "kb/knowledgebase.php";
var PATHS = {
forum : "",
cms : "",
blog : ""
};
var AJAXBASEURL = "http://www.touringmotorgliders.org/kb/";
// -->
</script>
I am still looking for that command to put into the code (index.php of KBPublisher, knowledgebase.php, or my template) to get me logged into the vBulletin system.
Lynne
12-08-2011, 04:16 PM
If it isn't recognizing you, then the global.php file isn't getting called/included correctly.
Rocket2009
12-08-2011, 05:11 PM
Yes, I agree that I am having trouble getting global.php called correctly through this rendering system.
I have tried adding
chdir ('/home/touring7/public_html/');
require_once('./global.php');
to /kb/index.php
to /kb/knowledgebase.php
and directly to the template in my style called KBPublisher (if you are following my earlier post)
and I have had no luck.
If I just load knowledgebase.php at the browser, I am logged in fine.
As you recall from earlier post, kb/index.php calls /kb/knowledgebase.php as a kb template which then calls the vB template KBPublisher. Everything displays as expected but I am not logged in.
I even tried defining a tag called {global_load} to try and insert an additional call to global.php by inserting the php code to no avail.
Two ideas:
(1) Do I need to 'register' a page such as /kb/index.php?
(2) Perhaps I could call global.php at /kb/index.php to define security tokens and etc and then pass that code via a tag to the vbulletin template via the /kb/index.php rendering system. Suggestions for what form that code should take?
Please help me get the global.php called and working correctly.
--------------- Added 1323374293 at 1323374293 ---------------
I am continuing to experiment and I might be close, if I can get some help:
In the /kb/input.php I place the following code:
$curdir = getcwd ();
chdir('/home/touring7/public_html/');
require_once('./global.php');
chdir ($curdir);
.
.
.
$page->assign('global_load',$vbulletin->userinfo['securitytoken']);
I have a tag I created in my template called {global_load} which renders the page correctly but on top of the page it prints out the security token obtained from the global call /kb/index.php. So this verifies that I can pass a global variable (security token) through the rendering process.
Can someone suggest a way I can get that rendered page to accept the security token so it will see me as logged in?
Thanks.
Easy5s.net
12-12-2011, 07:44 AM
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'premade');
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
?>
and error:
Unable to add cookies, header already sent.
File: premade.php
Line: 1
:confused:
Lynne
12-12-2011, 04:46 PM
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'premade');
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
?>
and error:
Unable to add cookies, header already sent.
File: premade.php
Line: 1
:confused:
That isn't going to work. You need to follow the tutorial.
JimxJNM
12-21-2011, 07:18 AM
This is Great man Thanks for the Lynne :D i will try this out,
Papa Bear
12-24-2011, 11:19 PM
Excellent..Works great.
Okuma Steve
12-30-2011, 03:32 AM
I am having a small problem and want to see if anyone can assist me.
I am trying to create a list with HTML and it isn't recognizing it, any ideas?
Here is a sample of what I am putting in:
<ul>
<li> item name </li>
<li> item name </li>
</ul>
I used the same code in making a new faq item and it worked fine, but not working in this form.
Link to faq item:
http://www.theoutdoorstrader.com/faq.php?faq=supporter
Link to new form:
http://www.theoutdoorstrader.com/supporter.php
HMBeaty
12-30-2011, 04:10 AM
You need to make the css for ul and li ;)
Okuma Steve
12-30-2011, 04:56 AM
You need to make the css for ul and li ;)
Could you translate that into "idiot" for me? :D
HMBeaty
12-30-2011, 05:06 AM
Hmm....I stand corrected.... Looking back on a few of my custom pages, I have them working just fine using what you have above. Do you mind posting what you have in your entire template?
--------------- Added 1325225260 at 1325225260 ---------------
Also, your php file so we can make sure everything is correct in there :)
Okuma Steve
12-30-2011, 05:37 AM
Here is my php file:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'supporter');
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('supporter',
);
// 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('' => 'Supporter Info'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'Become a Supporter!';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('supporter');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());
?>
--------------- Added 29 Dec 2011 at 22:39 ---------------
And here is my template:
(Please pardon my first grade understanding of html!)
{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">Supporter Info</h2>
<div class="blockbody">
<div class="blockrow">
<p>Become a Supporter! </p>
<br />
<font size="2"><p><b>What is a Supporter? </b></p></font>
<br />
<p>A supporter is someone who donates to the site to help keep it up and running. Currently the majority of revenue for the site is generated from the little bit of advertising we allow and donations from our users. </p>
<br />
<br />
<font size="2"><p><b>How much is it?</b> </p></font>
<br />
<p>The current cost to become a supporter: </p>
<br />
<ul>
<li><p>1 year - $15</p></li>
<br />
<li><p>2 years - $30</p></li>
<br />
<li><p>5 years - $50</p></li>
<br />
<li><p>15 years - $100</p></li>
</ul>
<br />
<br />
<font size="2"><p><b>What’s in it for me? </b></p></font>
<br />
<p>We do have additional benefits for anyone that becomes a supporter, and may add more in the future. The benefits only last as long as your subscription length, but you can re-up anytime.</p>
<br />
<p>The current upgrades are: </p>
<br />
<ul>
<li>Larger Private Message inbox! Supporter’s inboxes can hold up to 1,000 messages! </li><br />
<li>A new icon to go under your user name when you post. It looks like this: </li> <br />
<img src=http://www.theoutdoorstrader.com/images/ranks/supporter1.png width="130" height="30"/>
</ul>
<br />
<br />
<br />
<font size="2"><p><b>Sign me up!</b></p></font>
<br />
<p>If you would like to become a supporter you can click the banner below and it will take you to your “paid subscriptions” page in your profile. </p>
<br />
<p>Once there, just select a subscription length in the dropdown box and click “order.” Then it will take you to a screen where you will select your payment method. Currently the only method accepted is paypal. You do not have to have an account with paypal to use it. </p>
<br />
<p>If you would prefer to send a check or money order, you can mail it to the address listed at the bottom of this article. Please be sure to include your username with your check so we know which account to credit the donation to. </p>
<br />
<a href=http://www.theoutdoorstrader.com/payments.php > <img src=http://www.theoutdoorstrader.com/images/donate.png /> </a>
<br />
<br />
<p><b> Mailing Address for Donations:</b> </p>
<br />
<p>The Outdoors Trader
<br />PO Box 813669
<br />Smyrna, GA 30081 </p>
<br />
<p></p>
<br />
<font size="2"><p><b>What if I am already a supporter and want to donate? </b></p></font>
<br />
<p>Well, that’s awesome! We appreciate it very much! </p>
<br />
<p>If you are already a supporter and would like to donate more, you can do so by clicking the paypal link below and entering whatever amount you would like to donate. </p>
<br />
<p>Again, thank you very much! </p>
<br />
<br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="PVCDABEX7X7TA">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
</div>
{vb:raw footer}
</body>
</html>
Lynne
12-30-2011, 05:00 PM
I am having a small problem and want to see if anyone can assist me.
I am trying to create a list with HTML and it isn't recognizing it, any ideas?
Here is a sample of what I am putting in:
<ul>
<li> item name </li>
<li> item name </li>
</ul>
I used the same code in making a new faq item and it worked fine, but not working in this form.
Link to faq item:
http://www.theoutdoorstrader.com/faq.php?faq=supporter
Link to new form:
http://www.theoutdoorstrader.com/supporter.php
This has already been covered in this thread. Here's one of the posts - https://vborg.vbsupport.ru/showpost.php?p=1954467&postcount=150 You can go backwards to read the whole conversation.
Okuma Steve
12-30-2011, 07:00 PM
I think I understand now, but I still can't get it to work.
I pasted the style code into the header of my template, is that right?
Here is my current template:
{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}
<style type="text/css">
strong {font-weight:bold;}
ul.unordered li {list-style-type: disc;list-style-position:inside; display: list-item; margin-left: 2.5em; padding-left: 0;}
ul.unordered ul li {list-style-type: circle; display: list-item;margin-left: 2.5em; padding-left: 0;}
</style>
</head>
<body>
{vb:raw header}
{vb:raw navbar}
<div id="pagetitle">
<h1>{vb:raw pagetitle}</h1>
</div>
<h2 class="blockhead">Supporter Info</h2>
<div class="blockbody">
<div class="blockrow">
<p>Become a Supporter! </p>
<br />
<font size="2"><p><b>What is a Supporter? </b></p></font>
<br />
<p>A supporter is someone who donates to the site to help keep it up and running. Currently the majority of revenue for the site is generated from the little bit of advertising we allow and donations from our users. </p>
<br />
<br />
<font size="2"><p><b>How much is it?</b> </p></font>
<br />
<p>The current cost to become a supporter: </p>
<br />
<ul>
<li><li><p>1 year - $15</p></li>
<br />
<li><p>2 years - $30</p></li>
<br />
<li><p>5 years - $50</p></li>
<br />
<li><p>15 years - $100</p></li>
</ul></il>
<br />
<br />
<font size="2"><p><b>What?s in it for me? </b></p></font>
<br />
<p>We do have additional benefits for anyone that becomes a supporter, and may add more in the future. The benefits only last as long as your subscription length, but you can re-up anytime.</p>
<br />
<p>The current upgrades are: </p>
<br />
<li><ul>
<li>Larger Private Message inbox! Supporter?s inboxes can hold up to 1,000 messages! </li><br />
<li>A new icon to go under your user name when you post. It looks like this: </li> <br />
<img src=http://www.theoutdoorstrader.com/images/ranks/supporter1.png width="130" height="30"/>
</ul></li>
rabeel
12-30-2011, 07:38 PM
Looking great. But i am new and it take time for me to do this kind of experements on online forum. i guess should try on localhost.
Lynne
12-30-2011, 11:38 PM
If you copy paste some code, you need to understand what it means. "ul.unordered" means a <ul> tag of class "unordered". I would guess you did not assign a class to your <ul> tag. (I cannot get to your page to see if that is the case.)
Okuma Steve
12-31-2011, 01:20 AM
I wouldn't get anything done if I understood all of it before I did it! :D
What page can you not get to? I posted links in my earlier post and in my last post I included the HTML from my template.
Is there something else I need to link to or post here?
Lynne
12-31-2011, 01:41 AM
If you want to use that css, then:
<ul class="unordered">
You'll want to get rid of the <p> around the items in the <li> tags also.
Okuma Steve
12-31-2011, 04:04 AM
If you want to use that css, then:
<ul class="unordered">
You'll want to get rid of the <p> around the items in the <li> tags also.
Thanks! Works great now.
GossipAll
01-01-2012, 06:52 PM
How do I remove the meta description and meta keywords from the static page? It inserts the default "Home" meta descriptions and keywords on the static page.
So how do I remove this? Or add custom meta description and keywords on the static page?
Lynne
01-01-2012, 09:04 PM
Did you try just adding them into the template after the headininclude template is called?
<meta name="keywords" content="xxxx" />
<meta name="description" content="yyyy" />
and then change the condition in the headinclude template to not show those for your page:
<vb:if condition="$show['threadinfo'] OR Your Condition">
<vb:elseif condition="$show['foruminfo']" />
other stuff....
<meta name="keywords" content="{vb:raw vboptions.keywords}" />
<meta name="description" content="{vb:raw vboptions.description}" />
</vb:if>
TheSupportForum
01-04-2012, 04:52 PM
i need some help with this template using the information from 1st page
{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 class="blockbody">
<div class="blockrow">
<vb:if condition="$vboptions['policy_active']">
<ol id="forums" class="floatcontainer">
</div>
</div>
<li class="forumbit_nopost L1" id="cat1">
<div id="section1_a" class="block collapse">
<h2 class="blockhead">
<span class="forumtitle"><a href="">{vb:raw vboptions.policy_title}</a></span>
<span class="forumlastpost"></span>
<a class="collapse" id="collapse_section1" href="{vb:raw relpath}#top"><img src="{vb:stylevar imgdir_button}/collapse{vb:raw vbcollapse.collapseimg_cel_dummy_img}_40b.png" alt="{vb:rawphrase collapse_this_category}" /></a>
</h2>
<div class="forumrowdata" id="section1">
<p class="subforumdescription">{vb:raw vboptions.policy_content}</p>
</div>
</div>
<div>
<div>
<vb:else />
<div class="foruminfo td">
<img src="{vb:stylevar imgdir_button}/kural.gif" class="forumicon" id="forum_statusicon_2" alt="" />
<div class="forumdata">
<div class="datacontainer">
<div class="titleline">
<h2 class="forumtitle">{vb:raw vboptions.policy_closedreason}</h2>
</div>
<p class="forumdescription"></p>
</vb:if>
</div>
</div>
{vb:raw footer}
</body>
</html>
i get a white space but and need to remove it as shown in the screenshot, can anyone help
http://img651.imageshack.us/img651/1876/whitedv.jpg
I'm not really an html person, but I'm thinking maybe <div ... followed by <p ... is creating a blank line?
Lynne
01-05-2012, 05:14 PM
Just taking a quick look, this is totally not correct:
<div class="blockbody">
<div class="blockrow">
<vb:if condition="$vboptions['policy_active']">
<ol id="forums" class="floatcontainer">
</div>
</div>
<li class="forumbit_nopost L1" id="cat1">
You can't open an <ol> in the middle of the divs and then have the list continue after you close the divs. Any tag you open must be closed before you may close a tag then encloses it.
TheSupportForum
01-06-2012, 04:15 PM
Just taking a quick look, this is totally not correct:
<div class="blockbody">
<div class="blockrow">
<vb:if condition="$vboptions['policy_active']">
<ol id="forums" class="floatcontainer">
</div>
</div>
<li class="forumbit_nopost L1" id="cat1">You can't open an <ol> in the middle of the divs and then have the list continue after you close the divs. Any tag you open must be closed before you may close a tag then encloses it.
how do i correct it, i tried removing parts of the code to get rid of that white space
the reason it looks not correct was due to me removing some of the original code this from this point of it
<div class="blockbody">
<div class="blockrow">
Lynne
01-06-2012, 05:26 PM
I don't know how that code should be since I didn't write it. I actually see no reason for any of the code I quoted to be in that page as it doesn't seem to do anything.
Davidinh
01-07-2012, 08:42 PM
i created a custom page it just show an object (etc. picture)
i want to interage the forum (by forumid) into my custom page
can all of you guide me which template that i need to concern for it
any adviced or suggestion will be appriciated
Lynne
01-08-2012, 02:30 AM
i created a custom page it just show an object (etc. picture)
i want to interage the forum (by forumid) into my custom page
can all of you guide me which template that i need to concern for it
any adviced or suggestion will be appriciated
If you have a custom page and you want to do something, then you would edit the template for your custom page.
thenamesgould
01-13-2012, 05:28 AM
Works great for my 404 page! Thanks!!! :D
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.