Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: Artikel Content sortieren v2

    Ceciro

    • Fördermitglied
    • Beiträge: 449
    • Geschlecht:
    Re: Artikel Content sortieren v2
    Antwort #30 am: 23. März 2018, 17:06:30
    Um die Öffnung eines neuen Browserfensters zu vermeiden die Stelle, an der die Links gebildet werden suchen und dort:

    Code: XML  [Auswählen]
    onclick="window.open(this.href); return false;"

    entfernen. Dieser Code sorgt für das Öffnen eines neuen Fensters und ist mit der folgenden (früher gebräuchlichen) Funktion:

    Code: XML  [Auswählen]
    target="_blank"

    identisch.

    Gruß Cicero

    Onlineshopper

    • Fördermitglied
    • Beiträge: 954
    • Geschlecht:
    Re: Artikel Content sortieren v2
    Antwort #31 am: 23. März 2018, 18:53:29
    @Timm
    Vielen Dank für deine Geduld und Hilfe  :-)

    @Cicero
    Warum muss denn da etwas im Code geändert werden?
    Bevor ich die Änderungen von Timm gemacht habe, habe ich einfach einen neuen Slider eingefügt und dieser hatte nicht in einem neuen Fenster geöffnet.

    LG
    Nils

    Timm

    • Fördermitglied
    • Beiträge: 6.258
    Re: Artikel Content sortieren v2
    Antwort #32 am: 24. März 2018, 00:12:41
    Was macht eigentlich das ursprüngliche Problem mit der Artikel Content Sortierung bei neu angelegten Artikeln?

    Und nochmal: Wie gibts du den Link für den Slider/Banner an? In dem Url Feld oder dem Html Feld im Bannermanager?

    Wann hast du denn das letzte mal bewusst auf einen Slider geklickt? Nicht, dass das Problem schon länger her ist.

    Gruß Timm

    Onlineshopper

    • Fördermitglied
    • Beiträge: 954
    • Geschlecht:
    Re: Artikel Content sortieren v2
    Antwort #33 am: 24. März 2018, 02:07:08
    Die Sortierung funktioniert noch immer nicht  :no-sad:
    Ich habe keine Ahnung, wo da der Wurm drin ist.
    Es kann nur etwas gewesen sein, dass ich wohl überschrieben haben muss bei dem Update auf die aktuellste Version.

    Beim Banner / Slider trage ich die URL bei "Banner-URL:" ein, wo der Artikel zu finden ist und lade dann eine Grafik hoch.

    Das Problem besteht mit Sicherheit seit dem Update. Vorher habe ich drauf geklickt und im gleichen Fenster ist auch die URL geladen worden.

    LG
    Nils

    Onlineshopper

    • Fördermitglied
    • Beiträge: 954
    • Geschlecht:
    Re: Artikel Content sortieren v2
    Antwort #34 am: 27. März 2018, 09:13:06
    Muss ich leider mal hochschubsen, da ich das Problem ohne eure Hilfe leider nicht gelöst bekomme.

    LG
    Nils

    Timm

    • Fördermitglied
    • Beiträge: 6.258
    Re: Artikel Content sortieren v2
    Antwort #35 am: 31. März 2018, 16:35:07
    Wie hast du es hinbekommen, dass der der Link des Sliders nicht mehr in einem neuen Fenster öffnet?

    Onlineshopper

    • Fördermitglied
    • Beiträge: 954
    • Geschlecht:
    Re: Artikel Content sortieren v2
    Antwort #36 am: 31. März 2018, 20:56:38
    Mit Hilfe von Cicero

    Zitat
    Um die Öffnung eines neuen Browserfensters zu vermeiden die Stelle, an der die Links gebildet werden suchen und dort:

    Code: XML  [Auswählen]
    onclick="window.open(this.href); return false;"

    entfernen. Dieser Code sorgt für das Öffnen eines neuen Fensters und ist mit der folgenden (früher gebräuchlichen) Funktion:

    Code: XML  [Auswählen]
    target="_blank"

    identisch.

    Gruß Cicero

    Nur das Sortieren des Artikel Contents, was Ronald (web28) eingebaut hat funktioniert immer noch nicht  :-?

    hpzeller

    • Experte
    • Beiträge: 4.129
    • Geschlecht:
    Re: Artikel Content sortieren v2
    Antwort #37 am: 31. März 2018, 22:55:02
    Hallo Nils,

    poste doch hier mal den Inhalt folgender zwei Dateien.
    admin/content_manager.php
    admin/includes/modules/content_manager_products.php

    Gruss
    Hanspeter

    Onlineshopper

    • Fördermitglied
    • Beiträge: 954
    • Geschlecht:
    Re: Artikel Content sortieren v2
    Antwort #38 am: 01. April 2018, 00:46:30
    Hi Hanspeter,

    hier die content_manager.php

    Code: PHP  [Auswählen]
    <?php
      /* --------------------------------------------------------------
       $Id: content_manager.php 5007 2013-07-04 09:31:37Z web28 $

       modified eCommerce Shopsoftware
       http://www.modified-shop.org

       Copyright (c) 2009 - 2013 [www.modified-shop.org]
       --------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommercecoding standards www.oscommerce.com
       (c) 2003 nextcommerce (content_manager.php,v 1.18 2003/08/25); www.nextcommerce.org
       (c) 2006 XT-Commerce (content_manager.php 1304 2005-10-12)

       Released under the GNU General Public License
       --------------------------------------------------------------*/


      require('includes/application_top.php');
      require_once(DIR_FS_INC . 'xtc_format_filesize.inc.php');
      require_once(DIR_FS_INC . 'xtc_filesize.inc.php');
      require_once(DIR_FS_INC . 'xtc_wysiwyg.inc.php');
      require_once(DIR_FS_INC . 'xtc_href_link_from_admin.inc.php');

      if(!defined('CONTENT_CHILDS_ACTIV')) {
        define('CONTENT_CHILDS_ACTIV','true');
      }
     
      $set = (isset($_GET['set']) ? $_GET['set'] : '');
      $setparam = !empty($set) ? '&set='.$set : '';
      $action = (isset($_GET['action']) ? $_GET['action'] : '');
      $special = (isset($_GET['special']) ? $_GET['special'] : '');
      $id = (isset($_GET['id']) ? $_GET['id'] : '');
      $g_coID = (isset($_GET['coID']) ? (int)$_GET['coID'] : '');
      $coIndex = (isset($_GET['coIndex']) ? (int)$_GET['coIndex'] : '');
      $languages = xtc_get_languages();


      if ($special == 'delete') {
        xtc_db_query("DELETE FROM ".TABLE_CONTENT_MANAGER." WHERE content_group='".$g_coID."' AND content_group_index='".$coIndex."'");
        xtc_redirect(xtc_href_link(FILENAME_CONTENT_MANAGER,$setparam));
      }

      if ($special == 'delete_product') {
        xtc_db_query("DELETE FROM ".TABLE_PRODUCTS_CONTENT." where content_id='".$g_coID."'");
        if (isset($_GET['cPath'])) {
          xtc_redirect(xtc_href_link(FILENAME_CATEGORIES, xtc_get_all_get_params(array('special', 'last_action', 'action', 'coID', 'coIndex')) . 'action='.$_GET['last_action']));
        } else {
          xtc_redirect(xtc_href_link(FILENAME_CONTENT_MANAGER,'pID='.(int)$_GET['pID'].$setparam));
        }
      }
     
      if (empty($action) && isset($_GET['cPath'])) {
        xtc_redirect(xtc_href_link(FILENAME_CATEGORIES, xtc_get_all_get_params(array('special', 'last_action', 'action', 'coID', 'coIndex')) . 'action='.$_GET['last_action']));
      }

      if ($id == 'update' || $id == 'insert') {    
        foreach ($_POST as $key => $value) {
          if (!is_object(${$key})) {
            if (is_array($value)) {
              ${$key} = array_map('xtc_db_prepare_input', $value);
            } else {
              ${$key} = xtc_db_prepare_input($value);
            }
          }
        }

        $content_meta_robots = implode(', ', ((isset($content_meta_robots) && is_array($content_meta_robots)) ? $content_meta_robots : array()));    
        if ($parent_check == 'yes') {                                    
          $parent_query = xtc_db_query("SELECT c2.content_id,
                                               c2.languages_id
                                          FROM "
    .TABLE_CONTENT_MANAGER." c1
                                          JOIN "
    .TABLE_CONTENT_MANAGER." c2
                                               ON c1.content_group = c2.content_group
                                         WHERE c1.content_id = '"
    .(int)$parent_id."'
                                         "
    );
          $parent_id = array();
          while ($parent = xtc_db_fetch_array($parent_query)) {
            $parent_id[$parent['languages_id']] = $parent['content_id'];
          }
        }

        if ($content_group == '0' || $content_group == '') {
          $content_query = xtc_db_query("SELECT MAX(content_group) AS content_group FROM ".TABLE_CONTENT_MANAGER);
          $content_data = xtc_db_fetch_row($content_query);
          $content_group = $content_data[0] + 1;
        }

        $sql_data_array = array('content_group' => (int)$content_group,
                                'sort_order' => $sort_order,
                                'file_flag' => $file_flag,
                                'content_meta_robots' => $content_meta_robots,
                                );

       
        for ($i=0; $i<$content_count; $i++) {
          for ($l=0, $ln=count($languages); $l<$ln; $l++) {
            $error = false;
            /*
            if (strlen($content_title[$i][$languages[$l]['id']]) < 1) {
              $error = true;
              $messageStack->add_session(strtoupper($languages[$l]['name']).': '.ERROR_TITLE, 'error');
            }
            */

            if ($error === false) {
              $content_file_name = '';
              if ($select_file[$i][$languages[$l]['id']] != 'default') {
                $content_file_name = $select_file[$i][$languages[$l]['id']];
              }
              $accepted_file_upload_files_extensions = array("htm","html","txt");
              $accepted_file_upload_files_mime_types = array("text/html","text/html","text/plain");
              if ($content_file = xtc_try_upload('file_upload_'.$i.'_'.$languages[$l]['id'], DIR_FS_CATALOG.'media/content/', '644', $accepted_file_upload_files_extensions, $accepted_file_upload_files_mime_types)) {
                $content_file_name = $content_file->filename;
              }

              // set allowed c.groups
              $group_ids = '';
              if (isset($groups[$i][$languages[$l]['id']])) {
                foreach($groups[$i][$languages[$l]['id']] as $b) {
                  $group_ids .= 'c_'.$b."_group,";
                }
              }
              $customers_statuses_array = xtc_get_customers_statuses();
              if (strstr($group_ids,'c_all_group')) {
                $group_ids = 'c_all_group,';
                for ($g=0, $x=count($customers_statuses_array); $g<$x; $g++) {
                  $group_ids .= 'c_'.$customers_statuses_array[$g]['id'].'_group,';
                }
              }

              $sql_data_lang_array = array('content_status' => (int)$content_status[$i][$languages[$l]['id']],
                                           'content_active' => (int)$content_active[$i][$languages[$l]['id']],
                                           'languages_id' => $languages[$l]['id'],
                                           'parent_id' => $parent_id[$languages[$l]['id']],
                                           'group_ids' => $group_ids,
                                           'content_title' => $content_title[$i][$languages[$l]['id']],
                                           'content_heading' => $content_heading[$i][$languages[$l]['id']],
                                           'content_text' => $content_text[$i][$languages[$l]['id']],
                                           'content_meta_title' => $content_meta_title[$i][$languages[$l]['id']],
                                           'content_meta_description' => $content_meta_description[$i][$languages[$l]['id']],
                                           'content_meta_keywords' => $content_meta_keywords[$i][$languages[$l]['id']],
                                           'content_file' => $content_file_name
                                           );
           
              // check content_group_index
              $add_and = '';          
              if ($id == 'update' && $content_id[$i][$languages[$l]['id']] > 0) {
                $add_and = " AND content_id != '" . $content_id[$i][$languages[$l]['id']] ."'";
              }          
              $dbQuery = xtc_db_query(
                 "SELECT MAX(content_group_index)
                   FROM "
    .TABLE_CONTENT_MANAGER."
                   WHERE languages_id ='"
    . $sql_data_lang_array['languages_id'] . "'
                         "
    .$add_and."
                     AND content_group ='"
    . $sql_data_array['content_group'] . "'
                   "
    );
                   
              //check change content_group
              $change_content_group = (isset($coID) && $coID != $content_group) ? true : false;    
              $dbData = xtc_db_fetch_row($dbQuery);
              if (!is_null($dbData[0])) {
                $sql_data_array['content_group_index'] = $dbData[0] + 1;
                if ($id == 'update' && !  $change_content_group) {
                  $sql_data_array['content_group_index'] = $content_group_index;
                }
                $content_group_index = $sql_data_array['content_group_index'];
              } else {
                $sql_data_array['content_group_index'] = $change_content_group ? 0 : $content_group_index;
              }
             
              //FIX wenn es bei gleicher languages_id mehrere gleiche content_group gibt
              if (isset($content_new_group_index[$i][$languages[$l]['id']])) {
                $sql_data_array['content_group_index'] = (int)$content_new_group_index[$i][$languages[$l]['id']];
              }
             
              if ($id == 'update' && $content_id[$i][$languages[$l]['id']] > 0) {
                $sql_data_array['last_modified'] = 'now()';
                xtc_db_perform(TABLE_CONTENT_MANAGER, array_merge($sql_data_array, $sql_data_lang_array), 'update', "content_id = '".$content_id[$i][$languages[$l]['id']]."'");
              } else {
                $sql_data_array['date_added'] = 'now()';
                xtc_db_perform(TABLE_CONTENT_MANAGER, array_merge($sql_data_array, $sql_data_lang_array));
              }
            } //error
          } // end for count($languages)
        } // end for $content_count

        if (isset($page_update)) {
          $setparam = 'action=edit&coID='.$content_group.'&coIndex='.$sql_data_array['content_group_index'];
        }
        if ($error === true) {
          $setparam = 'action=edit&coID='.(($g_coID != '') ? $g_coID : $content_group);
        }
        xtc_redirect(xtc_href_link(FILENAME_CONTENT_MANAGER, $setparam));
      }


      if ($id == 'update_product' || $id == 'insert_product') {
        // set allowed c.groups
        $group_ids='';
        if(isset($_POST['groups'])) foreach($_POST['groups'] as $b){
          $group_ids .= 'c_'.$b."_group ,";
        }
        $customers_statuses_array=xtc_get_customers_statuses();
        if (strstr($group_ids,'c_all_group')) {
          $group_ids='c_all_group,';
          for ($i=0;$n=sizeof($customers_statuses_array),$i<$n;$i++) {
            $group_ids .='c_'.$customers_statuses_array[$i]['id'].'_group,';
         }
        }


        $content_title=xtc_db_prepare_input($_POST['cont_title']);
        $content_link=xtc_db_prepare_input($_POST['cont_link']);
        $content_language_code=xtc_db_prepare_input($_POST['language_code']);
        $product=xtc_db_prepare_input($_POST['product']);
        $upload_file=xtc_db_prepare_input($_POST['file_upload']);
        $filename=xtc_db_prepare_input($_POST['file_name']);
        $coID=xtc_db_prepare_input($_POST['coID']);
        $file_comment=xtc_db_prepare_input($_POST['file_comment']);
        $select_file=xtc_db_prepare_input($_POST['select_file']);
        $group_ids = $group_ids;
        $error=false; // reset error flag

        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
          if ($languages[$i]['code'] == $content_language_code)
              $content_language_id = $languages[$i]['id'];
        } // for

        if (strlen($content_title) < 1) {
          $error = true;
          $messageStack->add(ERROR_TITLE,'error');
        }  // if

        if ($error == false) {
           // mkdir() wont work with php in safe_mode
           //if  (!is_dir(DIR_FS_CATALOG.'media/products/'.$product.'/')) {
           //  $old_umask = umask(0);
           //  xtc_mkdirs(DIR_FS_CATALOG.'media/products/'.$product.'/',0777);
           //  umask($old_umask);
           //}
          if ($select_file=='default') {
            $accepted_file_upload_files_extensions = array("xls","xla","hlp","chm","ppt","ppz","pps","pot","doc","dot","pdf","rtf","swf","cab","tar","zip","au","snd","mp2","rpm","stream","wav","gif","jpeg","jpg","jpe","png","tiff","tif","bmp","csv","txt","rtf","tsv","mpeg","mpg","mpe","qt","mov","avi","movie","rar","7z");
            $accepted_file_upload_files_mime_types = array("application/msexcel","application/mshelp","application/mspowerpoint","application/msword","application/pdf","application/rtf","application/x-shockwave-flash","application/x-tar","application/zip","audio/basic","audio/x-mpeg","audio/x-pn-realaudio-plugin","audio/x-qt-stream","audio/x-wav","image/gif","image/jpeg","image/png","image/tiff","image/bmp","text/comma-separated-values","text/plain","text/rtf","text/tab-separated-values","video/mpeg","video/quicktime","video/x-msvideo","video/x-sgi-movie","application/x-rar-compressed","application/x-7z-compressed");
            if ($content_file = xtc_try_upload('file_upload', DIR_FS_CATALOG.'media/products/','644',$accepted_file_upload_files_extensions,$accepted_file_upload_files_mime_types)) {
              $content_file_name = $content_file->filename;
              $old_filename = $content_file->filename;
              $timestamp = str_replace('.','',microtime());
              $timestamp = str_replace(' ','',$timestamp);
              $content_file_name = $timestamp.strstr($content_file_name,'.');
              $rename_string = DIR_FS_CATALOG.'media/products/'.$content_file_name;
              rename(DIR_FS_CATALOG.'media/products/'.$old_filename,$rename_string);
              copy($rename_string,DIR_FS_CATALOG.'media/products/backup/'.$content_file_name);
            }
            if ($content_file_name=='')
              $content_file_name=$filename;
          } else {
            $content_file_name = $select_file;
          }

          // update data in table
          // set allowed c.groups
          $group_ids='';
          if(isset($_POST['groups'])) foreach($_POST['groups'] as $b){
            $group_ids .= 'c_'.$b."_group ,";
          }
          $customers_statuses_array=xtc_get_customers_statuses();
          if (strstr($group_ids,'c_all_group')) {
            $group_ids='c_all_group,';
            for ($i=0;$n=sizeof($customers_statuses_array),$i<$n;$i++) {
              $group_ids .='c_'.$customers_statuses_array[$i]['id'].'_group,';
           }
          }

          $sql_data_array = array(
                                  'products_id' => $product,
                                  'group_ids' => $group_ids,
                                  'content_name' => $content_title,
                                  'content_file' => $content_file_name,
                                  'content_link' => $content_link,
                                  'file_comment' => $file_comment,
                                  'languages_id' => $content_language_id);

          if ($id=='update_product') {
            xtc_db_perform(TABLE_PRODUCTS_CONTENT, $sql_data_array, 'update', "content_id = '" . $coID . "'");
            $content_id = xtc_db_insert_id();
          } else {
            xtc_db_perform(TABLE_PRODUCTS_CONTENT, $sql_data_array);
            $content_id = xtc_db_insert_id();
          } // if get id

          // rename filename
          if (isset($_GET['cPath'])) {
            xtc_redirect(xtc_href_link(FILENAME_CATEGORIES, xtc_get_all_get_params(array('last_action', 'action', 'id', 'coID')) . 'action='.$_GET['last_action']));
          } else {
            xtc_redirect(xtc_href_link(FILENAME_CONTENT_MANAGER,'pID='.$product.$setparam));
          }
        }// if error
      }

      function check_content_childs($content_id,$languages_id) {    
        $contents_query = xtc_db_query("SELECT parent_id                              
                                          FROM "
    . TABLE_CONTENT_MANAGER . "
                                         WHERE parent_id = '"
    . (int) $content_id . "'
                                           AND languages_id = '"
    . (int)$languages_id . "'");
        if (xtc_db_num_rows($contents_query) > 0) {
          return true;
        }
        return false;
      }

      require (DIR_WS_INCLUDES.'head.php');

      if (USE_WYSIWYG=='true') {
        $query=xtc_db_query("SELECT code FROM ". TABLE_LANGUAGES ." WHERE languages_id='".(int)$_SESSION['languages_id']."'");
        $data=xtc_db_fetch_array($query);
        if ($action =='new_products_content' || $action =='edit_products_content') {
          for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
            echo xtc_wysiwyg('products_content', $data['code'], $languages[$i]['id']);
          }
        }
      }
    ?>
    </head>
    <body>
        <!-- header //-->
        <?php require(DIR_WS_INCLUDES . 'header.php');?>
        <!-- header_eof //-->
        <!-- body //-->
        <table class="tableBody">
          <tr>
            <?php //left_navigation
            if (USE_ADMIN_TOP_MENU == 'false') {
              echo '<td class="columnLeft2">'.PHP_EOL;
              echo '<!-- left_navigation //-->'.PHP_EOL;      
              require_once(DIR_WS_INCLUDES . 'column_left.php');
              echo '<!-- left_navigation eof //-->'.PHP_EOL;
              echo '</td>'.PHP_EOL;      
            }
            ?>
            <!-- body_text //-->
            <td class="boxCenter">
              <div class="pageHeadingImage"><?php echo xtc_image(DIR_WS_ICONS.'heading/icon_content.png'); ?></div>
              <div class="pageHeading"><?php echo HEADING_TITLE;?><br /></div>          
              <div class="main pdg2 flt-l">Tools</div>
              <div class="clear"></div>
              <div class="content-manager-width mrg5">            
                  <?php
                    if ($set != 'product') {
                      //content
                      include(DIR_WS_MODULES.'content_manager_pages.php');
                      $newaction = 'new';
                    } else {
                      //products content
                      include(DIR_WS_MODULES.'content_manager_products.php');
                      $newaction = 'new_products_content';
                    }
                  ?>
                  <?php                        
                  if (!$action) {
                    ?>                
                    <div class="mrg5"><a class="button" onclick="this.blur();" href="<?php echo xtc_href_link(FILENAME_CONTENT_MANAGER,'action='.$newaction.$setparam); ?>"><?php echo BUTTON_NEW_CONTENT; ?></a></div>
                    <?php
                  }
                  ?>
              </div>
            </td>
            <!-- body_text_eof //-->
          </tr>
        </table>  
        <!-- body_eof //-->
        <!-- footer //-->
        <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
        <!-- footer_eof //-->
      </body>
    </html>
    <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
     

    Onlineshopper

    • Fördermitglied
    • Beiträge: 954
    • Geschlecht:
    Re: Artikel Content sortieren v2
    Antwort #39 am: 01. April 2018, 01:20:08
    Und hier die content_manager_products.php

    Code: PHP  [Auswählen]
    <?php
      /* --------------------------------------------------------------
       $Id: content_manager_products.php 10543 2017-01-02 08:51:27Z Tomcraft $

       modified eCommerce Shopsoftware
       http://www.modified-shop.org

       Copyright (c) 2009 - 2013 [www.modified-shop.org]
     
       Released under the GNU General Public License
       --------------------------------------------------------------*/


    defined('_VALID_XTC') or die('Direct Access to this location is not allowed.');

    if (!$action) {
      // products content
      // load products_ids into array
      $products_id_query=xtc_db_query("SELECT DISTINCT
                                                       pc.products_id,
                                                       pd.products_name
                                                  FROM "
    .TABLE_PRODUCTS_CONTENT." pc,
                                                       "
    .TABLE_PRODUCTS_DESCRIPTION." pd
                                                 WHERE pd.products_id=pc.products_id
                                                   AND pd.language_id='"
    .(int)$_SESSION['languages_id']."'");
      $products_ids=array();
      while ($products_id_data=xtc_db_fetch_array($products_id_query)) {
        $products_ids[]=array('id'=>$products_id_data['products_id'],
                            'name'=>$products_id_data['products_name']);
      } // while
      ?>
      <div class="pageHeadingTaba pdg2 flt-l"><a onclick="this.blur();" href="<?php echo xtc_href_link(FILENAME_CONTENT_MANAGER); ?>"><?php echo HEADING_CONTENT; ?></a></div>
      <div class="pageHeadingTab pdg2 flt-l"><?php echo HEADING_PRODUCTS_CONTENT; ?></div>
      <div class="borderTab">
      <?php
        $total_space_media_products = xtc_spaceUsed(DIR_FS_CATALOG.'media/products/'); // DokuMan - 2011-09-06 - sum up correct filesize avoiding global variable
        echo '<div class="main clear">'.USED_SPACE.xtc_format_filesize($total_space_media_products).'</div><br />';
      ?>
      <table class="tableCenter">
        <tr class="dataTableHeadingRow">
          <td class="dataTableHeadingContent nobr txta-c"><?php echo TABLE_HEADING_PRODUCTS_ID; ?></td>
          <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
        </tr>
        <?php
          for ($i=0,$n=sizeof($products_ids); $i<$n; $i++) {
            echo '<tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\'" onmouseout="this.className=\'dataTableRow\'">' . "\n";
              ?>
              <td class="dataTableContent_products txta-c" style="width:5%"><?php echo $products_ids[$i]['id']; ?></td>
              <td class="dataTableContent_products"><b>
                <?php echo xtc_image(DIR_WS_CATALOG.'images/icons/arrow.gif'); ?>
                <a href="<?php echo xtc_href_link(FILENAME_CONTENT_MANAGER,'pID='.$products_ids[$i]['id'].$setparam);?>"><?php echo $products_ids[$i]['name']; ?></a></b>
              </td>
            </tr>
            <?php
            if ($_GET['pID']) {
              // display content elements
              $content_query=xtc_db_query("SELECT
                                                  content_id,
                                                  content_name,
                                                  content_file,
                                                  content_link,
                                                                                              content_sort,
                                                  languages_id,
                                                  file_comment,
                                                  content_read
                                             FROM "
    .TABLE_PRODUCTS_CONTENT."
                                            WHERE products_id='"
    .$_GET['pID']."'
                                         ORDER BY content_sort, content_name
                                                                             "
    );
              $content_array = array();
              while ($content_data = xtc_db_fetch_array($content_query)) {
                $content_array[]=array('id'=> $content_data['content_id'],
                                     'name'=> $content_data['content_name'],
                                     'file'=> $content_data['content_file'],
                                     'link'=> $content_data['content_link'],
                                                                     'sort'=> $content_data['content_sort'],
                                  'comment'=> $content_data['file_comment'],
                             'languages_id'=> $content_data['languages_id'],
                                     'read'=> $content_data['content_read']);
              } // while content data

              if ($_GET['pID']==$products_ids[$i]['id']){
                ?>
                <tr>
                  <td class="dataTableContent"></td>
                  <td class="dataTableContent">
                    <table class="tableCenter">
                      <tr class="dataTableHeadingRow">
                        <td class="dataTableHeadingContent nobr txta-c" style="width:2%" ><?php echo TABLE_HEADING_PRODUCTS_CONTENT_ID; ?></td>
                        <td class="dataTableHeadingContent nobr" style="width:2%" >&nbsp;</td>
                                            <td class="dataTableHeadingContent nobr" style="width:5%" ><?php echo TEXT_DEFAULT_SORT_ORDER_TITLE; ?></td>
                        <td class="dataTableHeadingContent nobr" style="width:5%" ><?php echo TABLE_HEADING_LANGUAGE; ?></td>
                        <td class="dataTableHeadingContent nobr" style="width:15%" ><?php echo TABLE_HEADING_CONTENT_NAME; ?></td>
                        <td class="dataTableHeadingContent nobr" style="width:30%" ><?php echo TABLE_HEADING_CONTENT_FILE; ?></td>
                        <td class="dataTableHeadingContent nobr" style="width:1%" ><?php echo TABLE_HEADING_CONTENT_FILESIZE; ?></td>
                        <td class="dataTableHeadingContent nobr txta-c" style="width:20%" ><?php echo TABLE_HEADING_CONTENT_LINK; ?></td>
                        <td class="dataTableHeadingContent nobr" style="width:5%" ><?php echo TABLE_HEADING_CONTENT_HITS; ?></td>
                        <td class="dataTableHeadingContent nobr" style="width:20%" ><?php echo TABLE_HEADING_CONTENT_ACTION; ?></td>
                      </tr>
                      <?php
                      for ($ii=0,$nn=sizeof($content_array); $ii<$nn; $ii++) {
                        echo '<tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\'" onmouseout="this.className=\'dataTableRow\'">' . "\n";
                        ?>
                          <td class="dataTableContent txta-c"><?php echo  $content_array[$ii]['id']; ?> </td>
                          <td class="dataTableContent txta-c">
                            <?php
                              if ($content_array[$ii]['file']!='') {
                                echo xtc_image('../'. DIR_WS_IMAGES.'icons/filetype/icon_'.str_replace('.','',strstr($content_array[$ii]['file'],'.')).'.gif'); //web28 - 2010-09-03 - change path
                              } else {
                                echo xtc_image('../'. DIR_WS_IMAGES.'icons/filetype/icon_link.gif'); //web28 - 2010-09-03 - change path
                              }
                              for ($xx=0,$zz=sizeof($languages); $xx<$zz;$xx++){
                                if ($languages[$xx]['id']==$content_array[$ii]['languages_id']) {
                                  $lang_dir=$languages[$xx]['directory'];
                                  break;
                                }
                              }
                            ?>
                          </td>
                          <td class="dataTableContent txta-c"><?php echo $content_array[$ii]['sort']; ?></td>
                                              <td class="dataTableContent txta-c"><?php echo xtc_image(DIR_WS_CATALOG.'lang/'.$lang_dir.'/admin/images/icon.gif'); ?></td>
                          <td class="dataTableContent"><?php echo $content_array[$ii]['name']; ?></td>
                          <td class="dataTableContent"><?php echo $content_array[$ii]['file']; ?></td>
                          <td class="dataTableContent txta-c"><?php echo xtc_filesize($content_array[$ii]['file']); ?></td>
                          <td class="dataTableContent txta-c">
                            <?php
                              if ($content_array[$ii]['link']!='') {
                                echo '<a href="'.$content_array[$ii]['link'].'" target="new">'.$content_array[$ii]['link'].'</a>';
                              }
                            ?>
                            &nbsp;
                          </td>
                          <td class="dataTableContent txta-c"><?php echo $content_array[$ii]['read']; ?></td>
                          <td class="dataTableContent">
                            <a href="<?php echo xtc_href_link(FILENAME_CONTENT_MANAGER,'special=delete_product&coID='.$content_array[$ii]['id'].'&pID='.$products_ids[$i]['id'].'&set='.$set); ?>" onclick="return confirmLink('<?php echo DELETE_ENTRY; ?>', '', this)">
                            <?php
                              echo xtc_image(DIR_WS_ICONS.'delete.gif', ICON_DELETE,'','','style="cursor:pointer" onclick="return confirmLink(\''. DELETE_ENTRY .'\', \'\' ,this)"').'  '.TEXT_DELETE.'</a>&nbsp;&nbsp;';
                            ?>
                            <a href="<?php echo xtc_href_link(FILENAME_CONTENT_MANAGER,'action=edit_products_content&coID='.$content_array[$ii]['id'].$setparam); ?>">
                              <?php
                              echo xtc_image(DIR_WS_ICONS.'icon_edit.gif', ICON_EDIT,'','','style="cursor:pointer"').'  '.TEXT_EDIT.'</a>';
                            // display preview button if filetype in array
                            $allowed_filetypes = array('.gif','.jpg','.png','.html','.htm','.txt','.bmp');
                            if (in_array(substr($content_array[$ii]['file'], 0, strrpos($content_array[$ii]['file'], '.') - 1), $allowed_filetypes)) {
                              ?>
                              <a style="cursor:pointer" onclick="javascript:window.open('<?php echo xtc_href_link(FILENAME_CONTENT_PREVIEW,'pID=media&coID='.$content_array[$ii]['id']); ?>', 'popup', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no, width=640, height=600')">
                                <?php
                                echo xtc_image(DIR_WS_ICONS.'preview.gif', ICON_PREVIEW,'','',' style="cursor:pointer"').'&nbsp;&nbsp;'.TEXT_PREVIEW.'</a>';
                            }
                            ?>
                          </td>
                        </tr>
                        <?php
                      } // for content_array
                    echo '    </table>';
                  echo '  </td>';
                echo '</tr>';
              }
            } // for
          }
        ?>
      </table>
      </div>
      <?php
    } else {
      switch ($action) {
        case 'edit_products_content':
        case 'new_products_content':
          if ($action =='edit_products_content') {
            $content_query=xtc_db_query("SELECT
                                          content_id,
                                          products_id,
                                          group_ids,
                                          content_name,
                                          content_file,
                                          content_link,
                                                                              content_sort,
                                          languages_id,
                                          file_comment,
                                          content_read
                                         FROM "
    .TABLE_PRODUCTS_CONTENT."
                                         WHERE content_id='"
    .$g_coID."'
                                         LIMIT 1"
    ); //DokuMan - 2011-05-13 - added LIMIT 1
            $content=xtc_db_fetch_array($content_query);
          }
          // get products names.
          $products_query=xtc_db_query("SELECT
                                               products_id,
                                               products_name
                                          FROM "
    .TABLE_PRODUCTS_DESCRIPTION."
                                         WHERE language_id='"
    .(int)$_SESSION['languages_id']."'
                                      ORDER BY products_name"
    ); // Tomcraft - 2010-09-15 - Added default sort order to products_name for product-content in content-manager
          $products_array=array();
          while ($products_data=xtc_db_fetch_array($products_query)) {
            $products_array[]=array('id' => $products_data['products_id'],
                                  'text' => $products_data['products_name']);
          }

          // get languages
          $languages_array = array();
          for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
            if ($languages[$i]['id']==$content['languages_id']) {
              $languages_selected=$languages[$i]['code'];
              $languages_id=$languages[$i]['id'];
            }
            $languages_array[] = array('id' => $languages[$i]['code'],
                                     'text' => $languages[$i]['name']);
          }

          // get used content files
          $content_files_query=xtc_db_query("SELECT DISTINCT
                                                             content_name,
                                                             content_file
                                                        FROM "
    .TABLE_PRODUCTS_CONTENT."
                                                       WHERE content_file!=''"
    );
          $content_files=array();
          while ($content_files_data=xtc_db_fetch_array($content_files_query)) {
            $content_files[]=array('id' => $content_files_data['content_file'],
                                 'text' => $content_files_data['content_name']);
          }

          // add default value to array
          $default_array[]=array('id' => 'default','text' => TEXT_SELECT);
          $default_value='default';
          $content_files=array_merge($default_array,$content_files);
          // mask for product content
         
          ?>
          <div style="width:99%; margin:5px;">
          <div class="pageHeading"><br /><?php echo HEADING_PRODUCTS_CONTENT; ?><br /></div>
          <div class="main"><?php echo TEXT_CONTENT_DESCRIPTION; ?></div>
            <?php
            if ($action !='new_products_content') {
              echo xtc_draw_form('edit_content',FILENAME_CONTENT_MANAGER, xtc_get_all_get_params(array('action')) . 'action=edit_products_content&id=update_product&coID='.$g_coID,'post','enctype="multipart/form-data"').xtc_draw_hidden_field('coID',$g_coID);
            } else {
              echo xtc_draw_form('edit_content',FILENAME_CONTENT_MANAGER, xtc_get_all_get_params(array('action')) . 'action=edit_products_content&id=insert_product','post','enctype="multipart/form-data"');
            }
            ?>
            <table class="tableConfig borderall">
              <tr>
                <td class="dataTableConfig col-left"><?php echo TEXT_PRODUCT; ?></td>
                <td class="dataTableConfig col-single-right"><?php echo ((isset($_GET['pID'])) ? xtc_get_products_name($_GET['pID']) . xtc_draw_hidden_field('product', (int)$_GET['pID']) : xtc_draw_pull_down_menu('product',$products_array,$content['products_id'])); ?></td>
              </tr>
              <tr>
                <td class="dataTableConfig col-left"><?php echo TEXT_LANGUAGE; ?></td>
                <td class="dataTableConfig col-single-right"><?php echo xtc_draw_pull_down_menu('language_code',$languages_array,$languages_selected); ?></td>
              </tr>
              <?php
                if (GROUP_CHECK=='true') {
                  $customers_statuses_array = xtc_get_customers_statuses();
                  $customers_statuses_array=array_merge(array(array('id'=>'all','text'=>TXT_ALL)),$customers_statuses_array);
                  ?>
                    <td class="dataTableConfig col-left"><?php echo ENTRY_CUSTOMERS_STATUS; ?></td>
                    <td class="dataTableConfig col-single-right">
                      <div class="customers-groups">
                        <?php
                          for ($i=0;$n=sizeof($customers_statuses_array),$i<$n;$i++) {
                            $checked = false;
                            if (strstr($content['group_ids'],'c_'.$customers_statuses_array[$i]['id'].'_group')) {
                              $checked = true;
                            }
                            echo xtc_draw_checkbox_field('groups[]', $customers_statuses_array[$i]['id'], $checked).' '.$customers_statuses_array[$i]['text'].'<br />';
                          }
                        ?>
                      </div>
                    </td>
                  </tr>
                  <?php
                }
              ?>
              <tr>
                <td class="dataTableConfig col-left"><?php echo TEXT_TITLE_FILE; ?></td>
                <td class="dataTableConfig col-single-right"><?php echo xtc_draw_input_field('cont_title',$content['content_name'],'size="60"'); ?></td>
              </tr>
              <tr>
                <td class="dataTableConfig col-left"><?php echo TEXT_LINK; ?></td>
                <td class="dataTableConfig col-single-right"><?php echo xtc_draw_input_field('cont_link',$content['content_link'],'size="60"'); ?></td>
              </tr>
              <tr>
                <td class="dataTableConfig col-left"><?php echo TEXT_DEFAULT_SORT_ORDER_TITLE; ?>:</td>
                <td class="dataTableConfig col-single-right"><?php echo xtc_draw_input_field('cont_sort',$content['content_sort'],'size="10"'); ?></td>
              </tr>
                      <tr>
                <td class="dataTableConfig col-left"><?php echo TEXT_FILE_DESC; ?></td>
                <td class="dataTableConfig col-single-right"><?php echo xtc_draw_textarea_field('file_comment','','100','30',$content['file_comment']); ?></td>
              </tr>
              <tr>
                <td class="dataTableConfig col-left"><?php echo TEXT_CHOOSE_FILE; ?></td>
                <td class="dataTableConfig col-single-right"><?php echo xtc_draw_pull_down_menu('select_file',$content_files,$default_value); ?><?php echo ' '.TEXT_CHOOSE_FILE_DESC; ?></td>
              </tr>
              <tr>
                <td class="dataTableConfig col-left"><?php echo TEXT_UPLOAD_FILE; ?></td>
                <td class="dataTableConfig col-single-right"><?php echo xtc_draw_file_field('file_upload').' '.TEXT_UPLOAD_FILE_LOCAL; ?></td>
              </tr>
              <?php
                if ($content['content_file']!='') {
                  ?>
                  <tr>
                    <td class="dataTableConfig col-left"><?php echo TEXT_FILENAME; ?></td>
                    <td class="dataTableConfig col-single-right"><?php echo xtc_draw_hidden_field('file_name',$content['content_file']).xtc_image('../'. DIR_WS_IMAGES. 'icons/filetype/icon_'.str_replace('.','',strstr($content['content_file'],'.')).'.gif').$content['content_file']; //DokuMan - 2011-09-06 - change path ?></td>
                  </tr>
                  <?php
                }
              ?>          
            </table>
            <div class="flt-r mrg5 pdg2">
              <?php echo '<input type="submit" class="button" onclick="this.blur();" value="' . BUTTON_SAVE . '"/>'; ?>
            </div>
            <div class="flt-r mrg5 pdg2">
              <a class="button" onclick="this.blur();" href="<?php echo xtc_href_link(FILENAME_CONTENT_MANAGER, xtc_get_all_get_params(array('action'))); ?>"><?php echo BUTTON_BACK; ?></a>
            </div>
          </form>
          </div>
          <?php
          break;
      }
    }
     

    LG
    Nils

    Ceciro

    • Fördermitglied
    • Beiträge: 449
    • Geschlecht:
    Re: Artikel Content sortieren v2
    Antwort #40 am: 01. April 2018, 01:26:10
    In der content_manager_products.php steht:

    Code: PHP  [Auswählen]
    ORDER BY content_sort, content_name

    Das bedeutet es wird zunächst nach der Sotierreihenfolge und anschließend dann nach der Contentbezeichnung sortiert.
    Versuch mal:

    Code: PHP  [Auswählen]
    ]ORDER BY content_sort

    Gruß Cicero

    hpzeller

    • Experte
    • Beiträge: 4.129
    • Geschlecht:
    Re: Artikel Content sortieren v2
    Antwort #41 am: 01. April 2018, 01:33:21
    Hallo Nils,

    suche in 'admin/content_manager.php' folgenden Code

    Code: PHP  [Auswählen]
        $content_title=xtc_db_prepare_input($_POST['cont_title']);
        $content_link=xtc_db_prepare_input($_POST['cont_link']);
        $content_language_code=xtc_db_prepare_input($_POST['language_code']);
        $product=xtc_db_prepare_input($_POST['product']);
        $upload_file=xtc_db_prepare_input($_POST['file_upload']);
        $filename=xtc_db_prepare_input($_POST['file_name']);
        $coID=xtc_db_prepare_input($_POST['coID']);
        $file_comment=xtc_db_prepare_input($_POST['file_comment']);
        $select_file=xtc_db_prepare_input($_POST['select_file']);
        $group_ids = $group_ids;
        $error=false; // reset error flag
     

    und ersetze ihn mit diesem

    Code: PHP  [Auswählen]
        $content_title=xtc_db_prepare_input($_POST['cont_title']);
        $content_link=xtc_db_prepare_input($_POST['cont_link']);
        $content_sort=xtc_db_prepare_input($_POST['cont_sort']);
        $content_language_code=xtc_db_prepare_input($_POST['language_code']);
        $product=xtc_db_prepare_input($_POST['product']);
        $upload_file=xtc_db_prepare_input($_POST['file_upload']);
        $filename=xtc_db_prepare_input($_POST['file_name']);
        $coID=xtc_db_prepare_input($_POST['coID']);
        $file_comment=xtc_db_prepare_input($_POST['file_comment']);
        $select_file=xtc_db_prepare_input($_POST['select_file']);
        $group_ids = $group_ids;
        $error=false; // reset error flag
     

    dann suche folgenden Code

    Code: PHP  [Auswählen]
          $sql_data_array = array(
                                  'products_id' => $product,
                                  'group_ids' => $group_ids,
                                  'content_name' => $content_title,
                                  'content_file' => $content_file_name,
                                  'content_link' => $content_link,
                                  'file_comment' => $file_comment,
                                  'languages_id' => $content_language_id);
     

    und ersetze ihn mit diesem.

    Code: PHP  [Auswählen]
          $sql_data_array = array(
                                  'products_id' => $product,
                                  'group_ids' => $group_ids,
                                  'content_name' => $content_title,
                                  'content_sort' => $content_sort,
                                  'content_file' => $content_file_name,
                                  'content_link' => $content_link,
                                  'file_comment' => $file_comment,
                                  'languages_id' => $content_language_id);
     

    Gruss
    Hanspeter

    Onlineshopper

    • Fördermitglied
    • Beiträge: 954
    • Geschlecht:
    Re: Artikel Content sortieren v2
    Antwort #42 am: 01. April 2018, 01:58:07
    Ich glaub´s nicht Hanspeter. Es funktioniert wieder. Vielen herzlichen Dank  :-B

    LG
    Nils

    Onlineshopper

    • Fördermitglied
    • Beiträge: 954
    • Geschlecht:
    Re: Artikel Content sortieren v2
    Antwort #43 am: 24. April 2018, 18:11:23
    In welchen ganzen Dateien muss eigentlich etwas geändert werden, wenn ich zusätzliche Felder einbauen möchte, wie auf dem Screenshot zu sehen.

    Ich möchte gerne unterhalb von "Effet" gerne noch "Härtegrad" einbauen.

    Allerdings nicht mit den roten Balken sondern einfach als Text wie bei "Eignung".

    Wenn möglich vielleicht auch so einen Farbverlauf, wie im Screenshot.

    LG
    Nils
    Werbung / Banner buchen
    3 Antworten
    3065 Aufrufe
    30. September 2011, 08:55:27 von mrwmandy
    1 Antworten
    2417 Aufrufe
    09. Juli 2010, 15:28:41 von Tomcraft
    1 Antworten
    1671 Aufrufe
    01. August 2017, 13:15:38 von web-looks
    5 Antworten
    2151 Aufrufe
    24. April 2017, 10:25:46 von Onlineshopper