Edit for opencart 1.4.x By Siamopencart.com 13 feb 2010 auth:Somsak2004 1. copy all to toue store 2. goto phpmyadmin ->select database -> press sql [right tab menu] -> patse under sql to textarea -- table blog CREATE TABLE `blog` ( `post_id` int(11) NOT NULL auto_increment, `subject` text NOT NULL, `content` text NOT NULL, `author_id` int(11) NOT NULL, `status` enum('draft','published') NOT NULL default 'draft', `date_posted` datetime NOT NULL, `date_modified` datetime NOT NULL, PRIMARY KEY (`post_id`) ); -- end table blog 3. press ok insert database to your mysql. 4. goto backend of store to set permission of use blog 5. system->user->user group->Top Administrator->[Edit]-Access Permission:->press check->extension/blog ->Modify Permission:press check->extension/blog->press [SAVE] in roght top menu 6. press -> Extension -> Blog for new tpur blog & news Thank! ********************************************************************************** ############################################################################# # Module Blog & News for Opencart 1.4.x From Team SiamOpencart.com # # เว็บผู้พัฒนา www.siamopencart.com ,www.thaiopencart.com # # โดย Somsak2004 วันที่ 13 กุมภาพันธ์ 2553 # ############################################################################# # โดยการสนับสนุนจาก # # Unitedsme.com : ผู้ให้บริการเช่าพื้นที่เว็บไซต์ จดโดเมน ระบบ Linux # # Net-LifeStyle.com : ผู้ให้บริการเช่าพื้นที่เว็บไซต์์ จดโดเมน ระบบ Linux # # SiamWebThai.com : SEO ขั้นเทพ โปรโมทเว็บขั้นเซียน ออกแบบ พัฒนาเว็บไซต์ / ตามความต้องการ และถูกใจ Google # ############################################################################# OpenCart_Blog v1.3.4.1 Written by Seth Syberg (www.sethsyberg.com) Copyright 2009 Seth Syberg License: http://creativecommons.org/licenses/by-sa/3.0/us/ Disclaimer: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. IF YOU DO NOT AGREE TO THIS DISCLAIMER OR LICENSE, YOU MAY NOT USE THIS SOFTWARE. CONTENTS 0. Hire Me 1. Introduction 2. Database Changes 3. Install 3.1 Add New Files 3.2 hearder File Modifications 3.3 Displaying the Blog 3.4 Customizing the Blog Template 4. Using the Blog 4.1 Setting Permissions 4.2 Adding a Post 4.3 Editing a Post 4.4 Deleting Posts 5. Bugs, Troubleshooting, and Suggestions 0. HIRE ME A quick advertisement. I'm available for hire if you are interested in any kind of opencart modifications or customizations (or just about any other web development for that matter). Just contact me at www.sethsyberg.com. 1. INTRODUCTION This is the Blog mod for OpenCart version 1.3.4. It's a very simple blog and requires almost zero code modification. Install should be fairly painless, though it requires a bit of technical skill to edit the three hearder files and add a table to the database. I'm open to expanding this module if folks have any feature requests they should let me know. See my contact information below. 2. DATABASE CHANGES Run the following SQL query in your opencart database (if you use a database prefix for opencart, be sure to append it to the beggining of "blog"). This simply adds a new "Blog" table to the database. CREATE TABLE `blog` ( `post_id` int(11) NOT NULL auto_increment, `subject` text NOT NULL, `content` text NOT NULL, `author_id` int(11) NOT NULL, `status` enum('draft','published') NOT NULL default 'draft', `date_posted` datetime NOT NULL, `date_modified` datetime NOT NULL, PRIMARY KEY (`post_id`) ) 3. INSTALL 3.1 ADD NEW FILES In the zip file you downloaded, there is a directory named opencart. This directory replicates the directory structure of the OpenCart framework. To install, simply move each file in the downloaded opencart directory into the corresponding directory in your opencart install. If you are using an application like WinSCP, just copy the admin and catalog directories to your opencart root and it should put the files in the right place for you (note: your experience may vary depending on your scp/ftp program and settings). A complete list of the files that are added is as follows: opencart/admin/controller/extension/blog.php opencart/admin/language/english/extension/blog.php opencart/admin/model/extension/blog.php opencart/admin/view/template/extension/blog_list.tpl opencart/admin/view/template/extension/blog_post.tpl opencart/catalog/controller/module/blog.php opencart/catalog/language/english/module/blog.php opencart/catalog/model/module/blog.php opencart/catalog/view/theme/default/template/module/blog.tpl 3.2 hearder FILE MODIFICATIONS This mod requires a few very minor changes to the admin hearder files (so the blog functionality can show up in the admin hearder). (1) In admin/controller/common/hearder.php find this line: $this->data['text_zone'] = $this->language->get('text_zone'); And add this line directly under it: $this->data['text_blog'] = $this->language->get('text_blog'); In the same file, find this line: $this->data['zone'] = $this->url->https('localisation/zone'); And add this line directly under it: $this->data['blog'] = $this->url->https('extension/blog'); (2) In admin/view/template/common/hearder.tpl find this line: