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)

Mark4865 04-03-2011 01:59 PM

Got everything working as we wanted thanks for all the help Lynne great support

Acoly 04-18-2011 09:17 PM

Hi guys,
I have just created my first php vbulletin page following the instructions on the first page. Is there any way I can control the access to specific areas of my page according to the member's permission? If so can you point me to some code examples please?
TIA,
George
PS: Please be gentle PHP/vbulletin is fairly new to me :).

Lynne 04-18-2011 10:36 PM

Quote:

Originally Posted by Acoly (Post 2186106)
Hi guys,
I have just created my first php vbulletin page following the instructions on the first page. Is there any way I can control the access to specific areas of my page according to the member's permission? If so can you point me to some code examples please?
TIA,
George
PS: Please be gentle PHP/vbulletin is fairly new to me :).

You can use this function:
PHP Code:

if (!is_member_of($vbulletin->userinfoxyz))   { 
// no permission if you aren't a member of usergroupid x, y, or z         
print_no_permission();  



Acoly 04-19-2011 01:46 AM

Thank you so much Lynne, that worked :).

I have another question pertinent to this page--I want to use it to add a form that only contains a type=file input field and upload that file on the server.
I have created the form but when trying to submit, I get the following error:

Your submission could not be processed because a security token was invalid.

I am pretty sure that I will need to pass the credentials as well--do you know how I can accomplish this?

TIA,
George

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

I got it! I am adding the code for the whole form below:
Code:

<form action="test.php" method="post" enctype="multipart/form-data">
  <label for="file">Filename:</label>
  <input type="file" name="file" id="file" />
  <br />
  <input type="submit" name="submit" value="Submit" />
  <input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
  <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
</form>

These two hidden fields is what is needed.
George

Lynne 04-19-2011 05:11 PM

Yep, you got it. Thanks for sharing it. :)

ivan_wc3 04-19-2011 10:58 PM

Hi all,
there is a way to set in a specific navtab a different style?
I would to set for each navtab a different style? How it's possible?

Thanks a lot :)

Lynne 04-20-2011 03:56 AM

Quote:

Originally Posted by ivan_wc3 (Post 2186469)
Hi all,
there is a way to set in a specific navtab a different style?
I would to set for each navtab a different style? How it's possible?

Thanks a lot :)

This article has nothing to do with navtabs. If you have a question about navtabs, I suggest you post in the appropriate forum.

ivan_wc3 04-20-2011 06:22 AM

sorry,
this is a misunderstanding....
I've add my ownvBulletin page using my MASTER style... It's possibile create my own vBulletin page with another different style...

In this way i've differents style in differents page?

Thanks you a lot

Lynne 04-20-2011 08:17 PM

You may change the template for the different styles.

ivan_wc3 04-21-2011 04:12 PM

Sure,
but in this way user must change style and all the page will have the same style.

I would to create page with different style. It's possible?

wowautoauctions 05-02-2011 03:40 AM

Is it possible to change the template to work exactly like the front-page cms (create menu and everything).. So for it to look like this :

https://vborg.vbsupport.ru/external/2011/05/49.png

Lynne 05-02-2011 04:04 AM

Quote:

Originally Posted by wowautoauctions (Post 2190913)
Is it possible to change the template to work exactly like the front-page cms (create menu and everything).. So for it to look like this :

If you put all the code into the php page and then the html into the template, then sure.

wowautoauctions 05-02-2011 04:30 AM

Quote:

Originally Posted by Lynne (Post 2190920)
If you put all the code into the php page and then the html into the template, then sure.

So I have to find each template that the cms uses and combine them all into one template?

Lynne 05-02-2011 04:51 PM

Quote:

Originally Posted by wowautoauctions (Post 2190922)
So I have to find each template that the cms uses and combine them all into one template?

You need at least the template code for the areas you want to show. You could use the same templates, but you will need to render them in your php code in order to use them.

mintman72 05-03-2011 04:11 PM

Ok, so I know I've got to be doing something wrong, but I cannot figure it out for the life of me. I've loaded the php file into my root directory, added the template into my style, but whenever I try to key in the URL for the php, I get a 404 error.

I've checked my spelling, capitalization, and file location. Made sure everything is lined up, but I just cannot seem to clear the 404 error. Any suggests?

Lynne 05-03-2011 04:48 PM

How about a URL?

mintman72 05-03-2011 04:51 PM

PHP Code:

http://www.ourcouponhome.com/coupons.php 

is supposed to be where you can pull it up

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

OK, figured out what was going on! Thanks for the willingness to help out!

Mark4865 05-06-2011 01:28 PM

Hello Lynne,

we managed to use this fantastic mod to create the perfect custom page using this mod and wanted to thank you for all your hard work and great support, much appreciated. We want to use our new custom page as the first page (log in page) people see when they type in our website URL, how do we change things in VB so we can make this happen. When they log in they are then taken to the front page in the CMS as per normal. We have set all the log in places and links to do this all I need to know is where to change things to make this the 1st log in page please.

thanks again for a great mod and great support

Lynne 05-06-2011 03:28 PM

Quote:

Originally Posted by Mark4865 (Post 2192664)
Hello Lynne,

we managed to use this fantastic mod to create the perfect custom page using this mod and wanted to thank you for all your hard work and great support, much appreciated. We want to use our new custom page as the first page (log in page) people see when they type in our website URL, how do we change things in VB so we can make this happen. When they log in they are then taken to the front page in the CMS as per normal. We have set all the log in places and links to do this all I need to know is where to change things to make this the 1st log in page please.

thanks again for a great mod and great support

Have you tried just naming this new page index.php so that is the first page people go to?

Mark4865 05-06-2011 04:18 PM

Heh Lynne,

thanks for response. No I am a total technical idiot so would never have thought of that. I assume I would then have to name orignal index.php something else or is there not currently a file called index.php

Lynne 05-07-2011 03:57 AM

Have you tried looking at the default vbulletin index.php page? It just points to another page. Replace it with whatever you want (keep a copy in case you don't like your new page).

Mark4865 05-07-2011 05:21 AM

Hello Lynne,

Sorry another stupid question, where do I find this and how do I do that. Sorry as mentioned total technical idiot, need clear step by step instructions so I dont break it.

Thanks in advance

Mark4865 05-11-2011 02:25 PM

Hello Lynne,

any chance you can give me the instructions to sort out above issue.

regards and thanks

Mark

Lynne 05-11-2011 02:57 PM

Quote:

Originally Posted by Mark4865 (Post 2194444)
Hello Lynne,

any chance you can give me the instructions to sort out above issue.

regards and thanks

Mark

I really don't understand what you want. If you want your custom page to be the main page when people go to your site, then rename it to be index.php. Rename the old index.php file to be oldindex.php so you still have it around.

albanah 05-13-2011 05:44 PM

Thanks Lynne.
I tried to get it to work, but I get blank page.
I am using vb4.1.2
I saw your earlier responses to similar problems, bu I am sure I have the template added to all styles including the master.
Any help ?

Lynne 05-13-2011 05:49 PM

Quote:

Originally Posted by albanah (Post 2195210)
Thanks Lynne.
I tried to get it to work, but I get blank page.
I am using vb4.1.2
I saw your earlier responses to similar problems, bu I am sure I have the template added to all styles including the master.
Any help ?

If you did *exactly* what I posted in the first post, then you should not get a blank page. Double check any changes you made to the php page and template.

Mark4865 05-14-2011 05:28 PM

thanks Lynne I will give it a try

albanah 05-14-2011 05:37 PM

Quote:

Originally Posted by Lynne (Post 2195215)
If you did *exactly* what I posted in the first post, then you should not get a blank page. Double check any changes you made to the php page and template.

I did not change any thing. I named the page (test.php) and tempalate (Test)
Just copy and paste of your exact codes.

But it did not work.

Lynne 05-14-2011 07:43 PM

Quote:

Originally Posted by albanah (Post 2195670)
I did not change any thing. I named the page (test.php) and tempalate (Test)
Just copy and paste of your exact codes.

But it did not work.

The template is not named "Test", it is named "TEST".

albanah 05-15-2011 07:10 AM

Quote:

Originally Posted by Lynne (Post 2195733)
The template is not named "Test", it is named "TEST".

Yes, I used TEST of course.

Any idea why I am getting blank page ?

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

Quote:

Originally Posted by albanah (Post 2195914)
Yes, I used TEST of course.

Any idea why I am getting blank page ?

I have checked in vb 4.0.2 ---> it is working fine.

Can you then update it to work with 4.1.2 and higher.

Many thanks in advance.

Lynne 05-15-2011 04:32 PM

There is no need to update it. It works perfectly fine in 4.1.2 an 4.1.3. The basic page structure hasn't changed at all in the 4.x series.

setjo1980ya 05-25-2011 01:59 PM

I have created custom page in vbulletin forum but don't know how to link it from navigation bar.
Please help

Lynne 05-25-2011 03:54 PM

Quote:

Originally Posted by setjo1980ya (Post 2199794)
I have created custom page in vbulletin forum but don't know how to link it from navigation bar.
Please help

There are several modifications to do this and a few articles if you try a search. [HOW TO - vB4] Create a New Tab in the navbar

setjo1980ya 06-02-2011 10:43 AM

I have created new page in vbulletin using the following code but is it blank

Please let me know the issue

First I prepared new custom page in named we-support.php

<?php
error_reporting(E_ALL & ~E_NOTICE);

define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'we-support');

$phrasegroups = array();

$specialtemplates = array();

$globaltemplates = array(
'test'
);

$actiontemplates = array();

require_once('./global.php');

if ($vbulletin->options['ctab_enable'])
{
$noaccessgids = explode(",", $vbulletin->options['limit_groups']);
if (is_member_of($vbulletin->userinfo, $noaccessgids))
{
print_no_permission();
}else{
$content = $vbulletin->options['content'];
}

$pagetitle = $vbulletin->options['custom_title'];

$navbits = array();
$navbits[$parent] = $vbphrase['custom_message_title'];
$navbits = construct_navbits($navbits);
$navbar = render_navbar_template($navbits);

$templater = vB_Template::create('test');
$templater->register_page_templates();
$templater->register('content', $content);
$templater->register('navbar', $navbar);
print_output($templater->render());
}
?>

============================
And Prepared new template named test

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header

$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">Title</td>
</tr>
<tr>
<td class="alt1">Text</td>
</tr>
</table>

$footer
</body>
</html>

But When I opened it I found blank page
http://college-chat-rooms.gradchat.net/we-support.php

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

Issue solved
After deleting these lines the issue solved
if ($vbulletin->options['ctab_enable'])
{
$noaccessgids = explode(",", $vbulletin->options['limit_groups']);
if (is_member_of($vbulletin->userinfo, $noaccessgids))
{
print_no_permission();
}else{
$content = $vbulletin->options['content'];
}

Dave-ahfb 06-04-2011 01:29 PM

Is there any way to have each custom page have its own custom meta tags? I guess I could add about 100 if conditionals in the headinclude, but would this not bog things down?

Lynne 06-04-2011 03:21 PM

You may add your own meta tags into the pages. Just put it up where the headinclude template gets included.

Dave-ahfb 06-04-2011 10:33 PM

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

Dave

temsamane 06-07-2011 08:57 AM

Quote:

Originally Posted by Lynne (Post 1915364)
This is an updated article on how to create your own vbulletin powered page. It's only for use with vB4.

This is NOT my work. I'm posting this from another thread where vB Style took the time to write this out. And his work is based on the article by Gary King here - How to create your own vBulletin-powered page! (uses vB templates)

Instructions to Create your Own Page:


1. Create the php page:
- Create a new file, whatever you want to call it (let's say test.php).
- Open up test.php and add the following (replace TEST with whatever template you want to show)

2. Create the Template:
- If you are in debug mode, create the template in your MASTER STYLE so it shows up in all your styles, otherwise make sure you create the template in the style you are using.


i am a newby. I made step one and uploaded the file to forum root. but how can i create the template? can you tell me the steps i have to follow please?

Lynne 06-07-2011 04:47 PM

Quote:

Originally Posted by temsamane (Post 2204542)
i am a newby. I made step one and uploaded the file to forum root. but how can i create the template? can you tell me the steps i have to follow please?

Styles & Templates > Style Manager > find style > Add New Template

d19rnyxx 06-07-2011 11:36 PM

what condition can I use to only have a certain forum shown on a new .php page.


All times are GMT. The time now is 05:02 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.02602 seconds
  • Memory Usage 1,844KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (15)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