Little document of TanyaCMS

### Little document of TanyaCMS - Mella Zihan

# TanyaCMS Ver.1.0.0

Documentation Ver.0.0.1
By: FBSCHOOL
Email: pro@fbschool.com

Thank you for purchasing TanyaCMS. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!

## Table of Contents

1. About
2. Features
   General Features
   Question and Answer Features
   Control Panel Features
3. Installation
4. Set Up TanyaCMS
5. Development
6. TanyaCMS Rewrite (mod_rewrite)
7. FAQ (If your theme uses Flash)

### A) About TanyaCMS - top

TanyaCMS is a professional question & answer software (QAS), suited for anyone who want to create a question & answer community site. TanyaCMS created the clever idea of the site http://quora.com and http://stackoverflow.com, developed using PHP + MySQL + Zend Framework and other advanced technologies.

TanyaCMS is question-answer software with a focus on ease of use, speed and a great user experience. TanyaCMS is a powerful community platform, and it comes with a great set of features designed to make your social network experience on the Internet as easy, pleasant and appealing as possible. We are proud to offer you a standards-compliant, fast, light a Q&A system, with sensible default settings and features, and an extremely customizable core.

TanyaCMS is a great product. It's easy-to-use, quite powerful, and flexible. Before you invest your valuable time and energy into installing TanyaCMS, there are some documents you need to read to help you get started.

### B) General Features - top

- Search Engine Optimization
- -SEO Friendly URLs
- -Custom META keywords/description tag

- Support
- -Installation Guide
- -Public Q&A Forum
- -Standar Installation Services

- Flexibility
- -Extensible user Profiles
- -URL Rewriting
- -Interface Localization
- -Metadata

- Standards Compliance
- -Content Syndication (RSS)
- -Content Syndication: RSS, Atom, XML
- -PHP v5.4 compatible
- -GD Library Support

- Seamless Integrated Experience
- -Single Permission System
- -Single Admin Control Panel
- -Create a continuous Style/theme

- Control Panels
- -Super Admin
- -Esay to management
- -Verification code for Control Panels

- User/Member Management
- -Multi-user system with unlimited roles and permissions
- -Member groups
- -System groups
- -Security
- -Problem Notification
- -Captcha
- -Email Verification
- -Ajax Login System
- -Email and Password changes require current password

### Question & Answer - top

- Category
- -2 level hierarchy of Category
- -Unlimited Category/Subcategory
- -Switch category function (on/off)
- -Category to navigation menu
- -Easy ajax to choose category
- -Category to menu navigation (Icon mode, Text list mode)

- Topic
- -Topic and Category (Share/Invite friends)
- -Admin tools: edit, delete, move, lock, etc.
- -Email page to friend option
- -Unlimited Topic
- -Topic Discription
- -Topic modify records
- -Related topic
- -Follow/Unfollow topic
- -User followed
- -Picture topic
- -WYSIWYG Markdown editor
- -Auto meta discription
- -Filter list question (All questions, Unanswered, Popular)
- -Full information of the question

- Page Topic Square
- -List Popular Topic
- -Filter Topic (Square, Have Concern)
- -List All topics with Ajax
- -Info topic (snipet discription, number question, participan, etc)
- -Info Card topic
- -Shortcut Follow/Unfollow Topic
- -Info topic edit

- Posts Question
- -Supports Markdown Code in a question
- -Markdown WYSIWYG or standard editors for question and Private Messages
- -Avatars Owner
- -Attachment images (.gif, .jpg., etc.)
- -Preview post option
- -Polls (Thank)
- -Post Reporting - report question to admin
- -Info IP Address
- -Add/Edit Topic
- -Share (External website, Message, e-Mail)
- -Admin tools: edit, delete, redirect, lock, etc.
- -Question status (Activity, Views, Following)
- -Invite people to reply (Internal invitation, Email invitation)
- -Reviews Question
- -Reply Reviews Question
- -Reply Question
- -Anonymous Reply
- -Fold Reply

- Member Features
- -Member Profile Pages. This information can be viewed by other members from the member list. URL home page, date of birth, location, occupation, biography, interests, Reputation, Count "Agree" and "Thank", Send private messages, Ask her/him, Follow/Unfollow and related content information: reply, ask, latest post, follow, etc.
- -Account Settings (Basic information, Privacy\reminder, Security Setting)
- -Allows members to upload pictures that can be viewed in the user's profile.
- -Private Messaging
- -Followers List
- -Notification
- -Signature Editor
- -User Card (Ajax)

- Avatar Options
- -Custom Avatars - upload from own computer

- Private Messaging
- -Private Message Tracking
- -User can also enter 500 words
- -User can't sent message to yourself
- -Hierarchy interface
- -Ajax Search User
- -Notification Messaging

- Privacy & Permissions
- -Permission system (System group), based on user (Usergroup)
- -Anonymous (Post/Reply)

- General
- -Email and password changes require current password
- -Mention in post review and comments
- -Fully ajax in search, more question, user card, topic card, etc

- Feature Topic
- -Contains multiple topics
- -Unlimited Add Feature
- -Feature Alias
- -Special icon
- -Customized page layout
- -Add to navigation menu

- Search
- -Ajax search system
- -Search question, topic or person
- -Ask a question with search input

- Home page (for members)
- -Filter question (Latest post, My draft, My favorite, Followed questions, All questions, Invited me)
- -Latest post list (includ title, date, count reply, follow/unfollow, etc)
- -List interested people or topic
- -Invitation
- -Ajax for more question

- Question page
- -List All Question
- -Filter question (Latest, Hot, Unanswered)
- -Count Replay
- -Detail question info (category, owner, date, count participat and view)
- -Popular Topic
- -Hot users
- -Ajax for more question
- -Category Navigation

- Notice page
- -List All Notice
- -Notification setting
- -No unread item
- -Ajax for more question

- User list page
- -List All User
- -User reputation
- -Follow/Unfollow User
- -Includ information Avatar, Reputation, Agree, and Thank
- -Ajax for more question

- Users & Usergroups
- -User registration options
- -User banning
- -Limit on reply to each question
- -Unlimited FrontAdmin and SuperAdmin
- -Permission system (System group), based on user (Usergroup)
- -Allow user to answer own question (Yes/No)
- -Allow anonymous post or reply (Yes/No)
- -Add new usergroup
- -Group invitation
- -Group send Email
- -Default Follow after registration

- Account Settings
- -Basic information
- -Contact us
- -Education
- -Work experience
- -Message setting
- -Email setting
- -Notification setting
- -Change password

- Card
- -User Card
- -Topic Card

- FrontAdmin
- -FrontAdmin admin for frontend

- Attachments
- -Attachment thumbnails (requires PHP to have GD enabled)
- -Protected Link for digital download (only members)

- Styling & Templates
- -Powerful Templating System
- -Conditionals supported in the templates
- -Ability to create multiple styles which can be applied to different sites

- Template Engine and Layouts
- -Proprietary template engine
- -Template/Skins
- -Full CSS layout and design
- -Sitewide templates: you can create an entire site using a default set of templates
- -Powerful, fast and suitable for robust development
- -Add-ons and Plug-ins
- -Easily extensible through a plug-in architecture and variety of accessible plug-ins

### Control Panel Features - top

- Site information
- -Site name
- -Site description
- -Site keywords
- -Website home page
- -External URL adress of uploaded category
- -Absolute path of uploaded file
- -Static category resource URL adress

- Register and vist
- -Time zone
- -Closed site
- -Display verification code when new users register
- -Require Email verification when new user register
- -Membership only by invitation
- -Username rule
- -Minimum and Maximum character of username
- -Filter Username
- -Default user ID after registration
- -Recommend list of user when login for the first time
- -Number of invitations new users get with registration
- -System send Welcome Letter when new user register

- Site function
- -Site notice (Support for HTML)
- -Enable/Disable Rewrite
- -Statistics on Online members
- -Online members Statistics Time Range
- -Notice unread refreshing time
- -Automatic locking time
- -External Site statistics code
- -Question report reason option
- -Recipients report
- -System time display format
- -Backend verification code

- Content setting
- -Asking mode (Shortcut mode, Advanced mode)
- -Uploading attached (Enable/Disable)
- -Legal determine attachment
- -Maximum of attachment size
- -etc

- Credits and Reputation
- -Use credit system
- -Owner agreement with object reputation coefficient
- -Best replyReputation coefficient
- -Minimum value of log

- User permission
- -Limit on reply to each question
- -Allow user to answer own question
- -Allow anonymous post or reply

- Email setting
- -System email sending option
- -Acceptance test Email address
- -Original Email of System Email

- Interface
- -Choose interface style
- -Number of new posts to display
- -Notice display number
- -Page displays a list of issues and the number of users
- -Homepage recommend user and topic number
- -Number topic recommendation
- -Number my followed topics
- -Navigation setting
- -Editor (Markdown editor, Text editor)

- Content
- -Content Review
- -Question list
- -Category setting
- -Move group questions
- -Topic List and search
- -Manage Feature
- -Manage Report User
- -Filter words

- User
- -Online members
- -Members List
- -Edit user information
- -Manage Usergroup
- -Add a user/usergroup
- -Group invitation
- -Job setting
- -Suspended user

- Operations
- -Register statistics
- -Question statistics
- -Reply statistics
- -Topic statistics
- -Topic of the day

- Group send Email
- -User group management
- -Task management

- Tool
- -Update Cache
- -Update search index
- -Database Maintenance (backup, restore)
- -Update user reputation
- -Convert BBcode

### C) Installation - top

#### Before you install TanyaCMS

Before installing TanyaCMS, you need to check that your web hosting provider fulfills the necessary conditions (don't panic! most do) and that you yourself possess the required skills (don't panic! it isn't complicated). Neither of the two should be a problem, but it is wise to verify first.

Make sure you have:

- A web server which you can access via FTP, SFTP or shell.

You will need to be able to use an FTP program to upload files and set file permissions (optional). You could choose FileZilla for this task.

- A text editor

You will need to know how to use a text editor to edit the main configuration file. If you are a Windows user, Notepad will do. Later, you will likely want to edit your Template Files. You can do this through the TanyaCMS Administration Panels, but using a good text editor is highly recommended.

- Your web browser of choice

And make sure your web server is running:

- Web serving software such as Apache, IIS, nginx. Apache or nginx recommended to efficient performance.
- PHP 5.2.10 or later for all functionality.
- MySQL 5.0 or later, the server needs to support MySQLi or PDO_MySQL.
- Support GD library or ImageMagick. Recommended to use ImageMagick, when dealing with large files for better performance.

If you are not sure about this, please check with your web hosting provider.

#### Installing TanyaCMS for the first time

TanyaCMS is ease of installation. Under most circumstances, installing TanyaCMS is a very simple process and takes less than two minutes to complete

The instructions below are for installing TanyaCMS where it manages user accounts and logins for you.

- Download the latest version of TanyaCMS to your computer
- Unzip the download using a tool such as WinZip (or unzip in the Unix shell).
- Create a MySQL database, and a MySQL user with full permissions for that database.
- Set directory attributes (windows server can ignore this step). The following directories need permissions to be read and write
  - ./
  - ./system
  - ./system/config (including subdirectory)
- Execute the install script directly inside the browser to http://yourdomain/install/
- Follow the installation steps, until the installation is complete

### D) Basic Set Up TanyaCMS - top

With your installation complete, it's time to set up TanyaCMS so it will work the way you want it to work.

To help you understand how all the various features and screens on the TanyaCMS Administration Panels work. http://domain/?/admin/

For help on creating your user profile information, of which some or all may appear on your TanyaCMS

To set the site name and other information, go to Administration > General > Site information.

Whether to use the classification function, go to Administration > Content > Category setting. Yes or No. (Classification function is not used, the question will be saved to the [Default Category]). If yes, Add your category.

Want to change the look and feel of your TanyaCMS site? such as themes, number of new posts to display, number of notice, list of issues and the number of users, number topic recommendation, Go to Administration > Interface > Interface setting.

Want to Add Featured?, Featured is a combination of several topics. Example, php features consist of: array, function, etc. go to Administration > Content > Manage Feature > Add Feature.

Once the feature is made, please enter your topic in the feature.

Time to add a navigation menu. All the settings menu navigation, available at: Administration > Interface > Navigation setting. Here you can, delete, add, modify, sort with drag-drop, and select the navigation mode.

Time to add a navigation menu. All the settings menu navigation, available at: Administration > Interface > Navigation setting

### E) TanyaCMS Secondary Development - top

TanyaCMS believes in keeping it a simple/easy to use CMS or Content Management System, and a lot of thought goes into including new functionality as a part of the "core" TanyaCMS code, in order to keep TanyaCMS fast and lightweight. Still, users often find the need to graft additional functionality onto TanyaCMS to meet their needs.

### 1. Directory Structure

    	app – application directory
    	models – Model Directory
    	plugins – plugin directory
    	static – static files
    	system – system directory
    	views – template directory

### 2. URL Routing

TanyaCMS have a strong analytical ability URL routing

1. Action visit
   /ModuleName/Controller/Action/ID

   ID is id query, for example: account/login/123, In the login controller $_GET['id'] has a value of 123
   (*) If you use /ModuleName/Controller/Action/ID format Query string can refer to the use of Compatibility Support.
   (*) If the action in the main controller can be omitted, for example: account/main/login/ equivalent account/login/
   (*) If the action called index can be omitted, for example: account/login/index/ equivalent account/login/

2. Query string

   TanyaCMS query string to use __ separate arguments, use – parameter assignment, used directly in the program $_GET remove content
   Normal: account/login/?return_url=1&callback=2
   TanyaCMS of: account/login/return_url-1__callback-2
   (*) Output URL please use get_js_url function, because it will compatible Rewrite whether to open two cases

3. Compatibility Support
   The following URL in the form of several in the program are supported:

   http://domian/index.php?/question/id-55__column-log__source-doc
   http://domian/index.php?/question/55&column=log&source=doc
   http://domian/index.php?/question/?id=55&column=log&source=doc
   http://domian/index.php?/question/55?column-log__source-doc
   http://domian/index.php?/question/55&column-log__source-doc

### 3. Template naming rules.

TanyaCMS Themes are files that work together to create the design and functionality of a TanyaCMS site. Each Theme may be different, offering many choices for site owners to instantly change their website look.

All templates stored procedure rules Module/Controller/Action if the controller as the main omit
as account/main/login/ corresponding template views/template_set/account/login.tpl.htm
as account/setting/profile/ corresponding template views/template_set/account/setting/profile.tpl.htm

### 4. Automatically import mechanism.

TanyaCMS library, Model without prior introduction of the use of all files, which makes the programming process becomes convenient, but also to avoid duplication instantiation library problem, but using the automatic introduction of mechanisms need to follow the following rules.
(*) All automatic introduction of the library does not need prior instantiation, can be used directly.

1. Model

   Each module of the model on the directory, file name: name_class.inc.php
   File needs to have inherited ASK_MODEL of name_class
   (*) In the program to use: $this->model('name')->action();
   (*) Available range: Controller, Model

2. System library

   Placed in the system directory under the name of the class relative to the system directory, / replaced by _
   Example: Zend_Mail
   Path: system/Zend/Mail.php
   Class name: Zend_Mail
   (*) In the program to use: new, static call, load_class ('class_name');
   (*) Available range: Any, not instantiated with parameters recommended load_class

3. Profiles

   On the system/config directory under the file content as a $config array named configuration_name.php
   (*) In the program to use: ASK_APP::config()->get('Configuration name') -> array subscript
   (*) Available range: Any, not instantiated with parameters recommended load_class

### 5. TanyaCMS.

TanyaCMS template using inheritance mechanism, the system's default template-based, user-defined templates only need to change a few files you can achieve the program interface customization.

Inheritance mechanism works:

Build templates assemblies:

1. Create folder template in the directory view
2. In the directory under static/css/ create folder with the same set of template name, we recommend static/css/default/ copy of the contents to the new template set, and then start to modify the work.

### 6. Common development guidance

JavaScript:
We use jQuery as the main framework, loading plugins are:

1. jQuery Form (http://malsup.com/jquery/form/)
2. AJAX Upload ( http://valums.com/ajax-upload/ )
3. Valums file Uploader (modified)
4. jQuery.ScrollTo
(*) In Javascript judge determines whether the user login GET_USER_ID global variable is greater than 0
(*) Global variables in header template
(*) All JS request URL prefix need to add GET_BASE_URL
(*) Function uses io_load_more global ajax list

PHP:
About Zend Framwork library usage please refer to the official documentation

(*) In the controller determines whether the user is logged judge $this->user_id is greater than 0
(*) Controller and the template is always available $this->user_id and $this->user_info
(*) Controller and Model prohibit the use of constructor, you can use setup() function instead
(*) Program has provided two UTF-8 handlers utf8_substr and utf8_strlen

Access Rule:

    public function get_access_rule()
    	{
    	//Rule Type
    	//White: actions in the action all the user-visible, remaining action need to login.
    	//Black: actions in the action need to log in, all remaining action visible to the user.
    		$rule_action["rule_type"] = 'white';
    		$rule_action["actions"] = array(
    		'Check_username',
    		'Check_email',
    		'Register_process',
    		'Login_process',
    		'Register_agreement',
    		'Send_valid_mail',
    		'Valid_email_active',
    		'Request_find_password',
    		'Find_password_modify'
    		);
    	return $rule_action;
    }

(*) This function is not added to the controller, all necessary action logged visible.

Template:

(*) In the template you can use PHP code, all static class and function, but you can not use the Model
(*) Template $this-> contents of the generic variables are global variables template, the template can be introduced in the internal template can not be produced
(*) TPL::output method when the second parameter is false, the content will not be returned to the variable output, you can use this method to make calls or JS code reuse

### F) TanyaCMS Rewrite - top

#### 1. Permanent Link (permanent)

The URL to each post should be permanent, and never change — hence permalink. Permalinks are the permanent URLs to your individual weblog posts, as well as categories and other lists of postings.

##### Permalink Types

There are three basic types of TanyaCMS permalinks:

1. Default: "Pretty"

   The default looks like: http://localhost/tanyacms/?/question/N where N is the Post ID number. It works on all server environments, but it doesn't look as nice as some of the other options.

2. mod_rewrite: "Pretty Permalinks"

   Using mod_rewrite or lighttpd you can produce much nicer permalinks. There are many different formats, but the most common, and most versatile looks like: http://localhost/tanyacms/question/N Pretty permalinks are available under:

   Apache web server with the mod_rewrite module
   Microsoft IIS 7+ web server with the URL Rewrite 1.1+ module and PHP 5 running as FastCGI
   Microsoft IIS 6+ using ASAPI_Rewrite
   lighttpd using a 404 handler or mod_rewrite
3. PATHINFO: "Almost Pretty"

   PATHINFO permalinks look very much like mod_rewrite permalinks but for one exception: they have /index.php inserted before them, like so: http://localhost/tanyacms/index.php/question/N

##### Enable mod_rewrite

To Enable mod_rewrite please adjust setting the httpd.conf or create .htaccess file. If using IIS add to httpd.ini

If you installed in the web root directory:

Apache

    	<IfModule mod_rewrite.c>
    		RewriteEngine On
    		RewriteBase /
    		RewriteCond %{REQUEST_FILENAME} !-f
    		RewriteCond %{REQUEST_FILENAME} !-d
    		RewriteRule . /index.php [L]
    	</IfModule>

Nginx:

    location  /  {
    		if (!-e $request_filename)
    		{
    			rewrite (.*) /index.php;
    		}
    	}

IIS6:

    	RewriteRule /static/(.) /static/$1
    	RewriteRule /uploads/(.) /uploads/$1
    	RewriteRule /(.*) /index.php/$1

If you are installing on: your directory http://domain/xxx/, the corresponding configuration file are:

Apache

    	<IfModule mod_rewrite.c>
    		RewriteBase /xxx/
    		RewriteEngine On
    		RewriteCond %{REQUEST_FILENAME} !-f
    		RewriteCond %{REQUEST_FILENAME} !-d
    		RewriteRule . /xxx/index.php
    	</IfModule>

Nginx:

    location /xxx/  {
    		if (!-e $request_filename)
    		{
    			rewrite (.*) /index.php;
    		}
    	}

IIS6:

    	CacheClockRate 3600
    	RepeatLimit 32
    	RewriteBase /xxx/
    	RewriteRule /static/(.) /static/$1
    	RewriteRule /uploads/(.) /uploads/$1
    	RewriteRule /(.*) /xxx/index.php/$1

In the Administration > Global > Site function > Enable Rewrite Click Yes, then choose your permalink structure:

##### Customize route

In the URL per line a custom routing rules, separated by an intermediate use ===
The left side for the site default URL pattern, and the right side to replace post

    	/home/explore/===/explore/
    	/home/explore/guest===/guest
    	/home/explore/category-(:num)===/category/(:num)
    	/home/users/===/users/
    	/account/login/===/login/
    	/account/logout/===/logout/
    	/account/setting/(:any)/===/setting/(:any)/

### G) FAQ - top

##### How to change logo?

Logo are stored in /THEMES/img/ folder. Ex: static/css/default/img/logo_tanyacms.png

##### Need help?

If you need help you can write to me on Developer TanyaCMS

##### Do you have a service for changing some code?

Yes, it's paid service

##### Do you have a service for build awesome themes?

Yes, it's paid service

##### I found some bug, what i should to do?

If you've found a bug in our software, write to me on Developer TanyaCMS

##### When will be next update?

Next update will be after 300 sales

### Contribute to TanyaCMS

Language Translations - What does "I'm pretty sure"? Prettify me with your translation

Join in our community translation project, helping to translate our software into numerous other languages. Download lang.zip file at http://code.fbschool.com/translate then, following this steps:

1. Unzip lang.zip file
2. Open file with text Editor
3. Prettify language in lang.php file with your translation
4. Save As file with name your languages. Such as `en_gb.php, in.php, etc`
5. Don't forget put your name and website
6. Ziped file and send to us 13455n@gmail.com

or contribute to others. Visit official support Question & Answer Software

### Appendix: More information

Here are some important links with more information:

- Official Website FBSCHOOL
- Support Forum Question & Answer Software.

Mella Zihan

© 2011-2012 FBSCHOOL. All rights reserved.
TanyaCMS® is a registered trademark of FBSCHOOL Networks.

Go To Table of Contents