Ankündigung

Einklappen
Keine Ankündigung bisher.

foreach Fehlermeldung

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • foreach Fehlermeldung

    Hallo Zusammen

    Ich habe ein foreach Fehlermeldung:

    Warning: Invalid argument supplied for foreach()

    und hier der Cod:

    PHP-Code:
    <?php
    /**
    * @copyright (C) 2013 iJoomla, Inc. - All rights reserved.
    * @license GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html)
    * @author iJoomla.com <webmaster@ijoomla.com>
    * @url https://www.jomsocial.com/license-agreement
    * The PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript *are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0
    * More info at https://www.jomsocial.com/license-agreement
    */
    defined('_JEXEC') OR DIE();

    ?>

    <script type="text/javascript" src="<?php echo JURI::root(true);?>/components/com_community/assets/ajaxfileupload.pack.js"></script>
    <script type="text/javascript" src="<?php echo JURI::root(true);?>/components/com_community/assets/imgareaselect/scripts/jquery.imgareaselect.min.js"></script>
    <link rel="stylesheet" type="text/css" href="<?php echo JURI::root(true);?>/components/com_community/assets/imgareaselect/css/imgareaselect-avatar.css" />

    <script type="text/javascript"> joms.filters.bind();</script>

    <!-- begin: .cLayout -->
    <div id="cProfileWrapper" class="row-fluid cPage cProfile <?php if(!$isMine) { echo 'cProfileOther';} ?>">

        <!-- begin: .cFocus -->
        <?php $this->view('profile')->modProfileUserinfo(); ?>
        <!-- end: .cFocus -->

        <div id="editLayout-stop" class="page-action" style="display: none;">
            <a onclick="joms.editLayout.stop()" href="javascript: void(0)"><?php echo JText::sprintf('COM_COMMUNITY_STOP_EDIT_PROFILE_APPS_LAYOUT'?></a>
        </div>

        <?php $this->renderModules'js_profile_top' ); ?>
        <?php if($isMine$this->renderModules'js_profile_mine_top' ); ?>

        <div class="row-fluid">
            <div class="span8">
                <!-- begin: .cMain -->
                <div class="cMain">

                    <?php $this->renderModules'js_profile_feed_top' ); ?>
                    <div class="activity-stream-front">

                        <div class="joms-latest-activities-container" data-actid="<?php echo JFactory::getApplication()->input->get('actid', -1'INT'); ?>" style="display:none;">
                            <a id="activity-update-click" class="btn btn-block" href="javascript:void(0);"></a>
                        </div>
                

    <div class="cModule cProfile-About app-box">
        <h3 class="app-box-header cResetH"><?php echo JText::_('COM_COMMUNITY_ABOUT_ME'); ?></h3>

        <div class="app-box-content">
            <?php
            
    foreach ($profile['fields'] as $groupName => $items) {
                
    // Gather display data for the group. If there is no data, we can
                // later completely hide the whole segment
                
    $hasData false;
                
    ob_start();
                
    ?>
                <div class="cField">

                    <?php if ($groupName != 'ungrouped') { ?>
                        <h3 class="cField-Title cResetH"><?php echo JText::_($groupName); ?></h3>
                    <?php ?>

                    <ul class="cField-List cResetList">
                        <?php foreach ($items as $item) { ?>
                            <?php
                            
    if (CPrivacy::isAccessAllowed($my->id$profile['id'], 'custom'$item['access'])) {
                                
    // There is some displayable data here
                                
    $hasData $hasData || CProfileLibrary::getFieldData($item) != '';
                                
    ?>

                                <?php
                                $fieldData 
    CProfileLibrary::getFieldData($item);

                                
    // Escape unless it is URL type, since URL type is in HTML format
                                
    if ($item['type'] != 'url' && $item['type'] != 'email' && $item['type'] != 'list' && $item['type'] != 'checkbox') {
                                    
    $fieldData $this->escape($fieldData);
                                }

                                
    // If textarea, we need to support multiline entry
                                
    if ($item['type'] == 'textarea') {
                                    
    $fieldData nl2br($fieldData);
                                }

                                if (!empty(
    $fieldData)) {

                                    
    ?>
                                    <li>
                                        <h3 class="cField-Name cResetH"><?php echo JText::_($item['name']); ?></h3>
                                        <?php if (!empty($item['searchLink']) && is_array($item['searchLink'])) { ?>
                                            <div class="cField-Content">
                                                <?php
                                                
    foreach ($item['searchLink'] as $linkKey => $linkValue) {
                                                    
    $item['value'] = $linkKey;
                                                    if (
    $item['type'] == 'checkbox') {
                                                        echo 
    '<a href="' $linkValue '">' $item['value'] . '</a><br />';
                                                    } else {
                                                        echo 
    '<a href="' $linkValue '">' $fieldData '</a><br />';
                                                    }
                                                }
                                                
    ?>
                                            </div>
                                        <?php } else { ?>
                                            <div class="cField-Content">
                                                <?php echo (!empty($item['searchLink'])) ? '<a href="' $item['searchLink'] . '"> ' $fieldData ' </a>' $fieldData?>
                                            </div>
                                        <?php ?>
                                    </li>
                                    <?php
                                
    }
                            }
                            
    ?>
                        <?php ?>
                    </ul>
                </div>
                <?php
                $html 
    ob_get_contents();
                
    ob_end_clean();

                
    // We would only display the profile data in the group if there is actually some
                // data to be displayed
                
    if ($hasData) {
                    echo 
    $html;
                    
    $noData false;
                }
            }

            if (
    $noData) {
                if (
    $isMine) {
                    
    ?>
                    <div class="cEmpty">
                        <?php echo JText::_('COM_COMMUNITY_PROFILES_SHARE_ABOUT_YOURSELF'); ?>
                    </div>
                    <?php
                
    } else {
                    
    ?>
                    <div class="cEmpty">
                        <?php echo JText::_('COM_COMMUNITY_PROFILES_NO_INFORMATION_SHARE'); ?>
                    </div>
                    <?php
                
    }
            }
            
    ?>
        </div>
        <div class="app-box-footer">
            <?php if ($isMine): ?>
                <a class="edit-this" href="<?php echo CRoute::_('index.php?option=com_community&view=profile&task=edit'); ?>" title="<?php echo JText::_('COM_COMMUNITY_PROFILE_EDIT'); ?>"><?php echo JText::_('COM_COMMUNITY_PROFILE_EDIT'); ?></a>
            <?php endif; ?>
        </div>
    </div>
                        <div class="activity-stream-profile">
                            <div id="activity-stream-container">
                    
                            </div>
                        </div>

                        <?php $this->renderModules'js_profile_feed_bottom' ); ?>
                        <div id="apps-sortable" class="connectedSortable" >
                        
                        <?php echo $content?>
                        </div>
                    </div>
                </div>
                <!-- end: .cMain -->
            </div>
            <div class="span4">
                <!-- begin: .cSidebar -->
                <div class="cSidebar">
                    <?php

                        $this
    ->renderModules'js_side_top' );
                        
    $this->renderModules'js_profile_side_top' );
                        echo 
    $sidebarTop;

                        if(
    $isMine$this->renderModules'js_profile_mine_side_top' );

                        echo 
    $this->view('profile')->modProfileUserVideo();
                        echo 
    $this->view('profile')->modGetFriendsHTML();

                        if( 
    $config->get('enablegroups')){
                            echo 
    $this->view('profile')->modGetGroupsHTML();
                        }

                        if(
    $isMine$this->renderModules'js_profile_mine_side_bottom' );

                        echo 
    $sidebarBottom;
                        
    $this->renderModules'js_profile_side_bottom' );
                        
    $this->renderModules'js_side_bottom' );
                    
    ?>
                </div>
                <!-- end: .cSidebar -->
            </div>
        </div>

        <?php if($isMine$this->renderModules'js_profile_mine_bottom' ); ?>
        <?php $this->renderModules'js_profile_bottom' ); ?>

    </div>
    <!-- end: .cLayout -->
    Was ist da falsch? Danke im Vorraus.

    Gruss

    ypnetwork

  • #2
    Was ist da falsch?
    Steht doch da: Invalid argument supplied for foreach()
    Über 90% aller Gewaltverbrechen passieren innerhalb von 24 Stunden nach dem Konsum von Brot.

    Kommentar


    • #3
      Zitat von lstegelitz Beitrag anzeigen
      Steht doch da: Invalid argument supplied for foreach()
      Herzlichen dank für dein wundervolle hilfe. Auf das wäre ich nicht gekommen.

      Ich meine, was an diesem Code nicht stimmt?

      Kommentar


      • #4
        Zitat von ypnetwork Beitrag anzeigen
        Herzlichen dank für dein wundervolle hilfe. Auf das wäre ich nicht gekommen.

        Ich meine, was an diesem Code nicht stimmt?
        http://www.php.de/php-einsteiger/543...produkten.html

        http://lmgtfy.com/?q=+Invalid+argume...foreach%28%29+

        Kommentar


        • #5
          Ich meine, was an diesem Code nicht stimmt?
          Na du übergibst ein ungültiges Argument (= die Fehlermeldung auf deutsch), was brauchst du noch?

          Schau was du genau(!) übergibst inkl. dem Typ ( var_dump() ) und was laut Doku erwartet wird. Thats it, mehr gibt es dazu eigenltich nicht zu sagen.
          The string "()()" is not palindrom but the String "())(" is.

          Debugging: Finde DEINE Fehler selbst! | Gegen Probleme beim E-Mail-Versand | Sicheres Passwort-Hashing | Includes niemals ohne __DIR__
          PHP.de Wissenssammlung | Kein Support per PN

          Kommentar


          • #6
            Zitat von ypnetwork Beitrag anzeigen
            Herzlichen dank für dein wundervolle hilfe. Auf das wäre ich nicht gekommen.
            So wundervoll wie deine "Problembeschreibung"... nicht mal die Zeilennummer der fehlerhaften Stelle postest du, die sollen wir raten oder was?

            Betreibe Debugging!
            Über 90% aller Gewaltverbrechen passieren innerhalb von 24 Stunden nach dem Konsum von Brot.

            Kommentar

            Lädt...
            X