PDA

View Full Version : Extra page driven by forum templates


c-pr0mpt
03-26-2002, 10:00 PM
This is a really simple hack. This is for adding other pages to your site all driven by the forums templates. This also has instructions for adding it to whos online!


Example:
http://www.yaxay.com/yack/privacy.php?s=

This page is driven via the normal forum templates.
Sshot of admin area for this page:
https://vborg.vbsupport.ru/

Sshot of whos online if the person is on the page:
https://vborg.vbsupport.ru/


The instructions are for installing a page for a privacy statement. But just replace all instances of privacy, and privacy.php with the page you are creating. Very easy.

Instructions attached. :classic:

DFX
03-27-2002, 01:51 AM
Great hack c-pr0mpt, I'll be installing this right away!

MrBojangle1
03-27-2002, 02:00 AM
AWSOME! THANX DUDE!!

ja5es
03-27-2002, 02:59 AM
That hack's GREEEEAT!!!

MarkB
03-27-2002, 03:12 AM
Nice!

BigJohnson
03-27-2002, 05:29 AM
nice thanx

alanvo
03-27-2002, 06:16 AM
what about vbportal?

Elanor
03-27-2002, 06:34 AM
Very useful. Thanks for sharing ^__^

Dade
03-27-2002, 07:10 AM
Just tried it out, works great!

Floris
03-27-2002, 08:47 AM
Couldn't you post this 12 hours earlier? haha :) I just figured this out myself, since I was lacking a privacy statement and wanted it to integrate with vB :) Great hack :P Using your additions so it will show up online and stuff. Fnx for sharing.

Bop2Bop
03-27-2002, 09:09 AM
w00t corey you did it again ^_^
thx alot biggi help for those privacey statements etc

Floris
03-27-2002, 12:02 PM
I was planning on making more then one statement, like a mission statement, privacy policy and piracy policy + index to click through ..

Anyway,
this is the ONE file I use for all those statements!! (+4 templates)

Maybe you get the idea and alter your hack with it for upcomming version :)

example: http://www.creations.nl/ bottom box > forum statements

which will display a page, with click throughs to the other statements.

Ofcourse, this is very fun to use for any kind of new addition to the web site !! :) And so we will :p

By the way: I can NOT support this, this is more a personal post to cprompt. But feel free to try yourself :)


Anyway:

c-pr0mpt
03-27-2002, 01:33 PM
Thanks for the idea xiphoid, but for me I use the normal stuff at the bottom in my footer. Privacy, copyright, etc. And in each one I have a small navigation back. =)

Glad everyone likes it so far!

CloudBurst
03-27-2002, 05:44 PM
great hack corey :)

look's good!

Floris
03-27-2002, 06:00 PM
Originally posted by c-pr0mpt
Thanks for the idea xiphoid, but for me I use the normal stuff at the bottom in my footer. Privacy, copyright, etc. And in each one I have a small navigation back. =)

Glad everyone likes it so far!

Sure, but maybe there are others who like to put it all in 1 file, and just add a template where needed.

I also use the different options in the bottom menu..

< contact | statements | chat | url >

You ofcourse, can expand this to whatever one would please, just make sure to &action=<whatever> in the a href link.

< contact | privacy statement | mission statement | sponsors | etc >

Where it all can be managed from 1 file, instead of having to make several files with several templates.

Every template holds their own navigation back in the top, just like anything else on a forum, so you can even use $nav bits. and just add your own page to the end of that.

More dynamic, less file, and expandable, by just adding another if statement + template.

c-pr0mpt
03-27-2002, 07:26 PM
I wasn't saying the users might not like it, what I meant was I didn't need it.

Floris
03-27-2002, 08:15 PM
okidoki

E
04-03-2002, 11:18 AM
hmm ill try it.. .seems a bit like vbhome

c-pr0mpt
04-06-2002, 02:44 AM
Originally posted by E
hmm ill try it.. .seems a bit like vbhome

Not really. I just like to do it for extra pages like privacy statements, terms of use, etc. vBhome adds a home index like that of vB.org.

212rikanmofo
04-19-2002, 02:44 AM
the hack works i think, but when i click on to view my privacy statement, it shows up, but up top it doesnt have those navigational links like you do:

like:

site -> privacy statement

it doesnt have that, what did i do wrong???

RDX1
05-05-2002, 10:54 AM
whats up with this? http://www.nerdnations.com/bbs/cams.php


this is my template code

Chris M
05-05-2002, 12:49 PM
Originally posted by c-pr0mpt
This is a really simple hack. This is for adding other pages to your site all driven by the forums templates. This also has instructions for adding it to whos online!


Example:
http://www.yaxay.com/yack/privacy.php?s=

This page is driven via the normal forum templates.
Sshot of admin area for this page:
https://vborg.vbsupport.ru/

Sshot of whos online if the person is on the page:
https://vborg.vbsupport.ru/


The instructions are for installing a page for a privacy statement. But just replace all instances of privacy, and privacy.php with the page you are creating. Very easy.

Instructions attached. :classic:

I cant even get what nerdnations has...

What am I doing wrong?

Satan

c-pr0mpt
05-05-2002, 04:11 PM
Originally posted by NerdNations
whats up with this? http://www.nerdnations.com/bbs/cams.php


this is my template code

That page displays exactly what your code is telling it to. What is the problem? :ermm:

c-pr0mpt
05-05-2002, 04:11 PM
Originally posted by hellsatan


I cant even get what nerdnations has...

What am I doing wrong?

Satan

What are you getting? To know what you are doing wrong, I need to see what you have currently.

c-pr0mpt
05-05-2002, 04:18 PM
Originally posted by 212rikanmofo
the hack works i think, but when i click on to view my privacy statement, it shows up, but up top it doesnt have those navigational links like you do:

like:

site -> privacy statement

it doesnt have that, what did i do wrong???

Thats something I added on mine manually. Just add this code to the top below the header of any page you create.


&nbsp;<smallfont><b>? <a href="index.php?s=$session[sessionhash]">Forum Index</a> ? Page You Created</b>
<br><br>

RDX1
05-05-2002, 07:37 PM
it has a black background, mabey i should re look my code :P

$backcolor doesnt work :alien:

stuuu
08-22-2002, 05:15 PM
Nice hack, what if I want to have some PHP code where

<!-- YOUR CONTENT GOES HERE -->

is? The code I have is a SQL driven audio database table.

Help!

NTLDR
08-22-2002, 05:17 PM
You need to add the php code to the file you upload, the only template that can have php in it is the phpinclude template.

stuuu
08-22-2002, 05:24 PM
Originally posted by NTLDR
You need to add the php code to the file you upload, the only template that can have php in it is the phpinclude template.

I think the code is a bit too much to put into the php include template, as that is loaded with each page right?

I have put it in the main file that calls the templates, but how do I get the template to place my code between the vB header and footer? It just appears below the footer at the moment :(

Rose
08-22-2002, 05:26 PM
I'm interested in using this, but I'm using WebTemplates. Is there a difference in the two? :$

NTLDR
08-22-2002, 05:29 PM
Originally posted by stuuu
[B]I think the code is a bit too much to put into the php include template, as that is loaded with each page right?

Yes, its loaded with each page, so make sure that its only in the phpinclude template if it is used on each page.

I have put it in the main file that calls the templates, but how do I get the template to place my code between the vB header and footer? It just appears below the footer at the moment :(

Not knowing what the code is, or what it outputs its hard for me to say.

The easiest was is to assign the output to a variable and place that variable in the template where your content goes.

NTLDR
08-22-2002, 05:33 PM
Originally posted by Rose
I'm interested in using this, but I'm using WebTemplates. Is there a difference in the two? :$

It all depends what you are trying to achive, this hack is meant just to eval and display the content of a template that you have in your CP.

Webtemplates is similar to this but allows you to add queries via the AdminCP, and has a kind of permissions system built into it.

vBindex also allows you to create extra pages by adding templates that also fit your sites design.

It really depends what features you need and what works best with your setup ;)

stuuu
08-22-2002, 05:38 PM
Originally posted by NTLDR


Yes, its loaded with each page, so make sure that its only in the phpinclude template if it is used on each page.



Not knowing what the code is, or what it outputs its hard for me to say.

The easiest was is to assign the output to a variable and place that variable in the template where your content goes.

Yeah, its too much for phpincludes.

I have attached the output from when I was using PHPBB2, its basically a top 10 played audio clips, and the archive itself. They are output in a table format.

Any ideas? How do I put the whole file inside a variable that will use the style sheets of vB?

NTLDR
08-22-2002, 05:44 PM
If the output is just a sperate section of HTML just with PHP variables in and not any PHP code itself then just place that into the template instead.

stuuu
08-22-2002, 06:10 PM
Originally posted by NTLDR
If the output is just a sperate section of HTML just with PHP variables in and not any PHP code itself then just place that into the template instead.

Even though the code output is HTML, you cant put PHP inside the templates can you.

I am still stuck :/

FleaBag
10-11-2002, 10:36 PM
* GamerForums wonders if this will make any sense...

I'd known how to do this, but didn't realise I knew, until I read this thread. LOL, cheers mate, working well on 2.2.7. :)

obiwan8472
10-26-2002, 11:09 PM
Hi, great hack.
But I want to put this in

<? include ("vbforums/newstransfer.php"); ?>

It calls a news script I am using, however when I put it in the Templates it ignores it. Any ideas?
Tar.

Erwin
10-27-2002, 02:17 AM
Interesting... similar to my "HTML/ JAVA integrator hack" - didn't know that this one existed when I wrote mine. :)

NTLDR
10-27-2002, 04:35 PM
Originally posted by obiwan8472
Hi, great hack.
But I want to put this in

<? include ("vbforums/newstransfer.php"); ?>

It calls a news script I am using, however when I put it in the Templates it ignores it. Any ideas?
Tar.

The only template you can put PHP code in is the phpinclude template, it will not parse PHP in any other one. Add the include statment to the PHP file after it requires global.php.

pdaGuy
10-31-2002, 12:16 PM
Originally posted by NTLDR


The only template you can put PHP code in is the phpinclude template, it will not parse PHP in any other one. Add the include statment to the PHP file after it requires global.php. This works, BUT if you place the include statment in the PHP file under the require global.php the file that you want to include will appear in the very top of the page!

To be more specific, if you want a page with your site's header (on the top) and footer (on the bottom) and you want to include another (external) page right in the middle then your solution doesn't work. At least not for me! :|

Same happens if you place the include statment in the phpinclude template. The only differense is that the included page gets displayed to EVERY VB file.

What would really be helpful in this is to define something like $newpage = include("http://the_included_page");
And then everywhere (in the templates) you place $newpage the included page should appear. Is this possible?

Any ideas??

Talisman
01-04-2003, 04:54 AM
Originally posted by Erwin
Interesting... similar to my "HTML/ JAVA integrator hack" - didn't know that this one existed when I wrote mine. :)

This is really great. Thank you c-prOmpt.

And I'm glad I found your html/txt/java integrator and flash hacks, Erwin, before I came across this one. Will plan to use them all for our site.

We have a number of Admins supporting our site, with all different areas of expertise. I can use the approach in this hack for our fairly static, text-based pages of reference material and our Admins can easily update the appropriate template(s), as needed.

Will then use Erwin's hack for the more dynamic pages we want to integrate that our web-guys can use with more complex html coding, flash movies, java applets, etc.

It's truly a pleasure to browse through the many threads here. And it really helps me understand how to better maintain and develop our site.

Thanks, again.

Zombie-F
01-28-2003, 12:15 AM
This is exactly what I was just looking for! Thanks for the nifty little hack. I'm sure I'll use it for more than just the Privacy Statement. :D

Red Blaze
03-10-2003, 01:38 PM
I wanted to make something like this, is there a way to keep guests from entering certain pages I'd make? Lets say I'm making an MP3 section and I only want members to access that page. Do you know what I mean?

Also, I wanted to move the files else where besides the forums directory. For example I want all the pages on my main directory. www.mysite.com. Not on the /forums directory. I tried moving the new php files I made and I got this error.

Warning: main(./admin/config.php) [function.main]: failed to create stream: No such file or directory in /home/thesonic/public_html/forums/global.php on line 129

I'm guessing the problem lies with in global.php. Can someone help me out?

Triality159
06-20-2003, 07:54 PM
i am also having a problem..I get this error

Warning: Cannot modify header information - headers already sent by (output started at /home/advanced/public_html/advertising.php:7) in /home/advanced/public_html/admin/functions.php on line 1652

someone please help

thanks

Triality159
06-21-2003, 02:54 AM
nvm i got this fixed.....

dotagious
06-30-2003, 01:33 AM
Would this work with a small cgi based script?

Slybone
11-10-2003, 07:54 PM
GReat Job, Just what I needed
/me clicks install

gmarik
11-11-2003, 02:07 PM
This is a really simple hack. This is for adding other pages to your site all driven by the forums templates. This also has instructions for adding it to whos online!


Example:
http://www.yaxay.com/yack/privacy.php?s=

This page is driven via the normal forum templates.
Sshot of admin area for this page:
http://www.yaxay.com/sshotadmin.gif

Sshot of whos online if the person is on the page:
http://www.yaxay.com/online11.gif


The instructions are for installing a page for a privacy statement. But just replace all instances of privacy, and privacy.php with the page you are creating. Very easy.

Instructions attached. :classic:
Any live demo?
There are plentu of hacks like this, why is this better than, for example, the one Logician made?

glo
03-25-2004, 09:07 AM
There are plentu of hacks like this, why is this better than, for example, the one Logician made?

Exactly what i was thinking!

Gmarik, what did you discover?

Mythlander
04-11-2004, 05:10 PM
Thank you for this hack. Very simple and straightforward. I'm amazed vB doesn't have a mechanism to view the TOS/Privacy Statement after you've registered.

TheMusicMan
04-11-2004, 05:35 PM
Can anyone assist please... I get an error reported when I try to load the new page which is:

Fatal error: Call to undefined function: gettemplate() in ......../forums/privacy.php on line 7

... and line 7 is highlighted in red below

<?php
error_reporting(7);

require('./global.php');


eval("dooutput(\"".gettemplate('forumprivacy')."\");");

?>

I have created the forumprivacy which appears in the custom templates section in Styles Management>Edit Templates

Can anyone advice please... thanks

Mythlander
04-11-2004, 05:51 PM
"Undefined function" looks like it can't find global.php.

Is this file (privacy.php) in the same directory as global.php? It needs to be.

Also, make sure your forumprivacy template is part of the default template style. I also copied it to all of my other template styles.

TheMusicMan
04-11-2004, 06:00 PM
Hi Mythlander,

Thanks for the reply so promptly... much appreciated...

"Undefined function" looks like it can't find global.php.

Is this file (privacy.php) in the same directory as global.php? It needs to be.

Yup, nave checked using ftp prog and global.php and privacy.php are in both the forum directoty


Also, make sure your forumprivacy template is part of the default template style. I also copied it to all of my other template styles.

I ensured that I was in the default template when I created the template. I have checked the names to make sure I have created them correctly.

Can you suggest something else for me to try please...? is it to do with vB3 Gold perhaps...?

Mythlander
04-11-2004, 06:03 PM
Well this is a vB2 hack. I'm not sure if it works with vB3. Heck, I couldn't tell you if vB3 even has a gettemplate() function! :D

[Edit] I just checked. It looks like gettemplate() no longer exists in vB3. It's now fetch_template(). Also, I found a thread on doing this for vB3 here (https://vborg.vbsupport.ru/showthread.php?t=62164).

Mythlander
04-11-2004, 06:10 PM
Yup, this hack won't work on vB3. :) Use the link I provided in my previous message for the same (apparent) functionality.

TheMusicMan
04-11-2004, 06:26 PM
Yup, this hack won't work on vB3. :) Use the link I provided in my previous message for the same (apparent) functionality.
Excellent Mythlander, thanks for your help... :)