params= new JRegistry(); $this->params->loadString($plugin->params, 'JSON'); $this->_cacheEnabled = $this->params->get('cache_enabled'); if ($this->_cacheEnabled === null) $this->_cacheEnabled == 1; $this->_autoflush = $this->params->get('autoFlush'); if ($this->_autoflush === null) $this->_autoflush = 1; $this->_autoflush3rdParty = $this->params->get('autoFlush-ThirdParty'); if ($this->_autoflush3rdParty === null) $this->_autoflush3rdParty = 1; $this->_autoflushClientSide = $this->params->get('autoFlush-ClientSide'); if ($this->_autoflushClientSide === null) $this->_autoflushClientSide = 0; } /** * Heartbeat cache checking function. Will also monitor $_GET for the jSGCache parameter * (pressing the purge cache button in admin) * * * @access public * @return null */ public function onAfterInitialise() { if (!$this->_cacheEnabled || $this->_isBlacklisted($this->_applicationPath)) { JResponse::setHeader('X-Cache-Enabled','False',true); return; } if ($this->_cacheEnabled) { JResponse::allowCache(true); JResponse::setHeader('X-Cache-Enabled','True',true); } //Init the application url $this->_applicationPath = str_replace(array('administrator/index.php','index.php'),'',str_replace($_SERVER['DOCUMENT_ROOT'],'',$_SERVER['SCRIPT_FILENAME'])); //Check for any admin action and proceed to flushMonitor and 3rd party plugins if ( isset($_POST['task']) || isset($_GET['task']) || isset($_GET['cart_virtuemart_product_id'])) { $this->_flushMonitor(); if ($this->_autoflush3rdParty) $this->_monitorThirdPartyPlugins(); } //Check if we have a logged in user and enable cache bypass cookie 'task' => string 'user.login' $user = JFactory::getUser(); if (!$user->guest || (isset($_POST['task']) && preg_match('/login/i', $_POST['task']))) { $_POST[JSession::getFormToken()] = 1; //Force the correct token, since the login box on the page is cached with the 1st visitors' token //Enable the cache bypass for logged users by setting a cache bypass cookie setcookie('jSGCacheBypass',1,time() + 6000,'/'); } if ($user->guest || (isset($_POST['task']) && $_POST['task'] == 'user.logout')) { //Remove the bypass cookie if not a logged user if (isset($_COOKIE['jSGCacheBypass'])) setcookie('jSGCacheBypass',0, time() - 3600,'/'); } // Handle purge button press when get has jSGCache=purge, but only in admin with a logged user if(isset($_GET['jSGCache']) && $_GET['jSGCache'] == 'purge' && JFactory::getApplication()->isAdmin() && !$user->guest ) $this->_purgeCache(true); } /** * Admin panel icon display * * @access public * @param string $context * @return array */ public function onGetIcons( $context ) { return array(array( 'link'=>'?jSGCache=purge', 'image'=>'refresh', 'text'=>JText::_('Purge jSGCache'), 'id'=>'jSGCache' )); } /** * Calls the cache server to purge the cache * * @access public * @param string|bool $message Message to be displayed if purge is successful. If this param is false no output would be done * @return null */ private function _purgeCache( $message = true ) { $purgeRequest = $this->_applicationPath . '(.*)'; // Construct the PURGE request $hostname = str_replace( 'www.', '', $_SERVER['HTTP_HOST'] ); $purge_method = "PURGE"; $cacheServerSocket = fsockopen($hostname, 80, $errno, $errstr, 2); if(!$cacheServerSocket) { JError::raise(E_ERROR,500,JText::_('Connection to cache server failed!')); JError::raise(E_ERROR,500,JText::_($errstr ($errno))); return; } $request = "$purge_method {$purgeRequest} HTTP/1.0\r\nHost: {$_SERVER['SERVER_NAME']}\r\nConnection: Close\r\n\r\n"; if (preg_match('/^www\./',$_SERVER['SERVER_NAME'])) { $domain_no_www = preg_replace('/^www\./', '', $_SERVER['SERVER_NAME']); $request2 = "$purge_method {$purgeRequest} HTTP/1.0\r\nHost: {$domain_no_www}\r\nConnection: Close\r\n\r\n"; } else $request2 = "$purge_method {$purgeRequest} HTTP/1.0\r\nHost: www.{$_SERVER['SERVER_NAME']}\r\nConnection: Close\r\n\r\n"; fwrite($cacheServerSocket, $request); $response = fgets($cacheServerSocket); fclose($cacheServerSocket); $cacheServerSocket = fsockopen($hostname, 80, $errno, $errstr, 2); fwrite($cacheServerSocket, $request2); fclose($cacheServerSocket); if($message !== false) { if(preg_match('/200/',$response)) { if ($message === true) JFactory::getApplication()->enqueueMessage(JText::_('SG Cache Successfully Purged!')); else JFactory::getApplication()->enqueueMessage(JText::_( $message )); } else { JError::raise(E_NOTICE,501, JText::_('SG Cache: Purge was not successful!')); JError::raise(E_NOTICE,501, jText::_('Error: ' . $response)); } } } /** * Check if url is in caching blacklist * * @param string $applicationPath * * @return bool */ private function _isBlacklisted($applicationPath) { $blacklistArray = explode("\n",$this->params->get('blacklist')); $blacklistRegexArray = array(); $indexIsBlacklisted = false; foreach($blacklistArray as $key=>$row) { $row = trim($row); if ($row != '/' && $quoted = preg_quote($row,'/')) $blacklistRegexArray[$key] = $quoted; if ($row == '/') $indexIsBlacklisted = true; } if ($indexIsBlacklisted && $_SERVER['REQUEST_URI'] == $applicationPath) return true; if (empty($blacklistRegexArray)) return false; $blacklistRegex = '/('.implode('|',$blacklistRegexArray) . ')/i'; return preg_match($blacklistRegex, $_SERVER['REQUEST_URI']); } /** * 3rd party plugin monitor * * @access private * @return null */ private function _monitorThirdPartyPlugins() { // Kunena & K2 if ($this->params->get('autoFlush-ThirdParty') == 1 && isset($_POST['option']) && ($_POST['option']=='com_k2' || $_POST['option' ]== 'com_kunena')) { $this->_purgeCache(false); } // VirtueMart if ( (isset($_POST['option']) && $_POST['option'] == 'com_virtuemart') || ( isset($_GET['option']) && $_GET['option'] == 'com_virtuemart' ) || isset($_GET['cart_virtuemart_product_id']) ) { if($this->params->get('autoFlush-ThirdParty') == 1) $this->_purgeCache(false); } } /** * Action monitor * * @access private * @return null */ private function _flushMonitor() { $user = JFactory::getUser(); if ((!JFactory::getApplication()->isAdmin() && !$this->_autoflushClientSide) || $user->guest) return; $autoflush = $this->params->get('autoFlush'); if ($autoflush === null) $autoflush = 1; if (isset($_POST['task']) && $_POST['task'] && !in_array($_POST['task'],self::$_ignoreTasks) && $autoflush == 1) $this->_purgeCache(false); } } Community Support Forums - Sellacious
  Sunday, 24 January 2021
  5 Replies
  1.8K Visits
  Subscribe
I freshly installed Sellacious (beta_3) and found same errors as other people here. So created the two table who were missing (from other discussion), but still having the problem with the cache.

Searched further and this query does not seem to work (sql-error #1064 in the syntax):

SELECT COUNT(*)
FROM 'nbr96_sellacious_products' AS 'a'
LEFT JOIN ( SELECT GROUP_CONCAT(c.id
ORDER BY c.lft SEPARATOR ',') AS category_ids,GROUP_CONCAT(c.title
ORDER BY c.lft SEPARATOR '|:|') AS category_titles,pc.product_id
FROM 'nbr96_sellacious_categories' AS 'c'
LEFT JOIN 'nbr96_sellacious_product_categories' AS 'pc'
ON c.id = pc.category_id
GROUP BY pc.product_id) AS cc
ON cc.product_id = a.id
LEFT JOIN ( SELECT pp.product_id, pp.seller_uid, pp.id AS price_id, pp.cost_price, pp.margin, pp.margin_type,pp.list_price, pp.calculated_price, pp.product_price, pp.product_price AS sales_price, pp.ovr_price, pp.is_fallback,ss.title AS seller_company, ss.store_name AS seller_store,IF (ss.state = 1
AND u.block = 0, 1, 0) AS seller_active,u.name AS seller_name, u.username AS seller_username, u.email AS seller_email,'CHF' AS seller_currency
FROM 'nbr96_sellacious_product_prices' AS 'pp'
LEFT JOIN 'nbr96_sellacious_sellers' AS 'ss'
ON ss.user_id = pp.seller_uid
INNER JOIN 'nbr96_users' AS 'u'
ON u.id = pp.seller_uid
LEFT JOIN 'nbr96_sellacious_profiles' AS 'su'
ON su.user_id = pp.seller_uid;

Can you look into this please?

Kind regards, H. Beyeler
3 years ago
·
#5537
Hi,
Can you pls make sure your system fulfils these requirements https://www.sellacious.com/documentation-v2#/learn/basics/system-requirements
specially Sqlite 3.25.2+ and php executable cli enabled on your system.

Let me know if still not working
Thanks.
3 years ago
·
#5551
My provider told me that they have MySQL-Databases and not Sqlite. Also the php executable cli is not enabled and they will not do that either. So unfortunately no sellacious for me I suppose. Or do you have another option for me?
3 years ago
·
#5553
Hi,
You can change your server provider and choose the one who fulfils these requirements as these are standard which comes with any server.
Other option is you can subscribe our cloud plan in which we install your website on our fast servers and take care of all these requirements. https://www.sellacious.com/sellacious-cloud-marketplace-pricing-annual

Hope this helps
Thanks.
3 years ago
·
#5557
I installed the quick install:

First message is:

Message
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay

What does it mean?
3 years ago
·
#5558
This message comes also after starting rebuilding the cache. It was the first message before the installation-directory was deleted by the installation itself.

I am real happy with my provider and have no intention to change. I was really impressed by your store, but am afraid I have to look for another store-solution.

Regards
H. Beyeler
  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
  • +1 (408) 821-8283
  • Email hello@sellacious.com