Jump to content

quote

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

quote's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello again, We've been using the last script from DarkWater for a few days. It works fine, except for one detail : when we try to modifiy a product, we have to retrieve the picture in the scroll-down menu. It wasn't so before, the edit menu "remembered" what image file it used. I was wondering if anybody could tweak so that it works that way ?
  2. Awesome, it works now ! You just boosted my productivity by approximatively 500% ! Thanks a lot pal, I was really tired of spending 5 minutes scrolling down that bloody menu every time I added a product... If I didn't have so much trouble paying the rent each month, I'd gladly paypal you a few bucks, but I can't spare anything right now. If you're into astronomy or birding, or just need some binoculars or a tripod, come look at our website : http://lirelanature.com , and mention you've helped David with the website. I'll manage a friendly discount for you. Thanks again, Dave
  3. Alright then, I won't try to teach you French anymore Now there seems to be a long list of pictures, but no names are displayed, and no picture is displayed when you select any of the "ghost" entries.
  4. French CANADIAN, thank you I managed to find the missing } by myself by closely examining your code. But now all my images are gone from my menu, and I only have the choice between "aucune" (none) and "Array". Here's what the code looks like right now : <p>Image</p> <td> <select name="sImage" onchange="ChangeImage('ImgProduct','image/'+this.options[selectedIndex].value)"> <? // $k = 0; echo "<option value=\"\">Aucune</option>\n"; $d = dir ("image"); while(false !== ($FileName=$d->read ())) { if ($FileName !="." && $FileName !="..") { $files[$k]['name'] = $Filename; $files[$k]['last'] = filectime("image/$Filename"); } } $d->close (); array_multisort($files, SORT_DESC, SORT_NUMERIC); foreach ($files as $file) { echo "<option value=\"$file\">$file</option>\n"; } ?> </select> </td>
  5. Yes, there seems to be a mistake, but as I am extremely new to any of this, I don't have a clue what to look for. Here's what my browser said when I tested it : Parse error: syntax error, unexpected T_ENDIF in /home/lirelana/public_html/admin/modules/ShopStop/index.php on line 339 Which seems to refer to this portion : <p> <? CloseTable(); endif; include("footer.php"); ?> Again thanks for the help guys, sorry for being such a painful newbie.
  6. That didn't work out hitman6003. The page won't load. Is it possible that your script would need to be added in the upload section of the site ? Basically, the way it works is that I upload a picture using a page, and then use the "add a product" section to write the article and select the appropriate image. The code snippet I posted was from the "add a product" form. Here is the code for the upload page : <HTML> <HEAD> <TITLE>Admin Shop Stop Shopping Center</TITLE> <HEAD> <?php include ("CommonFunction.inc.php"); ?> <script language="Javascript" type="text/javascript"> <!-- function AddFileSlotToList() { FileList.innerHTML = FileList.innerHTML + "<input name='FileUpload[]' type='file'><br>"; } //--> </script> <? if (!eregi("admin.php", $PHP_SELF)) { die ("Access Denied"); } include("header.php"); include("config.php"); require("VarCWC02.php"); if ($AddPicture): $Error= UploadFileToDisk ("image/"); OpenTable(); echo ("<center><H4>Product List</h4></center>" ); $page = "admin.php?op=PhotoList"; if (!$Error) { Echo ("<BR><center>Les Photos ont été rajoutés</center>"); Echo ("<BR><center>Click <a href=$page>here</a> or wait 3 seconds to go back to Admin Center</center>"); } else { Echo ("<BR><center>Erreur dans l'ajout de photo</center>"); Echo ("<BR><center>Click <a href=$page>here</a> to go back to Photo List</center>"); } CloseTable(); ?> <script language="Javascript" type="text/javascript"> <!-- function gotoThread() { window.location.href="<?php print $page ?>"; } <? if (!$Error) echo ("window.setTimeout('gotoThread()', 3000)"); ?> //--> </script> <? else: // Request info // SYSTEM MENU // MAIN MENU include("menushop.php"); Echo ("<BR>"); OpenTable(); ?> <form enctype="multipart/form-data" action="admin.php?op=PhotoList" method="POST"> <div id=FileList> <b>Liste des Fichier</b><br> <input name="FileUpload[]" type="file"><br> <input name="FileUpload[]" type="file"><br> <input name="FileUpload[]" type="file"><br> <input name="FileUpload[]" type="file"><br> <input name="FileUpload[]" type="file"><br> </div> <br><br><button onclick='AddFileSlotToList()'>Ajouter une entrée de fichier</button><br><br> <input type="submit" name="AddPicture" value="Send File"> </form> <? CloseTable(); endif; include ("footer.php"); ?> Dark Water, I am going to try your suggestion. Do I need to replace the same portion of the code that hitman did ? Thanks for the help guys EDIT : Might have something to do with this as well <? echo ("<TABLE><tr>"); $Img=0; $d = dir ("image"); while(false !== ($FileName=$d->read ())) { echo ("<td>"); if ($FileName !="." && $FileName !="..") { echo "<option value=\"$FileName\">$FileName</option>\n"; } echo ("<br><b>$FileName</b></td>"); $Img++; if ($Img >= 5) { $Img = 0; echo ("</tr><tr>"); } } $d->close (); echo ("</tr></table>"); ?>
  7. Ideally, by date and time of uploading, but anything would do really.
  8. Hi everybody, First of all I'd like to specify that I'm a total newbie regarding php and coding in general. I'm turning to you because I don't know anybody that has the time to fix my problem, which is that my job requires me to work on uploading articles for a (buggy) commercial website. That isn't much of a problem, except for the fact that when I try to select an image in the drop-down menu for the product I'm uploading, the images aren't sorted in any (apparent) fashion. I have to scroll down the whole menu to find the picture I'm looking for, and there are hundreds, if not thousands of them. It's taking a lot of time, and my patience is growing thin. I managed to find what I suspect is the main culprit, this code portion, which I think lack some sort of sorting function : <p>Image</p> <td> <select name="sImage" onchange="ChangeImage('ImgProduct','image/'+this.options[selectedIndex].value)"> <? // echo "<option value=\"\">Aucune</option>\n"; $d = dir ("image"); while(false !== ($FileName=$d->read ())) { if ($FileName !="." && $FileName !="..") { echo "<option value=\"$FileName\">$FileName</option>\n"; } } $d->close (); ?> </select> If anybody could give me an easy solution to this problem, I'd be infinitely grateful. Thanks in advance.
×
×
  • 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.