<?php
/**
  @licence GPL 2005-2010  The osCSS developers - osCSS Open Source E-commerce
  @portion code Copyright (c) 2002 osCommerce
  @package osCSS-2 <www http://www.oscss.org>
  @version 2.1.0
  @date  19/12/10, 19:49
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
*/

function blockVars($sTpl,$beginSymbol='',$endSymbol='') {
  if(strlen($beginSymbol) == 0) $beginSymbol = "{";
  if(strlen($endSymbol) == 0) $endSymbol = "}";
  $beginSymbolLength = strlen($beginSymbol);
  $endTag = 0;
  /* searching open symbol */
  while (($beginTag = strpos($sTpl,$beginSymbol,$endTag)) !== false)
  {
    /* searching close symbol */
    if (($endTag = strpos($sTpl,$endSymbol,$beginTag)) !== false)
    {
      /* add variable name to the array of variable */
      $vars[] = substr($sTpl, $beginTag + $beginSymbolLength, $endTag - $beginTag - $beginSymbolLength);
    }
  }
  /* if there is one or more variable in array then return this array */
  if(isset($vars)) return $vars;
  else return false;
}



// Sets the status of the store
function tep_cms_set_content_status($content_id, $status) {
  if ($status == '1') {
    return tep_db_query("update " . TABLE_CONTENT . " set content_status = '1', last_modified = now() where content_id = '" . (int)$content_id . "'");
  } elseif ($status == '0') {
    return tep_db_query("update " . TABLE_CONTENT . " set content_status = '0', last_modified = now() where content_id = '" . (int)$content_id . "'");
  } else {
    return -1;
  }
}

?>
