Jump to content

stevenjweir

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by stevenjweir

  1. Thank you!!, also thank you for laying it out in an easy way for me to understand.
  2. Hi all, I'm having a bit of trouble a script running on a site where it converts a date of birth in a database shown like this '30/04/1993' to an actual age, for instance 18 in this case. Only the script I'm using below shows this age as 17, not 18 as it should be. <?php $birthday = $row_getdets['dob']; function birthday ($birthday){ list($day,$month,$year) = explode("/",$birthday); $day_diff = date("d") - $day; $month_diff = date("m") - $month; $year_diff = date("Y") - $year; if ($day_diff < 0 || $month_diff < 0) $year_diff--; return $year_diff; } ?> So i've tried to remedy this myself with the following: <?php $birthday = $row_getdets['dob']; function birthday ($birthday){ list($year,$month,$day) = explode("/",$birthday); $year_diff = date("Y") - $year; $month_diff = date("m") - $month; $day_diff = date("d") - $day; if ($month_diff < 0) $year_diff--; else if (($month_diff==0) && ($day_diff < 0)) $year_diff--; return $year_diff; } ?> ..but I'm having a syntax error (unexpected T_LINE), most probably down to my novice ability, I bet I've missed something simple. I'm still learning guys and I'd really appreciate any help at all.
  3. micmania1, thank you. Sorted it. Also I just noticed the price bit doesn't actually work. The line: printf ('%02.2f', (($row_getdets['price']) * $row_prices['dollar']) ); where it says dollar, I need it to grab $_COOKIE["currency"] and replace the dollar.How do I include the $_COOKIE data within that ['dollar'] box?
  4. Hi guys, I'm still learning PHP so bare with me please. I've written a script to change the displayed price of a product based on the currency set in a cookie. The script is: <?php if ($_COOKIE["currency"] == dollar) {echo "$";} /* if the cookie is set to Dollar, show a '$' */ else if ($_COOKIE["currency"] == euro) {echo "€";} /* or if the cookie is set to Euro, show a '€' */ else { echo "£";} /* or if the cookie isn't set to Dollar or Euro, show a '£' */ printf ('%02.2f', (($row_getdets['price']) * $row_prices['[$_COOKIE["currency"]']) ); /* Show Price multiplied by the chosen currency rate set by the cookie, set to 2 decimals. */ ?> So basically I just need it to show the currency symbol, ie: £, $ or € and then show the price. The price part works, the bit that doesn't is the if else part. Any help would be really appreciated.
  5. Ok so I have a website with two types of photo gallerys. Model Cars and Model Planes. The galleries are becoming so big that I need to add an archive link to the galleries, but it's messy to have the archive link there until we actually enable the archived photos. So what I want to do is show the DIV with the archive link in it if the page can find database a 1 in the model_pictures.car_gallery AND model_pictures.archive. How would I achieve this? The page is already connected to the database as it's pulling the images and information for the gallery. I need it to scan the entire 'archive' column in the database and also the 'car_gallery' and if it finds 1's in there AND the car_gallery then to show the link. What I would like to avoid, as I have two galleries, is having the archive link show on the car gallery when it finds a 1 in the archives column, but that archive is for a plane_gallery photo. Hence why I would like to have check both car_gallery + archive and then plane_gallery + archive. Any help would be greatly appreciated.
  6. Yep: The images are all in the directory /slideshow/ on the website. Here's the Slideshow inside its DIV inside the page: <div class="slideshow" align="center" style="background: transparent !important;"><br /> <?php $files = glob("slideshow/*.*"); for ($i=1; $i<count($files); $i++) { $num = $files[$i]; echo '<div class="slide"><img src="'.$num.'" alt="Slideshow"></div>'." "; } ?> </div> Here's the CSS for that: .slideshow { margin: 0px auto; padding: 0; height: 240px; width: 240px; display:block; } .slide { margin: auto; text-align:center; vertical-align:middle; background: transparent !important; } .slideshow, .slide { height: 240px; width: 240px; background: transparent !important;} .slide img { padding: 0px; border: 0px solid #ccc; margin: auto; margin-top: auto; display: block; background: transparent !important;} Here's the code I'm using to wait for the slideshow before loading page: <!-- initialize the slideshow when the DOM is ready --> <script type="text/javascript"> $(document).ready(function() { $('.slideshow').cycle({ fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc... }); }); </script> Here's the JQuery Cycle script: http://jquery.malsup.com/cycle/download.html Thanks.
  7. Hi there, I'm currently running http://jquery.malsup.com/cycle/ Jquery Cycle plugin on a page on a website. On all our machines and all the machines I've been able to test the page on, the slideshow works as intended. But sod's law that the only person having issues is the client. He is using Internet Explorer and won't budge on the browser. The issue he is having is that when he loads the page, sometimes, not everytime, two images are shown stacked ontop of each other for about a second then the fading animation begins between single images. Things I've done to combat this to hold the page off from showing until the slideshow has finished loading, doesn't work apparently, client still has issues. It's also a problem that I cannot replicate this issue either, so I'm struggling to fix something I can't see. The next idea I have is to preload the CSS, but is that even possible? Isn't the CSS loaded first anyway? Any ideas guys?
  8. Thanks for the link, that's the link I've used and got as far as getting it to show a thumb on hover, but... Problem is the thumbnail path is selected from within the javascript file. So the file has no way to know what link in the table is being hovered. The code: <?php echo $objDynamicThumb1->Execute(); ?> when added to the javascript: tooltips[0]=["<?php echo $objDynamicThumb1->Execute(); ?>"] I thought that opening a new <?php block would cause issues so I tried: tooltips[0]=["$objDynamicThumb1->Execute()"] and its not working. I just have the feeling that by putting that bit of code out in the .js file it has no way to know what image to show because it doesnt know what row I am hovering.
  9. Hi, I've recently started working on a site that someone else created. I'm not advanced with PHP like the previous guy was, so picking it up as I go. Currently there is an admin page for managing a database of images uploaded by users. The table on this page grabs the database field values and just fills in the table with tick boxes, etc to manage. Rather than display thumbnails of each of the images on the page directly, the website owner wants to have a list of links to images in the table (this is done), but on hovering over the link, show the thumbnail, have a pop up thumbnail right on the mouse cursor. There already exists the function to grab the thumbnail into the table, but I am unsure how to have this work in a hovering thumb image. Any help would be great.
×
×
  • 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.