Jump to content

RhysAndrews

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

RhysAndrews's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi again. I didn't expect wordpress to offer something like that... I did just find a system called Thingamablog, which is a free piece of software that does it all on the client computer and then uploads HTM/HTML files to the server. This seems to do exactly what I'd like. Thanks for your help -Rhys
  2. I understand, but I had found a site once that showed how to integrate the RSS feed into a website and customise it, making it look just like a blog - then it was editable from Wordpress' site. But surely it is possible to create a blog system that, instead of looking for entries in a database to edit (or adding new entries to the database), looks for DIV containers with a certain class name. You could even have all the DIV containers in one document, and then according to the page archive number, pick a cluster of 5 DIV containers to display on the page (For archived pages etc). Anyway, thanks for your help.
  3. Hey guys! I am looking for a blog system, such as Wordpress, that can be integrated and styled into my own website without requiring mySQL databases. I've heard it's possible to use the Wordpress RSS function to display blog entries straight from wordpress, but I have no idea how I would go about doing this - and would it automatically archive articles into new pages? I'm seriously lost here! Any help would be much appreciated. -Rhys
  4. Solved! I created checkboxes for each photo, which is named photo0, photo1, and so on. You can go up to as many photos as you like, because the PHP script just searches through photo0, 1, 2, etc until it reaches the number of photos that exist. Then, I just use checkboxes and radio buttons and the like for sizes and colour. Regards Rhys Andrews
  5. Hey guys. I'm attemping to setup a order form, where viewers can open a photo from a lightbox/ajax style gallery and click "Add to Order". To do this, I have hidden inputs for each photo, each with a unique name. When the "add to order" button is pressed, this javascript code is executed: var ind=0; function submitPhoto(photoNum) { photoNum = String(photoNum); getElementsByName("orderform").photoNum.name = "ph"+String(ind); ind+=1; } photoNum is the unique name of the hidden inputs. The javascript should change the name to ph0, ph1, and so on, depending on the number of photos you add to the order. The PHP script that sends the order via email then checks the values of ph0, ph1, etc. It keeps searching those variables until there's one that's empty, so it knows it's the end of the order. The PHP will then send all the values of those (which are pre-entered into the hidden inputs) via email to the order taker. Here is the section of code (its a PHP code) that displays the button and hidden input: <li><BUTTON type=\'button\' onClick=\'javascript:submitPhoto('.substr($img,0,-4).');\'>Add to Order</BUTTON><INPUT type=\'hidden\' name=\''.substr($img,0,-4).'\' value=\''.substr($img,0,-4).'\'></INPUT></li> the substr function is the 'photo code' which is actually just the photo's filename without the extension - this is what is provided to the order taker. On using this PHP code, I get nothing from $_POST["ph0"] when ordering one photo: if ($_GET["doorder"]==1) { echo $_POST["ph0"]; } I know this is complicated to understand, my apologies in advance. Thanks very much! -Rhys Andrews
  6. @npsari That sounds like exactly what I am hoping for in design, I just need technical help. Thanks very much! -Rhys
  7. I wasn't planning on having the photos as attachments to the email - just their 'photo codes'. Detecting how many rows were provided in PHP and sending all the values is potentially difficult, so I am happy to just have a fixed number of rows, i.e 10. The main issue for me is how can the viewer open the photo and click a button or something to 'add' that photo's code to a row?
  8. Hey guys. My client has a lightbox-style photo gallery, and at the bottom of each photos is a 'photo code' - it's actually just the file name minus the extension. She now wants an order form, where clients can submit photos they'd like to order, as well as options like colour or black/white, size, and so on. Once they submit the form, the info just goes to my client via email and she gets in touch with them. I'm trying to get my head around how I can associate the lightbox gallery with an HTML Form (which is processed in PHP when submitted). It would be nice if customers can just click a '+' button to add a new row if they want to order additional photos, however I must also figure out how the customers identify which photo they want to order from the gallery. They could just enter the photo code from the gallery, but they could get tedious if they're ordering multiple photos. Ideally, I'd like to know how to have a button that automatically enters data photo code into the first empty row. What can you guys suggest? Sorry if I am not clear! -Rhys
  9. Woe mama! Thanks dawsba - I just placed session_start() at the top of gallery.php and img.php and it's all fine and dandy now. I think it was img.php that was the problem, because gallery.php detects the files and it did so with no issues, but img.php couldn't display them. You've solved a big problem of mine! Thanks! -Rhys
  10. Err, when I do that the page disappears and it just says the URL on a blank page.
  11. Hi redarrow The code looks like it should work, but if I use that header code it tells me the header has already been set. And if I take it out... I get a very long page full of symbols. This is my code: <?php if ($_GET["action"]==1) { $album = $_POST["album"]; $album = stripcslashes($album); for($i=1; $i<7; $i+=1) { if (!empty($_FILES["imgfile$i"]["name"])) { //header('Content-type: image/jpeg'); list($width_orig,$height_orig) = getimagesize($_FILES["imgfile$i"]["tmp_name"]); $ratio_orig = $width_orig/$height_orig; $width=600; $height=600; if ($width/$height > $ratio_orig){ $width = $height*$ratio_orig; } else{ $height = $width/$ratio_orig; } $image_p = imagecreatetruecolor($width,$height); $image = imagecreatefromjpeg($_FILES["imgfile$i"]["tmp_name"]); imagecopyresampled($image_p,$image,0,0,0,0,$width,$height,$width_orig,$height_orig); imagejpeg($image_p,null,100); $filename = basename($_FILES["imgfile$i"]["name"]); if (end(explode(".", $filename))=="jpg") { //Find destination directory $targetpath="../photos/$album/"; $targetpath = $targetpath . $filename; if(move_uploaded_file($image_p, $targetpath)) { echo "<SPAN style='color:lime;'>The file $filename has been uploaded successfully!</SPAN><BR>"; } else{ echo "<SPAN style='color:red;'>There was an error uploading $filename - please try again!</SPAN><BR>"; } } else { echo "<SPAN style='color:red;'>$filename has an invalid extension - only JPG and PNG files are allowed!</SPAN><BR>"; } } } } ?> Could you help me out? Thanks! -Rhys
  12. Hey everyone. I've googled the hell out of this, and while I've found a lot of solutions, they were all either too in-depth or too hard to understand. I use this script to upload photos - the form has 6 upload fields, so the user can upload up to 6 JPG photos at once. It checks each file and moves it to the directory. All I need added to the script is for it to resize the JPG first - I want the larger axis to be resized to 600, and the proportions to remain the same - I don't want it to be upsized, though. So, for instance: - 600x1000 photo will be resized to 360x600 - 200x200 photo will not be resized - 1000x600 photo will be resized to 600x360 Here is my code - could someone help me add this feature to the code without altering it too much? Thanks so much! The names of the upload fields in the form are imgfile1, imgfile2, and so on. <?php if ($_GET["action"]==1) { $album = $_POST["album"]; $album = stripcslashes($album); $allowedExtensions = array("jpg", "jpeg"); for($i=1; $i<7; $i+=1) { if (!empty($_FILES["imgfile$i"]["name"])) { $filename = basename($_FILES["imgfile$i"]["name"]); if (in_array(end(explode(".", $filename)), $allowedExtensions)) { //Find destination directory $targetpath="../photos/$album/"; $targetpath = $targetpath . $filename; if(move_uploaded_file($_FILES["imgfile$i"]["tmp_name"], $targetpath)) { echo "<SPAN style='color:lime;'>The file $filename has been uploaded successfully!</SPAN><BR>"; } else{ echo "<SPAN style='color:red;'>There was an error uploading $filename - please try again!</SPAN><BR>"; } } else { echo "<SPAN style='color:red;'>$filename has an invalid extension - only JPG and PNG files are allowed!</SPAN><BR>"; } } } } ?>
  13. Right here:<a href="./gallery/img.php?file=dmkchhkctu.jpg&thumb=0" class="linkopacity" rel="lightbox[]" title="View Preview" id="<ul><li>Photo Code - dmkchhkctu</a></li></ul>"><img src="./gallery/img.php?file=dmkchhkctu.jpg&thumb=1"></a> (dmkchhtctu.jpg exists)
  14. <?php require 'logcheck.php'; require('./gallery/gallery.php'); //Load the gallery scripts if($loggedin==0) { header("location: index.php"); //redirect to the index }?> This is the code I use. logcheck.php is irrelevant (it had the same issues when a majority of logcheck.php didn't exist). I use this code to show the gallery where I want on the page: <DIV id='gallery'><?php if ($loggedin==1) showGallery();?></DIV> This is img.php: <?php require('./gallery.php'); generateImg($_GET['file'], $_GET['thumb']); function generateImg($img, $thumb) { global $gallery_root, $pictwidth, $pictheight, $thumbwidth, $thumbheight; if($thumb) { $height = $thumbheight; $width = $thumbwidth; } else { $height = $pictheight; $width = $pictwidth; } $img = $gallery_root.$img; $path = pathinfo($img); switch(strtolower($path["extension"])){ case "jpeg": case "jpg": Header("Content-type: image/jpeg"); $img=imagecreatefromjpeg($img); break; case "gif": Header("Content-type: image/gif"); $img=imagecreatefromgif($img); break; case "png": Header("Content-type: image/png"); $img=imagecreatefrompng($img); break; default: break; } $xratio = $width/(imagesx($img)); $yratio = $height/(imagesy($img)); if($xratio < 1 || $yratio < 1) { if($xratio < $yratio) $resized = imagecreatetruecolor($width,floor(imagesy($img)*$xratio)); else $resized = imagecreatetruecolor(floor(imagesx($img)*$yratio), $height); imagecopyresampled($resized, $img, 0, 0, 0, 0, imagesx($resized)+1,imagesy($resized)+1,imagesx($img),imagesy($img)); imagejpeg($resized); imagedestroy($resized); } else { imagejpeg($img); } imagedestroy($img); } ?> I wouldn't be surprised if the source of the issue was in img.php. Thanks for your help! -Rhys
×
×
  • 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.