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. All terms
  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
      • API
      • Admin Interface
      • After more position
      • Anonymous User
      • Article
      • Author
      • Back-Link
      • Back-Office
      • Blog Client
      • Blog Member
      • Blog or Weblog
      • Blogger
      • Book
      • Bootstrap Framework
      • Bubble Tips
      • CCMS
      • CMS
      • CamelCase
      • Category
      • Chapter
      • Collection
      • Collection Admin
      • Collection Member
      • Collection Owner
      • Comment
      • Cover position
      • Datetime
      • Display-Time vs Save-Time
      • Editor
      • Email Campaign
      • Email Sequence
      • Extra Categories
      • FTP
      • Fallback position
      • Forum
      • Front Office
      • Front Page
      • Full-Access Collection Admins
      • Group Level
      • HTTP Referer
      • Home Page
      • Info Page
      • Info Page
      • Inline position
      • Installed Plugins
      • Intro Post
      • Intro-Sub
      • Intro-Tag
      • Issue Date
      • Item
      • Item Tag
      • Item Types
      • Link Blog
      • Logged-in User
      • Mailing List
      • Main Category
      • Manual Page
      • Meta Category
      • Meta Comments
      • Moderator
      • Newsletter
      • Newsletter Issue
      • Newsletter Subscription
      • Notification
      • Online Manual
      • Owner
      • PHP
      • Permalink
      • Photoblog
      • Ping
      • Post
      • Post ID
      • Prerendering Cache
      • Private Message
      • Quick moderation
      • Recipient
      • Renderer Plugins
      • Reply
      • Responsive Web Design (RWD)
      • SMTP
      • Scheduled Job
      • Scheduled Task
      • Scheduler
      • Section
      • Site Admin or System Admin
      • Site Member or Authenticated User
      • Site Visitor
      • Skin or evoSkin
      • Skins Repository
      • Slug
      • Stub File
      • Subscriber
      • Subscription
      • Teaser
      • Teaser position
      • Themes
      • Topic
      • UI
      • Update Notification
      • Update Subscription
      • User Account
      • User Admin
      • User Community
      • User Group
      • User Level
      • User Moderator
      • User Permissions
      • Webmentions
      • Website
      • Workflow
      • evoBar
    • Blog vocabulary
    • CMS vocabulary
    • Emailing vocabulary
    • Forum vocabulary
    • Generic vocabulary
    • 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