b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (CVS HEAD) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Source for file _collsettings.class.php

Documentation is available at _collsettings.class.php

  1. <?php
  2. /**
  3.  * This file implements the CollectionSettings class which handles
  4.  * coll_ID/name/value triplets for collections/blogs.
  5.  *
  6.  * This file is part of the evoCore framework - {@link http://evocore.net/}
  7.  * See also {@link http://sourceforge.net/projects/evocms/}.
  8.  *
  9.  * @copyright (c)2003-2010 by Francois PLANQUE - {@link http://fplanque.net/}
  10.  *
  11.  *  {@internal License choice
  12.  *  - If you have received this file as part of a package, please find the license.txt file in
  13.  *    the same folder or the closest folder above for complete license terms.
  14.  *  - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  15.  *    then you must choose one of the following licenses before using the file:
  16.  *    - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  17.  *    - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  18.  *  }}}
  19.  *
  20.  *  {@internal Open Source relicensing agreement:
  21.  *  }}}
  22.  *
  23.  * @package evocore
  24.  *
  25.  *  {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  26.  * @author fplanque: Francois PLANQUE
  27.  *
  28.  * @version $Id: _collsettings.class.php,v 1.44 2010/02/26 22:15:52 fplanque Exp $
  29.  *
  30.  */
  31. if!defined('EVO_MAIN_INIT') ) die'Please, do not access this page directly.' );
  32.  
  33. load_class'settings/model/_abstractsettings.class.php''AbstractSettings' );
  34.  
  35. /**
  36.  * Class to handle the settings for collections/blogs
  37.  *
  38.  * @package evocore
  39.  */
  40. {
  41.     /**
  42.      * The default settings to use, when a setting is not defined in the database.
  43.      *
  44.      * @access protected
  45.      */
  46.     var $_defaults = array(
  47.         // Home page settings:
  48.             'what_to_show'           => 'posts',        // posts, days
  49.             'main_content'           => 'normal',
  50.             'posts_per_page'         => '5',
  51.             'canonical_homepage'     => 1,                    // Redirect homepage to its canonical Url?
  52.             'relcanonical_homepage'  => 1,                // If no 301, fall back to rel="canoncial" ?
  53.             'default_noindex'        => '0',                        // META NOINDEX on Default blog page
  54.             // the following are actually general params but are probably best understood if being presented with the home page params
  55.             'orderby'         => 'datestart',
  56.             'orderdir'        => 'DESC',
  57.             'title_link_type' => 'permalink',
  58.             'permalinks'      => 'single',                // single, archive, subchap
  59.  
  60.         // Page 2,3,4..; settings:
  61.             'paged_noindex' => '1',                            // META NOINDEX on following blog pages
  62.             'paged_nofollowto' => '0',          // NOFOLLOW on links to following blog pages
  63.  
  64.         // Single post settings:
  65.             'canonical_item_urls' => 1,                    // Redirect posts to their canonical Url?
  66.             'relcanonical_item_urls' => 1,            // If no 301, fall back to rel="canoncial" ?
  67.             'single_links'   => 'ymd',
  68.             'single_item_footer_text' => '',
  69.  
  70.         // Comment settings:
  71.             'new_feedback_status' => 'draft',      // 'draft', 'published' or 'deprecated'
  72.             'allow_rating'   => 'never',
  73.             'comments_orderdir' => 'ASC',
  74.  
  75.         // Archive settings:
  76.             'arcdir_noindex' => '1',                        // META NOINDEX on Archive directory
  77.             'archive_mode'   => 'monthly',            // monthly, weekly, daily, postbypost
  78.             'archive_links'  => 'extrapath',        // param, extrapath
  79.             'canonical_archive_urls' => 1,                    // Redirect archives to their canonical URL?
  80.             'relcanonical_archive_urls' => 1,                // If no 301, fall back to rel="canoncial" ?
  81.             'archive_content'   => 'excerpt',
  82.             'archive_posts_per_page' => '100',
  83.             'archive_noindex' => '1',                        // META NOINDEX on Archive pages
  84.             'archive_nofollowto' => '0',        // NOFOLLOW on links to archive pages
  85.             'archives_sort_order' => 'date',
  86.  
  87.         // Chapter/Category settings:
  88.             'catdir_noindex' => '1',                        // META NOINDEX on Category directory
  89.             'chapter_links'  => 'chapters',            // 'param_num', 'subchap', 'chapters'
  90.             'canonical_cat_urls' => 1,                    // Redirect categories to their canonical URL?
  91.             'relcanonical_cat_urls' => 1,                // If no 301, fall back to rel="canoncial" ?
  92.             'chapter_content'   => 'excerpt',
  93.             'chapter_posts_per_page' => NULL,
  94.             'chapter_noindex'   => '1',                        // META NOINDEX on Category pages
  95.             'category_prefix'   => '',
  96.  
  97.         // Tag page settings:
  98.             'tag_links'  => 'colon',                        // 'param', 'semicolon' -- fp> we want this changed to prefix only for new blogs only
  99.             'canonical_tag_urls' => 1,                    // Redirect tag pages to their canonical Url?
  100.             'relcanonical_tag_urls' => 1,                // If no 301, fall back to rel="canoncial" ?
  101.             'tag_content'       => 'excerpt',
  102.             'tag_posts_per_page' => NULL,
  103.             'tag_noindex' => '1',                          // META NOINDEX on Tag pages
  104.             'tag_prefix' => '',                                    // fp> fp> we want this changed to prefix only for new blogs only
  105.             'tag_rel_attrib' => 1,              // rel="tag" attribute for tag links (http://microformats.org/wiki/rel-tag) -- valid only in prefix-only mode
  106.  
  107.         // Other filtered pages:
  108.             'filtered_noindex' => '1',                    // META NOINDEX on other filtered pages
  109.             'filtered_content'  => 'excerpt',
  110.  
  111.         // Other pages:
  112.             'feedback-popup_noindex' => '1',        // META NOINDEX on Feedback popups
  113.             'msgform_noindex' => '1',                        // META NOINDEX on Message forms
  114.             'special_noindex' => '1',                        // META NOINDEX on other special pages
  115.             '404_response' => '404',
  116.  
  117.         // Feed settings: (should probably be duplicated for comment feed, category feeds, etc...)
  118.             'atom_redirect' => '',
  119.             'rss2_redirect' => '',
  120.             'feed_content'   => 'normal',
  121.             'posts_per_feed' => '8',
  122.             'xml_item_footer_text' => '<p><small><a href="$item_perm_url$">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p>',
  123.             'image_size'    => 'fit-320x320',
  124.  
  125.         // Sitemaps settings:
  126.             'enable_sitemaps' => 1,
  127.  
  128.         // General settings:
  129.             'cache_enabled' => 0,
  130.             'cache_enabled_widgets' => 0,
  131.             'default_cat_ID' => NULL,                        // Default Cat for new posts
  132.             'require_title' => 'required',          // Is a title for items required ("required", "optional", "none")
  133.             'ping_plugins'   => 'ping_pingomatic,ping_b2evonet,evo_twitter'// ping plugin codes, separated by comma
  134.             'allow_subscriptions' => 0,                    // Don't all email subscriptions by default
  135.             'use_workflow' => 0,                                // Don't use workflow by default
  136.             'aggregate_coll_IDs' => '',
  137.             'blog_footer_text' => '&copy;$year$ by $owner$',
  138.             'max_footer_credits' => 3,
  139.             'enable_goto_blog' => 1,                        // Go to blog after publishing post
  140.         );
  141.  
  142.  
  143.     /**
  144.      * Constructor
  145.      */
  146.     function CollectionSettings()
  147.     {
  148.         parent::AbstractSettings'T_coll_settings'array'cset_coll_ID''cset_name' )'cset_value');
  149.     }
  150.  
  151.     /**
  152.      * Loads the settings. Not meant to be called directly, but gets called
  153.      * when needed.
  154.      *
  155.      * @access protected
  156.      * @param string First column key
  157.      * @param string Second column key
  158.      * @return boolean 
  159.      */
  160.     function _load$coll_ID$arg )
  161.     {
  162.         ifempty$coll_ID ) )
  163.         {
  164.             return false;
  165.         }
  166.  
  167.         return parent::_load$coll_ID$arg );
  168.     }
  169.  
  170. }
  171.  
  172.  
  173. /*
  174.  * $Log: _collsettings.class.php,v $
  175.  * Revision 1.44  2010/02/26 22:15:52  fplanque
  176.  * whitespace/doc/minor
  177.  *
  178.  * Revision 1.42  2010/02/08 17:52:09  efy-yury
  179.  * copyright 2009 -> 2010
  180.  *
  181.  * Revision 1.41  2010/02/06 11:48:32  efy-yury
  182.  * add checkbox 'go to blog after posting' in blog settings
  183.  *
  184.  * Revision 1.40  2010/01/20 20:08:30  efy-asimo
  185.  * Countries&Currencies redirect fix + RSS/Atom feeds image size select list
  186.  *
  187.  * Revision 1.39  2009/11/30 04:31:38  fplanque
  188.  * BlockCache Proof Of Concept
  189.  *
  190.  * Revision 1.38  2009/09/29 16:56:12  tblue246
  191.  * Added setting to disable sitemaps skins
  192.  *
  193.  * Revision 1.37  2009/09/14 12:43:05  efy-arrin
  194.  * Included the ClassName in load_class() call with proper UpperCase
  195.  *
  196.  * Revision 1.36  2009/08/27 12:24:27  tblue246
  197.  * Added blog setting to display comments in ascending/descending order
  198.  *
  199.  * Revision 1.35  2009/08/27 11:54:39  tblue246
  200.  * General blog settings: Added default value for archives_sort_order
  201.  *
  202.  * Revision 1.34  2009/05/26 17:36:41  fplanque
  203.  * Have twitter plugin enabled by default. (it still won't tweet until user enters credentials)
  204.  *
  205.  * Revision 1.33  2009/05/21 12:34:39  fplanque
  206.  * Options to select how much content to display (excerpt|teaser|normal) on different types of pages.
  207.  *
  208.  * Revision 1.32  2009/05/20 18:27:09  fplanque
  209.  * canonical support for date archives
  210.  *
  211.  * Revision 1.31  2009/05/20 12:58:17  fplanque
  212.  * Homepage: option to 301 redirect to canonical homepage.
  213.  * Option to support rel="canonical" instead of or when 301 redirect cannot be used.
  214.  *
  215.  * Revision 1.30  2009/05/17 19:51:10  fplanque
  216.  * minor/doc
  217.  *
  218.  * Revision 1.29  2009/04/22 22:46:33  blueyed
  219.  * Add support for rel=tag in tag URLs. This adds a new tag_links mode 'prefix-only', which requires a prefix (default: tag) and uses no suffix (dash/colon/semicolon). Also adds more JS juice and cleans up/normalized previously existing JS. Not much tested, but implemented as discussed on ML.
  220.  *
  221.  * Revision 1.28  2009/03/20 04:04:07  fplanque
  222.  * minor
  223.  *
  224.  * Revision 1.27  2009/03/08 23:57:42  fplanque
  225.  * 2009
  226.  *
  227.  * Revision 1.26  2009/01/28 22:34:21  fplanque
  228.  * Default cat for each blog can now be chosen explicitely
  229.  *
  230.  * Revision 1.25  2008/10/05 10:55:46  tblue246
  231.  * Blog by mail: We've only one working method => removed the drop-down box and added automatical change to pop3a.
  232.  * The default value for this setting was in the wrong file, moved.
  233.  *
  234.  * Revision 1.24  2008/10/05 06:28:32  fplanque
  235.  * no message
  236.  *
  237.  * Revision 1.23  2008/10/04 14:25:25  tblue246
  238.  * Code improvements in blog/cron/getmail.php, e. g. option to add <img> tags for image attachments.
  239.  * All attachments now get added to the post if the filename is valid (validate_filename()). Not sure if this is secure, but should be.
  240.  *
  241.  * Revision 1.22  2008/09/27 00:48:32  fplanque
  242.  * caching step 0.
  243.  *
  244.  * Revision 1.21  2008/09/09 06:03:30  fplanque
  245.  * More tag URL options
  246.  * Enhanced URL resolution for categories and tags
  247.  *
  248.  * Revision 1.20  2008/06/30 23:47:04  blueyed
  249.  * require_title setting for Blogs, defaulting to 'required'. This makes the title field now a requirement (by default), since it often gets forgotten when posting first (and then the urltitle is ugly already)
  250.  *
  251.  * Revision 1.19  2008/05/06 23:25:34  fplanque
  252.  * minor
  253.  *
  254.  * Revision 1.18  2008/04/19 15:14:35  waltercruz
  255.  * Feedburner
  256.  *
  257.  * Revision 1.17  2008/04/04 16:02:10  fplanque
  258.  * uncool feature about limiting credits
  259.  *
  260.  * Revision 1.16  2008/03/21 19:42:44  fplanque
  261.  * enhanced 404 handling
  262.  *
  263.  * Revision 1.15  2008/02/18 20:22:40  fplanque
  264.  * no message
  265.  *
  266.  * Revision 1.14  2008/02/05 01:51:54  fplanque
  267.  * minors
  268.  *
  269.  * Revision 1.13  2008/01/21 09:35:26  fplanque
  270.  * (c) 2008
  271.  *
  272.  * Revision 1.12  2008/01/17 17:43:52  fplanque
  273.  * cleaner urls by default
  274.  *
  275.  * Revision 1.11  2008/01/17 14:38:30  fplanque
  276.  * Item Footer template tag
  277.  *
  278.  * Revision 1.10  2008/01/15 08:19:36  fplanque
  279.  * blog footer text tag
  280.  *
  281.  * Revision 1.9  2008/01/08 03:28:11  fplanque
  282.  * minor
  283.  *
  284.  * Revision 1.8  2008/01/07 02:53:26  fplanque
  285.  * cleaner tag urls
  286.  *
  287.  * Revision 1.7  2007/11/25 18:20:38  fplanque
  288.  * additional SEO settings
  289.  *
  290.  * Revision 1.6  2007/11/25 14:28:17  fplanque
  291.  * additional SEO settings
  292.  *
  293.  * Revision 1.5  2007/11/24 21:41:12  fplanque
  294.  * additional SEO settings
  295.  *
  296.  * Revision 1.4  2007/11/03 04:56:03  fplanque
  297.  * permalink / title links cleanup
  298.  *
  299.  * Revision 1.3  2007/11/02 01:46:53  fplanque
  300.  * comment ratings
  301.  *
  302.  * Revision 1.2  2007/09/28 09:28:36  fplanque
  303.  * per blog advanced SEO settings
  304.  *
  305.  * Revision 1.1  2007/06/25 10:59:33  fplanque
  306.  * MODULES (refactored MVC)
  307.  *
  308.  * Revision 1.17  2007/05/13 22:53:31  fplanque
  309.  * allow feeds restricted to post excerpts
  310.  *
  311.  * Revision 1.16  2007/04/26 00:11:06  fplanque
  312.  * (c) 2007
  313.  *
  314.  * Revision 1.15  2007/03/24 20:41:16  fplanque
  315.  * Refactored a lot of the link junk.
  316.  * Made options blog specific.
  317.  * Some junk still needs to be cleaned out. Will do asap.
  318.  *
  319.  * Revision 1.14  2007/01/23 09:25:40  fplanque
  320.  * Configurable sort order.
  321.  *
  322.  * Revision 1.13  2007/01/15 03:54:36  fplanque
  323.  * pepped up new blog creation a little more
  324.  *
  325.  * Revision 1.12  2006/12/17 23:42:38  fplanque
  326.  * Removed special behavior of blog #1. Any blog can now aggregate any other combination of blogs.
  327.  * Look into Advanced Settings for the aggregating blog.
  328.  * There may be side effects and new bugs created by this. Please report them :]
  329.  *
  330.  * Revision 1.11  2006/12/16 01:30:46  fplanque
  331.  * Setting to allow/disable email subscriptions on a per blog basis
  332.  *
  333.  * Revision 1.10  2006/12/14 21:41:15  fplanque
  334.  * Allow different number of items in feeds than on site
  335.  *
  336.  * Revision 1.9  2006/12/10 23:56:26  fplanque
  337.  * Worfklow stuff is now hidden by default and can be enabled on a per blog basis.
  338.  *
  339.  * Revision 1.8  2006/12/04 19:41:11  fplanque
  340.  * Each blog can now have its own "archive mode" settings
  341.  *
  342.  * Revision 1.7  2006/12/04 18:16:50  fplanque
  343.  * Each blog can now have its own "number of page/days to display" settings
  344.  *
  345.  * Revision 1.6  2006/11/24 18:27:23  blueyed
  346.  * Fixed link to b2evo CVS browsing interface in file docblocks
  347.  *
  348.  * Revision 1.5  2006/10/10 23:29:01  blueyed
  349.  * Fixed default for "ping_plugins"
  350.  *
  351.  * Revision 1.4  2006/10/01 22:11:42  blueyed
  352.  * Ping services as plugins.
  353.  */
  354. ?>

Documentation generated on Sat, 06 Mar 2010 04:04:04 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).