_ >   56 56         return isset($m_var_list_update[$name]) ? $m_var_list_update[$name] : $m_var_list[$name];
  57 57 }
  58 58
< >   59   function &LoadRelatedItems(&$Relations,&$RelatedItems,$ResourceId)
    59 function LoadRelatedItems(&$Relations,&$RelatedItems,$ResourceId)
60 60 {
  61 61         global $objItemTypes;
  62 62
 
189 189         global $var_list, $objSession, $objUsers, $objTemplate;
  190 190
  191 191         $userid = $objSession->Get('PortalUserId');
< >   192     
    192
193 193         if ($userid <= 0) {
  194 194                 if ( getArrayValue($attribs, '_logintemplate')) {
  195 195                         $t = $objTemplate->ParseTemplate($attribs['_logintemplate']);
 
233 233 function m_subscribe_address()
  234 234 {
  235 235     global $objSession;
< >   236           
    236
237 237     return $objSession->GetVariable('SubscribeAddress');
  238 238 }
  239 239
 
448 448         }
  449 449         else
  450 450         {
< >   451                   $value = (int)$FormValues[$form][$field];
  452                   if($value==1)
  453                   $checked=' CHECKED';
    451                 $value = $FormValues[$form][$field];
    452         if (is_array($value)) {
    453                 $value = $value['value'];
    454         }
    455
    456                 if ((int)$value==1) {
    457                         $checked = ' CHECKED';
    458                 }
454 459         }
  455 460         //echo $form.".".$field."=".$value."<br>\n";
  456 461         $ret = "<INPUT TYPE=\"checkbox\" $html_attribs name=\"$field\" VALUE=\"1\" $checked />";
 
797 802        $FormValues[$FormName]["country"] = $u->Get("Country");
  798 803        $FormValues[$FormName]["minpwresetdelay"] = $u->Get("MinPwResetDelay");
  799 804
< >   800         
    805
801 806 //       $FormValues[$FormName]["dob"] = LangDate($u->Get("dob"), 0, true);
  802 807        $FormValues[$FormName]["dob_day"] = adodb_date("d", $u->Get("dob"));
  803 808        $FormValues[$FormName]["dob_year"] = adodb_date("Y", $u->Get("dob"));
 
1253 1258         if(getArrayValue($attribs,'_fullpath') || getArrayValue($attribs,'_currentcategory'))
  1254 1259         {
  1255 1260                 $CurrentCat = $objCatList->CurrentCategoryID();
< >   1256           if((int)$CurrentCat>0)
  1257           {
  1258                   $c = $objCatList->GetCategory($CurrentCat);
  1259                   if($attribs["_fullpath"])
  1260                   {
  1261                     $path = $c->Get("CachedNavbar");
    1261                 if((int)$CurrentCat>0)
    1262                 {
    1263                         $c = $objCatList->GetCategory($CurrentCat);
    1264                         if($attribs["_fullpath"])
    1265                         {
    1266                                 $application =& kApplication::Instance();
    1267                                 $ml_formatter =& $application->recallObject('kMultiLanguage');
    1268                                 $path = $c->Get($ml_formatter->LangFieldName('CachedNavbar'));
1262 1269
< >   1263                     if(strlen($path))
  1264                            $ret .= " - ".$path;
  1265                   }
  1266                   else
  1267                   {
  1268                     if($attribs["_currentcategory"])
  1269                     {
  1270                            $f = $attribs["_catfield"];
  1271                            if(!strlen($f))
  1272                              $f = "Name";
  1273                           $ret .= " - ".$c->Get($f);
  1274                     }
  1275                   }
  1276           }
  1277       }
    1270                                 if (strlen($path)) {
    1271                                         $ret .= " - ".str_replace('&|&', ' > ', $path);
    1272                                 }
    1273                         }
    1274                         else
    1275                         {
    1276                                 if($attribs["_currentcategory"])
    1277                                 {
    1278                                         $f = $attribs["_catfield"];
    1279                                         if (!strlen($f)) {
    1280                                                 $f = "Name";
    1281                                         }
    1282
    1283                                         if ($f == 'Name') $f = $objCatList->TitleField;
    1284                                         $ret .= " - ".$c->Get($f);
    1285                                 }
    1286                         }
    1287                 }
    1288         }
1278 1289     $ret = stripslashes($ret);
  1279 1290         return $ret;
  1280 1291 }
 
1531 1542      for($i=0;$i<count($Groups);$i++)
  1532 1543      {
  1533 1544          $g = $Groups[$i];
< >   1534            $acl_where[] = "(FIND_IN_SET($g,acl) OR ((NOT FIND_IN_SET($g,dacl)) AND acl='')) ";
    1545          $acl_where[] = "FIND_IN_SET($g,acl) ";
1535 1546      }
  1536 1547      if(count($acl_where))
  1537 1548      {
  1538 1549          $acl_where = "(".implode(" OR ",$acl_where).")";
  1539 1550      }
< >   1540        else
  1541          $acl_where = "(FIND_IN_SET(0,acl))";
    1551      else {
    1552        $acl_where = "FIND_IN_SET(0,acl)";
    1553      }
1542 1554    }
< >   1543      else
  1544          $acl_where = "(FIND_IN_SET(0,acl))";
    1555    else {
    1556        $acl_where = "FIND_IN_SET(0,acl)";
    1557    }
1545 1558    $objCatList->Clear();
  1546 1559    $OrderBy = $objCatList->QueryOrderByClause(TRUE,TRUE,TRUE);
  1547 1560    $objCatList->LoadCategories("ParentId=$CategoryId AND Status=1",$OrderBy, false);
 
1658 1671         for($i=0;$i<count($Groups);$i++)
  1659 1672         {
  1660 1673             $g = $Groups[$i];
< >   1661               $acl_where[] = "(FIND_IN_SET($g,acl) OR ((NOT FIND_IN_SET($g,dacl)) AND acl='')) ";
    1674             $acl_where[] = "FIND_IN_SET($g,acl) ";
1662 1675         }
  1663 1676         if(count($acl_where))
  1664 1677         {
  1665 1678             $acl_where = "(".implode(" OR ",$acl_where).")";
  1666 1679         }
< >   1667           else
  1668               $acl_where = "(FIND_IN_SET(0,acl))";
    1680         else {
    1681             $acl_where = "FIND_IN_SET(0,acl)";
    1682         }
1669 1683     }
< >   1670       else
  1671           $acl_where = "(FIND_IN_SET(0,acl))";
    1684     else {
    1685         $acl_where = "FIND_IN_SET(0,acl)";
    1686     }
1672 1687
  1673 1688     $order_by = "EdPick DESC,Relevance DESC";
  1674 1689
 
1702 1717     $objSearchCats->Query_Item($sql);
  1703 1718     $where = "ItemType=1";
  1704 1719
< >     1720     $Keywords = GetKeywords($objSession->GetVariable("Search_Keywords"));
    1721     //echo "SQL Loaded ItemCount (<b>".get_class($this).'</b>): '.$this->NumItems().'<br>';
    1722     for($i = 0; $i < $objSearchCats->NumItems(); $i++)
    1723     {
    1724       $objSearchCats->Items[$i]->Keywords = $Keywords;
    1725     }
    1726
1705 1727     if(is_numeric($CountVal[1]))
  1706 1728     {
  1707 1729         $objSearchCats->QueryItemCount = $CountVal[1];
 
1893 1915                 if ($keywords) {
  1894 1916                         foreach ($objSearchCats->Items as $cat) {
  1895 1917
< >   1896                                   if (strstr(strip_tags(strtolower($cat->Data['Name'])), strtolower($_POST['keywords'])) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($_POST['keywords']))) {
    1918                                 if (strstr(strip_tags(strtolower($cat->Data[$cat->TitleField])), strtolower($_POST['keywords'])) || strstr(strip_tags(strtolower($cat->Data[$cat->DescriptionField])), strtolower($_POST['keywords']))) {
1897 1919                                         $ret++;
  1898 1920                                 }
  1899 1921                         }
 
1965 1987      foreach($objSearchCats->Items as $cat)
  1966 1988      {
  1967 1989         //$cat->Keywords = GetKeywords($objSession->GetVariable("Search_Keywords"));
< >   1968   /*        $keywords_found = strstr( strip_tags(strtolower($cat->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($keywords));
    1990 /*        $keywords_found = strstr( strip_tags(strtolower($cat->Data[$objCatList->TitleField])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data[$cat->DescriptionField])), strtolower($keywords));
1969 1991         if(!$keywords) $keywords_found = true;
  1970 1992         if ($keywords_found) {*/
  1971 1993                 if($row==0 && strlen($attribs["_firstitemtemplate"]))
 
2910 2932 function m_meta_keywords($attribs = array())
  2911 2933 {
  2912 2934     global $objCatList, $objConfig;
< >   2913      
    2935
2914 2936     $keywords = '';
  2915 2937     $catid = (int)getArrayValue($attribs, '_catid');
< >   2916      
    2938
2917 2939     if (!$catid)
  2918 2940     {
  2919 2941         $catid = $objCatList->CurrentCategoryID();
  2920 2942     }
< >   2921      
    2943
2922 2944     if ($catid)
  2923 2945     {
  2924 2946         $c = $objCatList->GetItem($catid);
  2925 2947         $keywords = $c->Get('MetaKeywords');
  2926 2948     }
< >   2927      
    2949
2928 2950     if (!$keywords)
  2929 2951     {
  2930 2952         $keywords = $objConfig->Get('Category_MetaKey');
 
2946 2968     {
  2947 2969                 $catid = $objCatList->CurrentCategoryID();
  2948 2970     }
< >   2949      
    2971
2950 2972     if ($catid)
  2951 2973     {
  2952 2974         $c = $objCatList->GetItem($catid);
  2953 2975         $description = $c->Get('MetaDescription');
  2954 2976     }
< >   2955      
    2977
2956 2978     if (!$description)
  2957 2979     {
  2958 2980         $description = $objConfig->Get('Category_MetaDesc');
 
3404 3426     /*if ($keywords) {
  3405 3427         foreach ($objSearchCats->Items as $cat) {
  3406 3428
< >   3407                   if (strstr(strip_tags(strtolower($cat->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($keywords))) {
    3429                 if (strstr(strip_tags(strtolower($cat->Data[$objCatList->TitleField])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data[$cat->DescriptionField])), strtolower($keywords))) {
3408 3430                         $ret++;
  3409 3431                 }
  3410 3432         }
 
3533 3555 */
  3534 3556 function m_sitemap($attribs = array())
  3535 3557 {
< >   3536           global $objModules, $objConfig;
    3558         global $objModules, $objConfig, $objCatList;
3537 3559
  3538 3560     $html_attribs = ExtraAttributes($attribs);
  3539 3561
 
3612 3634
  3613 3635                 foreach ($_C_catList as $cat)
  3614 3636                 {
< >   3615                           $text = $cat->Get("Name");
    3637                         $text = $cat->Get($objCatList->TitleField);
3616 3638                         $val = $cat->Get("CategoryId");
  3617 3639                         $sub_path = $cat->Get("ParentPath");
  3618 3640
 
3641 3663                         $ParentPath = empty($_RootCat) ? '|'.$val.'|%' : '|'.$_RootCat.'|'.$val.'|%';
  3642 3664
  3643 3665                         $_Where = GetTablePrefix()."Category.ParentPath LIKE '$ParentPath' AND ".GetTablePrefix()."Category.CategoryId!=$val AND Status=1";
< >   3644                           $_OrderBy = " ORDER BY ".GetTablePrefix()."Category.ParentPath ASC, ".GetTablePrefix()."Category.Name ASC";
    3666                         $_OrderBy = " ORDER BY ".GetTablePrefix()."Category.ParentPath ASC, ".GetTablePrefix()."Category.".$objCatList->TitleField." ASC";
3645 3667                         $old_value = $objConfig->Get($_C_objCatSubs->PerPageVar);
  3646 3668                         $objConfig->Set($_C_objCatSubs->PerPageVar, (int)$MaxCats);
  3647 3669
 
3653 3675                         {
  3654 3676                                 foreach ($SubCats as $subcat)
  3655 3677                                 {
< >   3656                                           $SubCatName = $subcat->Get("Name");
    3678                                         $SubCatName = $subcat->Get($objCatList->TitleField);
3657 3679                                         $SubCatId = $subcat->Get("CategoryId");
  3658 3680
  3659 3681                                         $SubPath = $subcat->Get("ParentPath");
 
3708 3730
  3709 3731 function m_IsDebugMode($params)
  3710 3732 {
< >   3711           echo 'kool';
    3733 //      echo 'kool';
3712 3734         return IsDebugMode() ? true : '';
  3713 3735 }
  3714 3736
 
3717 3739                 $parser_params = GetVar('parser_params');
  3718 3740                 $param_name = strtolower($params['_name']);
  3719 3741                 $value = getArrayValue($parser_params, $param_name);
< >   3720                   
    3742
3721 3743                 if ($value) {
  3722 3744                         if (getArrayValue($params, '_asphrase')) {
  3723 3745                                 $value = language($value);
  3724 3746                         }
  3725 3747                 }
< >   3726                   
    3748
3727 3749                 return $value;
  3728 3750         }
  3729 3751
  3730 3752         function m_set_category($params)
  3731 3753         {
  3732 3754                 global $m_var_list;
< >   3733                   
    3755
3734 3756                 if (getArrayValue($params, '_onlyonce') && $m_var_list['cat']) return ;
< >   3735                   
    3757
3736 3758                 $db =& GetADODBConnection();
  3737 3759                 $category_id = getArrayValue($params, '_catid');
  3738 3760                 if (!$category_id) {
  3739 3761                         $module = getArrayValue($params, '_module');
  3740 3762                         if ($module) {
< >   3741                                   
    3763
3742 3764                                 $sql = 'SELECT RootCat FROM '.GetTablePrefix().'Modules WHERE LOWER(Name) = '.$db->qstr( strtolower($module) );
  3743 3765                                 $category_id = $db->GetOne($sql);
  3744 3766                         }
  3745 3767                 }
< >   3746                   
    3768
3747 3769                 if ($category_id) {
  3748 3770                         $m_var_list['cat'] = $category_id;
  3749 3771                 }
  3750 3772         }
< >   3751           
    3773
3752 3774         function m_template_equals($params)
  3753 3775         {
  3754 3776                 $t = preg_replace('/(.*)\.tpl/', '\\1', $params['_template']);
  3755 3777                 return $GLOBALS['var_list']['t'] == $t ? true : '';
  3756 3778         }
< >   3757           
    3779
3758 3780         function m_ShowSearchError($params)
  3759 3781         {
  3760 3782                 global $objSession, $objTemplate;
< >   3761                   
    3783
3762 3784                 $error_phrase = $objSession->GetVariable('search_error');
  3763 3785                 if (!$error_phrase) {
  3764 3786                         return '';
  3765 3787                 }
< >   3766                   
    3788
3767 3789                 $template = getArrayValue($params, '_itemtemplate');
  3768 3790                 if (!$template) {
  3769 3791                         $ret = '<inp:form_error />';
  3770 3792                 }
< >   3771      
    3793
3772 3794         $ret = $objTemplate->GetTemplate($template, true);
  3773 3795         $ret = $ret->source;
< >   3774                   
    3796
3775 3797                 return str_replace('<inp:form_error />', language($error_phrase), $ret);
  3776 3798         }
< >   3777           
    3799
< _   3778 3800 /*function m_object($attribs=Array())
  3779 3801 {
  3780 3802         $element = new clsHtmlTag();