Jump to content

xamonix

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by xamonix

  1. Thank you for your answer, but this line should go where? After or before this piece of code? $userfile2=(isset($_FILES['userfile']['tmp_name']) ? $_FILES['userfile']['tmp_name'] : ""); $userfile_name=(isset($_FILES['userfile']['name']) ? $_FILES['userfile']['name'] : "");
  2. Hi, I've got a script to upload images by users. What happens is users usually put special characters on filename like "ç" and "ã". When they do so the filename on server gets weird like this "canóú.jpg". I would like to have some help on this script to remove this special charactres from filename on upload. Here is the script I got: //Send Images $userfile2=(isset($_FILES['userfile']['tmp_name']) ? $_FILES['userfile']['tmp_name'] : ""); $userfile_name=(isset($_FILES['userfile']['name']) ? $_FILES['userfile']['name'] : ""); $imagesize = $_FILES['userfile']['size']; if (( $imageenabled == 2 ) || ( ($imageenabled == 1) && (!empty($userfile_name)) ) ) { $base_Dir = ELPATH.'/images/eventlist/events/'; $sizelimit = $sizelimit*1024; //size limit in kb if ($imagesize > $sizelimit) { mosRedirect("index.php?option=$option&Itemid=$Itemid", "Image too big"." "); } if (!move_uploaded_file ($_FILES['userfile']['tmp_name'],$base_Dir.$_FILES['userfile']['name']) || !mosChmod($base_Dir.$_FILES['userfile']['name'])) { mosRedirect("index.php?option=$option&Itemid=$Itemid", _EVENTS_IMAGEFAIL." "); } else { $file = $base_Dir.$userfile_name; //chmod Bild @chmod ($file, octdec($imagechmod)); //Vorbereiten auf Thumbnailerstellung $thumbdir = $base_Dir.'small/'; $save = $thumbdir.$userfile_name ; if ($imageprob = 1) { $imageprob = TRUE; } else { $imageprob = FALSE; } if ($gddisabled == 1) { evlist_imgd::thumb($file, $save, $imagewidth, $imagehight, $imageprob); } } $_POST['datimage'] = $userfile_name ; } Thank you for your time!
  3. Hi. I got an alpha index (A | B | C | D |... ) to catalogue lyrics, so if the user wants to list all lyrics starting by "A" he simply clicks "A". But the returned results don't show lyrics started by "À" for example "Às pedras da rua". How can I get all the results started by "A" including the ones with accented letters like "À"? Here is the code I got: switch($task){ case "listforletter": $action = "index.php?option=".$option."&Itemid=".$Itemid."& amp;task=".$task."&letter=".$letter; if($letter!='0') $database->setQuery("SELECT COUNT(a.id) FROM #__jmovies as a WHERE a.access <= ".(int)$my->gid." AND SUBSTRING(a.title,1,1)='".$letter."'"); else $database->setQuery("SELECT COUNT(a.id) FROM #__jmovies as a WHERE a.access <= ".(int)$my->gid." AND (SUBSTRING(a.title,1,1)='0'"); $total = $database->loadResult(); break; Thank you for your time !
  4. Hi ! I got this script to upload images, but as a portuguese website I need to clean or replace the portuguese characters like "ã" or "ç" from user's filename. The script is the following. What lines should I add to the script to get the desired result? $userfile2=(isset($_FILES['userfile']['tmp_name']) ? $_FILES['userfile']['tmp_name'] : ""); $userfile_name=(isset($_FILES['userfile']['name']) ? $_FILES['userfile']['name'] : ""); $imagesize = $_FILES['userfile']['size']; if (( $imageenabled == 2 ) || ( ($imageenabled == 1) && (!empty($userfile_name)) ) ) { $base_Dir = ELPATH.'/../../images/eventlist/events/'; $sizelimit = $sizelimit*1024; //size limit in kb if (!move_uploaded_file ($_FILES['userfile']['tmp_name'],$base_Dir.$_FILES['userfile']['name']) || !mosChmod($base_Dir.$_FILES['userfile']['name'])) { echo "<script> alert('Image not sent!.'); window.history.go(-1); </script>\n"; exit(); } else { $file = $base_Dir.$userfile_name; //chmod Bild @chmod ($file, octdec($imagechmod)); //Vorbereiten auf Thumbnailerstellung $thumbdir = $base_Dir.'small/'; $save = $thumbdir.$userfile_name ; if ($imageprob = 1) { $imageprob = TRUE; } else { $imageprob = FALSE; } if ($gddisabled == 1) { evlist_imgd::thumb($file, $save, $imagewidth, $imagehight, $imageprob); } } $_POST['datimage'] = $userfile_name ; } Thank you for your time and help!
  5. Hi I have this serach function, wich searches on site by a lot of parameters at the same time (titolo, titolo2, attore1,etc...) , but I want to make them options, so you would have a search field and an options dropdown menu. Can anyone help me with this? My code follows: PHP function jm_search(){ global $database, $sstring, $my, $cinConfig, $Itemid, $option, $mainframe; $tl_title = _JMOVIES_SEARCHRESULT." ".$sstring; $suchstring = trim( strtolower( $sstring ) ); $query1 = "SELECT * FROM #__jmovies WHERE" ."\n (titolo LIKE '%".$suchstring."%'" ."\n OR titolo2 LIKE '%".$suchstring."%'" ."\n OR attore1 LIKE '%".$suchstring."%'" ."\n OR attore2 LIKE '%".$suchstring."%'" ."\n OR attore3 LIKE '%".$suchstring."%'" ."\n OR attore4 LIKE '%".$suchstring."%'" ."\n OR nazione LIKE '%".$suchstring."%'" ."\n OR regista LIKE '%".$suchstring."%'" ."\n OR descrizione LIKE '%".$suchstring."%'" ."\n OR anno LIKE '%".$suchstring."%') AND published = 1 AND access <= ".(int)$my->gid." ORDER BY titolo"; $database->setQuery($query1); //echo $database->getQuery(); $rows = $database->loadObjectList(); if(is_file($mainframe->getCfg('absolute_path')."/components/".$option."/templates/".$cinConfig['template']."/show_search_tpl.php")) require($mainframe->getCfg('absolute_path')."/components/".$option."/templates/".$cinConfig['template']."/show_search_tpl.php"); else require($mainframe->getCfg('absolute_path')."/components/".$option."/templates/default/show_search_tpl.php"); } HTML <td width="44%" valign="middle" bgcolor="#eeeeee" style="text-align:right"> <input name="sstring" type="text" class="jmoviesInputSearch" title="<?php echo _JMOVIES_SEARCH?>" onfocus="if(this.value=='<?php echo _JMOVIES_SEARCH?>') this.value='';" onblur="if(this.value=='') this.value='<?php echo _JMOVIES_SEARCH?>';" onchange="javascript:document.jmoviesSearchForm.submit();" value="<?php echo _JMOVIES_SEARCH?>" size="50"/><input type="submit" value="OK" class="button"/></td> Thank you.
  6. Hi I'm trying to modify a Shipping module for an online shop but I'm not getting it to work...I want to put two options on that, if customer chooses first option he gets one price for the shipment if he chooses second option then he gets a different price. The original module only allows one option for Shipment Method and I want to add a second option using two radio buttons. Basically I want to check what radio button is selected and then get the value, if first radio button is checked get it's value if the second radio button is checked get the previous value plus and aditional tax. Here goes the code: $_SESSION[$value] = "1"; $string = " <input type=\"radio\" id=\"radio1\" name=\"shipping_rate_id\" value=\"$value\" />"; $string .= " Zone Shipping - $country_name <strong><div class='zone'>". $CURRENCY_DISPLAY->getFullValue($rate )."</div></strong>"; $string .= "<br /> <input type=\"radio\" id=\"radio2\"name=\"shipping_rate_id\" value=\"$value\" />"; $string .= " Contra Re-embolso (+ 1.50€)<strong><div class='zone'>". $CURRENCY_DISPLAY->getFullValue($rate+1.50 )."</div></strong>"; echo $string; } function get_rate( &$d ) { if (document.getElementById("radio2").checked) { $shipping_rate_id = vmGet($_REQUEST,"shipping_rate_id")+1.50; $zone_arr = explode("|", urldecode(urldecode($shipping_rate_id)) ); $order_shipping = $zone_arr[3]; } else { $shipping_rate_id = vmGet($_REQUEST,"shipping_rate_id"); $zone_arr = explode("|", urldecode(urldecode($shipping_rate_id)) ); $order_shipping = $zone_arr[3]; } return $order_shipping; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.