vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Create Custom Pages (https://vborg.vbsupport.ru/showthread.php?t=108586)

Princeton 02-21-2006 10:00 PM

Create Custom Pages
 
GO-TOTAL LLC had everyone in mind when GTCustom Pages 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:
  1. In your favorite editor, create the contents of the page. HTML is allowed.
  2. 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
  3. That's it! Now, go visit the page via URL: $vboptions[bburl]/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)

Examples Included With Product:
  • About Us Custom Page - phrases: gtcustom_about_header, gtcustom_about
    URL: $vboptions[bburl]/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
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 04-25-2006 01:38 AM

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 04-25-2006 11:25 AM

edit the goto.php and create a new template with conditionals

FIND:
HTML Code:

switch($_REQUEST['section'])
{

REPLACE:
HTML Code:

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


FIND:
HTML Code:

        switch ($section)
        {

REPLACE WITH:
HTML Code:

        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 04-25-2006 04:15 PM

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 05-04-2006 11:13 AM

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 05-04-2006 05:23 PM

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-04-2006 10:07 PM

Quote:

Originally Posted by aceofspades
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 05-12-2006 06:32 PM

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 05-12-2006 06:43 PM

edit the CUSTOM_SHELL template

Snake 05-14-2006 11:09 AM

Thanks for the tutorial. Very useful! :)

twitch 05-26-2006 11:39 PM

Quote:

Originally Posted by Princeton
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 05-27-2006 01:51 AM

replace custom_shell with
HTML Code:

$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 05-27-2006 04:23 AM

Thanks! That did the trick :)

blankoboy 06-22-2006 03:40 AM

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 06-22-2006 11:44 AM

the "body" of the page is a phrase

MadKad 07-19-2006 10:33 AM

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 07-19-2006 01:29 PM

you can use is_member_of() function...

Code:

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 07-19-2006 07:31 PM

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 07-19-2006 07:39 PM

that's up to you ... you can add it to the templates or the file

MadKad 07-19-2006 07:46 PM

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 07-23-2006 12:58 PM

Does anyone know if this works for 3.6?

PoetJA-1975 10-10-2006 01:38 AM

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:
Code:

<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:

PHP Code:

$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 10-17-2006 10:20 AM

hi PoetJA-1975,

I'm guessing that you want to remove the "box" enclosing the Amazon script. If so ...
REPLACE:
HTML Code:

<table cellspacing="0" cellpadding="0" border="0" width="100%">
  <tr>
    <td width="100%" valign="top">$HTML</td>
  </tr>
</table>

WITH:
HTML Code:

$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 10-17-2006 05:05 PM

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 10-17-2006 08:04 PM

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 10-18-2006 08:21 AM

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:

PHP Code:

<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 10-18-2006 10:15 AM

remove everything except ... $vbphrase[content]

PoetJA-1975 10-19-2006 12:45 AM

GREAT - thanx PRINCETON! Much appreciation

Jacquii.

texasf1racer 11-08-2006 04:38 AM

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 11-08-2006 11:27 AM

Quote:

Originally Posted by texasf1racer
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 01-02-2007 10:19 AM

Doest work with vbulletin 3.6.4

beduino 06-27-2007 04:40 PM

Quote:

Originally Posted by wIrEs (Post 1149050)
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 06-27-2007 06:00 PM

the mod was made for 3.5 not 3.6+

however, there are some users who say it does work for them ...
https://vborg.vbsupport.ru/showthread.php?t=108583

beduino 07-29-2007 02:35 AM

tks a lot

karlm 07-29-2007 04:12 AM

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 08-06-2007 09:35 AM

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 08-06-2007 11:15 AM

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 04-01-2008 03:37 PM

nevrmind LOL I need more sleep


All times are GMT. The time now is 09:50 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.01889 seconds
  • Memory Usage 1,853KB
  • 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
  • (2)bbcode_code_printable
  • (7)bbcode_html_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (38)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete