laurapessoa Posted June 6, 2013 Share Posted June 6, 2013 (edited) Please help, My slider has crashed. I have this error in Firebug: "NetworkError: 404 Not Found - https://www.genialgifts.com/modules/slideric/%20it1.jpg" This is weird because the pic is not %20it1.jpg, but it1.jpg. Why it is adding that "%20" before the name of the pic and what is doing that? How can I make all the pics became again wthout %20??? Thank you very much. Edited June 6, 2013 by laurapessoa (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted June 6, 2013 Share Posted June 6, 2013 %20 is a space sign, maybe when you upload picture - your filename has got empty space before name? 1 Link to comment Share on other sites More sharing options...
laurapessoa Posted June 6, 2013 Author Share Posted June 6, 2013 Thank you Vekia, but I have reload all the pictures from a Backup that worked fine and there is the same %20 for all the pictures in all the languages. Could you take a look at my homepage? www.genialgifts.com Thank you very much again. Link to comment Share on other sites More sharing options...
laurapessoa Posted June 6, 2013 Author Share Posted June 6, 2013 I have installed and uninstalled the Slideric module again, but nothing. Link to comment Share on other sites More sharing options...
vekia Posted June 6, 2013 Share Posted June 6, 2013 you should check module .tpl file, i think that there is an space because all images you've got have _ space before the name 1 Link to comment Share on other sites More sharing options...
laurapessoa Posted June 6, 2013 Author Share Posted June 6, 2013 I post the .tpl file of the module, but the weird thing is that I have uninstall and install the module from 0... {if $page_name == 'index'} {literal} <script type="text/javascript" src="{/literal}{$this_path}{literal}js/jquery.nivo.slider.pack.js"></script> <link rel="stylesheet" type="text/css" href="{/literal}{$this_path}{literal}css/nivo-slider.css" /> <!-- SLIDER ---------------------------------------------------------------------------------------------------------------------------------------> <div id="slide_holder"> <div id="slider"> {/literal} {foreach from=$xml->link item=home_link name=links} {literal} <a href='{/literal}{$home_link->url}{literal}'><img src='{/literal}{$this_path}{$home_link->img}{literal}'alt="" /></a> {/literal} {/foreach} {literal} </div> </div> <script type="text/javascript"> $(window).load(function() { $('#slider').nivoSlider({ effect:'fold', //Specify sets like: 'fold,fade,sliceDown' slices:11, animSpeed:500, //Slide transition speed pauseTime:8500, startSlide:0, //Set starting Slide (0 index) directionNav:true, //Next & Prev directionNavHide:true, //Only show on hover controlNav:false, //1,2,3... controlNavThumbs:false, //Use thumbnails for Control Nav controlNavThumbsFromRel:false, //Use image rel for thumbs controlNavThumbsSearch: '.jpg', //Replace this with... controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src keyboardNav:true, //Use left & right arrows pauseOnHover:true, //Stop animation while hovering manualAdvance:false, //Force manual transitions captionOpacity:0.8, //Universal caption opacity beforeChange: function(){}, afterChange: function(){}, // Triggers after a slide transition slideshowEnd: function(){} //Triggers after all slides have been shown }); }); </script> <!-- SLIDER ---------------------------------------------------------------------------------------------------------------------------------------> {/literal} {/if} Link to comment Share on other sites More sharing options...
vekia Posted June 6, 2013 Share Posted June 6, 2013 thnx i need additional info: this is the code for the link: {$this_path}{$home_link->img} in this case i need also a part of php code 1 Link to comment Share on other sites More sharing options...
laurapessoa Posted June 6, 2013 Author Share Posted June 6, 2013 This? <?php /** Modulo JQuerySlider Galery **/ /** www.tiendasvirtuales.com.ve **/ class slideric extends Module { /** @var max image size */ protected $maxImageSize = 307200; function __construct() { $this->name = 'slideric'; $this->tab = 'front_office_features'; $this->version = '2.1'; /* The parent construct is required for translations */ parent::__construct(); $this->page = basename(__FILE__, '.php'); $this->displayName = $this->l('Slideric - JQuery Nivo Slider'); $this->description = $this->l('Slide the images with choosen languages | Dreamtheme.eu'); } function install() { if (!parent::install() OR !$this->registerHook('Top')) return false; return true; } function putContent($xml_data, $key, $field) { $field = htmlspecialchars($field); if (!$field) return 0; return ("\n".' <'.$key.'>'.$field.'</'.$key.'>'); } function getContent() { global $cookie; /* Languages preliminaries */ $defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT')); $languages = Language::getLanguages(); $iso = Language::getIsoById($defaultLanguage); $isoUser = Language::getIsoById(intval($cookie->id_lang)); /* display the module name */ $this->_html = '<h2>'.$this->displayName.' '.$this->version.'</h2>'; /* update the editorial xml */ if (isset($_POST['submitUpdate'])) { // Generate new XML data $newXml = '<?xml version=\'1.0\' encoding=\'utf-8\' ?>'."\n"; $newXml .= '<links>'."\n"; $i = 0; foreach ($_POST['link'] as $link) { $newXml .= ' <link>'; foreach ($link AS $key => $field) { if ($line = $this->putContent($newXml, $key, $field)) $newXml .= $line; } /* upload the image */ if (isset($_FILES['link_'.$i.'_img']) AND isset($_FILES['link_'.$i.'_img']['tmp_name']) AND !empty($_FILES['link_'.$i.'_img']['tmp_name'])) { Configuration::set('PS_IMAGE_GENERATION_METHOD', 1); if ($error = checkImage($_FILES['link_'.$i.'_img'], $this->maxImageSize)) $this->_html .= $error; elseif (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['link_'.$i.'_img']['tmp_name'], $tmpName)) return false; elseif (!imageResize($tmpName, dirname(__FILE__).'/'.$isoUser.$i.'.jpg')) $this->_html .= $this->displayError($this->l('An error occurred during the image upload.')); unlink($tmpName); } if ($line = $this->putContent($newXml, 'img', $isoUser.$i.'.jpg')) $newXml .= $line; $newXml .= "\n".' </link>'."\n"; $i++; } $newXml .= '</links>'."\n"; /* write it into the editorial xml file */ if ($fd = @fopen(dirname(__FILE__).'/'.$isoUser.'links.xml', 'w')) { if (!@fwrite($fd, $newXml)) $this->_html .= $this->displayError($this->l('Unable to write to the editor file.')); if (!@fclose($fd)) $this->_html .= $this->displayError($this->l('Can\'t close the editor file.')); } else $this->_html .= $this->displayError($this->l('Unable to update the editor file.<br />Please check the editor file\'s writing permissions.')); } /* display the editorial's form */ $this->_displayForm(); return $this->_html; } private function _displayForm() { global $cookie; /* Languages preliminaries */ $defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT')); $languages = Language::getLanguages(); $iso = Language::getIsoById($defaultLanguage); $isoUser = Language::getIsoById(intval($cookie->id_lang)); /* xml loading */ $xml = false; if (file_exists(dirname(__FILE__).'/'.$isoUser.'links.xml')) if (!$xml = @simplexml_load_file(dirname(__FILE__).'/'.$isoUser.'links.xml')) $this->_html .= $this->displayError($this->l('Your links file is empty.')); $this->_html .= '<br /> <form method="post" action="'.$_SERVER['REQUEST_URI'].'" enctype="multipart/form-data"> <fieldset style="width: 900px;"> <legend><img src="'.$this->_path.'logo.gif" alt="" title="" /> '.$this->displayName.'</legend>'; $i = 0; foreach ($xml->link as $link) { $divLangName = 'title'.$i.'造cpara'.$i; $this->_html .= '<h4>'.$this->l('Slider #').$i.'</h4>'; $this->_html .= '<div class="clear"></div>'; $this->_html .= ' <fieldset style="width:870px"> <h5><label>'.$this->l('Image Size (50%)').'</label></h5> <div class="margin-form"> <img src="'.$this->_path.$isoUser.$i.'.jpg" alt="" title="" style="width:50%; height:50%;" /><br /> <input type="file" name="link_'.$i.'_img" /> </div> <h5><label>'.$this->l('URL').'</label></h5> <div class="margin-form"> <input type="text" name="link['.$i.'][url]" size="64" value="'.($xml ? stripslashes(htmlspecialchars($xml->link[$i]->url)) : '').'" /> </div> </fieldset>'; $i++; } $this->_html .= ' <div class="margin-form clear"> <div class="clear pspace"></div> <div class="margin-form"> <input type="submit" name="submitUpdate" value="'.$this->l('Save').'" class="button" /> </div> </div> </fieldset> </form>'; } function hookTop($params) { global $cookie; /* Languages preliminaries */ $defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT')); $languages = Language::getLanguages(); $iso = Language::getIsoById($defaultLanguage); $isoUser = Language::getIsoById(intval($cookie->id_lang)); if (file_exists(dirname(__FILE__).'/'.$isoUser.'links.xml')) if ($xml = simplexml_load_file(dirname(__FILE__).'/'.$isoUser.'links.xml')) { global $cookie, $smarty; $smarty->assign(array( 'xml' => $xml, 'this_path' => $this->_path )); return $this->display(__FILE__, 'slideric.tpl'); } return false; } } ?> Link to comment Share on other sites More sharing options...
vekia Posted June 6, 2013 Share Posted June 6, 2013 thanks try to use this in the .tpl file: {$this_path|replace:' ':''}{$home_link->img|replace:' ':''} instead the: {$this_path}{$home_link->img} 1 Link to comment Share on other sites More sharing options...
laurapessoa Posted June 6, 2013 Author Share Posted June 6, 2013 Thanks.... by now nothing changes. Are you sure the problem is inside the module? I have intalled it again from the original. I have changed what you said. <div id="slider"> {/literal} {foreach from=$xml->link item=home_link name=links} {literal} <a href='{/literal}{$home_link->url}{literal}'><img src='{/literal}{$this_path|replace:' ':''}{$home_link->img|replace:' ':''}{literal}'alt="" /></a> {/literal} {/foreach} {literal} </div> Link to comment Share on other sites More sharing options...
vekia Posted June 6, 2013 Share Posted June 6, 2013 definitely, because https://www.genialgi...ric/itlinks.xml looks fine, the problem is related to the .tpl / .php file have you turned force compilation on ? + are you sure that you havent got module .tpl file in the themes/your_theme/modules/slideric/ directory? 1 Link to comment Share on other sites More sharing options...
laurapessoa Posted June 6, 2013 Author Share Posted June 6, 2013 have you turned force compilation on ? + are you sure that you havent got module .tpl file in the themes/your_theme/modules/slideric/ directory? To the first question: yes To the second: in my_theme/modules/ I only have blockcurrencies and blocklanguages, not the slideric. Maybe an override from other module? I have uninstalled the Yotpo module (?) Link to comment Share on other sites More sharing options...
laurapessoa Posted June 6, 2013 Author Share Posted June 6, 2013 (edited) I have installed another Slider... :-( (and I works, by now I leave it, hoping to resolve this...) Edited June 6, 2013 by laurapessoa (see edit history) Link to comment Share on other sites More sharing options...
laurapessoa Posted June 6, 2013 Author Share Posted June 6, 2013 I have solved the problem changing all the permissions of my Theme, I don't know what file wasn't with the right ones and why It was changed, but the good news is that now everything works again. Thanks Vekia, you help me to understand how the slider works, that help me a lot. Link to comment Share on other sites More sharing options...
vekia Posted June 6, 2013 Share Posted June 6, 2013 really really weird but im glad that it works for you exactly as you expect ! happy sales! regards 1 Link to comment Share on other sites More sharing options...
Recommended Posts