/** * @version 2.5 * @package JDownloads * @copyright (C) 2013 www.jdownloads.com * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * * Plugin to handle some special features from jDownloads. * In v1.2 added the hide function. * In 2.5 added the new events: onJDUserGroupSettingsBeforeSave and onJDUserGroupSettingsAfterSave */ defined( '_JEXEC' ) or die( 'Restricted access' ); //Error_Reporting(E_ERROR); jimport('joomla.plugin.plugin'); jimport( 'joomla.filesystem.folder' ); jimport( 'joomla.filesystem.file' ); if (!defined('DS')){ define('DS',DIRECTORY_SEPARATOR); } class plgSystemjdownloads extends JPlugin { private $caching = 0; /** * Constructor * * @access protected * @param object $subject The object to observe * @param array $params An array that holds the plugin configuration */ public function __construct(& $subject, $params) { parent::__construct($subject, $params); $this->loadLanguage(); // get jD language admin file $language = JFactory::getLanguage(); $language->load('com_jdownloads'); } /** * This event is triggered after the framework has dispatched the application. * * @param none * @return none */ public function onAfterDispatch() { // function to deactivate partially the Joomla 'cache option' for defined sections // inspired by cacheControl plugin from www.crosstec.de if( JFactory::getApplication()->isSite() && $this->checkCacheRules()){ $plugin = JPluginHelper::getPlugin('system', 'jdownloads'); jimport( 'joomla.html.parameter' ); $pluginParams = $this->params; if($pluginParams->def('enable_again_after_dispatch', 0)){ JFactory::getConfig()->set('caching', $this->caching); } } } /** * This event is triggered after the framework has loaded and the application initialise method has been called. * * @param none * @return none */ public function onAfterInitialise() { $app = JFactory::getApplication(); $database = JFactory::getDBO(); // exist the tables? $prefix = $database->getPrefix(); $prefix2 = strtolower($prefix); $tablelist = $database->getTableList(); if ( !in_array ( $prefix.'jdownloads_files', $tablelist ) && !in_array ( $prefix2.'jdownloads_files', $tablelist ) ){ return; } $plugin = JPluginHelper::getPlugin('system', 'jdownloads'); jimport( 'joomla.utilities.utility' ); // get params $params = $this->params; //$use_hider = $params->get( 'reduce_log_data_sets_to' ); //if (!$use_hider) $return = true; // No need in admin //if( $app->isAdmin() ) return; $j = date('Y'); $m = date('m'); $d = date('d'); $h = date('H'); $min = date('i'); $sec = date('s'); $unpublish_time = date('Y-m-d H:i:s',mktime($h,$min,$sec,$m,$d-1,$j)); $now = date('Y-m-d H:i:s'); // get all published files with use the timeframe options $database->setQuery("SELECT file_id from #__jdownloads_files WHERE published = 1 AND use_timeframe = 1 AND publish_to != '0000-00-00 00:00:00' AND publish_to <= '$now'"); $files = $database->loadColumn(); if ($files){ $fileslist = implode(',', $files); $database->setQuery("UPDATE #__jdownloads_files SET published = '0', use_timeframe = '0' WHERE file_id IN ('$fileslist')"); $database->execute(); } // get all unpublished files with use the timeframe options $database->setQuery("SELECT file_id from #__jdownloads_files WHERE published = 0 AND use_timeframe = 1 AND publish_from != '0000-00-00 00:00:00' AND publish_from <= '$now'"); $files = $database->loadColumn(); if ($files){ $fileslist = implode(',', $files); $database->setQuery("UPDATE #__jdownloads_files SET published = '1' WHERE file_id IN ('$fileslist')"); $database->execute(); } return; } public function onJDUserGroupSettingsBeforeSave($type, $table) { return true; } public function onJDUserGroupSettingsAfterSave($type, $table) { global $jlistConfig; $app = JFactory::getApplication(); $db = JFactory::getDBO(); $result = array(); if ($table->use_private_area == 1) { if (is_writable($jlistConfig['files.uploaddir'].DS.$jlistConfig['private.area.folder.name'])){ // get all user IDs from this user group $query = $db->getQuery(true); $db->setQuery("SELECT a.id FROM #__users as a LEFT JOIN #__user_usergroup_map AS map ON map.user_id = a.id WHERE map.group_id = '".(int)$table->group_id."'"); $users = $db->loadObjectList(); $error = $db->getErrorMsg(); if ($error){ $this->setError($error); return false; } if (count($users) > 0){ $rootfolder = $jlistConfig['files.uploaddir'].DS.$jlistConfig['private.area.folder.name'].DS; // create the subfolder for every user when it not exist foreach ($users as $user){ if (!JFolder::exists($rootfolder.(int)$user->id)){ $result = JFolder::create($rootfolder.(int)$user->id, 0755); if ($result){ // copy index.html JFile::copy($rootfolder.'index.html',$rootfolder.(int)$user->id.DS.'index.html'); } } } } } else { // folder not writable JError::raiseWarning( 100, JText::_('COM_JDOWNLOADS_USERGROUPS_PRIVATE_FILES_AREA_ERROR') ); return false; } } return true; } /** * When we use the private area for jD users, we must add for every new user the private folder (when he has the correct usergroup) */ public function onUserAfterSave($user, $isNew, $success) { $app = JFactory::getApplication(); $db = JFactory::getDBO(); $groups = array(); $x = null; // check at first that we use the private folder option $query = $db->getQuery(true); $db->setQuery("SELECT group_id FROM #__jdownloads_usergroups_limits a WHERE use_private_area = '1'"); $groups = $db->loadRowList(); if ($groups){ // get folder path from config $db->setQuery("SELECT setting_value FROM #__jdownloads_config WHERE setting_name = 'files.uploaddir'"); $root_dir = $db->loadResult(); $db->setQuery("SELECT setting_value FROM #__jdownloads_config WHERE setting_name = 'private.area.folder.name'"); $private_dir = $db->loadResult(); // build array which usergroups are activated in jD usergroups_limits table foreach ($groups as $group){ $used_groups_for_private[] = $group[0]; } // build array which usergroups are selected for the updated or new added user foreach ($user['groups'] as $usergroup){ $user_groups[] = $usergroup[0]; } for ($i=0; $i < count($user_groups); $i++){ $x = array_search ( $user_groups[$i], $used_groups_for_private ); if ($x !== false){ $private_folder = $root_dir.DS.$private_dir.DS.$user['id']; if (!JFolder::exists($private_folder)){ if (JFolder::create($private_folder, 0755)){ JFile::copy($root_dir.DS.'index.html',$private_folder.DS.'index.html'); } } } } } } /** * When we use the private area for jD users, we must remove the users folder, when his user account is deleted */ public function onUserAfterDelete($user, $isNew, $success) { $app = JFactory::getApplication(); $db = JFactory::getDBO(); // get folder path from config $db->setQuery("SELECT setting_value FROM #__jdownloads_config WHERE setting_name = 'files.uploaddir'"); $root_dir = $db->loadResult(); $db->setQuery("SELECT setting_value FROM #__jdownloads_config WHERE setting_name = 'private.area.folder.name'"); $private_dir = $db->loadResult(); $private_folder = $root_dir.DS.$private_dir.DS.$user['id']; if (JFolder::exists($private_folder)){ if (JFolder::delete($private_folder)){ JError::raiseNotice( 100, JText::_('COM_JDOWNLOADS_USERGROUPS_PRIVATE_FILES_FOLDER_REMOVED') ); } else { JError::raiseWarning( 100, JText::_('COM_JDOWNLOADS_USERGROUPS_PRIVATE_FILES_FOLDER_REMOVED_ERROR') ); } } } /** * This event is triggered after the framework has rendered the application. * Rendering is the process of pushing the document buffers into the template placeholders, retrieving data from the document and pushing it into the JResponse buffer. * When this event is triggered the output of the application is available in the response buffer. * * @param none * @return none */ public function onAfterRender() { $app = JFactory::getApplication(); $database = JFactory::getDBO(); $return = false; // exist the tables? $prefix = strtolower($database->getPrefix()); $tablelist = $database->getTableList(); if ( !in_array ( $prefix.'jdownloads_files', $tablelist ) ){ $return = true; } $plugin = JPluginHelper::getPlugin('system', 'jdownloads'); jimport( 'joomla.utilities.utility' ); // get params $params = $this->params;; $use_hider = $params->get( 'use_hider' ); if (!$use_hider) $return = true; // No need in admin if (!$app->isAdmin()) { $body = JResponse::getBody(); if (!$return){ function _getParameter( $name, $default='' ) { $return = ""; $return = $this->params->get( $name, $default ); } // define the regular expression $regex1 = "#{jdreg}(.*?){/jdreg}#s"; $regex2 = "#{jdpub}(.*?){/jdpub}#s"; $regex3 = "#{jdauthor}(.*?){/jdauthor}#s"; $regex4 = "#{jdeditor}(.*?){/jdeditor}#s"; $regex5 = "#{jdpublisher}(.*?){/jdpublisher}#s"; $regex6 = "#{jdmanager}(.*?){/jdmanager}#s"; $regex7 = "#{jdadmin}(.*?){/jdadmin}#s"; $regex8 = "#{jdsuper}(.*?){/jdsuper}#s"; $regex9 = "#{jdspecial}(.*?){/jdspecial}#s"; // replacement for _reg $body = preg_replace_callback( $regex1, array('plgSystemjdownloads', '_reg'), $body ); // replacement for _pub $body = preg_replace_callback( $regex2, array('plgSystemjdownloads', '_pub'), $body ); // replacements for groups by name $body = preg_replace_callback( $regex9, array('plgSystemjdownloads', '_special'), $body ); $body = preg_replace_callback( $regex3, array('plgSystemjdownloads', '_author'), $body ); $body = preg_replace_callback( $regex4, array('plgSystemjdownloads', '_editor'), $body ); $body = preg_replace_callback( $regex5, array('plgSystemjdownloads', '_publisher'), $body ); $body = preg_replace_callback( $regex6, array('plgSystemjdownloads', '_manager'), $body ); $body = preg_replace_callback( $regex7, array('plgSystemjdownloads', '_admin'), $body ); $body = preg_replace_callback( $regex8, array('plgSystemjdownloads', '_super'), $body ); JResponse::setBody($body); } else { // Hide option is deactivated - so we must remove maybe the prior inserted placeholder $body = str_replace('{jdreg}', '', $body); $body = str_replace('{/jdreg}', '', $body); $body = str_replace('{jdpub}', '', $body); $body = str_replace('{/jdpub}', '', $body); $body = str_replace('{jdauthor}', '', $body); $body = str_replace('{/jdauthor}', '', $body); $body = str_replace('{jdeditor}', '', $body); $body = str_replace('{/jdeditor}', '', $body); $body = str_replace('{jdpublisher}', '', $body); $body = str_replace('{/jdpublisher}', '', $body); $body = str_replace('{jdmanager}', '', $body); $body = str_replace('{/jdmanager}', '', $body); $body = str_replace('{jdadmin}', '', $body); $body = str_replace('{/jdadmin}', '', $body); $body = str_replace('{jdsuper}', '', $body); $body = str_replace('{/jdsuper}', '', $body); $body = str_replace('{jdspecial}', '', $body); $body = str_replace('{/jdspecial}', '', $body); JResponse::setBody($body); } } } /** * This event is triggered after the framework has loaded and initialised and the router has routed the client request. * Routing is the process of examining the request environment to determine which component should receive the request. The component optional parameters are then set in the request object that will be processed when the application is being dispatched. * When this event triggers, the router has parsed the route and pushed the request parameters into JRequest to be retrieved by the application. * * @param none * @return none */ public function onAfterRoute(){ // deactivate Joomla caching when required if( JFactory::getApplication()->isSite() && $this->checkCacheRules()){ $this->caching = JFactory::getConfig()->get('caching'); JFactory::getConfig()->set('caching', 0); } // reduce download log data sets when a maximum value exists $database = JFactory::getDBO(); // exist the table? $prefix = strtolower($database->getPrefix()); $tablelist = $database->getTableList(); if ( !in_array ( $prefix.'jdownloads_logs', $tablelist ) ){ return; } $plugin = JPluginHelper::getPlugin('system', 'jdownloads'); jimport( 'joomla.utilities.utility' ); // get params $params = $this->params;; $reduce_data_to = (int)$params->get('reduce_log_data_sets_to'); if ($reduce_data_to == 0) return; // reduce data $database->setQuery("SELECT COUNT(*) FROM #__jdownloads_logs"); $sum = $database->loadResult(); $sum_delete = $sum - $reduce_data_to; if ($sum_delete > 0){ $database->setQuery("DELETE FROM #__jdownloads_logs ORDER BY id LIMIT $sum_delete"); $database->execute(); } return; } /** * * */ function checkCacheRules(){ $plugin = JPluginHelper::getPlugin('system', 'jdownloads'); jimport( 'joomla.html.parameter' ); $params = $this->params; $defs = trim(str_replace("\r","", $params->def('rules',''))); $defs = explode("\n", $defs); foreach($defs as $def){ if ($def != ''){ $result = $this->parseQueryString($def); if(is_array($result)){ $found = 0; $required = count($result); foreach($result As $key => $value){ if( JRequest::getVar($key) == $value || ( JRequest::getVar($key, null) !== null && $value == '?' ) ){ $found++; } } if($found == $required){ return true; } } } } return false; } /** * * * @param mixed $str */ function parseQueryString($str) { $op = array(); $pairs = explode("&", $str); foreach ($pairs as $pair) { list($k, $v) = array_map("urldecode", explode("=", $pair)); $op[$k] = $v; } return $op; } /** * Functions for hide elements from output for special user groups * * Inspired by the hider content plugin from Dioscouri Design * Part of this functions are copyright by Dioscouri Design - www.dioscouri.com * * */ function _reg( &$matches ) { $user = JFactory::getUser(); $return = ''; if ($user->id) { $return = $matches[1]; } return $return; } function _pub( &$matches ) { $user = JFactory::getUser(); $return = $matches[1]; if ($user->id) { $return = ''; } return $return; } function _author( &$matches ) { $user = JFactory::getUser(); $coreUserGroups = $user->getAuthorisedGroups(); $return = $matches[1]; if (!in_array(3,$coreUserGroups) && !in_array(8,$coreUserGroups)){ $return = ''; } return $return; } function _editor( &$matches ) { $user = JFactory::getUser(); $coreUserGroups = $user->getAuthorisedGroups(); $return = $matches[1]; if (!in_array(4,$coreUserGroups) && !in_array(8,$coreUserGroups)){ $return = ''; } return $return; } function _publisher( &$matches ) { $user = JFactory::getUser(); $coreUserGroups = $user->getAuthorisedGroups(); $return = $matches[1]; if (!in_array(5,$coreUserGroups) && !in_array(8,$coreUserGroups)){ $return = ''; } return $return; } function _manager( &$matches ) { $user = JFactory::getUser(); $coreUserGroups = $user->getAuthorisedGroups(); $return = $matches[1]; if (!in_array(6,$coreUserGroups) && !in_array(8,$coreUserGroups)){ $return = ''; } return $return; } function _admin( &$matches ) { $user = JFactory::getUser(); $coreUserGroups = $user->getAuthorisedGroups(); $return = $matches[1]; if (!in_array(7,$coreUserGroups) && !in_array(8,$coreUserGroups)){ $return = ''; } return $return; } function _super( &$matches ) { $user = JFactory::getUser(); $coreUserGroups = $user->getAuthorisedGroups(); $return = $matches[1]; if (!in_array(8,$coreUserGroups)){ $return = ''; } return $return; } function _special( &$matches ) { $user = JFactory::getUser(); $aid = max ($user->getAuthorisedViewLevels()); $return = $matches[1]; if ($aid != 3){ $return = ''; } return $return; } } ?>
Warning: Cannot modify header information - headers already sent by (output started at /home/wwweasb/public_html/plugins/system/jdownloads/jdownloads.php:516) in /home/wwweasb/public_html/libraries/joomla/input/cookie.php on line 94
Master of Science (Marketing)

Programme Enquiry


Master of Science (Marketing)

The Edinburgh Business School MSc Marketing from Heriot-Watt University is designed for individuals wishing to gain advanced management skills and expertise.  The MSc (Marketing) is a broad-based management degree and appeals to individuals from a wide range of backgrounds.  The degree is aimed at people with experience who wish to develop themselves as effective managers.  The programme includes the opportunity for students to extend their study to meet specific career requirements by taking one of the specialist awards. The specialism provides students with a deeper understanding of the application of a specific discipline.

The programme offers general coverage of the key management disciplines – people skills, economics, marketing, accounting, finance, and project management. This capstone course in marketing develops strategic thinking and the ability to recognise and use the various tools and techniques of the other core courses to identify and solve a wide range of business problems.

Programme Objective

To understand the business environment and the influence of both consumers and micro and macro influences that shape the industry.

To understand the role of different cultures in shaping national, regional and global business practice.

To develop in graduates, both within the business curriculum and in the context of their degree programme, a range of transferable skills appropriate to employers needs.

To develop analytical and evaluative skills.


Graduates will have the skills and knowledge to seek management trainee, junior management or supervisory positions in any business establishment.

Looking beyond the nearest future, a masters degree from Edinburgh Business School is a long-term investment. MSc Marketing prepares students for careers as business managers in the field of marketing. Obtaining a masters degree in marketing from Edinburgh Business School helps our graduates stand out and take on leadership roles in marketing management, advertising, public relations, sales management and new product development.

Delivery Method

Generally the curriculums for all levels are taught over 3 terms. Modules are conducted in formal instructor-led classroom sessions where students are introduced to the course discipline. Each term will cover 3-4 modules with 56 contact hours per module. Lectures are 2-hour sessions.

Progression Pathway
Master of Science (Marketing)
Mode & Duration
Full-time: 18 mths
Part-time: 18 mths

(Typical Delivery Structure for MSc Marketing – 18 months)
3 months 3 months 3 months 3 months 3 months 3 months
Term 1
(2 modules)
Term 2
(1 module)
Term 3
(2 modules)
Term 4
(1 module)
Term 5
(2 modules)
Term 6
(1 module)
Mar / Jun / Aug / Dec
Average Teacher-Student Ratio
100% Written Examination
    Core Modules:
  • 1. International Marketing
    • This course addresses global issues and describes concepts relevant to all international marketers. It provides an approach and framework for identifying and analyzing the key cultural and environmental characteristics of any nation or global region and highlights the importance of viewing international marketing management from a global perspective
  • 2. Marketing Communications
    • The often-misunderstood concept of marketing communications is examined from a strategic perspective in this course. The following ideas are explored: the interlinking of corporate, marketing and communication strategy; the blend of internal and external communications; the relational aspects of network communications; the context within which marketing communications operate; how audiences frame and interpret marketing messages. This course assumes relationship marketing to be essential and sees communication in the context of both transactional and relational exchanges. Corporate and marketing communications are considered as important components of the complete process.
  • 3. Marketing Research
    • The marketing research elective gives you a solid understanding of the marketing research process as well as the practical skills to do qualitative and quantitative research. It looks in detail at data collection methods, measurement instruments, sampling procedures and data analysis techniques. The emphasis is on solving marketing problems using marketing research. Extensive case study material offers insights into the problems and practical applications of the research techniques.
  • 4. Marketing
    • In highly competitive markets the success or failure of a product or service may be determined by the marketing decisions you take. This course will help you make the right ones. The course will enable you to analyse and critically evaluate marketing problems and opportunities. It will also help you develop and implement marketing strategies and programmes which take best advantage of your firm's situation.
  • 5. Consumer Behaviour
    • We buy goods and services every day: to eat, to wear, to read, to watch, to play, to travel, to exercise, to make us wealthy and perhaps wise. Consumption is so prevalent that we are often unaware of its importance in shaping our lives. This elective adopts a psychological approach to consumer behaviour and, with examples of marketing in practice, explores the complementary experience of the individual consumer and individual marketer. Understanding why people buy what they buy is crucial for effective marketing, helping managers identify appropriate people to target and design and communicate attractive offerings. Every element of the marketing plan benefits from an understanding of the customer, and with the rapid pace of change in consumer markets today this is only going to become more important.
  • Elective Modules:
  • 1. Marketing Channels
    • Channel relationships are increasingly important in creating market value and sustainable competitive advantage. This elective provides an up-to-date perspective of the relationships among marketing channels using the channel relationship model (CRM). It looks at challenges and opportunities in the external channel environment, behavioural issues that beset channel relationships (internal channel environment), co-ordinations, conflict, cooperation, the economics of exchange and the development of channel relationships, including the implication of acquiring strategic partners.
  • 2. Negotiation
    • Negotiation is one of several means that help managers make decisions. It is neither superior nor inferior to other forms of decision making. It is appropriate in some circumstances but not in others. Management is complex and deciding when negotiation is appropriate is just one aspect. The course aims to provide a thorough grounding in the science and practice of negotiation. Academic disciplines such as economics, psychology, sociology, politics, anthropology and mathematics have researched negotiation and much of this material forms the basis for its scientific analysis.
  • 3. Services Marketing
    • Service industries face dramatic changes in their environment, ranging from developments in computerization and telecommunications (including the Internet) to the emergence of global markets for their output. Perhaps the most significant trend
  • 4. Quantitative Methods
    • In order to make decisions it is necessary to have access to information. In the world of business, that information will often be in numerical form. The objective of this course is to enable students to make good decisions and to be able to organize and understand numbers.

Our Campus

9 Ah Hood Road
Singapore 329975
Tel: (65) 6252 5500
Email: enquiries@easb.edu.sg

Operation Hours

Monday - Friday
9:00 am - 6:00 pm
9:00 am - 1:00 pm
Go to top