Jump to content

spyke01

Members
  • Posts

    74
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://fasttracksites.com

Profile Information

  • Gender
    Not Telling

spyke01's Achievements

Member

Member (2/5)

0

Reputation

  1. if a div wont take a focus, how can i move down the page to a section without using an "a name" tag?
  2. from what i saw on google you can do setfocus(document.item) instead of document.item.focus() i tried both ways however to no avail
  3. i have a div that i need to focus the page on so that the user can see their new comment flashing. I am using scriptaculous from script.aculo.us The div: [CODE] <div id="11" class="comment" onload="setforcus(document.11); new Effect.Highlight(this); new Effect.Highlight(this);"> <a href="http://www.fasttracksites.com">paden</a><br /> <small>Posted on Sep 20, 2006</small><br /><br /> asdasd </div> [/CODE] heres the full page: [url=http://www.fasttracksites.com/demos/blog/index.php?p=viewentry&id=1]http://www.fasttracksites.com/demos/blog/index.php?p=viewentry&id=1[/url] the page just stays at the top, any ideas?
  4. that would still be one image, the large one, i need to actually create the smaller ones for a shorter load time
  5. I need to create 2 different sized thumbnails automaticly from an image being uploaded, the databas insertion works fine, but after the first image is uploaded, the other two never get made. I only get a dialog box saying that the script on the page is taking too long to execute and asks if i want to stop it or continue. I added echo statements in but the script wont print past some basic html for the menus page: [code] <?php include "includes/header.php"; //===================================================== // If the user is not logged in redirect them //===================================================== if (!isset($_SESSION[user_level])) { // User is not allowed in the admin section, kick them out echo "\n You do not have sufficient access rights to access this section, or you are not logged in. You are being redirected to the login page.<br />"; echo "\n If you are not redirected automaticly, please click <a href=\"$menuvar[LOGIN]\">here</a>.<br />"; echo "\n <meta http-equiv='refresh' content='1;url=$menuvar[LOGIN]'>"; } //===================================================== // If the user is an employee the print the page //===================================================== else { if ($_SESSION[user_level] != ADMIN && $_SESSION[user_level] != EDITORS && $_SESSION[user_level] != STREET_TEAM) { echo "\n You do not have sufficient access rights, please contact an administrator."; } else { //======================================================== // Upload the photo //======================================================== if(isset($_POST[submit])){ $typeOfFile = $_FILES['large_pic']['type']; $fileName = $_FILES['large_pic']['name']; $fileExt = strtolower(substr($fileName,strrpos($fileName,"."))); $fileName = str_replace("\\","",$fileName); $fileName = str_replace("'","",$fileName); $randName = md5(rand() * time()); // make a random filename $largefilename = "../assets/galleries2/maroonweeklystreetteam/" . $randName . $fileExt; // Upload the full sixed image move_uploaded_file($_FILES['large_pic']['tmp_name'], "../assets/galleries2/maroonweeklystreetteam/" . $randName . $fileExt); // Get the image size so we can calculate the new size list($width, $height) = getimagesize("../assets/galleries2/maroonweeklystreetteam/" . $randName . $fileExt); if ($width < $height) { // Get what the next ID will be - not pretty but i dont feel like fixing it $sql = "SELECT ID FROM galleryimages ORDER BY ID DESC LIMIT 1"; $result = mysql_query($sql) or die(mysql_error()); if ($row = mysql_fetch_array($result)) { $last_id = $row['ID'] + 1; } mysql_free_result($result); // Insert the caption and image into the DB $sql = "INSERT INTO `galleryimages` (ID, filename, memberof, caption, numinorder, height, width, owner) VALUES('$last_id', 'assets/galleries2/maroonweeklystreetteam/". $randName . $fileExt . "', '0', '$_POST[caption]', '$last_id', '0', '540', '0')"; $result = mysql_query($sql) or die(mysql_error()); // Our files $mediumfilename = "assets/galleries2/maroonweeklystreetteam/" . $randName . "_mid." . $fileExt; $smallfilename = "assets/galleries2/maroonweeklystreetteam/" . $randName . "_thumb." . $fileExt; // Create the Medium sized pic - Height is more important than width to us $tosubtract = $height - 380; // This tells what to subtract the current hieght and width by to get 380 $newwidth = $width - $tosubtract; $newheight = $tosubtract; createthumb($largefilename, $mediumfilename, $width, $height, $newwidth, $newheight); // Create the Thumbnail - Height is more important than width to us $tosubtract = $height - 159; // This tells what to subtract the current hieght and width by to get 159 $newwidth = $width - $tosubtract; $newheight = $tosubtract; createthumb($largefilename, $smallfilename, $width, $height, $newwidth, $newheight); } else { echo "\n <center>"; echo "\n The height of your image should be larger than the width. Please crop the image and try again"; echo "\n </center>"; echo "\n <br />"; echo "\n <br />"; } unset($_POST[submit]); } //======================================================== // Print our form //======================================================== echo "\n <center>"; echo "\n <form method=\"POST\" action=\"$menuvar[STREETTEAM]\" enctype=\"multipart/form-data\">"; echo "\n <table class='TableBorder' border='0' cellpadding='0' cellspacing='1' style=\"width: 400px;\">"; echo "\n <tr>"; echo "\n <td colspan=\"2\" class=\"title1\">Add Street Team Photo</td>"; echo "\n </tr>"; echo "\n <tr>"; echo "\n <td colspan=\"2\" class=\"title2\">Please only upload JPG images with a height larger than their width.</td>"; echo "\n </tr>"; echo "\n <tr>"; echo "\n <td class=\"row2\">Caption</td><td class=\"row1\"><input name=\"caption\" type=\"text\" size=\"30\" /></td>"; echo "\n </tr>"; echo "\n <tr>"; echo "\n <td class=\"row2\">Picture</td><td class=\"row1\"><input type=\"file\" name=\"large_pic\" /></td>"; echo "\n </tr>"; echo "\n </table>"; echo "\n <br />"; echo "\n <input type=\"submit\" name=\"submit\" class=\"button\" value=\"Add It!\" />"; echo "\n </form>"; echo "\n </center>"; } } include "includes/footer.php"; ?> [/code] function: [code] //============================================ // This function is designed to create a // thumbnail from the given image. // // ORIGINALLY FROM: // http://icant.co.uk/articles/phpthumbnails/ // Modified for use here // // USAGE: // createthumb($p, "tn_".$p, 150, 150); // // OPTIONS: // $name Original filename // $filename Filename of the resized image // $new_w width of resized image // $new_h height of resized image //============================================ function createthumb($name, $filename, $old_w, $old_h, $new_w, $new_h) { echo "$name, $filename, $old_w, $old_h, $new_w, $new_h<br />"; $system=explode(".",$name); print_r($system); if (preg_match("/jpg|jpeg/", $system[3])){$src_img = imagecreatefromjpeg($name);} if (preg_match("/png/", $system[3])){$src_img = imagecreatefrompng($name);} $dst_img = ImageCreateTrueColor($new_w, $new_h); if (imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h, $old_x, $old_y)) { echo "made copyresampled<br />"; } else { echo "didnt make copyresampled<br />"; } if (preg_match("/png/", $system[3])) { imagepng($dst_img, "../" . $filename); } else { imagejpeg($dst_img, "../" . $filename); } imagedestroy($dst_img); imagedestroy($src_img); } [/code]
  6. I need to create 2 different sized thumbnails automaticly from an image being uploaded, the databas insertion works fine, as well as the first image, however the second and third images look like this: [img]http://www.maroonweekly.com/assets/galleries2/maroonweeklystreetteam/1570932f817abf417fa50d20370b650b_mid..jpg[/img] [img]http://www.maroonweekly.com/assets/galleries2/maroonweeklystreetteam/1570932f817abf417fa50d20370b650b_thumb..jpg[/img] Heres the code thats called when an image is uploaded [code] if(isset($_POST[submit])){                                 $typeOfFile = $_FILES['large_pic']['type'];                 $fileName = $_FILES['large_pic']['name'];                 $fileExt = strtolower(substr($fileName,strrpos($fileName,".")));                 $fileName = str_replace("\\","",$fileName);                 $fileName = str_replace("'","",$fileName);                 $randName = md5(rand() * time()); // make a random filename                                 $largefilename = "../assets/galleries2/maroonweeklystreetteam/" . $randName . $fileExt;                                                                // Upload the full sixed image                 move_uploaded_file($_FILES['large_pic']['tmp_name'], "../assets/galleries2/maroonweeklystreetteam/" . $randName . $fileExt);                                                 // Get the image size so we can calculate the new size                 list($width, $height) = getimagesize("../assets/galleries2/maroonweeklystreetteam/" . $randName . $fileExt);                                 if ($width < $height) {                     // Get what the next ID will be - not pretty but i dont feel like fixing it                                    $sql = "SELECT ID FROM galleryimages ORDER BY ID DESC LIMIT 1";                     $result = mysql_query($sql) or die(mysql_error());                                         while ($row = mysql_fetch_array($result)) {                         $last_id = $row['ID'] + 1;                     }                                         // Insert the caption and image into the DB                     $sql = "INSERT INTO `galleryimages` (ID, filename, memberof, caption, numinorder, height, width, owner) VALUES('$last_id', 'assets/galleries2/maroonweeklystreetteam/". $randName . $fileExt . "', '0', '$_POST[caption]', '$last_id', '0', '540', '0')";                     $result = mysql_query($sql) or die(mysql_error());                                                                                // Our files                     $mediumfilename = "assets/galleries2/maroonweeklystreetteam/" . $randName . "_mid." . $fileExt;                     $smallfilename = "assets/galleries2/maroonweeklystreetteam/" . $randName . "_thumb." . $fileExt;                                                     // Create the Medium sized pic - Height is more important than width to us                     $tosubtract = $height - 380; // This tells what to subtract the current hieght and width by to get 380                     $newwidth = $width - $tosubtract;                     $newheight = $height - $tosubtract;                                         createthumb($largefilename, $mediumfilename, $newwidth, $newheight);                                         // Create the Thumbnail - Height is more important than width to us                     $tosubtract = $height - 159; // This tells what to subtract the current hieght and width by to get 159                     $newwidth = $width - $tosubtract;                     $newheight = $height - $tosubtract;                                         createthumb($largefilename, $smallfilename, $newwidth, $newheight);                                }                 else {                        echo "\n            <center>";                     echo "\n                The height of your image should be larger than the width. Please crop the image and try again";                     echo "\n            </center>";                     echo "\n            <br />";                     echo "\n            <br />";                 }                 unset($_POST[submit]);             }  [/code] and heres the create thum function [code] //============================================ // This function is designed to create a // thumbnail from the given image. // // ORIGINALLY FROM: // http://icant.co.uk/articles/phpthumbnails/ // Modified for use here // // USAGE: // createthumb($p, "tn_".$p, 150, 150); // // OPTIONS: // $name        Original filename // $filename    Filename of the resized image // $new_w        width of resized image // $new_h        height of resized image //============================================ function createthumb($name, $filename, $new_w, $new_h) {     $system=explode(".",$name);         if (preg_match("/jpg|jpeg/", $system[1])){$src_img = imagecreatefromjpeg($name);}     if (preg_match("/png/", $system[1])){$src_img = imagecreatefrompng($name);}         list($old_x, $old_y) = getimagesize($name);         if ($old_x > $old_y) {         $thumb_w = $new_w;         $thumb_h = $old_y * ($new_h/$old_x);     }         if ($old_x < $old_y) {         $thumb_w = $old_x * ($new_w/$old_y);         $thumb_h = $new_h;     }         if ($old_x == $old_y) {         $thumb_w = $new_w;         $thumb_h = $new_h;     }         $thumb_w = number_format($thumb_w, 0, '.', '');     $thumb_h = number_format($thumb_h, 0, '.', '');             $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);         echo $dst_img . " " . $src_img . " " . 0 . " " . 0 . " " . 0 . " " . 0 . " " . $thumb_w . " " . $thumb_h . " " . $old_x . " " . $old_y;         imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);         if (preg_match("/png/", $system[1])) {         imagepng($dst_img, "../" . $filename);     }         else {         imagejpeg($dst_img, "../" . $filename);     }         imagedestroy($dst_img);     imagedestroy($src_img); }  [/code]
  7. Ok thought this was fixed, but the gremlins have fought back once again. Im still having the hated double scroll bar problems, and sometimes text will slip beneath my footers Page(for double scroll bar and footer issue): [url=http://www.fasttracksites.com/sitemap.php]http://www.fasttracksites.com/sitemap.php[/url] CSS: [url=http://www.fasttracksites.com/stylesheets/main.css]http://www.fasttracksites.com/stylesheets/main.css[/url] NOTE: you may have to scroll to the right to see the double scrollbar
  8. Ok, i have [URL=http://"http://www.fasttracksites.com/ftsssforum.php"]this page[/URL] and at the bottom, you can see "Free Version: Download" well the F on free is under the blue "border" the border is really the background image of #page. There is a list on the page like so [CODE] <ul class="smaller"> <li>Fast Track Sites is not resposible for what you do with this application.</li> <li>Fast Track Sites is not resposible for any damage caused this application.</li> <li>This application is As-Is with no warranty(except for the professional edition).</li> <li>Support for this application may found on our forums.</li> </ul> [/CODE] the funny thing is that when i increase the padding left like so: [CODE] ul.smaller { font-family: Helvetica, Tahoma, Verdana, Arial, sans-serif; font-size: 12px; line-height: 14px; padding-left: 10px; } [/CODE] it moves the Free Version text to the left i want the Free Version text to be where its at, but not get sucked under the "blue border of doom", FF and opera are playing nice with the lists and text just not IE
  9. Ok, i fired up Opera 9 last night and lo and behold my page looks like crap, firefox does things great, ie is ok, but opera really kills the page. Heres the page: http://www.fasttracksites.com/privacypolicy.php Heres the problems: 1. Opera doesnt make the fage 100% height 2. Text slides underneath right hand footer(sometimes happens in IE and FF)
  10. ok, the problem is that the width of container has to be 100%, i ending up wrapping the contents of container with a wrapper called page and used the following css to make sure the page didnt change width or the float drop [code] div#container { position: relative; width: 100%; min-height: 100%; /* For Modern Browsers */ height: auto !important; /*For Modern Browsers */ height: 100%; /*For IE */ margin: 0px; padding: 0px; text-align: left; } div#page { width: 1011px; min-height: 100%; /* For Modern Browsers */ height: auto !important; /*For Modern Browsers */ height: 100%; /*For IE */ margin: 0px; padding: 0px; text-align: left; } [/code] thanks anyways guys
  11. Im working on a new layout, and having several problems, ive finally got my two different footers acting like i want them, but now i have double scroll bars, the other problem is that the two columns need to stretch as one(if the left column stretches to 150px then the right column needs to stretch to be 150px) Heres the page: http://www.fasttracksites.com/new%20layout/ Can anyone help me fix these two problems?
  12. Ok guys heres the page [url=http://www.fasttracksites.com/new layout]http://www.fasttracksites.com/new layout[/url] The problem im having is that the content on the right side is being stretched by content(like its supposed to) however the footer is not moving down the page like it should, its stuck there. I know that its stuck due to position: absolute; but i can't remove it, because if the content is not big enough, then the footer wont be lined up with the bottom of the viewport. Any ideas?
  13. the little box is the newline character, sometimes notepad freadks out on it, if you copy and paste it into say wordpad it will change it to a new line, try these two fwrite($fo, $towrite . "/n"); fwrite($fo, $towrite . "/r"); im suprised php isnt throwing errors the way your doing your variables, if you are doing anything wih multiple variables(echo, print, functions, etc) then the . is your friend. it appends one variable onto the end of the other
×
×
  • 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.