<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://fbb.just4test.de/extern.php?action=feed&amp;tid=1396&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Informationen für CMS/made simple / Company Directory seit Update sortby="f:feld" Problem?]]></title>
		<link>http://www.cmsmadesimple.de/forum/viewtopic.php?id=1396</link>
		<description><![CDATA[Die aktuellsten Beiträge in Company Directory seit Update sortby="f:feld" Problem?.]]></description>
		<lastBuildDate>Thu, 20 Oct 2011 16:10:39 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Company Directory seit Update sortby="f:feld" Problem?]]></title>
			<link>http://www.cmsmadesimple.de/forum/viewtopic.php?pid=12152#p12152</link>
			<description><![CDATA[<p>Wie sieht denn dein Template aus? Hast du dies angepasst?</p><p>Falls ja, könntest mal versuchen, dies auf die programmseitigen Voreinstellungen zurückzusetzen ...</p>]]></description>
			<author><![CDATA[dummy@example.com (cyberman)]]></author>
			<pubDate>Thu, 20 Oct 2011 16:10:39 +0000</pubDate>
			<guid>http://www.cmsmadesimple.de/forum/viewtopic.php?pid=12152#p12152</guid>
		</item>
		<item>
			<title><![CDATA[Re: Company Directory seit Update sortby="f:feld" Problem?]]></title>
			<link>http://www.cmsmadesimple.de/forum/viewtopic.php?pid=12148#p12148</link>
			<description><![CDATA[<p>Keiner eine Lösung?</p>]]></description>
			<author><![CDATA[dummy@example.com (dalton)]]></author>
			<pubDate>Thu, 20 Oct 2011 15:54:43 +0000</pubDate>
			<guid>http://www.cmsmadesimple.de/forum/viewtopic.php?pid=12148#p12148</guid>
		</item>
		<item>
			<title><![CDATA[Company Directory seit Update sortby="f:feld" Problem?]]></title>
			<link>http://www.cmsmadesimple.de/forum/viewtopic.php?pid=12107#p12107</link>
			<description><![CDATA[<p>Hallo,</p><p>da ich ein CMS von der Version 1.8.2 auf die neuste Version wegen des Moduls CMSMLE upgraden musste, gab es natürlich auch mit anderen Modulen Komplikationen diese habe ich aber alle auf den neusten Stand aktualisiert.</p><p>Nur leider funktioniert in der neusten Version vom Company Directory das Sortby für das eigene Feld nicht mehr.</p><p>Es kommt folgende Fehlermeldung:</p><div class="codebox"><pre><code>Fatal error: Uncaught exception &#039;Exception&#039; with message &#039;Invalid Sortby Field&#039; in /home/httpd/vhosts/ugz.ch/httpdocs/modules/CompanyDirectory/lib/class.cd_company_filter.php:139 Stack trace: #0 /home/httpd/vhosts/ugz.ch/httpdocs/modules/CompanyDirectory/lib/class.cd_company_filter.php(68): cd_company_filter-&gt;offsetSet(&#039;sortby&#039;, &#039;f:sortby&#039;) #1 /home/httpd/vhosts/ugz.ch/httpdocs/modules/CompanyDirectory/action.default.php(47): cd_company_filter-&gt;__construct(Array) #2 /home/httpd/vhosts/ugz.ch/httpdocs/lib/classes/class.module.inc.php(2005): include(&#039;/home/httpd/vho...&#039;) #3 /home/httpd/vhosts/ugz.ch/httpdocs/modules/CGExtensions/CGExtensions.module.php(484): CMSModule-&gt;DoAction(&#039;default&#039;, &#039;maa412&#039;, Array, &#039;86&#039;) #4 /home/httpd/vhosts/ugz.ch/httpdocs/lib/classes/class.module.inc.php(2050): CGExtensions-&gt;DoAction(&#039;default&#039;, &#039;maa412&#039;, Array, &#039;86&#039;) #5 /home/httpd/vhosts/ugz.ch/httpdocs/lib/module.functions.php(144): CMSModule-&gt;DoActionBase(&#039;default&#039;, &#039;maa412&#039;, Array, &#039;86&#039;) #6 /home/httpd/vhosts/ugz.ch/httpdocs/lib/classes/class. in /home/httpd/vhosts/ugz.ch/httpdocs/modules/CompanyDirectory/lib/class.cd_company_filter.php on line 139</code></pre></div><br /><p>nach eingabe mit: {CompanyDirectory sortby=&quot;f:sortby&quot;} vor dem Update des Moduls ging das ohne Probleme.</p><br /><p>Nach Modulhilfe sollte man das so einrichten: </p><p>&quot;f:Feldname -- nach öffentlichen zusätzlichen Feldern sortieren. Die Ausgabe erfolgt sortiert nach dem benannten zusätzlichen Feld.<br />Hinweis 1: Wenn die Feldnamen Leerzeichen enthalten, müssen Sie Anführungszeichen verwenden.<br />Hinweis 2: The field specified must be marked as public.<br />Note: When using custom field sorting, You may also specify a flag after the field name to indicate that integer sorting should be performed. i.e: sortby=f:custom_ordering&quot;</p><br /><p>Und der Code an dieser Stelle wo das Felddefinierte sortby funktion zustande kommt sieht so aus:</p><div class="codebox"><pre class="vscroll"><code>  public function offsetSet($key,$value)
  {
    $cdmod = cms_utils::get_module(&#039;CompanyDirectory&#039;);

    if( !in_array($key,self::$_keys) )
      throw new Exception(&#039;Set: Invalid Key &#039;.$key.&#039;  specified for cd_company_filter&#039;);

    // validate data.
    switch( $key )
      {
      case &#039;sortby&#039;:
        $value = strtolower(trim($value));
        switch( $value )
          {
          case &#039;name&#039;:
            $value = &#039;company_name&#039;;
            break;

          case &#039;id&#039;:
          case &#039;address&#039;:
          case &#039;owner&#039;:
          case &#039;company_name&#039;:
          case &#039;phone&#039;:
          case &#039;fax&#039;:
          case &#039;email&#039;:
          case &#039;website&#039;:
          case &#039;created&#039;:
          case &#039;modified&#039;:
          case &#039;random&#039;:
          case &#039;distance&#039;:
            break;

          default:
            $good = false;
            if( startswith($sortby,&#039;f:&#039;) )
              {
                // validate custom field.
                list($junk,$fname,$ftype) = explode(&#039;:&#039;,$sortby,3);
                $fielddefs = $this-&gt;GetFieldDefs();
                for( $i = 0; $i &lt; count($fielddefs); $i++ )
                  {
                    if( $fielddefs[$i]-&gt;name == $fname ) 
                      {
                        $this-&gt;_sortby_fld = $fielddefs[$i];
                        $good = true;
                        break;
                      }
                  }
                if( $good &amp;&amp; $ftype != &#039;&#039; &amp;&amp; $ftype != &#039;i&#039; &amp;&amp; $ftype != &#039;f&#039;)
                  {
                    $good = false;
                  }
              }
            if( !$good ) throw new exception(&#039;Invalid Sortby Field&#039;);
            break;
          }
        break;</code></pre></div><p>Besten Dank im vorraus für eure Hilfe.</p>]]></description>
			<author><![CDATA[dummy@example.com (dalton)]]></author>
			<pubDate>Wed, 19 Oct 2011 12:44:39 +0000</pubDate>
			<guid>http://www.cmsmadesimple.de/forum/viewtopic.php?pid=12107#p12107</guid>
		</item>
	</channel>
</rss>
