vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Create your own vBulletin page (https://vborg.vbsupport.ru/showthread.php?t=228112)

basilrath 02-14-2011 06:45 AM

Quote:

Originally Posted by Lynne (Post 2162346)
Sure, if you copy the code for it also.

Well i tried that Lynne but sadly nothing...

Im assuming its the section in the showthread ???

Thanks for any info

Armadio 02-14-2011 06:38 PM

1 Attachment(s)
Quote:

Originally Posted by iBaker (Post 2162430)
I have found with 4.1.1 that:
- If I have the forums in my root
- My pages in a folder /pages/
- I use the chdir ('/home/xxxx/public_html');

The page displays with correct styling ONLY if I have the vb option "Always use Forum URL as Base Path" set to Yes...If I set it to No (which I need to do) I lose all the styling from the vb style

I have the same problem, look at the picture

basilrath 02-15-2011 12:15 PM

Is there a way to add "who is viewing this thread" or in my case page to my custom page????

Lynne 02-15-2011 03:35 PM

Quote:

Originally Posted by basilrath (Post 2162763)
Is there a way to add "who is viewing this thread" or in my case page to my custom page????

I do not have the code for this, but yes there is a way. The code you need is probably at the bottom of the forum.php or showthread.php page since both of those will show users browsing that page.

justasiam 02-26-2011 06:40 PM

Thank you for these instructions. I only have 1 question.

You said to create 2 new plugins. What do I name them?

Lynne 02-26-2011 07:57 PM

Quote:

Originally Posted by justasiam (Post 2167237)
Thank you for these instructions. I only have 1 question.

You said to create 2 new plugins. What do I name them?

You do not need to create any plugins for a page. If you do create plugins, you may name them whatever you want - that only matters to you.

CampinCarl 03-06-2011 03:44 PM

Can someone please tell me how to add the vB sidebar to my own custom page?

bchertov 03-08-2011 10:20 PM

Sorry folks, but I haven't read through this whole thread. I did see the first post where it suggests creating a template for a custom page.

I want to create a media kit for my site and I want to look good!

I'm thinking it would be best to use some sort of page layout program (dreamweaver, etc.) and take the generated HTML and display it within my vBulletin 4.x site, probably in the content area. It could replace just the contents of a post or article, or completely fill the page between the header and footer.

Ideally it wouldn't have to be recoded to be in the VB template language.
How would I include the generated HTML in vbulletin?
What about CCS files or anything else needed to display it inside of vBulletin?

How would you suggest I proceed?

And what's the best Mac program to use for the layout that's relatively simple but has some flexibility?

Thanks!
Barry

SkyStryder 03-10-2011 07:05 PM

Quote:

Originally Posted by CampinCarl (Post 2170233)
Can someone please tell me how to add the vB sidebar to my own custom page?

I need to do this also.:up:

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

Alternatively, Is there code we can add to the example Lynne provided that
will bring in the cms layout? It may be just a matter of initializing and
adding to the template? I have seen this which gives me hope:
<div class="vbcms_content">
{vb:raw layout}
</div>
Then I could assign it to a section and category? That would be awesome!

priest1311 03-15-2011 03:15 PM

Hello all,

So if i have been ready it correct this is the way to get a custom homepage with the navbar and footer. Because i have been searching like crazy for it but if i can add my own html layout and still use the header and footer that would be great. This is correct right?

Priest!

Lynne 03-15-2011 03:53 PM

Quote:

Originally Posted by priest1311 (Post 2173635)
Hello all,

So if i have been ready it correct this is the way to get a custom homepage with the navbar and footer. Because i have been searching like crazy for it but if i can add my own html layout and still use the header and footer that would be great. This is correct right?

Priest!

You may add your own html. Just try it out and see.

kc3815 03-20-2011 11:12 PM

I just get the following when I navigate to http://www.mysite.com/test.php

'test')); eval('$navbar = "' . fetch_template('navbar') . '";'); // spit out template eval('print_output("' . fetch_template('test') . '");'); ?>

Any Ideas?

Lynne 03-20-2011 11:31 PM

You've done something wrong. I suggest you redo it all and make sure you are using a plain text editor when creating the php file. like notepad.

kc3815 03-21-2011 09:07 PM

Quote:

Originally Posted by Lynne (Post 2175617)
You've done something wrong. I suggest you redo it all and make sure you are using a plain text editor when creating the php file. like notepad.

Thanks for the fast response. I tried again and was able to get it to work.

Another question if you don't mind...

Please forgive me if my terminology is not perfect.

I see that I can set values in the // ###### YOUR CUSTOM CODE GOES HERE ##### area and the register them for use by the template in the // ###### NOW YOUR TEMPLATE IS BEING RENDERED ###### area. However, I want to display the output from some php code. Is there a way to add the code and set it's value for template use?

Or I guess, in other words, is there a way to run a php script and display it's output within the template?

Lynne 03-21-2011 10:54 PM

Quote:

Originally Posted by kc3815 (Post 2175945)
Or I guess, in other words, is there a way to run a php script and display it's output within the template?

Run the PHP code and put the result into a variable and then put the variable in the template.

boodog 03-23-2011 12:35 AM

Worked beautifully. Thank you Lynne :)

Phaedrus 03-27-2011 04:19 AM

Excellent. I was able to make a very nice Privacy Statement rather than the pdf file I had before.

Mark4865 03-27-2011 10:26 AM

Hello,

Can anyone tell me how we view the page we have created, we followed all instructions but have no idea how to view the page.

Please help??

Lynne 03-27-2011 05:48 PM

Quote:

Originally Posted by Mark4865 (Post 2177915)
Hello,

Can anyone tell me how we view the page we have created, we followed all instructions but have no idea how to view the page.

Please help??

yoursiteurl.com/yourpagename.php

Mark4865 03-28-2011 11:07 AM

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

Lynne 03-28-2011 03:14 PM

Quote:

Originally Posted by Mark4865 (Post 2178278)
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

Quote:

Originally Posted by Mark4865 (Post 2178429)
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 [DATE]1301338367[/DATE] at [TIME]1301338367[/TIME] ---------------

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".
PHP Code:

...
$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

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 [DATE]1301403637[/DATE] at [TIME]1301403637[/TIME] ---------------

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

Quote:

Originally Posted by Mark4865 (Post 2178669)
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.

Quote:

Originally Posted by SuperTaz (Post 2178610)
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

Quote:

Originally Posted by Lynne (Post 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.


I would guess it is a template issue. Can you post what your template looks like?

Sure can. Here you go:

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 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&copy 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">
&nbsp;
  <br>
  <br>
    Start Number:
  <input type=text value=1 name=ips size=2 style="text-align:right">
  &nbsp; End Number:
  <input
size=3 type=text value=100 name=ipe style="text-align:right">
  &nbsp;
  <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

Quote:

Originally Posted by BF777 (Post 2178781)
Where does one create the template suggested in step #2?

admin cp > style manager > find your style > add template in dropdown
Quote:

Originally Posted by Mark4865 (Post 2178787)
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. :)

Quote:

Originally Posted by SuperTaz (Post 2178857)
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:
HTML Code:

<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

Quote:

Originally Posted by BF777 (Post 2179157)
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

Quote:

Originally Posted by BF777 (Post 2179199)
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.


All times are GMT. The time now is 12:22 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02392 seconds
  • Memory Usage 1,867KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete