ConPresso Newsletter Modul ConPresso Warenkorb-Modul ConPresso Formular-Modul ConPresso Galerie/Slideshow-Modul ConPresso Bildskalierungs-Modul ConPresso Menü-Modul ConPresso Mobilseiten-Modul ConPresso Feature-Suche-Modul viele weitere Conpresso Module

News  News

Die Seite befindet sich gerade in einer Umstrukturierungsphase. Daher sind einige Funktionen nicht erreichbar. Bei Bedarf nehmen Sie einfach Kontakt mit uns auf.

pimp my Artikelsortierung

WIRD GERADE NOCH BEARBEITET!

=== OPEN / ÖFFNE ===

_admin/articles.php

=== FIND / FINDE ===

Code:
    case 'articles_status': // {{{ articles_status_versions, articles_status_release
=== BEFORE, INSERT / DAVOR, EINFÜGEN === 
Code:
// start part 1 of 2 pimp my artikelsortierung by m.roesel ************************
    case 'articles_quick_sort': // {{{
      $db = new DB;
      $query = 'SELECT nr, sort_id '
            .'FROM '.CPO_NEWS.' '
            ."WHERE (artikel_archiv = '0' "
            ."AND idx='zzzzzz' "
            ."AND rubric_id = '".addslashes($_SESSION['SID_rubric_id'])."') ORDER BY " . $cpoRubricSettings['sorting'];
      $db->query($query);
      if (isset($_GET['top']))  {
         $db->next_record();
         $numbers[] = $_GET['top'];
         $sort_ids[] = $db->v('sort_id');
         $numbers[] = $db->v('nr');
         while ($db->next_record())  {
            if ($db->v('nr') != $_GET['top'])  {
               $numbers[] = $db->v('nr');
            }
            $sort_ids[] = $db->v('sort_id');
         }
         for ($i=0;$i<count($numbers);$i++)  {
            $db->query("UPDATE ".CPO_NEWS." SET sort_id = ".$sort_ids[$i]." WHERE nr = ".$numbers[$i]);
         }
      }
      if (isset($_GET['bottom']))  {
         while ($db->next_record())  {
            if ($db->v('nr') != $_GET['bottom'])  {
               $numbers[] = $db->v('nr');
            }
            $sort_ids[] = $db->v('sort_id');
         }
         $numbers[] = $_GET['bottom'];
         for ($i=0; $i<count($numbers);$i++)  {
            $db->query("UPDATE ".CPO_NEWS." SET sort_id = ".$sort_ids[$i]." WHERE nr = ".$numbers[$i]);
         }
      }
      if (isset($_GET['rew']))  {
         $x=0;
         while ($db->next_record())  {
            if ($db->v('nr') == $_GET['rew']) $x_nr = $x;
            $numbers[$x] = $db->v('nr');
            $sort_ids[$x] = $db->v('sort_id');
            $x++;
         }
         $delta = max(0,$x_nr-$articleSortOffset);
         $set[] = $_GET['rew'];
         $new_sort_id[] = $sort_ids[$delta];
         for ($i=$delta;$i<$x_nr;$i++)  {
            $set[] = $numbers[$i];
            $new_sort_id[] = $sort_ids[$i+1];
         }
         for ($i=0; $i<count($set);$i++)  {
            $db->query("UPDATE ".CPO_NEWS." SET sort_id = ".$new_sort_id[$i]." WHERE nr = ".$set[$i]);
         }
      }
      if (isset($_GET['ff']))  {
         $x=0;
         while ($db->next_record())  {
            if ($db->v('nr') == $_GET['ff']) $x_nr = $x;
            $numbers[$x] = $db->v('nr');
            $sort_ids[$x] = $db->v('sort_id');
            $x++;
         }
         $delta = min($x-1,$x_nr+$articleSortOffset);
         $set[] = $_GET['ff'];
         $new_sort_id[] = $sort_ids[$delta];
         for ($i=$x_nr;$i<$delta;$i++)  {
            $set[] = $numbers[$i+1];
            $new_sort_id[] = $sort_ids[$i];
         }
         for ($i=0; $i<count($set);$i++)  {
            $db->query("UPDATE ".CPO_NEWS." SET sort_id = ".$new_sort_id[$i]." WHERE nr = ".$set[$i]);
         }
      }
        logaction('quick article order switch', '');
        break;
        // }}}
// end part 1 of 2 pimp my artikelsortierung by m.roesel ************************
=== FIND / FINDE ===
Code:
        if ($_SESSION['SID_stufe2']==1 && $cpoRubricSettings['sorting']=='sort_id desc') {
            echo '<th style="width: 1%;"><span>'.help('', true).'</span></th>'; // helpme
        }

        echo '<th style="width: 74%;"><span>'.___('Title/Author').help('articles-listarticles.html#articles-listarticles-titleauthor').'</span></th>';

        if ($_SESSION['SID_stufe2']==1) {
            echo '<th style="width: 10%;"><span>'.___('Manage').help('articles-listarticles.html#articles-listarticles-edit').'</span></th>';
        }

        echo '<th style="width: 5%;"><span>'.___('Status').help('articles-listarticles.html#articles-listarticles-status').'</span></th>';
        echo '<th style="width: 5%;"><span>'.___('Publication').help('articles-listarticles.html#articles-listarticles-publication').'</span></th>';
        echo '<th style="width: 5%;"><span>'.___('Info').help('articles-listarticles.html#articles-listarticles-info').'</span></th>';
        echo '</tr></thead><tbody>';
        // }}}

        $query = "SELECT nr, article_nr, auth, autor, changer, commentary, freigabe, released_user_id, last_modify, datum, pub_datum, sort_id, templates_id, titel, verfallsdatum "
                .$_q
                ."ORDER BY ".$cpoRubricSettings['sorting']." "
                ."LIMIT ".$_SESSION['SID_pagers']['articles'].", ".$cpoSystem['noOfArticles'];
        DEBUG(1, $query, __FILE__, __LINE__);
        $db->query($query);

        while($db->next_record()) {
            echo '<tr>';
            // article sorting {{{
            if ($_SESSION['SID_stufe2']==1 && $cpoRubricSettings['sorting']=='sort_id desc') {
                echo '<td>';

                // Find article "below" this one {{{
                $query = "SELECT nr, sort_id FROM ".CPO_NEWS." "
                        ."WHERE artikel_archiv=0 "
                        ."AND sort_id<'".$db->v('sort_id')."' "
                        ."AND rubric_id='".$_SESSION['SID_rubric_id']."' "
                        ."ORDER BY sort_id DESC LIMIT 1";
                DEBUG(2, 'Find article "below" this one.<br /><br />'.$query, __FILE__, __LINE__);
                $db_2 = new DB;
                $db_2->query($query);
                $down_id = 'no';
                if ($db_2->num_rows()>0) {
                    $db_2->next_record();
                    $down_id = $db_2->v('sort_id');
                    $down_nr = $db_2->v('nr');
                }
                // }}}
                // Find article "above" this one {{{
                $query = "SELECT nr, sort_id FROM ".CPO_NEWS." "
                        ."WHERE artikel_archiv=0 "
                        ."AND sort_id>'".$db->v('sort_id')."' "
                        ."AND rubric_id='".$_SESSION['SID_rubric_id']."' "
                        ."ORDER BY sort_id LIMIT 1";
                DEBUG(2, 'Find article "above" this one.<br /><br />'.$query, __FILE__, __LINE__);
                $db_2->query($query);
                $up_id = 'no';
                if ($db_2->num_rows()>0) {
                    $db_2->next_record();
                    $up_id = $db_2->v('sort_id');
                    $up_nr = $db_2->v('nr');
                }
                // }}}
               
                if ($up_id=='no') {
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_empty'.($_GET['unr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="" /><br />';
                } else {
                    $art_pos = $_SESSION['SID_pagers']['articles'];
                    if ($art_count=='0') $art_pos = $_SESSION['SID_pagers']['articles'] - $cpoSystem['noOfArticles'];
                    echo '<a href="'.BASE_REL.'_admin/articles.php?action=articles_sort&pos='.$art_pos.'&unr='.$db->v('nr').'&switch_id='.$up_id.'&sort_id='.$db->v('sort_id').'&switch_nr='.$up_nr.'&sort_nr='.$db->v('nr').'">';
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_up'.($_GET['unr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="'.___('move up').'" title="'.___('move up').'" />';
                    echo '</a><br />';
                }

                if ($down_id=='no') {
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_empty'.($_GET['dnr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="" /><br />';
                } else {
                    $art_pos = $_SESSION['SID_pagers']['articles'];
                    if ($art_count==($cpoSystem['noOfArticles']-1) ) {
                        $art_pos = $_SESSION['SID_pagers']['articles'] + $cpoSystem['noOfArticles'];
                    }
                    echo '<a href="'.BASE_REL.'_admin/articles.php?action=articles_sort&pos='.$art_pos.'&dnr='.$db->v('nr').'&switch_id='.$down_id.'&sort_id='.$db->v('sort_id').'&switch_nr='.$down_nr.'&sort_nr='.$db->v('nr').'">';
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_down'.($_GET['dnr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="'.___('move down').'" title="'.___('move down').'" />';
                    echo '</a><br />';
                }
                echo '</td>';
            }
=== REPLACE WITH / ERSETZEN MIT ===
Code:
// start part 2 of 2 pimp my artikelsortierung by m.roesel ************************
        if ($_SESSION['SID_stufe2']==1 && ($cpoRubricSettings['sorting']=='idx ASC, sort_id DESC' || $cpoRubricSettings['sorting']=='idx DESC, sort_id DESC')) {
            echo '<th style="width: 1%;"><span>'.help('', true).'</span></th>'; // helpme
        }

        echo '<th style="width: 74%;"><span>'.___('Title/Author').help('articles-listarticles.html#articles-listarticles-titleauthor').'</span></th>';

        if ($_SESSION['SID_stufe2']==1) {
            echo '<th style="width: 10%;"><span>'.___('Manage').help('articles-listarticles.html#articles-listarticles-edit').'</span></th>';
        }

        echo '<th style="width: 5%;"><span>'.___('Status').help('articles-listarticles.html#articles-listarticles-status').'</span></th>';
        echo '<th style="width: 5%;"><span>'.___('Publication').help('articles-listarticles.html#articles-listarticles-publication').'</span></th>';
        echo '<th style="width: 5%;"><span>'.___('Info').help('articles-listarticles.html#articles-listarticles-info').'</span></th>';
        echo '</tr></thead><tbody>';
        // }}}

        $query = "SELECT nr, article_nr, auth, autor, changer, commentary, freigabe, released_user_id, last_modify, datum, pub_datum, sort_id, templates_id, titel, verfallsdatum, idx "
                .$_q
                ."ORDER BY ".$cpoRubricSettings['sorting']." "
                ."LIMIT ".$_SESSION['SID_pagers']['articles'].", ".$cpoSystem['noOfArticles'];
        DEBUG(1, $query, __FILE__, __LINE__);
        $db->query($query);

        while($db->next_record()) {
            echo '<tr>';
            // article sorting {{{
            if ($_SESSION['SID_stufe2']==1 && $db->v('idx')=='zzzzzz' && ($cpoRubricSettings['sorting']=='idx ASC, sort_id DESC' || $cpoRubricSettings['sorting']=='idx DESC, sort_id DESC')) {
                echo '<td>';

                // Find article "below" this one {{{
                $query = "SELECT nr, sort_id FROM ".CPO_NEWS." "
                        ."WHERE artikel_archiv=0 "
                        ."AND sort_id<'".$db->v('sort_id')."' "
                        ."AND idx='zzzzzz' "
                        ."AND rubric_id='".$_SESSION['SID_rubric_id']."' "
                        ."ORDER BY sort_id DESC LIMIT 1";
                DEBUG(2, 'Find article "below" this one.<br /><br />'.$query, __FILE__, __LINE__);
                $db_2 = new DB;
                $db_2->query($query);
                $down_id = 'no';
                if ($db_2->num_rows()>0) {
                    $db_2->next_record();
                    $down_id = $db_2->v('sort_id');
                    $down_nr = $db_2->v('nr');
                }
                // }}}
                // Find article "above" this one {{{
                $query = "SELECT nr, sort_id FROM ".CPO_NEWS." "
                        ."WHERE artikel_archiv=0 "
                        ."AND sort_id>'".$db->v('sort_id')."' "
                        ."AND idx='zzzzzz' "
                        ."AND rubric_id='".$_SESSION['SID_rubric_id']."' "
                        ."ORDER BY sort_id LIMIT 1";
                DEBUG(2, 'Find article "above" this one.<br /><br />'.$query, __FILE__, __LINE__);
                $db_2->query($query);
                $up_id = 'no';
                if ($db_2->num_rows()>0) {
                    $db_2->next_record();
                    $up_id = $db_2->v('sort_id');
                    $up_nr = $db_2->v('nr');
                }
                // }}}
               
                if ($up_id=='no') {
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_empty'.($_GET['unr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="" />';
               echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_empty'.($_GET['unr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="" />';
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_empty'.($_GET['unr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="" />';
               echo '<br />';
                } else {
                    $art_pos = $_SESSION['SID_pagers']['articles'];
                    if ($art_count=='0') $art_pos = $_SESSION['SID_pagers']['articles'] - $cpoSystem['noOfArticles'];
                    echo '<a href="'.BASE_REL.'_admin/articles.php?action=articles_sort&pos='.$art_pos.'&unr='.$db->v('nr').'&switch_id='.$up_id.'&sort_id='.$db->v('sort_id').'&switch_nr='.$up_nr.'&sort_nr='.$db->v('nr').'">';
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_up'.($_GET['unr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="'.__('move up').'" title="'.__('move up').'" />';
                    echo '</a>';

                    echo '<a href="'.BASE_REL.'_admin/articles.php?action=articles_quick_sort&rew='.$db->v('nr').'&unr='.$db->v('nr').'">';
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_rew'.($_GET['unr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="'.$articleSortOffset.' '.__('places up').'" title="'.$articleSortOffset.' '.__('places up').'" />';
                    echo '</a>';

                    echo '<a href="'.BASE_REL.'_admin/articles.php?action=articles_quick_sort&top='.$db->v('nr').'&unr='.$db->v('nr').'">';
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_top'.($_GET['unr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="'.__('move to top').'" title="'.__('move to top').'" />';
                    echo '</a>';
               echo '<br />';
                }

                if ($down_id=='no') {
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_empty'.($_GET['dnr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="" />';
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_empty'.($_GET['dnr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="" />';
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_empty'.($_GET['dnr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="" />';
               echo '<br />';
                } else {
                    $art_pos = $_SESSION['SID_pagers']['articles'];
                    if ($art_count==($cpoSystem['noOfArticles']-1) ) {
                        $art_pos = $_SESSION['SID_pagers']['articles'] + $cpoSystem['noOfArticles'];
                    }
                    echo '<a href="'.BASE_REL.'_admin/articles.php?action=articles_sort&pos='.$art_pos.'&dnr='.$db->v('nr').'&switch_id='.$down_id.'&sort_id='.$db->v('sort_id').'&switch_nr='.$down_nr.'&sort_nr='.$db->v('nr').'">';
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_down'.($_GET['dnr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="'.__('move down').'" title="'.__('move down').'" />';
                    echo '</a>';

                    echo '<a href="'.BASE_REL.'_admin/articles.php?action=articles_quick_sort&ff='.$db->v('nr').'&dnr='.$db->v('nr').'">';
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_ff'.($_GET['dnr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="'.$articleSortOffset.' '.__('places down').'" title="'.$articleSortOffset.' '.__('places down').'" />';
                    echo '</a>';

                    echo '<a href="'.BASE_REL.'_admin/articles.php?action=articles_quick_sort&bottom='.$db->v('nr').'&dnr='.$db->v('nr').'">';
                    echo '<img style="margin-bottom: 2px;" src="'.SKIN_URL.'sort_bottom'.($_GET['dnr']==$db->v('nr')?'2':'').'.gif" width="13" height="13" alt="'.__('move to bottom').'" title="'.__('move to bottom').'" />';
                    echo '</a>';
               echo '<br />';
                }
                echo '</td>';
            } elseif ($_SESSION['SID_stufe2']==1 && $db->v('idx')!='zzzzzz' && ($cpoRubricSettings['sorting']=='idx ASC, sort_id DESC' || $cpoRubricSettings['sorting']=='idx DESC, sort_id DESC')) {
               echo '<td>';
               if ($showIndex) echo 'Index: <br />'.$db->v('idx');
                echo '</td>';
         }
// end part 2 of 2 pimp my artikelsortierung by m.roesel ************************
=== FIND / FINDE ===
Code:
      next_page($_SESSION['SID_pagers']['articles'], $max_data, $cpoSystem['noOfArticles'], 1, '', BASE_REL.'_admin/articles.php');
=== BEFORE, INSERT / DAVOR, EINFÜGEN ===
Code:
// start part 3 of 3 pimp my artikelsortierung by m.roesel ************************
      echo __('Sorting method:').' '.array_search($cpoRubricSettings['sorting'], $articleSortMethods);
// end part 3 of 3 pimp my artikelsortierung by m.roesel ************************