vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Are there any mods to create custom pages? (https://vborg.vbsupport.ru/showthread.php?t=322147)

Innsomnimaniac 03-17-2016 03:43 PM

Are there any mods to create custom pages?
 
I'm looking to create pages an easy non complex way, is there any mod that will do this?

In Omnibus 03-17-2016 04:03 PM

Custom pages require custom coding. There might be a mod that utilizes a template but that won't necessarily meet your specific needs.

You might want to start here: https://vborg.vbsupport.ru/showthread.php?t=228112

MarkFL 03-17-2016 04:10 PM

Quote:

Originally Posted by ProSportsForums (Post 2567458)
Custom pages require custom coding. There might be a mod that utilizes a template but that won't necessarily meet your specific needs.

You might want to start here: https://vborg.vbsupport.ru/showthread.php?t=228112

Yes, that's an excellent tutorial and I used it to easily get going with creating custom pages. :up:

Innsomnimaniac 03-17-2016 05:50 PM

I tried it, but this is what I got following the directions precisely. http://urbanvapekartel.com/uvk/About.php Blank page. Nothing to see.

MarkFL 03-17-2016 06:27 PM

Quote:

Originally Posted by MaxwellMorphine (Post 2567473)
I tried it, but this is what I got following the directions precisely. http://urbanvapekartel.com/uvk/About.php Blank page. Nothing to see.

Please post the code in your PHP file, and maybe we can determine the issue. :)

Innsomnimaniac 03-17-2016 06:33 PM

Quote:

Originally Posted by MarkFL (Post 2567477)
Please post the code in your PHP file, and maybe we can determine the issue. :)

I was actually hoping for a little help figuring it out. This is what I got. I may have something wrong, but I think I did what the instructions said.


PHP Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT''about');
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('about',
);

// 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('' => 'About Page'));
$navbar render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle 'About Max Evans';

// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

$templater vB_Template::create('Aboutme');
$templater->register_page_templates();
$templater->register('navbar'$navbar);
$templater->register('pagetitle'$pagetitle);
print_output($templater->render());

?>


MarkFL 03-17-2016 06:40 PM

Try changing:

PHP Code:

// pre-cache templates used by all actions
$globaltemplates = array('about',
); 

to:

PHP Code:

// pre-cache templates used by all actions
$globaltemplates = array('about'); 


Innsomnimaniac 03-17-2016 07:06 PM

Now it says the page isn't working. http://urbanvapekartel.com/uvk/About.php

MarkFL 03-17-2016 07:10 PM

Quote:

Originally Posted by MaxwellMorphine (Post 2567486)
Now it says the page isn't working. http://urbanvapekartel.com/uvk/About.php

It looks like the requested file isn't where it's supposed to be...

ForceHSS 03-17-2016 07:12 PM

try putting the about.php into the uvk folder so the url will be http://urbanvapekartel.com/uvk/about.php

Innsomnimaniac 03-17-2016 07:15 PM

I edited the post after I realized it was the wrong link. http://urbanvapekartel.com/uvk/About.php

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

Quote:

Originally Posted by MarkFL (Post 2567487)
It looks like the requested file isn't where it's supposed to be...

What file? I'm lost.

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

I realized my FTP client didn't upload the new edit. But, even still, it's blank again. I don't get it. Was there anything I missed in the PHP code?

MarkFL 03-17-2016 10:19 PM

Did you create the template called "Aboutme"? If there's no template to render, then that would definitely give you a blank page. :)

Innsomnimaniac 03-17-2016 11:54 PM

Let me try that.

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

That worked, now how to I populate the page with text?

MarkFL 03-18-2016 01:06 AM

You can simply add the appropriate HTML to make it look like you want, within the body, beneath the navbar. :)

Innsomnimaniac 03-18-2016 01:20 AM

Where do I do that? Like in the templates, or what?

MarkFL 03-18-2016 01:35 AM

Quote:

Originally Posted by MaxwellMorphine (Post 2567517)
Where do I do that? Like in the templates, or what?

Yes, in your "Aboutme" template. Here is a template I created on my local dev site when I was testing this kind of thing out:

HTML 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}
                <h2 class="blockhead aboutus_head">About MHB</h2>
                <div class="blockbody">
                        <div class="blockrow aboutus_body">
                                <div style="text-align: center"><b>Hello And Welcome To MHB!</b></div><br>
                                <p>We are very pleased that you have decided to register at MHB, and we look forward to your participation. We trust that you find your time here to be productive and pleasant. If you have any questions or concerns regarding MHB, we encourage you to address these to an MHB staff member. We truly value feedback from our members, and we are always looking for ways to improve. So, if you think of something you feel would help make MHB better in any way, we would love to hear from you.</p>
                                <div style="text-align: center"><b>MHB's Goals and Philosophy</b></div><br>
                                <p>Our primary goal here at MHB is to help those with mathematics questions to not only gain a better understanding of the question being asked, but to also be able to apply this help in a more general way. We want people to not only be able to successfully apply a formula or technique, but to also understand why and when it works, and when it doesn't. We feel that when this is understood, the procedure for solving the problem will seem less arbitrary and easier to remember. We work to ensure that all of this is done in an environment where discussions are kept civil and on track.<p>
                                <p>We are not a place where you can drop off your homework, and then come back later to find it all neatly done for you. Our goal is to actively engage people in the process of solving their problems so that the benefit to them is maximized. Much more is learned by doing than by watching, and so when we guide rather than simply give the solution, our primary goal is more easily realized.</p>
                                <p>It would actually take less effort on the part of our helpers to just work the problem and post the solution, but this would be lazy and much less effective. You have probably heard the old adage that if you give a man a fish, he eats for a day, but if you teach him to fish, he eats for a lifetime. The majority of those who give help here subscribe to this philosophy.<p>
                                <p>So, in light of this, we expect that when you post a question, work and/or thoughts are also posted so that our helpers know where you are stuck, or what mistake(s) you may be making. This way our helpers can offer specific and judicious guidance. When a question is posted with no effort shown, our helpers are left to guess how best to help. You may have, prior to posting, unsuccessfully tried to apply the suggestions that may be subsequently given on how to begin, and as a result this wastes both your time and that of the helper. We place a high premium on the time of those who contribute help here; it is extremely valuable and should not be squandered.</p>
                                <p>We encourage everyone who desires to do so to help others, as long as the help is relevant and lucid. Help that is hard to read or follow is of minimal value. We urge those who decide to give help on a regular basis to be proficient in the use of $\LaTeX$ so that this help is as easy to read as possible. Those who are observed by MHB staff to consistently give such help and abide by MHB rules, may be nominated to be an official MHB Math Helper. So, if you are asking a question, and the person who is offering you help has the MHB Math Helper badge, this indicates to you that they have been recognized by MHB staff for giving solid help in a manner consistent with MHB philosophy.</p>
                                <p>Mathematics is such a vast and rich field, full of many wonders and beautiful results, and as such we feel it deserves the best possible environment we can provide to our members to explore this incredible wonder and beauty. Few other fields of study has people so passionate to share their knowledge freely with others, for the sheer joy of helping others to experience and appreciate one of the greatest intellectual pursuits known to man.</p>
                        </div>
                </div>
                {vb:raw footer}
        </body>
</html>


RichieBoy67 03-18-2016 02:54 AM

This is a great way to create new pages but I have found it does not render some html any more.

For example. It will render <b></b> but not <strong></strong>. CSS would probably work better though than just sticking html inside the template.

Innsomnimaniac 03-18-2016 03:19 AM

Nevermind, I found a mod that allows you to create custom pages under a pages navbar link. That's good enough for me. Thanks for the help though.

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

Quote:

Originally Posted by MarkFL (Post 2567519)
Yes, in your "Aboutme" template. Here is a template I created on my local dev site when I was testing this kind of thing out:

HTML 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}
                <h2 class="blockhead aboutus_head">About MHB</h2>
                <div class="blockbody">
                        <div class="blockrow aboutus_body">
                                <div style="text-align: center"><b>Hello And Welcome To MHB!</b></div><br>
                                <p>We are very pleased that you have decided to register at MHB, and we look forward to your participation. We trust that you find your time here to be productive and pleasant. If you have any questions or concerns regarding MHB, we encourage you to address these to an MHB staff member. We truly value feedback from our members, and we are always looking for ways to improve. So, if you think of something you feel would help make MHB better in any way, we would love to hear from you.</p>
                                <div style="text-align: center"><b>MHB's Goals and Philosophy</b></div><br>
                                <p>Our primary goal here at MHB is to help those with mathematics questions to not only gain a better understanding of the question being asked, but to also be able to apply this help in a more general way. We want people to not only be able to successfully apply a formula or technique, but to also understand why and when it works, and when it doesn't. We feel that when this is understood, the procedure for solving the problem will seem less arbitrary and easier to remember. We work to ensure that all of this is done in an environment where discussions are kept civil and on track.<p>
                                <p>We are not a place where you can drop off your homework, and then come back later to find it all neatly done for you. Our goal is to actively engage people in the process of solving their problems so that the benefit to them is maximized. Much more is learned by doing than by watching, and so when we guide rather than simply give the solution, our primary goal is more easily realized.</p>
                                <p>It would actually take less effort on the part of our helpers to just work the problem and post the solution, but this would be lazy and much less effective. You have probably heard the old adage that if you give a man a fish, he eats for a day, but if you teach him to fish, he eats for a lifetime. The majority of those who give help here subscribe to this philosophy.<p>
                                <p>So, in light of this, we expect that when you post a question, work and/or thoughts are also posted so that our helpers know where you are stuck, or what mistake(s) you may be making. This way our helpers can offer specific and judicious guidance. When a question is posted with no effort shown, our helpers are left to guess how best to help. You may have, prior to posting, unsuccessfully tried to apply the suggestions that may be subsequently given on how to begin, and as a result this wastes both your time and that of the helper. We place a high premium on the time of those who contribute help here; it is extremely valuable and should not be squandered.</p>
                                <p>We encourage everyone who desires to do so to help others, as long as the help is relevant and lucid. Help that is hard to read or follow is of minimal value. We urge those who decide to give help on a regular basis to be proficient in the use of $\LaTeX$ so that this help is as easy to read as possible. Those who are observed by MHB staff to consistently give such help and abide by MHB rules, may be nominated to be an official MHB Math Helper. So, if you are asking a question, and the person who is offering you help has the MHB Math Helper badge, this indicates to you that they have been recognized by MHB staff for giving solid help in a manner consistent with MHB philosophy.</p>
                                <p>Mathematics is such a vast and rich field, full of many wonders and beautiful results, and as such we feel it deserves the best possible environment we can provide to our members to explore this incredible wonder and beauty. Few other fields of study has people so passionate to share their knowledge freely with others, for the sheer joy of helping others to experience and appreciate one of the greatest intellectual pursuits known to man.</p>
                        </div>
                </div>
                {vb:raw footer}
        </body>
</html>



Ohhh okay, that's not hard.

RichieBoy67 03-18-2016 03:21 AM

Quote:

Originally Posted by MaxwellMorphine (Post 2567523)
Nevermind, I found a mod that allows you to create custom pages under a pages navbar link. That's good enough for me. Thanks for the help though.

If you are talking about this mod:

https://vborg.vbsupport.ru/showthread.php?p=1961076

Be sure to do the fix for usergroup permissions or some of your usergroup permissions will not stick.

Innsomnimaniac 03-18-2016 03:24 AM

How's this? http://urbanvapekartel.com/uvk/About.php

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

Now that I figured this out, I'll use this instead. It's better for me.

RichieBoy67 03-18-2016 03:27 AM

I just see text there, no html?

Innsomnimaniac 03-18-2016 02:10 PM

Quote:

Originally Posted by RichieBoy67 (Post 2567528)
I just see text there, no html?

I was just getting used to doing it. Once I sit down and work with it, I'll add HTML to it.


All times are GMT. The time now is 05:49 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.01329 seconds
  • Memory Usage 1,841KB
  • 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_html_printable
  • (3)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (22)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