GetConfig(); $fileTimeIS=filemtime($File); $File= str_replace($config['root_path'], "", $File); $newPath = $File."?".$fileTimeIS; return $newPath; } function GetCategoriesNamesForCompany($path,$id){ $entryarray = array(); global $gCms; $db =& $gCms->GetDB(); $query = 'SELECT * FROM '.cms_db_prefix().'module_compdir_company_categories AS c ' .'LEFT JOIN '.cms_db_prefix().'module_compdir_categories AS a ' .'ON c.category_id = a.id WHERE c.company_id = ?'; $result = $db->Execute($query, array($id)); while ($result && !$result->EOF){ $entryarray[]=$result->fields['name']; $result->MoveNext(); } return $entryarray; } function GetCategoryName($path,$id){ global $gCms; $db =& $gCms->GetDB(); $query = 'SELECT * FROM '.cms_db_prefix().'module_products_categories ' .'WHERE id = ?'; $result = $db->Execute($query, array($id)); while ($result && !$result->EOF){ return $result->fields['name']; } } } function smarty_cms_function_modslack($params, &$smarty) { global $gCms; $config =& $gCms->GetConfig(); //get and set the parameters $function = isset($params['Func']) ? $params['Func']:''; $param1 = isset($params['param1']) ? $params['param1']:''; $param2 = isset($params['param2']) ? $params['param2']:''; $param3 = isset($params['param3']) ? $params['param3']:''; $param4 = isset($params['param4']) ? $params['param4']:''; $param5 = isset($params['param5']) ? $params['param5']:''; $assign = isset($params['assign']) ? $params['assign']:''; $path = isset($params['path']) ? $params['path']:false; if($path!=false){ $path=$config['root_path'].$path; } //object model :: $ModSlackOBJ->$function($path,$param1,$param2,$param2,$param2,$param5); $ModSlackOBJ = new modslack(); $OutCome = $ModSlackOBJ->$function($path,$param1,$param2,$param2,$param2,$param5); if($assign!=''){ $smarty->assign($assign,$OutCome); }else{ echo $OutCome; } } function smarty_cms_help_function_modslack() { ?>

Ever just had a need for a off function...

... that you wished was in a module well this is where I have been sticking mine.
Please feel free to Let me know if you find more.

How do I use this tag?

Functions:

fileTime($path) -- returns file creation time of a file for caching controll

MOD - Company Directy

-- GetCategoriesNamesForCompany($params1=$id) -- returns an array of the Categories of the company id

MOD - Products

-- GetCategoryName($params1=$id) -- returns the name of the Category of the Category id



Params



Examples:



Author: jeremyBass <jeremybass@cableone.net>
Website: CorbensProducts.com
Support more mods like this:


Version: 1.0, 11.19.2009

Author: jeremyBass <jeremybass@cableone.net>

Version: 1.0, 10.10.2009