Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 未通过javascript文件选择项_Php_Jquery_Joomla2.5 - Fatal编程技术网

Php 未通过javascript文件选择项

Php 未通过javascript文件选择项,php,jquery,joomla2.5,Php,Jquery,Joomla2.5,我有一个简单的jquery文件,其中包含幻灯片新闻,但现在出现了一些问题,它没有选择元素。在调试时,它在触发器中显示空值 Php文件的代码 <?php /** * copyright (C) 2008 GWE Systems Ltd - All rights reserved */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die(); /** * HTML View clas

我有一个简单的jquery文件,其中包含幻灯片新闻,但现在出现了一些问题,它没有选择元素。在调试时,它在触发器中显示空值

Php文件的代码

<?php
/**
 * copyright (C) 2008 GWE Systems Ltd - All rights reserved
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

/**
 * HTML View class for the module  frontend
 *
 * @static
 */
include_once(JPATH_SITE."/modules/mod_jevents_latest/tmpl/default/latest.php");


class GeraintModLatestView extends DefaultModLatestView  
{

    function displayLatestEvents(){
        $document = JFactory::getDocument();

        $this->getLatestEventsData();

        $content = "";
        $var=count($this->eventsByRelDay);
        $testVar=1;
        if(isset($this->eventsByRelDay) && count($this->eventsByRelDay)){
            $content .='<html>';
            $content.='<body>';
            $urls= "http://localhost/Mineral/modules/mod_jevents_latest/tmpl/myjs/jquery.min.js";
            $content.='<script src="'.$urls.'"></script>';

            $urls= "http://localhost/Mineral/modules/mod_jevents_latest/tmpl/myjs/slideshow.js";
            $content.='<script src="'.$urls.'"></script>';
            $content.='<script>  jQuery.noConflict(true);</script>';
            $content.='<div style="height:200px; width=300px; overflow: hidden; position:relative; top:0; border:5px double #206BA4; border-radius:7px; text-align:center; ">';

            $content .= '<ul class="triggers" width="100%" border="0" cellspacing="0" cellpadding="0" align="center">';

            // Now to display these events, we just start at the smallest index of the $this->eventsByRelDay array
            // and work our way up.
            $firstTime=true;
            $lastElem=false;
            // initialize name of com_jevents module and task defined to view
            // event detail.  Note that these could change in future com_event
            // component revisions!!  Note that the '$this->itemId' can be left out in
            // the link parameters for event details below since the event.php
            // component handler will fetch its own id from the db menu table
            // anyways as far as I understand it.

            $task_events = 'icalrepeat.detail';
            $this->processFormatString();

            foreach($this->eventsByRelDay as $relDay => $daysEvents){
                reset($last);
                reset($daysEvents);

                // get all of the events for this day
                foreach($daysEvents as $dayEvent){
                    if($testVar==$var)
                    $lastTime=true;
                    if(($dayEvent->bgcolor()=='#FF0000')&&($lastTime))
                    $dst = "text-decoration:blink;border-color:".$dayEvent->bgcolor();
                    else
                    $dst = "border-color:".$dayEvent->bgcolor();
                    if($firstTime) $content .= '<li  style="'.$dst.'">';
                    else $content .= '<li style="'.$dst.'">';

                    // generate output according custom string
                    foreach($this->splitCustomFormat as $condtoken) {

                        if (isset($condtoken['cond'])) {
                            if ( $condtoken['cond'] == 'a'  && !$dayEvent->alldayevent()) continue;
                            else if ( $condtoken['cond'] == '!a' &&  $dayEvent->alldayevent()) continue;
                            else if ( $condtoken['cond'] == 'e'  && !($dayEvent->noendtime() || $dayEvent->alldayevent())) continue;
                            else if ( $condtoken['cond'] == '!e' &&  ($dayEvent->noendtime() || $dayEvent->alldayevent())) continue;                            
                            else if ( $condtoken['cond'] == '!m' &&  $dayEvent->getUnixStartDate()!=$dayEvent->getUnixEndDate() ) continue;
                            else if ( $condtoken['cond'] == 'm' &&  $dayEvent->getUnixStartDate()==$dayEvent->getUnixEndDate() ) continue;
                        }
                        foreach($condtoken['data'] as $token) {
                            unset($match);
                            unset($dateParm);
                            $dateParm="";
                            $match='';
                            if (is_array($token)) {
                                $match = $token['keyword'];
                                $dateParm = isset($token['dateParm']) ? trim($token['dateParm']) : "";
                            }
                            else if (strpos($token,'${')!==false){
                                $match = $token;
                            }
                            else {
                                $content .= $token;
                                continue;
                            }

                            $this->processMatch($content, $match, $dayEvent, $dateParm,$relDay);
                        } // end of foreach
                    } // end of foreach

                    $content .= "</li>\n";
                    $firstTime=false;
                    $testVar++;
                } // end of foreach
            } // end of foreach
            //$content=var_dump($var);
            $content .="</ul>";
            $content .="</div>";
            $content .="</body>";
            $content .="</html>";

        } else {
            $content.='<div style="height:200px; width=300px; overflow: hidden; position:relative; top:0; border:5px double #206BA4; border-radius:7px; text-align:center; ">';
            $content .= '<ul class="mod_events_latest_table" width="100%" border="0" cellspacing="0" cellpadding="0" align="center">';
            $content .= '<li class="mod_events_latest_first" >'. JText::_('JEV_NO_EVENTS') . '</li>' . "\n";
            $content .="</ul>\n";
            $content.='</div>';
        }

        $callink_HTML = '<div class="mod_events_latest_callink">'
        .$this->getCalendarLink()
        . '</div>';

        if ($this->linkToCal == 1) $content = $callink_HTML . $content;
        if ($this->linkToCal == 2) $content .= $callink_HTML;

        if ($this->displayRSS){
            $rssimg = JURI::root() . "media/system/images/livemarks.png";
            $callink_HTML = '<div class="mod_events_latest_rsslink">'
            .'<a href="'.$this->rsslink.'" title="'.JText::_("RSS_FEED").'" target="_blank">'
            .'<img src="'.$rssimg.'" alt="'.JText::_("RSS_FEED").'" />'
            .JText::_("SUBSCRIBE_TO_RSS_FEED")
            . '</a>'
            . '</div>';
            $content .= $callink_HTML;
        }

        return $content;
    } // end of function
} // end of class

同一文件在其他joomla模板中正常工作。我认为它们一定没有任何冲突的问题,因为我通过禁用其他模型进行了检查。

除非我错了,否则PHP文件似乎同时执行控制器函数和视图。这是非常丑陋和荒谬的:(我正在处理jevent模块这些模块不允许调用正确的视图?我的问题是我可以看到ul和li元素,但脚本不工作可能是什么问题。它在另一个模板中工作良好。
$(window).load(function () 
{
    jQuery.noConflict();
    var triggers = $('ul.triggers li');
    var lastElem = triggers.length-1;
    var target;
    triggers.first().addClass('selected');
    triggers.hide().first().show();                         
    function sliderResponse(target)                         
      {
        triggers.removeClass('selected').
        fadeOut(9000).eq(target).addClass('selected').fadeIn(9000);
      }
    function sliderTiming() 
    {
         if(triggers.length==1)
        {
            triggers.first().show();
            clearInterval(timingRun);
        }
        else
       {
           target = $('ul.triggers li.selected').index();
            if ( target === lastElem ) 
                { target = 0; }
            else 
                { target = target+1; }

            sliderResponse(target);
       }
   }

   var timingRun = setInterval(function() { sliderTiming(); },9000);
    function resetTiming() 
    {
        clearInterval(timingRun);
        timingRun = setInterval(function() { sliderTiming(); },9000);
    }
});