Example #1
0
 function &getData()
 {
     if (empty($this->_data)) {
         $query = ' SELECT * FROM #__fst_comments ' . '  WHERE id = ' . FSTJ3Helper::getEscaped($this->_db, $this->_id);
         $this->_db->setQuery($query);
         $this->_data = $this->_db->loadObject();
     }
     if (!$this->_data) {
         $this->_data = new stdClass();
         $this->_data->id = 0;
         $this->_data->ident = 5;
         //
         $this->_data->itemid = 0;
         $this->_data->body = null;
         $this->_data->email = null;
         $this->_data->name = null;
         $this->_data->website = null;
         $this->_data->published = 1;
         $current_date = new JDate();
         if (FSTJ3Helper::IsJ3()) {
             $mySQL_conform_date = $current_date->toSql();
         } else {
             $mySQL_conform_date = $current_date->toMySQL();
         }
         $this->_data->created = $mySQL_conform_date;
     }
     return $this->_data;
 }
Example #2
0
 function &getData()
 {
     if (empty($this->_data)) {
         $query = ' SELECT * FROM #__fst_prod ' . '  WHERE id = ' . FSTJ3Helper::getEscaped($this->_db, $this->_id);
         $this->_db->setQuery($query);
         $this->_data = $this->_db->loadObject();
     }
     if (!$this->_data) {
         $this->_data = new stdClass();
         $this->_data->id = 0;
         $this->_data->title = null;
         $this->_data->description = null;
         $this->_data->ordering = 0;
         $this->_data->image = null;
         $this->_data->extratext = null;
         $this->_data->inkb = 1;
         $this->_data->insupport = 1;
         $this->_data->intest = 1;
         $this->_data->published = 1;
         $this->published = 1;
         $this->_data->access = 1;
         $this->_data->translation = "";
     }
     return $this->_data;
 }
Example #3
0
 function _buildQuery()
 {
     $db =& JFactory::getDBO();
     $query = ' SELECT c.id, c.title, c.ordering as ordering, c.published, c.description, c.image, c.inkb, c.insupport, c.intest, c.access, c.translation FROM #__fst_prod as c ';
     $where = array();
     if ($this->lists['search']) {
         $where[] = '(LOWER( title ) LIKE ' . $db->Quote('%' . FSTJ3Helper::getEscaped($db, $this->lists['search'], true) . '%', false) . ')';
     }
     if ($this->lists['order'] == 'c.ordering') {
         $order = ' ORDER BY c.ordering ' . $this->lists['order_Dir'];
     } else {
         $order = ' ORDER BY ' . $this->lists['order'] . ' ' . $this->lists['order_Dir'] . ', c.ordering';
     }
     if ($this->lists['ispublished'] > -1) {
         $where[] = 'published = ' . $this->lists['ispublished'];
     }
     if (FSTAdminHelper::Is16()) {
         FSTAdminHelper::LA_GetFilterState();
         /*if (FSTAdminHelper::$filter_lang)	
         		$where[] = "language = '" . FSTJ3Helper::getEscaped($db, FSTAdminHelper::$filter_lang) . "'";*/
         if (FSTAdminHelper::$filter_access) {
             $where[] = "access = '" . FSTJ3Helper::getEscaped($db, FSTAdminHelper::$filter_access) . "'";
         }
     }
     $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
     $query .= $where . $order;
     return $query;
 }
Example #4
0
 function _buildQuery()
 {
     $db =& JFactory::getDBO();
     $query = ' SELECT t.id as id,t.body as body, t.email as email, t.name as name, t.website as website, t.published as published, ';
     $query .= ' t.created as added, ident, itemid FROM #__fst_comments as t';
     $where = array();
     if ($this->lists['search']) {
         $where[] = '(LOWER( t.name ) LIKE ' . $db->Quote('%' . FSTJ3Helper::getEscaped($db, $this->lists['search'], true) . '%', false) . ' OR ' . 'LOWER( t.body ) LIKE ' . $db->Quote('%' . FSTJ3Helper::getEscaped($db, $this->lists['search'], true) . '%', false) . ')';
     }
     $order = "";
     if ($this->lists['order'] == 'added') {
         $order = ' ORDER BY added ' . FSTJ3Helper::getEscaped($db, $this->lists['order_Dir']);
     } else {
         if ($this->lists['order']) {
             $order = ' ORDER BY ' . FSTJ3Helper::getEscaped($db, $this->lists['order']) . ' ' . FSTJ3Helper::getEscaped($db, $this->lists['order_Dir']) . '';
         }
     }
     if ($this->lists['prod_id'] > 0) {
         $where[] = 'p.id = ' . FSTJ3Helper::getEscaped($db, $this->lists['prod_id']);
     }
     if ($this->lists['ispublished'] > -1) {
         $where[] = 't.published = ' . FSTJ3Helper::getEscaped($db, $this->lists['ispublished']);
     }
     $ident = JRequest::getVar('ident', '');
     if ($ident > 0) {
         $where[] = 'ident = ' . FSTJ3Helper::getEscaped($db, $ident);
     }
     $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
     $query .= $where . $order;
     return $query;
 }
Example #5
0
function FST_GetFeaturedText($ispub)
{
    if (FSTJ3Helper::IsJ3()) {
        if ($ispub) {
            return "<i class='icon-star'></i>";
            //return '<span class="state publish"><span class="text"><i class="icon-publish"></i>'.JText::_('Published').'</span></span>';
        } else {
            return "<i class='icon-star-empty'></i>";
        }
    } elseif (FST_Helper::Is16()) {
        if (!$ispub) {
            return '<img src="templates/bluestork/images/admin/disabled.png" alt="' . JText::_('Featured_FAQ') . '">';
            //return '<span class="state featured"><span class="text">'.JText::_('Featured').'</span></span>';
        } else {
            return '<img src="templates/bluestork/images/admin/featured.png" alt="' . JText::_('Unfeatured_FAQ') . '">';
            //return '<span class="state unfeatured"><span class="text">'.JText::_('Unfeatured').'</span></span>';
        }
    } else {
        $img = 'publish_g.png';
        $alt = JText::_("Featured_FAQ");
        if ($ispub == 0) {
            $img = 'publish_x.png';
            $alt = JText::_("Unfeatured_FAQ");
        }
        return '<img src="images/' . $img . '" width="16" height="16" border="0" alt="' . $alt . '" />';
    }
}
Example #6
0
 function &getData()
 {
     if (empty($this->_data)) {
         if (FST_Helper::Is16()) {
             $query = ' SELECT u.*, ' . 'CONCAT(m.username," (",m.name,")") as name ' . ' FROM #__fst_user as u ' . ' LEFT JOIN #__users as m ON u.user_id = m.id ' . '  WHERE u.id = ' . FSTJ3Helper::getEscaped($this->_db, $this->_id);
         } else {
             $query = ' SELECT u.*, ' . 'CONCAT(m.username," (",m.name,")") as name, ' . 'g.name as groupname ' . ' FROM #__fst_user as u ' . ' LEFT JOIN #__users as m ON u.user_id = m.id ' . ' LEFT JOIN #__core_acl_aro_groups as g ON u.group_id = g.id ' . '  WHERE u.id = ' . FSTJ3Helper::getEscaped($this->_db, $this->_id);
         }
         $this->_db->setQuery($query);
         $this->_data = $this->_db->loadObject();
     }
     if (!$this->_data) {
         $this->_data = new stdClass();
         $this->_data->id = 0;
         $this->_data->mod_kb = 0;
         $this->_data->mod_test = 0;
         $this->_data->support = 0;
         $this->_data->user_id = 0;
         $this->_data->group_id = 0;
         $this->_data->seeownonly = 0;
         $this->_data->autoassignexc = 0;
         $this->_data->allprods = 1;
         $this->_data->alldepts = 1;
         $this->_data->allcats = 1;
         $this->_data->artperm = 0;
         $this->_data->groups = 0;
         $this->_data->allprods_a = 1;
         $this->_data->alldepts_a = 1;
         $this->_data->allcats_a = 1;
         $this->_data->assignperms = 0;
         $this->_data->reports = 0;
         $this->name = "";
     }
     return $this->_data;
 }
Example #7
0
 static function loadResultArray(&$db)
 {
     if (FSTJ3Helper::IsJ3()) {
         return $db->loadColumn(0);
     } else {
         return $db->loadResultArray();
     }
 }
Example #8
0
 function &getData()
 {
     if (empty($this->_data)) {
         $query = ' SELECT * FROM #__fst_emails ' . '  WHERE id = ' . FSTJ3Helper::getEscaped($this->_db, $this->_id);
         $this->_db->setQuery($query);
         $this->_data = $this->_db->loadObject();
     }
     return $this->_data;
 }
Example #9
0
 function &getProduct()
 {
     $db = JFactory::getDBO();
     $prodid = JRequest::getVar('prodid', 0, '', 'int');
     $query = "SELECT * FROM #__fst_prod WHERE id = '" . FSTJ3Helper::getEscaped($db, $prodid) . "'";
     $db->setQuery($query);
     $rows = $db->loadAssoc();
     return $rows;
 }
Example #10
0
 function display($tpl = null)
 {
     $document = JFactory::getDocument();
     if (FST_Helper::Is16()) {
         JHtml::_('behavior.framework');
     }
     $mainframe = JFactory::getApplication();
     JHTML::_('behavior.tooltip');
     JHTML::_('behavior.modal', 'a.fst_modal');
     $user = JFactory::getUser();
     $userid = $user->id;
     $db = JFactory::getDBO();
     $query = "SELECT * FROM #__fst_user WHERE user_id = '" . FSTJ3Helper::getEscaped($db, $userid) . "'";
     $db->setQuery($query);
     $this->_permissions = $db->loadAssoc();
     $this->params =& FST_Settings::GetViewSettingsObj('test');
     $this->test_show_prod_mode = $this->params->get('test_show_prod_mode', 'accordian');
     $this->test_always_prod_select = $this->params->get('test_always_prod_select', '0');
     $layout = JRequest::getVar('layout', '');
     $this->prodid = JRequest::getVar('prodid');
     if ($this->prodid == "") {
         $this->prodid = -1;
     }
     $this->products = $this->get('Products');
     //print_p($this->products);
     if (count($this->products) == 0) {
         $this->prodid = 0;
     }
     $this->comments = new FST_Comments("test", $this->prodid);
     if ($this->prodid == -1) {
         $this->comments->opt_show_posted_message_only = 1;
     }
     $onlyprodid = JRequest::getVar('onlyprodid', 'x');
     if ($onlyprodid != 'x') {
         $this->comments->itemid = (int) $onlyprodid;
         $this->comments->show_item_select = false;
     }
     echo "Hide Add : " . $this->params->get('hide_add', 0) . "<br>";
     if ($this->params->get('hide_add', 0)) {
         $this->comments->can_add = 0;
     }
     if ($layout == "create") {
         $this->setupCommentsCreate();
     }
     if ($this->comments->Process()) {
         return;
     }
     if ($layout == "create") {
         return $this->displayCreate();
     }
     if ($this->prodid != -1) {
         return $this->displaySingleProduct();
     }
     return $this->displayAllProducts();
 }
Example #11
0
 function GetSelect(&$handler, $ident, $itemid)
 {
     $db =& JFactory::getDBO();
     $qry = "SELECT " . FSTJ3Helper::getEscaped($db, $handler->field_title) . ", " . FSTJ3Helper::getEscaped($db, $handler->field_id) . " FROM " . FSTJ3Helper::getEscaped($db, $handler->table) . " ORDER BY " . FSTJ3Helper::getEscaped($db, $handler->field_title);
     $db->setQuery($qry);
     $items = $db->loadObjectList();
     if ($ident == 5) {
         $newitems[] = JHTML::_('select.option', '0', JText::_("GENERAL_TESTIMONIALS"), $handler->field_id, $handler->field_title);
         $items = array_merge($newitems, $items);
     }
     return JHTML::_('select.genericlist', $items, 'itemid', 'class="inputbox" size="1"', $handler->field_id, $handler->field_title, $itemid);
 }
Example #12
0
 function DoPublishComment($published)
 {
     $commentid = JRequest::getVar('commentid', 0, '', 'int');
     if (!$commentid) {
         return;
     }
     $db = JFactory::getDBO();
     $qry = "UPDATE #__fst_comments SET published = {$published} WHERE id = '" . FSTJ3Helper::getEscaped($db, $commentid) . "'";
     $db->SetQuery($qry);
     $db->Query();
     echo $qry;
     exit;
     return true;
 }
Example #13
0
 function GetItemData($itemids = null)
 {
     $db = JFactory::getDBO();
     $qry = "SELECT {$this->field_id}, {$this->field_title} FROM {$this->table} WHERE {$this->field_id}";
     if ($itemids) {
         $ids = array();
         foreach ($itemids as $id) {
             $ids[] = FSTJ3Helper::getEscaped($db, $id);
         }
         $qry .= " IN (" . implode(", ", $ids) . ")";
     }
     $db->setQuery($qry);
     $this->itemdata = $db->loadAssocList($this->field_id);
 }
Example #14
0
 function Load($template, $tpltype)
 {
     //echo "Loading $template => $tpltype<br>";
     if ($this->loadedtmpl == $template && $this->loadedtype == $tpltype) {
         return;
     }
     $db = JFactory::getDBO();
     $query = "SELECT * FROM #__fst_templates WHERE template = '" . FSTJ3Helper::getEscaped($db, $template) . "' AND tpltype = " . FSTJ3Helper::getEscaped($db, $tpltype);
     $db->SetQuery($query);
     $tmpl = $db->LoadObject();
     $this->template = $tmpl->value;
     $this->ProcessLanguage();
     $this->loadedtmpl = $template;
     $this->loadedtype = $tpltype;
 }
Example #15
0
 function _buildQuery()
 {
     $db =& JFactory::getDBO();
     $query = ' SELECT u.*, CONCAT(m.username," (",m.name,")") as name FROM #__fst_user as u LEFT JOIN #__users as m ON u.user_id = m.id';
     $where = array();
     if ($this->lists['search']) {
         $where[] = '(LOWER( name ) LIKE ' . $db->Quote('%' . FSTJ3Helper::getEscaped($db, $this->lists['search'], true) . '%', false) . ')';
     }
     if ($this->lists['order']) {
         $order = ' ORDER BY ' . $this->lists['order'] . ' ' . $this->lists['order_Dir'];
     }
     $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
     $query .= $where;
     return $query;
 }
Example #16
0
 function check()
 {
     // make published by default and get a new order no
     if (!$this->id) {
         if ($this->created == "") {
             $current_date = new JDate();
             if (FSTJ3Helper::IsJ3()) {
                 $mySQL_conform_date = $current_date->toSql();
             } else {
                 $mySQL_conform_date = $current_date->toMySQL();
             }
             $this->set('created', $mySQL_conform_date);
         }
     }
     return true;
 }
Example #17
0
 function SaveAPI()
 {
     $username = JRequest::getVar('username');
     $apikey = JRequest::getVar('apikey');
     $db =& JFactory::getDBO();
     $qry = "REPLACE INTO #__fst_settings (setting, value) VALUES ('fsj_username','" . FSTJ3Helper::getEscaped($db, $username) . "')";
     $db->setQuery($qry);
     $db->Query();
     $qry = "REPLACE INTO #__fst_settings (setting, value) VALUES ('fsj_apikey','" . FSTJ3Helper::getEscaped($db, $apikey) . "')";
     $db->setQuery($qry);
     $db->Query();
     // update url links
     if (FSTAdminHelper::Is16()) {
         $updater = new FSTUpdater();
         $updater->SortAPIKey($username, $apikey);
     }
     $mainframe = JFactory::getApplication();
     $link = FSTRoute::x('index.php?option=com_fst&view=backup', false);
     $mainframe->redirect($link);
 }
Example #18
0
 function toggleField()
 {
     $id = JRequest::getVar('id');
     $field = JRequest::getVar('field');
     $val = JRequest::getVar('val');
     if ($field == "") {
         return;
     }
     if ($id < 1) {
         return;
     }
     if ($field != "inkb" && $field != "insupport" && $field != "intest") {
         return;
     }
     $db = JFactory::getDBO();
     $qry = "UPDATE #__fst_prod SET " . FSTJ3Helper::getEscaped($db, $field) . " = " . FSTJ3Helper::getEscaped($db, $val) . " WHERE id = " . FSTJ3Helper::getEscaped($db, $id);
     $db->setQuery($qry);
     $db->Query();
     echo FST_GetYesNoText($val);
     exit;
 }
Example #19
0
 function TableExists($table)
 {
     $db = JFactory::getDBO();
     $prefix = $db->getPrefix();
     $table = str_replace("#__", $prefix, $table);
     $qry = "SHOW TABLES";
     $db->setQuery($qry);
     $tables = FSTJ3Helper::loadResultArray($db);
     foreach ($tables as $exist) {
         if ($exist == $table) {
             return true;
         }
     }
     return false;
 }
Example #20
0
 static function Get_Template($tmpl)
 {
     $db = JFactory::getDBO();
     $qry = "SELECT body, subject, ishtml FROM #__fst_emails WHERE tmpl = '" . FSTJ3Helper::getEscaped($db, $tmpl) . "'";
     $db->setQuery($qry);
     return $db->loadAssoc();
 }
Example #21
0
 function GetItemData($itemids = null)
 {
     $db = JFactory::getDBO();
     $qry = "SELECT {$this->field_id}, {$this->field_title}, translation FROM {$this->table} WHERE intest = 1 AND published = 1";
     if ($itemids) {
         $ids = array();
         foreach ($itemids as $id) {
             $ids[] = FSTJ3Helper::getEscaped($db, $id);
         }
         $qry .= " AND {$this->field_id} IN (" . implode(", ", $ids) . ")";
     }
     $db->setQuery($qry);
     $this->itemdata = $db->loadAssocList($this->field_id);
     FST_Helper::Tr($this->itemdata);
 }
Example #22
0
 function displayCatsA()
 {
     $user_id = JRequest::getInt('user_id', 0);
     $db =& JFactory::getDBO();
     $query = "SELECT * FROM #__fst_user_cat_a as u LEFT JOIN #__fst_ticket_cat as p ON u.ticket_cat_id = p.id WHERE u.user_id = '" . FSTJ3Helper::getEscaped($db, $user_id) . "'";
     $db->setQuery($query);
     $catogries = $db->loadObjectList();
     $query = "SELECT * FROM #__fst_user WHERE id = '" . FSTJ3Helper::getEscaped($db, $user_id) . "'";
     $db->setQuery($query);
     $userpermissions = $db->loadObject();
     $jid = $userpermissions->user_id;
     $query = "SELECT * FROM #__users WHERE id = '" . FSTJ3Helper::getEscaped($db, $jid) . "'";
     $db->setQuery($query);
     $joomlauser = $db->loadObject();
     $this->assignRef('userpermissions', $userpermissions);
     $this->assignRef('joomlauser', $joomlauser);
     $this->assignRef('catogries', $catogries);
     parent::display();
 }
Example #23
0
 function CustomTemplate()
 {
     $template = JRequest::getVar('name');
     $db =& JFactory::getDBO();
     $qry = "SELECT * FROM #__fst_templates WHERE template = '" . FSTJ3Helper::getEscaped($db, $template) . "'";
     $db->setQuery($qry);
     $rows = $db->loadAssocList();
     $output = array();
     foreach ($rows as $row) {
         if ($row['tpltype']) {
             $output['head'] = $row['value'];
         } else {
             $output['row'] = $row['value'];
         }
     }
     echo json_encode($output);
     exit;
 }
Example #24
0
            <th>
                <?php 
echo JHTML::_('grid.sort', 'Image', 'image', @$this->lists['order_Dir'], @$this->lists['order']);
?>
            </th>
			<th width="1%" nowrap="nowrap">
				<?php 
echo JHTML::_('grid.sort', 'Published', 'published', @$this->lists['order_Dir'], @$this->lists['order']);
?>
			</th>
<!--  -->
			<?php 
FSTAdminHelper::LA_Header($this, true);
?>
             <th width="<?php 
echo FSTJ3Helper::IsJ3() ? '130px' : '8%';
?>
">
				<?php 
echo JHTML::_('grid.sort', 'Order', 'ordering', @$this->lists['order_Dir'], @$this->lists['order']);
?>
				<?php 
if ($ordering) {
    echo JHTML::_('grid.order', $this->data);
}
?>
			</th>
		</tr>
    </thead>
    <?php 
$k = 0;
Example #25
0
	
	var togglerName='div.accordion_toggler_';
	var contentName='div.accordion_content_';
	
	var acc_elem = null;
	var acc_toggle = null;
	
	var counter=1;	
	var toggler=$$(togglerName+counter);
	var content=$$(contentName+counter);
	
	while(toggler.length>0)
	{
		// Accordion anwenden
<?php 
    if (FSTJ3Helper::IsJ3()) {
        ?>
		new Fx.Accordion(toggler, content, {
<?php 
    } else {
        ?>
		new Accordion(toggler, content, {
<?php 
    }
    ?>
		opacity: false,
		alwaysHide: true,
		display: -1,
		onActive: function(toggler, content) {
				acc_elem = content;
				acc_toggle = toggler;
Example #26
0
 static function getAdminPermissions()
 {
     if (empty(FST_Ticket_Helper::$_permissions)) {
         $mainframe = JFactory::getApplication();
         global $option;
         $user = JFactory::getUser();
         $userid = $user->id;
         $db = JFactory::getDBO();
         $query = "SELECT * FROM #__fst_user WHERE user_id = '" . FSTJ3Helper::getEscaped($db, $userid) . "'";
         $db->setQuery($query);
         FST_Ticket_Helper::$_permissions = $db->loadAssoc();
         if (!FST_Ticket_Helper::$_permissions) {
             FST_Ticket_Helper::$_permissions['mod_kb'] = 0;
             FST_Ticket_Helper::$_permissions['mod_test'] = 0;
             FST_Ticket_Helper::$_permissions['support'] = 0;
             FST_Ticket_Helper::$_permissions['seeownonly'] = 1;
             FST_Ticket_Helper::$_permissions['autoassignexc'] = 1;
             FST_Ticket_Helper::$_permissions['allprods'] = 1;
             FST_Ticket_Helper::$_permissions['allcats'] = 1;
             FST_Ticket_Helper::$_permissions['alldepts'] = 1;
             FST_Ticket_Helper::$_permissions['artperm'] = 0;
             FST_Ticket_Helper::$_permissions['id'] = 0;
             FST_Ticket_Helper::$_permissions['groups'] = 0;
             FST_Ticket_Helper::$_permissions['reports'] = 0;
             FST_Ticket_Helper::$_permissions['settings'] = '';
         }
         FST_Ticket_Helper::$_permissions['userid'] = $userid;
         FST_Ticket_Helper::$_perm_only = '';
         FST_Ticket_Helper::$_perm_prods = '';
         FST_Ticket_Helper::$_perm_depts = '';
         FST_Ticket_Helper::$_perm_cats = '';
         FST_Ticket_Helper::$_permissions['perm_where'] = '';
         //
         // check for permission overrides for Joomla 1.6
         if (FST_Settings::get('perm_article_joomla') || FST_Settings::get('perm_mod_joomla')) {
             if (FST_Helper::Is16()) {
                 $newart = 0;
                 $newmod = 0;
                 $user = JFactory::getUser();
                 if ($user->authorise('core.edit.own', 'com_fst')) {
                     $newart = 1;
                 }
                 if ($user->authorise('core.edit', 'com_fst')) {
                     $newart = 2;
                     $newmod = 1;
                 }
                 if ($user->authorise('core.edit.state', 'com_fst')) {
                     $newart = 3;
                     $newmod = 1;
                 }
                 if (FST_Settings::get('perm_article_joomla') && $newart > FST_Ticket_Helper::$_permissions['artperm']) {
                     FST_Ticket_Helper::$_permissions['artperm'] = $newart;
                 }
                 if (FST_Settings::get('perm_mod_joomla') && $newmod > FST_Ticket_Helper::$_permissions['mod_kb']) {
                     FST_Ticket_Helper::$_permissions['mod_kb'] = $newmod;
                 }
                 //
             } else {
                 $newart = 0;
                 $newmod = 0;
                 $user = JFactory::getUser();
                 if ($user->authorize('com_fst', 'create', 'content', 'own')) {
                     $newart = 1;
                 }
                 if ($user->authorize('com_fst', 'edit', 'content', 'own')) {
                     $newart = 2;
                     $newmod = 1;
                 }
                 if ($user->authorize('com_fst', 'publish', 'content', 'all')) {
                     $newart = 3;
                     $newmod = 1;
                 }
                 if (FST_Settings::get('perm_article_joomla') && $newart > FST_Ticket_Helper::$_permissions['artperm']) {
                     FST_Ticket_Helper::$_permissions['artperm'] = $newart;
                 }
                 if (FST_Settings::get('perm_mod_joomla') && $newmod > FST_Ticket_Helper::$_permissions['mod_kb']) {
                     FST_Ticket_Helper::$_permissions['mod_kb'] = $newmod;
                 }
             }
         }
     }
     return FST_Ticket_Helper::$_permissions;
 }
Example #27
0
 static function CurDate()
 {
     if (FST_Helper::Is16()) {
         $myTimezone = FST_Helper::getTimezone();
         $myDate = null;
         $date = new JDate($myDate, $myTimezone);
         $formatted = $date->format('Y-m-d H:i:s', false, false);
         return $formatted;
     } else {
         $myTimezone = FST_Helper::getTimezone();
         $date = null;
         $date = new JDate($date, $myTimezone);
         if (FSTJ3Helper::IsJ3()) {
             return $date->toSql();
         } else {
             return $date->toMySQL();
         }
     }
 }
Example #28
0
 function getAnnouncement()
 {
     // get a list of announcements, including pagination and filter
     $id = JRequest::getVar('id', 0);
     $db = JFactory::getDBO();
     $qry = "SELECT a.*, u.name, u.username FROM #__fst_announce as a LEFT JOIN #__users as u ON a.author = u.id ";
     $qry .= "WHERE a.id = '" . FSTJ3Helper::getEscaped($db, $id) . "'";
     $db->setQuery($qry);
     return $db->loadObject();
 }
Example #29
0
 static function &Comm_GetCustomFields($ident)
 {
     $db = JFactory::getDBO();
     // get a list of all available fields
     if ($ident != -1) {
         $qry = "SELECT * FROM #__fst_field as f WHERE f.published = 1 AND (f.ident = 999 OR f.ident = '" . FSTJ3Helper::getEscaped($db, $ident) . "') ";
     } else {
         $qry = "SELECT * FROM #__fst_field as f WHERE f.published = 1 ";
     }
     $qry .= " ORDER BY f.ordering";
     $db->setQuery($qry);
     $rows = $db->loadAssocList("id");
     $indexes = array();
     if (count($rows) > 0) {
         foreach ($rows as $index => &$row) {
             $indexes[] = FSTJ3Helper::getEscaped($db, $index);
         }
     }
     $indexlist = implode(",", $indexes);
     if (count($indexes) == 0) {
         $indexlist = "0";
     }
     $qry = "SELECT * FROM #__fst_field_values WHERE field_id IN ({$indexlist})";
     $db->setQuery($qry);
     $values = $db->loadAssocList();
     if (count($values) > 0) {
         foreach ($values as &$value) {
             $field_id = $value['field_id'];
             $rows[$field_id]['values'][] = $value['value'];
         }
     }
     return $rows;
 }
Example #30
0
 function SortAPIKey($username = "", $apikey = "")
 {
     $db = JFactory::getDBO();
     $log = "";
     if ($username == "") {
         $qry = "SELECT * FROM #__fst_settings WHERE setting = 'fsj_username'";
         $db->setQuery($qry);
         $row = $db->loadObject();
         if ($row) {
             $username = $row->value;
         }
         $qry = "SELECT * FROM #__fst_settings WHERE setting = 'fsj_apikey'";
         $db->setQuery($qry);
         $row = $db->loadObject();
         if ($row) {
             $apikey = $row->value;
         }
     }
     if ($apikey == "" || $username == "") {
         $log = "No API key set\n";
         return $log;
     }
     // find current component id
     $qry = "SELECT * FROM #__extensions WHERE element = 'com_fst'";
     $db->setQuery($qry);
     $comp = $db->loadObject();
     if ($comp) {
         // delete from update sites where component is me
         $qry = "SELECT * FROM #__update_sites_extensions WHERE extension_id = {$comp->extension_id}";
         $db->setQuery($qry);
         $sites = $db->loadObjectList();
         foreach ($sites as $site) {
             $siteid = $site->update_site_id;
             $qry = "DELETE FROM #__update_sites WHERE update_site_id = {$siteid}";
             $db->setQuery($qry);
             $db->Query($qry);
         }
         $qry = "DELETE FROM #__update_sites_extensions WHERE extension_id = {$comp->extension_id}";
         $db->setQuery($qry);
         $db->Query($qry);
         // insert new record in to site
         $qry = "INSERT INTO #__update_sites (name, type, location, enabled) VALUES ('Freestyle Testimonials Updates', 'collection', 'http://www.freestyle-joomla.com/update/list.php?username="******"&apikey=" . FSTJ3Helper::getEscaped($db, $apikey) . "', 1)";
         $db->setQuery($qry);
         $db->Query();
         $site_id = $db->insertid();
         $qry = "INSERT INTO #__update_sites_extensions (update_site_id, extension_id) VALUES ({$site_id}, {$comp->extension_id})";
         $db->setQuery($qry);
         $db->Query();
         $log .= "Updater link appended with api information\n";
     } else {
         $log .= "Unable to find component\n";
     }
     return $log;
 }