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)

cellarius 06-08-2011 03:49 AM

You'd need much more than a simple variable. You basically need the code to get all the forum data from database.

KW802 06-08-2011 04:36 PM

Quote:

Originally Posted by Dave-ahfb (Post 2203611)
That is half the solution.

The problem then would be the second set of "default" meta tags also served up. To combat this I created a template which copies headinclude minus all the meta info, which is placed into the page templates.

This is the first time I have pulled out vb4 since the "not ready for prime time" release. Luckily after my 3rd attempt to locate my old test backups, I finally found them :).

I find myself in the same situation with trying to override a few of the default meta tags as well. Would've been good if there was a hook in headinclude for that purpose.

Lynne 06-08-2011 05:26 PM

Quote:

Originally Posted by KW802 (Post 2205127)
I find myself in the same situation with trying to override a few of the default meta tags as well. Would've been good if there was a hook in headinclude for that purpose.

There is no reason you cannot write a plugin that changes a meta tag for a page. As long as you are able to write a valid condition, you should be able to change it.

KW802 06-10-2011 04:45 PM

Quote:

Originally Posted by Lynne (Post 2205151)
There is no reason you cannot write a plugin that changes a meta tag for a page. As long as you are able to write a valid condition, you should be able to change it.

Lynne, would you mind giving an example of dynamically changing, for example, a pages meta tag (eg: description)? For example, using the code in the first post of this thread, if I was to generate a random value every time the page loads then how would I go about using that dynamic random value as the page meta description?

I can see that I can the style_fetch hook & a few other locations to have a constant meta tag override but I'm not seeing how to get a dynamic one in there for a custom page. :o

Thanks

Lynne 06-10-2011 04:56 PM

Just add this to your test.php page:
PHP Code:

      $vbulletin->options['description'] = "This is a test"

That will set the description for that page.

KW802 06-10-2011 05:08 PM

Quote:

Originally Posted by Lynne (Post 2205909)
Just add this to your test.php page:
PHP Code:

      $vbulletin->options['description'] = "This is a test"

That will set the description for that page.

Hhhhhmm.... was one of the first things I tried but was still getting the generic vB description out of the ACP. I'll try again using a more simplistic page tonight. :o

scubasteve3 06-11-2011 12:22 AM

For some reason all of my text goes above the template, above the template header. I am putting my coding after:

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

$navbits = construct_navbits(array('' => 'Test Page'));
$navbar = render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'This is a Test Page';

Lynne 06-11-2011 02:13 AM

You should have no echo statements in your coding or it will go above the template header. All output in your page should be assigned to a variable, that variable registered for use in a template, and then the variable put in the template where you want your output to show.

NgocTam 06-15-2011 01:39 PM

how to support php

CouponWCents 06-16-2011 02:57 PM

I know how to create a template but how do you "create a new file"?

Lynne 06-16-2011 03:12 PM

Quote:

Originally Posted by CouponWCents (Post 2208540)
I know how to create a template but how do you "create a new file"?

Use a plain text editor such as notepad or bbedit and create a file and save it as xxxx.php Then upload it to your site.

CouponWCents 06-16-2011 03:20 PM

Ok, yay! I got that. What I am trying to do is link an amazon store to a page. I have uploaded your code in the OP to the ftp and created a template. I guess what I am having trouble with is linking my amazon store to that template. Does that make sense?

Lynne 06-16-2011 03:29 PM

Then in your template, using proper html, link to the store.

CouponWCents 06-16-2011 03:31 PM

This is what I put but when I type in www.mysite.com/amazon.php, it is just a blank page

{vb:stylevar htmldoctype}
<html xmlns="<iframe src="http://astore.amazon.com/coupo002-20" width="90%" height="4000" frameborder="0" scrolling="no"></iframe>"{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}

<div id="amazon.php">
<h1>{vb:raw pagetitle}</h1>
</div>

<h2 class="blockhead">amazon</h2>
<div class="blockbody">
<div class="blockrow">
Text
</div>
</div>

{vb:raw footer}
</body>
</html>

Lynne 06-16-2011 03:46 PM

Quote:

Originally Posted by CouponWCents (Post 2208558)
This is what I put but when I type in www.mysite.com/amazon.php, it is just a blank page

Perhaps you are using a style that does not have that template included in it?

CouponWCents 06-16-2011 04:21 PM

I created a template named Amazon under my style and added the code above into it.

Lynne 06-16-2011 05:28 PM

Quote:

Originally Posted by CouponWCents (Post 2208578)
I created a template named Amazon under my style and added the code above into it.

Then in your php file, you had better be calling the *exact* same template. Not "amazon", but "Amazon".

CouponWCents 06-16-2011 09:09 PM

I finally got it! Thanks so much Lynne!

cellarius 06-17-2011 11:17 AM

Lynne, may I make a suggestion, if you don't mind? Maybe it would be a good thing to add a big bold note in first post about the case sensivity. That seems to get people in trouble fairly regularly. (or have I missed that note? just took a quick look)

Lynne 06-17-2011 04:49 PM

Quote:

Originally Posted by cellarius (Post 2208935)
Lynne, may I make a suggestion, if you don't mind? Maybe it would be a good thing to add a big bold note in first post about the case sensivity. That seems to get people in trouble fairly regularly. (or have I missed that note? just took a quick look)

I think you are right. I tried to do it by just using colors to show it is the same, but I think I should be a bit more, um, blunt! If they don't see it now, well..... :/

GaRanT 06-18-2011 12:06 PM

How do I delete a just created 'test' template?
Thank you

HMBeaty 06-18-2011 12:30 PM

Go to your template you just created in Styles & Templates and revert that template

Mark4865 06-25-2011 10:37 AM

Hello Lynne,

We renamed index.php to oldindex.php and named our custom page index.php as instructed, worked perfectly and looks great, thanks for all the help on this. One issue, when someone logs in they are then taken back to the same new index.php custom page and not the standard content.php page they used to be taken to with the old index.php file.

How do we fix this please.

thanks in advance for the help

Lynne 06-25-2011 03:29 PM

Quote:

Originally Posted by Mark4865 (Post 2212516)
Hello Lynne,

We renamed index.php to oldindex.php and named our custom page index.php as instructed, worked perfectly and looks great, thanks for all the help on this. One issue, when someone logs in they are then taken back to the same new index.php custom page and not the standard content.php page they used to be taken to with the old index.php file.

How do we fix this please.

thanks in advance for the help

You will have to either modify the code or write a plugin to modify the code. I know people have asked about how to redirect to another page after login before, so try a search in the forums and you should hopefully find the code posted.

Bandit8007 06-25-2011 04:09 PM

this was very helpfull :)

but i find it myself tricky to show this on mainpage

you guys can help me on how to show test.php on main page below navbar?

because it will be a tiny php file.....

i also did read up Lynne his link to it.... but that making me more confused how to do this...

a little hand would be very apprciated :)
thank you..

Lynne 06-25-2011 04:42 PM

This is an article about how to create a whole page, not how to create a little bit of text to show on existing pages.

Bandit8007 06-25-2011 05:13 PM

its is a page m8!
i dint say its txt though.....

Mark4865 06-25-2011 06:11 PM

Quote:

Originally Posted by Lynne (Post 2212662)
You will have to either modify the code or write a plugin to modify the code. I know people have asked about how to redirect to another page after login before, so try a search in the forums and you should hopefully find the code posted.

Thanks Lynne, appreciate the feedback.

I will try and find a coder to take a look at this for me

Bandit8007 06-26-2011 08:13 AM

well ive fixed it on how to show the page on main page..:)
but im wonder how i can add the collapse button to it..
anyone has an idea on how to adcive that?

gracias :)

cellarius 06-26-2011 01:58 PM

When you add the result of this tutorial to another page, you end up with invalid source code.
Regarding the collapse button: Just do a search. I did a tutorial for vB4 on this.

HMBeaty 06-26-2011 02:01 PM

Quote:

Originally Posted by cellarius (Post 2213011)
Just do a search. I did a tutorial for vB4 on this.

Or just check your profile under your "Articles" section lol ;)

LordEd 06-29-2011 10:26 AM

Will this actually work for the CMS aswell?

I have added a dropdown box to my menu, but using static pages bugs me off a little as when I first make it, I end up using html to show things properly. But editing the static page afterwards, make it all wonky.

cellarius 06-29-2011 10:34 AM

Quote:

Originally Posted by LordEd (Post 2214445)
Will this actually work for the CMS aswell?

No.

LordEd 06-29-2011 10:50 AM

Quote:

Originally Posted by cellarius (Post 2214447)
No.

Meh, there seems to be a distinct lack of good articles about modding the CMS. So far I've managed to add buttons, and dropdowns to the navbar, but as I do that other problems arises, like when I go to edit a static page which one of the drop down items links to it basicly removes the html code I've added, replacing it with some stuff i really dont know what is.

Like <br> turning into &lt;br&gt;

Thanks for the answer tho, I was actually going to try it and see how it ended up, probably saved me quite a bit of cursing :) As a total sidenote, any idea where I could find some good information about modding the CMS?

cellarius 06-29-2011 12:02 PM

If it exists, it would be on vbulletin.org. I'm afraid there's not much yet, tho, as you have noted.

radiofranky 06-30-2011 07:24 PM

after creating the external page. What happens if i want to list latest 5 threads from each of my forums?

thanks

cellarius 07-01-2011 03:41 AM

You add the code for that, but that's clearly not part of this tutorial and you should create your own thread for that. Also, you seem to be not quite sure what version of vB you are using?

rtyagis 07-03-2011 05:32 PM

I am creating a TEST page (with Test.php code in the first page) in my sub domain (faqs.policywala.com).
Link to my TEST page is - faqs.policywala.com/TEST.PHP

Getting error -
PHP Code:

Warning: require_once(./global.php) [function.require-once]: failed to open streamNo such file or directory in /home/policywa/public_html/faqs/TEST.PHP on line 31

Fatal error
: require_once() [function.require]: Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php'in /home/policywa/public_html/faqs/TEST.PHP on line 31 

Path to my forum - /home/policywa/public_html/forum

Please help what am I doing wrong? :confused:

flbutterflyz 07-04-2011 01:13 AM

This tutorial worked perfectly for me. Thanks. :)

kevin.kool 07-04-2011 07:05 AM

Thank you for this perfect article.

Just 1 question, how can i parse special characters in username? My members using some special char like ®... in their usernames, it doesn't showing up correctly when output.


All times are GMT. The time now is 05:13 AM.

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.02246 seconds
  • Memory Usage 1,833KB
  • 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_php_printable
  • (13)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