Sergey,
Is it possible to access an SQL database from within my Plugin that uses 'onBeforeArticleSaved'?
This query code doesn't work (although it works in another program) but it's the general idea.
defined('_JEXEC') or die('Restricted access');
// Get VIN from hold_vin.
$query = $db->getQuery(true);
$holdid = 1;
$query
->select('vin')
->from('hold_vin')
->where('id = ' . $db->quote($holdid));
$db->setQuery($query);
$vin = $db->loadResult();
//echo $vin;
require_once JPATH_ROOT . '/components/com_cobalt/api.php';
class plgMintVinpreload extends JPlugin
{
public function onBeforeArticleSaved($isnew, $record, $section, $type)
{
if($isnew)
{
$app = JFactory::getApplication();
if($app->isAdmin() || $app->input->getInt('section_id') != 6)
{
return;
}
etc.....
Sergey, Is it possible to access an SQL database from within my Plugin that uses 'onBeforeArticleSaved'?
This query code doesn't work (although it works in another program) but it's the general idea.