Bonjour à tous, j'ai installé ce mod et je peux dire que ça fonctionne impeccable et sans problème d'accents :)
Voilà, je recherche à faire un truc qui parait simple, mais vu mon haut niveau en codage je préfère en parler ici.
Donc quand je fais un upload normal, j'insère une image dans la case image et celle-ci apparait en page d'acceuil de mon site, dans le carroussel.
Ce que je chercherais à améliorer dans le mod allociné, c'est que l'image trouvée avec le lien "allociné qu'on obtient en résultat s'affiche également en page d'acceuil dans le carroussel, comme si j'avais uploadé l'image à partir d'un upload d'image normal.
Voilà, est-ce faisable ? merci pour vos lumières ;)
Hello everyone, I installed this mod and I can say that it works flawless and trouble accents :)
So, I'm looking to do something that seems simple, but given my high level coding I prefer to talk about here.
So when I do a normal upload, I insert a picture in the picture box and it appears in the home page of my site in the carousel.
What I would try to improve the allociné mod is that the image found with the link "allociné you get as a result is also displayed in the homepage carousel, as if I had uploaded the image upload from a normal picture.
So, is it feasible? thank you for your lights ;)
Dans "torrents-upload.php/ In torrents-upload.php
Quote://upload images
$allowed_types = &$site_config["allowed_image_types"];
$inames = array();
for ($x=0; $x < 2; $x++) {
if (!($_FILES[image.$x]['name'] == "")) {
$y = $x + 1;
//if (!preg_match('/^(.+).(jpg|gif|png)$/si', $_FILES[image.$x]['name']))
// show_error_msg(T_("INVAILD_IMAGE"), T_("THIS_FILETYPE_NOT_IMAGE"), 1);
if ($_FILES['image$x']['size'] > $site_config['image_max_filesize'])
show_error_msg(T_("ERROR"), T_("INVAILD_FILE_SIZE_IMAGE"), 1);
$uploaddir = $site_config["torrent_dir"]."/images/";
$ifile = $_FILES[image.$x]['tmp_name'];
$im = getimagesize($ifile);
if (!$im[2])
show_error_msg(T_("ERROR"), sprintf(T_("INVALID_IMAGE"), $y), 1);
if (!array_key_exists($im['mime'], $allowed_types))
show_error_msg(T_("ERROR"), T_("INVALID_FILETYPE_IMAGE"), 1);
$ret = SQL_Query_exec("SHOW TABLE STATUS LIKE 'torrents'");
$row = mysql_fetch_array($ret);
$next_id = $row['Auto_increment'];
$ifilename = $next_id . $x . $allowed_types[$im['mime']];
$copy = copy($ifile, $uploaddir.$ifilename);
if (!$copy)
show_error_msg(T_("ERROR"), sprintf(T_("IMAGE_UPLOAD_FAILED"), $y), 1);
$inames[] = $ifilename;
}
}
//end upload images
Cette partie de code est-elle adaptable ?