PDA

View Full Version : Create Custom Pages


Princeton
22 Feb 2006, 01:47
GO-TOTAL LLC had everyone in mind when GTCustom Pages (http://www.vbulletin.org/forum/showthread.php?t=108583) was created.
Custom pages can now be created with little or no coding knowledge.

If you know how to create a phrase within ADMINCP / LANGUAGES then you can create custom pages with ease.

First Download and install product and...

Let's Create A Custom "About Us" Page:

In your favorite editor, create the contents of the page. HTML is allowed.
When you finish with the contents of the page, create 2 phrases (an optional subtitle is available).
"gtcustom_about_header" - title of custom page
"gtcustom_about" - contents of custom page
"gtcustom_about_subtitle" -optional subtitle for custom page; the subtitle (table cell) will only display if it's created
That's it! Now, go visit the page via URL: $vboptions/goto.php?section=about
NOTE:
- Replace bold text with your choice of name. Follow naming convention as described above or the pages will not display.
- All 'xxx_header' phrases should be added to GLOBAL phrase group. (Needs to be global to display in navbar, etc.)
- All other phrases are required to be in GTCustom Pages phrase group. (If it's not here, cutom page will not work.)
Tips:

URL looks good with mod-rewrite enabled.
For example, $vboptions[bburl]/goto/section/about, $vboptions[bburl]/goto_section_about.html
Use short names to prevent mod-rewrite (SEO links) problems. (It really depends on your setup. For example, some SEO scripts will convert every '_' into '/'. Which will prevent custom page from being displayed.)
Examples:
about - (GOOD)
terms - (GOOD)
privacy - (GOOD)
about_us - (BAD)
terms_of_service - (BAD)
privacy_policy - (BAD)


[b]Examples Included With Product:
About Us Custom Page - phrases: gtcustom_about_header, gtcustom_about
URL: $vboptions/goto.php?section=about
Terms Of Service Custom Page - phrases: gtcustom_terms_header, gtcustom_terms
URL: $vboptions[bburl]/goto.php?section=terms
Additional options available in Admincp/ vBulletin Options/ Site Name / URL / Contact Details to create Terms of Service
Privacy Policy Custom Page- phrases: gtcustom_privacy_header, gtcustom_privacy
URL: $vboptions[bburl]/goto.php?section=privacy
[b]Now Let's Create Who's Online Location For All Custom Pages:
Oops, this feature is only available to those who donate.
What do you get? A new Custom Pages Plugin. All you have to do is overwrite the original.

Connector
25 Apr 2006, 03:38
Very nice .. if i need to show a messge for each usergroup when they visit the about page .. is there any way to do this ?

Thanks :)

Princeton
25 Apr 2006, 13:25
edit the goto.php and create a new template with conditionals

FIND:
switch($_REQUEST['section'])
{

REPLACE:
switch($_REQUEST['section'])
{
case 'about';
$globaltemplates[] = 'gtcustom_about';
break;


FIND:
switch ($section)
{

REPLACE WITH:
switch ($section)
{
case 'about';
eval('$HTML = "' . fetch_template('gtcustom_about') . '";');
break;


Create new template as you see fit (use conditionals, use phrases, it's up to you):
name it "gtcustom_about"

that's it

Connector
25 Apr 2006, 18:15
Thankyou very much .. It's work fine. . i'm not sure if there is way where i can add UserPost Count ..

Example

Welcome Username You have Made XX Post ..

Welcome username i find how to do this but Their postcount i dont no :)

Thanks :)

almukmin
04 May 2006, 13:13
What if I need the page to do some PHP commands?

How do I just add a header and a footer to that PHP file?

aceofspades
04 May 2006, 19:23
Im sorry, but im new to this and i dont have a clue what you are talking about in your instructions.

In the admin CP im going to phrase manager, then what, you havent said?!

Phrase type = ?
Product type = ?
Var name = gtcustom_about_header (for first one)
Text = ?

Thank you

Princeton
05 May 2006, 00:07
Im sorry, but im new to this and i dont have a clue what you are talking about in your instructions.

In the admin CP im going to phrase manager, then what, you havent said?!

Phrase type = ?
Product type = ?
Var name = gtcustom_about_header (for first one)
Text = ?

Thank you
- Replace bold text with your choice of name. Follow naming convention as described above or the pages will not display.
- All 'xxx_header' phrases should be added to GLOBAL phrase group. (Needs to be global to display in navbar, etc.)
- All other phrases are required to be in GTCustom Pages phrase group. (If it's not here, cutom page will not work.)

aceofspades
12 May 2006, 20:32
Here is my page:

http://www.hiven.net/forum/goto.php?section=rules

Can you tell me how i get rid of the box's on the left please, i just want the text no search / advert / stuff box. Thank you

James

Princeton
12 May 2006, 20:43
edit the CUSTOM_SHELL template

Snake
14 May 2006, 13:09
Thanks for the tutorial. Very useful! :)

twitch
27 May 2006, 01:39
edit the CUSTOM_SHELL template

can you tell me exactly what to remove in order to get rid of that stuff on the left?

Awesome product, I donated to help the cause :)

Princeton
27 May 2006, 03:51
replace custom_shell with
$stylevar[htmldoctype]
<html id="moooo" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$pagetitle - $vboptions[bbtitle]</title>
</head>
<body>
$header
$navbar
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td width="100%" valign="top">$HTML</td>
</tr>
</table>
$footer
</body>
</html>

thanks Arin ... appreciate the donation :up:

twitch
27 May 2006, 06:23
Thanks! That did the trick :)

blankoboy
22 Jun 2006, 05:40
Great looking mod. Will this allow me to update the body of the custom page via the Admin CP?

For example, I want to have a custom page to list advsertising rates and availability. I would then also like to regularly update the availability and pricing. Is this possible with this mod?


---off-topic----
ps - off-topic but hoping someone here might know the answer. How do sites like totalbf2.com and evilavatar.com display news pulled from specific forums on their front page? Are they using vbexternal or a similar available mod? thx.
---off-topic----

Princeton
22 Jun 2006, 13:44
the "body" of the page is a phrase

MadKad
19 Jul 2006, 12:33
Is there a way to set a permission on these pages so that I can only allow serton usergroups into the serton custom section page?

Like make some sort of code so I can add it to the page I want a serton group to access only and leave the others like sitemap so that any one can see them?

Princeton
19 Jul 2006, 15:29
you can use is_member_of() function...


is_member_of()

Works out if a user is a member of the specified usergroup(s)

This function can be overloaded to test multiple usergroups: is_member_of($user, 1, 3, 4, 6...)
boolean is_member_of (array &$userinfo, integer $usergroupid)

* array &$userinfo: User info array - must contain userid, usergroupid and membergroupids fields
* integer $usergroupid: Usergroup ID to test

MadKad
19 Jul 2006, 21:31
Nice one mate, do i add this to the body of the template or to one of your php files like the goto.php

thanks

Princeton
19 Jul 2006, 21:39
that's up to you ... you can add it to the templates or the file

MadKad
19 Jul 2006, 21:46
OK thanks, sorry one more question as I am a little confused on this

what code am I using with this then? I only want to allow 3 usergroups to serton pages so i would be adding it to the body of the template code

so it would be is_member_of($user, 1, 3, 4) what would go with that :s sorry is it an if or something?

Oddjob
23 Jul 2006, 14:58
Does anyone know if this works for 3.6?

PoetJA-1975
10 Oct 2006, 03:38
Hi PRINCETON - Fabulous Fabulous vB hack. I am soooo loving this one - I do have a question/issue about the layout. I think in vBadvanced there's an option to either Use Module Shell Template or NO!

My choice would be to not have the page in a "box" - so to speak - I would like to have the custom page aligned in the middle of the page, rather than in the Module shell - Is there anyway to accomplish this?

I am building an Amazon store for my forum - the link url is: http://www.jpicforum.info/goto.php?section=shop

You'll notice how the alignment of the store is off a bit... The inline frame code is from Amazon directly (also the html for my gtcustom_shop phrase) and is as follows:

<table cellspacing="0" cellpadding="0" border="0" width="100%">
<iframe src="http://astore.amazon.com/jpicforumforw-20" width="100%" height="4000" frameborder="0" scrolling="no"></iframe>

I'm not really sure if I can tweek that html at all. But I have managed to tweek the CUSTOM_SHELL template as follows:

$stylevar[htmldoctype]
<html id="moooo" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$pagetitle - $vboptions[bbtitle]</title>
</head>
<body>
$header
<br />
$showrandomquote

<div align="center">

<script type="text/javascript"><!--
google_ad_client = "pub-6622330007501456";
google_ad_width = 468;
google_ad_height = 15;
google_ad_format = "468x15_0ads_al";
google_ad_channel ="";
google_color_border = "E7E3D2";
google_color_bg = "E7E3D2";
google_color_link = "800000";
google_color_text = "000000";
google_color_url = "008000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</div>
<br />
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td width="100%" valign="top">$HTML</td>
</tr>
</table>$footer
</body>
</html>

Can you please help me to fix this code to where the the custom-shell-like box is removed and the Amazon store can sit right in the middle of the http://www.jpicforum.info/goto.php?section=shop page ------> I will surely appreciate your help!

ALSO thanx for providing this nice piece of mod/hack work - Very nice indeed :)

Jacquii.

Princeton
17 Oct 2006, 12:20
hi PoetJA-1975,

I'm guessing that you want to remove the "box" enclosing the Amazon script. If so ...
REPLACE:
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td width="100%" valign="top">$HTML</td>
</tr>
</table>
WITH:
$HTML

If not the above template, you may have to edit the other template ... keep in mind that any changes you do to it may reflect on other custom pages.

If that's not what you are referring to can you be more specific?

Sorry for the delayed response ...

PoetJA-1975
17 Oct 2006, 19:05
Hey PRINCETON - Exactly... I'm trying to remove the box enclosing the Amazon script...

I tried the CUSTOM_SHELL template edit you suggested above - And it didn't work.

What do you mean by "other" template? I've looked at all GTCUSTOM PAGES Templates and the code you suggested is only on the CUSTOM_SHELL...

Jacquii.

Princeton
17 Oct 2006, 22:04
the template you need to edit is "gtcustom_mypage"

however, if you edit that template other custom pages will have the same look (eg. no 'wrapper')

PoetJA-1975
18 Oct 2006, 10:21
hey PRINCETON - just threwup a gallon of tainted beer - so trust me - I totally used to "no wrapper" :P ------ OK OK OK - more than enough info etcetera...

custom_mypage template:

<table class="tborder" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" width="100%">
<if condition="$vbphrase['header_title']">
<tr>
<td class="tcat" width="100%">$vbphrase[header_title]</td>
</tr>
</if>
<if condition="$vbphrase['sub_title']">
<tr>
<td class="alt2">$vbphrase[sub_title]</td>
</tr>
</if>
<tr>
<td class="alt1" valign="top">$vbphrase[content]</td>
</tr>
</table>

What do I edit?

Jacquii.

btw - thank you everso kindly for helping me out with this issue. Perhaps I'll sleep for 24hrs and get over the throwup spree LOL :lick:

Princeton
18 Oct 2006, 12:15
remove everything except ... $vbphrase[content]

PoetJA-1975
19 Oct 2006, 02:45
GREAT - thanx PRINCETON! Much appreciation

Jacquii.

texasf1racer
08 Nov 2006, 05:38
Great mod! One brief question..

If I wanted one of my custom pages to "act" as the home page (like a portal) when someone visits my site url as usual, how would I do this?

Many thx!

Princeton
08 Nov 2006, 12:27
Great mod! One brief question..

If I wanted one of my custom pages to "act" as the home page (like a portal) when someone visits my site url as usual, how would I do this?

Many thx!

rename your forum index page (option can be found in admincp) to forum.php ...

now, rename the custom page to index.php


NOTE: This hasn't been tested.

wIrEs
02 Jan 2007, 11:19
Doest work with vbulletin 3.6.4

beduino
27 Jun 2007, 18:40
Doest work with vbulletin 3.6.4
Hey Princeton!
[finally i will install this hack! :D] but... the last msg makes me unsure about .
All the best
And tks for all work in vb.org
Beduino

Princeton
27 Jun 2007, 20:00
the mod was made for 3.5 not 3.6+

however, there are some users who say it does work for them ...
http://www.vbulletin.org/forum/showthread.php?t=108583

beduino
29 Jul 2007, 04:35
tks a lot

karlm
29 Jul 2007, 06:12
Does this work outside the forumhome/root?

an example - http://somedomain/forum/index.php is the usual
but I might want to see a page at http://somedomain/mynewpage.php

thanks :)

garyrogers
06 Aug 2007, 11:35
could I use this technique to produce a unique " Invoice page" for each of my users?
Essentially what I want to do is to have a page that each member can open, and that will show their " Invoice Number", which is the same as their "IDnumber". They then print out the page and send their payment to me by ordinary mail.
How do I include the " IDnumber" on the custom page?
Also, and this would be neat- once I have manually inserted their payment into the " paid subscriptions" section of the admincp, how can I get the paid subscriptions part of the usercp- the " active subscriptions" part, to show up on my custom page?

All my members do not use the online paid subscriptions functions( they work for the NHS). And I need a page that they can easily access to produce/print out an invoice.
all help much appreciated
Gary

Princeton
06 Aug 2007, 13:15
yes, it can be done ... you will need to create the template - use $bbuserinfo[userid] to display ID

I also suggest a PRINT feature that will display only the "invoice" for printing purposes .. this cannot be done out-of-the-box with this addon. You will need to modify addon.

Wizardjv
01 Apr 2008, 17:37
nevrmind LOL I need more sleep