Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Custom Pages in vBulletin - PHP, HTML CSS, the works Details »»
Custom Pages in vBulletin - PHP, HTML CSS, the works
Version: 1.00, by gibigbig gibigbig is offline
Developer Last Online: Jan 2013 Show Printable Version Email this Page

Category: Add-On Releases - Version: 4.0.8 Rating:
Released: 11-20-2010 Last Update: Never Installs: 16
Auto-Templates
Additional Files  
No support by the author.

Im not 100% sure where to add this, this is not a product, it is a work around the template system (only uses the template system for grabbing any template you want and displaying it in this page)
To use this addon, make a new file "page.php" in your forum root (if you want it in another directory you will need to edit a few lines in the code, not a big deal though). Paste the below code into the page.php and save. Run http://www.site.com/forum/page.php
Here is the code.


PHP Code:
<?php
/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 4.0.8
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000-2010 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/

/**
 * If you want to move this file to the root of your website, change this
 * line to your vBulletin directory and uncomment it (delete the //).
 *
 * For example, if vBulletin is installed in '/forum' the line should
 * state:
 *
 *    define('VB_RELATIVE_PATH', 'forum');
 *
 * Note: You may need to change the cookie path of your vBulletin
 * installation to enable your users to log in at the root of your website.
 * If you move this file to the root of your website then you should ensure
 * the cookie path is set to '/'.
 *
 * See 'Admin Control Panel
 *    ->Cookies and HTTP Header Options
 *      ->Path to Save Cookies
 */

//define('VB_RELATIVE_PATH', 'forums');


// Do not edit.
if (defined('VB_RELATIVE_PATH'))
{
    
chdir('./' VB_RELATIVE_PATH);
}


/**
 * You can choose the default script here.  Uncomment the appropriate line
 * to set the default script.  Note: Only uncomment one of these, you must
 * add // to comment out the script(s) that you DO NOT want to use as your
 * default script.
 *
 * You can choose the default script even if you do not plan to move this
 * file to the root of your website.
 */



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

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

define('THIS_SCRIPT''home');     // change this so you can use other conditionals like "THIS_PAGE" != "home" etc.. in other, real templates.
define('CSRF_PROTECTION'false);   // turn on for token layer security


// ################### PRE-CACHE TEMPLATES AND DATA ###################### 

// cache any templates you want  to use for this mod .

// get special phrase groups 
$phrasegroups = array(); 

// get special data templates from the datastore 
$specialtemplates = array(); 

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

// 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 ############################ 
// ####################################################################### 

//This appears in your breadcrumbs navigation.

$navbits construct_navbits(array('' => 'Welcome to animeFans.tv. No fancy "we\'re the best, we\'re #1, you judge this site your self by browsing our forums below :D')); 
$navbar render_navbar_template($navbits); 

// ###### YOUR CUSTOM CODE GOES HERE ##### 
//appears in the <title> tags in the head
$pagetitle 'animeFans Home'

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

// register your templates

$templater vB_Template::create('TEST'); 
$templater->register_page_templates(); 
$templater->register('header'$header); 
$templater->register('headinclude'$headinclude); 
$templater->register('navbar'$navbar); 
$templater->register('footer'$footer); 
$templater->register('pagetitle'$pagetitle); 
// 
//important variables, already queried and ready to use
$userid            =    $vbulletin->userinfo[userid];
$username        =    $vbulletin->userinfo[username];
$usergroup        =    $vbulletin->userinfo[usergroupid];
$avatarrevision =    $vbulletin->userinfo[avatarrevision];
//

// your own custom head and css files
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html dir="ltr" lang="en"> <head> 
'
.$headinclude.
 <title>'
.$pagetitle.'</title>  
   <link href="clientscript/animefans/rpg.css" rel="stylesheet" type="text/css" /> 
  <style type="text/css"> 
<!-- 
.advertisement {display: none !important} 
--> 
</style> 

 </head> <body> '

 
// output templates
echo $header$navbar
//content here 

echo 'you can do queries, loops, anything you want here';
//footer, close everything 
echo $footer
echo 
'</body></html>';
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 16:53, Mon Nov 8th 2010
|| # CVS: $RCSfile$ - $Revision: 35749 $
|| ####################################################################
\*======================================================================*/

?>
Please note that you can use the switch() to loop through conditions so that you can have one page for a whole custom mod. example:

PHP Code:
switch($do){
case 
"register":
echo 
'registration form';
break;
case 
"member":
echo 
'member details';
break;
default;
echo 
'something here if $do is empty';

and access it like
www.site.com/page.php?do=register //registration
www.site.com/page.php?do=member // member page
www.site.com/page.php?do=fgdgf // nonsense will be directed to the default; in the switch

www.site.com/page.php // empty $do will be directed to the default; in the switch

I know this is not the the best way to use vb, and has some security risks when csrf protection is off but its a great way to get used to vbulletin.

Benefits:
  • Automatically adjusted to suite any skin when a user switches, no extra coding needed
  • Simple and easy
  • can access other databases
  • can use any php function available to your server
  • can access ALL of vbulletin's functions and classes.
  • can use any html tag
  • can use any css file and selector
  • canuse any amount of javascript
  • no messy plugins and settings to sort through.
  • have full access to all vbulletin's plugins, classes, templates and much more!!!
Downsides
  • requires small amounts of php/html/css knowledge.


CHANGELOG:

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 11-28-2010, 08:23 AM
SpiritOf76 SpiritOf76 is offline
 
Join Date: Nov 2010
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much. This is incredibly useful to a newbie like myself.
Reply With Quote
  #3  
Old 11-28-2010, 04:59 PM
DarKNull DarKNull is offline
 
Join Date: Feb 2005
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm getting this design error after installing.

Reply With Quote
  #4  
Old 11-29-2010, 03:25 AM
gibigbig gibigbig is offline
 
Join Date: Jul 2007
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SpiritOf76 View Post
Thank you very much. This is incredibly useful to a newbie like myself.
not a problem i originally made it because im a noob at making vb products myself, so i came up with a way to NOT use the template system (which is very limiting) and NOT have to sieve through messy products and xml etc..

I also have a 3.6 - 3.8 version available
Quote:
Originally Posted by DarKNull View Post
I'm getting this design error after installing.

send me your forum link, i need to look at your code if i can assist you.
it looks a css file is missing though
Reply With Quote
  #5  
Old 11-29-2010, 03:29 AM
gibigbig gibigbig is offline
 
Join Date: Jul 2007
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

changelog added
Reply With Quote
  #6  
Old 04-16-2011, 02:05 AM
Lestat_ Lestat_ is offline
 
Join Date: Apr 2011
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is 100% exactly what I needed !!! thank you mate
Reply With Quote
  #7  
Old 09-25-2013, 11:05 AM
Zoul Zoul is offline
 
Join Date: Nov 2012
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello
to version 4.2.1 it works
the only problem is it does not take into account the "aditionnal.css" file

can tell you how to include it.

In addition, losque I add a VB variable, this plant page.
Basically I would like to create a login page in this principle:



here is my code (retrieved during a connection error, wrong username or pass):
Code:
        <div class="standard_error">
            <form class="block vbform"  method="post" action="login.php?do=login" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, {vb:raw show.nopasswordempty})">
                <h2 class="blockhead">Message de connexion vBulletin</h2>

                <input type="hidden" name="do" value="login" />
                <input type="hidden" name="url" value="{vb:raw scriptpath}" />
                <input type="hidden" name="vb_login_md5password" />
                <input type="hidden" name="vb_login_md5password_utf" />
                {vb:raw postvars}
                <input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
                <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
                <div class="blockbody formcontrols">
                    
                    <h3 class="blocksubhead">{vb:rawphrase not_logged_no_permission}</h3>
                    <div class="blockrow restore">Vous etes sur le point de vous connecter a GFX-Art. Mot de passe oubli? ? Cliquez <a href="http://www.gfx-art.fr/forum/login.php?do=lostpw"><b>ICI</b></a>!
                            </div>
                    <vb:if condition="$show['register_message']">
                    <p class="blockrow">{vb:rawphrase admin_required_register, {vb:raw session.sessionurl}}</p>
                    </vb:if>
                    
                    <h3 class="blocksubhead">{vb:rawphrase log_in}</h3>        
                    <div class="blockrow">
                        <label for="vb_login_username">{vb:rawphrase username}:</label>
                        <input type="text" class="primary textbox" id="vb_login_username" name="vb_login_username" accesskey="u" tabindex="1" />
                    </div>
                    <div class="blockrow">            
                        <label for="vb_login_password">{vb:rawphrase password}:</label>
                        <input type="password" class="primary textbox" id="vb_login_password" name="vb_login_password" tabindex="1" />
                    </div>
                    <div class="blockrow singlecheck">
                        <label for="cb_cookieuser"><input type="checkbox" name="cookieuser" id="cb_cookieuser" value="1" tabindex="1" /> {vb:rawphrase remember_me}</label>
                    </div>
                    
                </div>
                <div class="blockfoot actionbuttons">
                    <div class="group">
                        <input type="submit" class="button" value="{vb:rawphrase log_in}" accesskey="s" tabindex="1" />
                        <input type="reset" class="button" value="{vb:rawphrase reset_fields}" accesskey="r" tabindex="1" />
                    </div>
                </div>
            </form>
        </div>
If you have another solution, I'm interested

thank you
Reply With Quote
  #8  
Old 09-26-2013, 12:34 AM
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Posts: 1,314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is the defacto guide for making custom pages for vbulletin.
https://vborg.vbsupport.ru/showthread.php?t=228112
You're welcome.
Reply With Quote
  #9  
Old 09-27-2013, 12:08 AM
Zoul Zoul is offline
 
Join Date: Nov 2012
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you very much

I think I have managed to create a login page for my navbar
http://www.gfx-art.fr/forum/connect.php
Reply With Quote
  #10  
Old 09-27-2013, 09:11 AM
Zoul Zoul is offline
 
Join Date: Nov 2012
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hello
I just have a quick question

When I connect this new page, I am redirected to the same page.
Is it possible that I am recognized as connected, I am redirected to the forum index?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:03 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.04644 seconds
  • Memory Usage 2,346KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete