b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Glossary
  3. Generic vocabulary
  4. Stub File

Stub File

WARNING This feature is deprecated. It still works but recent versions of b2evolution allow a very wide range of URL schemes, including aliases and tiny URLs. Therefore the preferred method is to Mod Rewrite all your URLs to index.php and let b2evolution do the job of figuring out which collection needs to be displayed.

A Stub File is a placeholder file that will make a particular Blog or Collection live in a particular place of your website.

For example you could create a stub file called myblog.php at the root of your website so that your blog could be accessed at http://www.mydomain.com/myblog.php. The main function of the stub file would be to set the collection ID by something like $blog = 3;.

  • Older versions of b2evolution ship with files named blog1.php to blog7.php in the root directory.
  • Newer versions of b2evolution don’t ship with stub files any more. They are configured by default to recognize all collections as extra-parameters on index.php.

You can download a sample stub file from this page or you can copy/paste the sample provided below. Rename it to whatever you want and make sure the extension is .php once you upload it to your website. (not .php.txt which is only to make download and editing convenient.)

IMPORTANT: in addition to placing the stub file on your site, you will also need to configure the collection/blog’s base URL accordingly.

Exemple of contents of a stub file:

<?php
/**
 * This is a stub file for displaying a b2evolution blog.
 *
 * A stub file is used to anchor a particular blog in a particular location of your website.
 */

# First, select which blog you want to display here!
# You can find these numbers in the back-office under the Blogs section.
# You can also create new blogs over there. If you do, you may duplicate this file for the new blog.
$blog = 2;

# You could *force* a specific skin here with this setting: (otherwise, default will be used)
# $skin = 'custom';

# This setting retricts posts to those published, thus hiding drafts.
# You should not have to change this.
$show_statuses = array();

# Additionnaly, you can set other values (see URL params in the manual)...
# $order = 'ASC'; // This for example would display the blog in chronological order...

/**
 * That's it, now let b2evolution do the rest! :)
 * Note: if you put this file in a subdirectory, you will need to adjust the path below, for example:
 * require_once dirname(__FILE__).'/../conf/_config.php';
 */
require_once dirname(__FILE__).'/conf/_config.php';

require $inc_path.'_blog_main.inc.php';
?>

If you want more information about stub files, please read: Introduction to Stub Files

Attachments:

  • blog2.php.txt (1.2 KB)
Tags: deprecated
Created by fatimahnasra • Last edit by fplanque on 2020-01-10 19:37 • •

No feedback yet

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
    • All terms
    • Blog vocabulary
    • CMS vocabulary
    • Emailing vocabulary
    • Forum vocabulary
    • Generic vocabulary
      • API
      • Admin Interface
      • After more position
      • Anonymous User
      • Author
      • Back-Link
      • Back-Office
      • Base URL
      • Bubble Tips
      • CamelCase
      • Category
      • Collection
      • Collection Admin
      • Collection Member
      • Collection Owner
      • Collection Template List
      • Comment
      • Container
      • Content Block
      • Content Moderator
      • Cover position
      • DB
      • Datetime
      • Editor
      • Extra Categories
      • FTP
      • Fallback position
      • File Root
      • Front Office
      • Front Page
      • Full-Access Collection Admins
      • Group Level
      • Home Page
      • Info Page
      • Info Page
      • Inline position
      • Intro Post
      • Intro-Sub
      • Intro-Tag
      • Issue Date
      • Item
      • Item Tag
      • Item Types
      • Item Usage
      • Keyboard Shortcuts
      • Logged-in User
      • Main Category
      • Mass Edit
      • Meta Category
      • Meta Comments
      • Moderator
      • Owner
      • PHP
      • Permalink
      • Ping
      • Post
      • Post ID
      • Private Message
      • Quick moderation
      • Recently Edited Posts
      • Renderer Plugins
      • Request Title
      • Section
      • Site Admin or System Admin
      • Site Member or Authenticated User
      • Site Visitor
      • Skin or evoSkin
      • Skins Repository
      • Slug
      • Standalone Page
      • Stub File
      • Teaser
      • Teaser position
      • Themes
      • Tiny Slug
      • UI
      • User Account
      • User Admin
      • User Community
      • User Group
      • User Level
      • User Moderator
      • User Permissions
      • Website
      • Widget
      • Widget Page
      • Workflow
      • evoBar
    • Manual vocabulary
    • Technical vocabulary
  • Archives
Social CMS

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque