Jump to content

designer76

Members
  • Posts

    88
  • Joined

  • Last visited

    Never

Everything posted by designer76

  1. Thanks for the help! That does 100% exactly what I wanted. The only problem is that I am having issues integrating it into the script that I posted already. The one that I posted already handles the thumbnails changing a main image, I just needed to integrate the dropdowns in there as well (exactly as you have it). I need to be able to integrate the new code into the my original script because it allows you to zoom in, pan around the image, etc... so that code needs to stay. Is this possible? I appreciate you bearing with me, as I said, I am new to jQuery and this script is one that I found that I am trying to modify to fit what I need. Thanks in advance for any further help given.
  2. Hi, I do not have much jQuery experience at all, so please bear with me. What I need is for dropdown (select) boxes to change a main image as well as a set of thumbnails being able to do the same. I have some code below that uses buttons and thumbnails, but I can?t use buttons, it needs to be dropdowns (select) boxes and thumbnails. For example: I will have thumbnails and dropdown (select) boxes on one page. The thumbnails will be red, blue and green and the dropdown (select) box will have three options in them that say red, blue and green. When I click on the green thumbnail the thumbnail will be highlighted/selected, the dropdown (select) box will also change to the green option and the main image would change to the green image. And in reverse, if I click on the green option in the dropdown (select) box, the thumbnail that is green will be highlighted/selected and the main image would change to the green image. I don't know how complicated this is, and for the life of me, I can't seem to get this to work. The important thing is that the thumbnail, image and dropdown always update/be in sync at the same time. I can't have the selected thumbnail and main image showing green while the dropdown box says red. I have posted the code below that has the buttons in it (which I do not want, they are just there as an example) along with everything else. Also, here is a link to the show as an example exactly what I am looking to do: http://www.abercrombie.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=10901&storeId=10051&langId=-1&categoryId=12215&parentCategoryId=%5bLjava.lang.String%3b%4061db61db&topCategoryId=&productId=1002193 Thanks in advance for any help given. <script> var $thumbs; jQuery(function($){ $thumbs = $('.zoom_thumbnails').find('li a'); $thumbs.each(function (i){ $(this).bind('click', {src: $(this).attr('href'), ob: $(this).find('img')}, function (e){ //Add your zoom settings here $('#zoom_container').smoothZoom('destroy').css('background-image', 'url(zoom_assets/preloader.gif)').smoothZoom({ image_url: e.data.src, width: 512, height: 384, button_ROUND_CORNERS: false, control_BOX_MARGIN: 4, /****************************************** Enable Responsive settings below if needed. Max width and height values are optional. ******************************************/ responsive: false, responsive_maintain_ratio: true, max_WIDTH: '', max_HEIGHT: '' }); $thumbs.each(function (){ $(this).find('img').removeClass('thumb_highlight').addClass('thumb_normal'); }); e.data.ob.addClass('thumb_highlight'); return false; }) .find('img').addClass('thumb_normal'); }).eq(0).trigger('click'); }); </script> </head> <body> <div id="zoom_container"></div> <div style="width: 512px; text-align:center"> <ul class="zoom_thumbnails"> <li><a href="images/gallery_images/main1.jpg" data-size="500,400"><img src="images/gallery_images/thumb1.jpg"></a></li> <li><a href="images/gallery_images/main2.jpg" data-size="500,400"><img src="images/gallery_images/thumb2.jpg"></a></li> <li><a href="images/gallery_images/main3.jpg" data-size="500,400"><img src="images/gallery_images/thumb3.jpg"></a></li> <li><a href="images/gallery_images/main4.jpg" data-size="500,400"><img src="images/gallery_images/thumb4.jpg"></a></li> </ul> </div> <button type="button" onClick="$thumbs.eq(0).trigger('click')" >Show Image 1</button> <button type="button" onClick="$thumbs.eq(1).trigger('click')">Show Image 2</button> <button type="button" onClick="$thumbs.eq(2).trigger('click')" >Show Image 3</button> <button type="button" onClick="$thumbs.eq(3).trigger('click')">Show Image 4</button> </body>
  3. Actually, I was able to solve it. I found and manipulated some code that worked for me.
  4. Actually, I have figured out the issue with having to make a new rewrite rule every time I add a new page or folder with new content. The only issue I am having now is making this condition: RewriteCond %{REQUEST_FILENAME}.php -f RewriteCond %{REQUEST_URI} !/$ RewriteRule (.*) $1\.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ /$1 [R=301,L] Work with my paging condition here: RewriteRule ^designs/([0-9]+) designs.php?page=$1 [L] RewriteRule ^designs/([a-z]+) designs.php?page=viewall [L] RewriteRule ^artwork/([paintings]+)/([a-z]+)/([0-9]+) paintings/acrylics/blue.php?page=$3 [L] RewriteRule ^artwork/([paintings]+)/([a-z]+)/([a-z]+) paintings/acrylics/blue.php?page=viewall [L] The condition on the top allows people to type a trailing slash at the end of the url and have it redirect back to a url that does NOT have the trailing slash on it. The condition I was using before would throw an internal server error any time someone typed a trailing slash at the end of the url. The problem is that now my paging is throwing an internal server error with the new trailing slash condition that I am using. I have tried a bunch of things, but I can't figure out how to make the two work together. If anyone could help me with this last little bit, that would be awesome. I am almost there. Thanks.
  5. First, I don't think this code is doing what you think it is doing. ([paintings]+) -- The parenthesis make it a capturing group so you can refer to the value as $1 in the rewrite. The square brackets make it a character class so any of the letters inside the bracket must be matched: "aginpst" are the letters in your character class (I just removed the repeating ones and alphabetized it). The "+" means 1 or more of the letters (from that class). So you are rewriting artwork/ants/bugs/2 to paintings/acrylics/blue.php?page=2. Second, what distinguishes this rewrite rule from the one you wanted to go to "organge"? They are exactly the same as far as I can see. Third, why are you capturing the first two values, you are not using them in the rewrite. I think you need to rethink what you are trying to accomplish. It might actually solve your question about orange. As for the trailing slash; I usually use something like: RewriteRule ^artwork/paintings/(blue)/([a-z]+)/([0-9]+)/? paintings/acrylics/$1.php?page=$3 [L] Which makes the trailing slash optional for that rewrite. Granted, I'm no expert at this, and I still have problems with the trailing slash from time-to-time. Thanks for the reply sir, but I am still confused. I am basically new to url rewriting, so I don't really know much about what you stated. I wasn't trying to get get over-complicated with the code that I posted, it's just what I was able to piece together that worked with my website paging code. I am just looking for as simple of a rewrite as possible (that can work with my paging) that will prevent me from having to create a new rewrite rule every time I add new folders/pages/content to my site.
  6. If this is any help, I found this code below that fixes most of my problems except for two issues. 1. I do not want the trailing slash to effect my search page at all, because it is causing problems. 2. I can not get it to work correctly with my paging. For example: both mysite.com/acrylics/viewall/ and mysite.com/acrylics/viewall (no trailing slash) worked with the mod_rewrite I posted above, but now it doesn't. I get an error saying that viewall.php does not exist. It seems like I may be close, but I just need some help to get this working properly. Can anyone assist? RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*[^/])/$ $1.php [L] # Forces a trailing slash to be added RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$ RewriteRule (.*)$ /$1/ [R=301,L]
  7. Unfortunately, still no luck. I don't get it, the dropdown selection is being changed to nothing when it is hidden, so I would think that on the page refresh the url would do the same thing. It seems like it would work like it has been except the only difference being that the dropdown is hidden now. It makes no sense why it doesn't work exactly as you typed out in your earlier post. Weird.
  8. I am a little confused I guess, it works now just using PHP and Javascript. When you select a dropdown option, the page refreshes and shows/sorts the results based on the option you pick, and so on. This code below is what does it. javascript:document.forms['filter'].submit(); The only problem when I add the hiding dropdown and clearing hidden dropdown value is that the page refresh does not update the url and clear out the value of the hidden dropdown. I know there are more sophisticated ways to do something like this now, but I am somewhat new to this stuff and I am just looking to find something that works if possible.
  9. Actually, I may have been slightly premature. The code provided DOES clear out/reset the dropdown box value, the only problem is that the page url does not, and it is still sorting by the previous value in the hidden dropdown box. If I am not being clear enough or you need more info, please let me know. Basically I am half way there, I just need the url to update to reflect that there is no longer a value to sort by in the hidden box.
  10. I apologize for being vague, that wasn't my intent at all. That code looks exactly like what I am looking for, and I tried something similar but I think my formatting was incorrect. I will try this and report back to you. If it is not what I was looking for I will be happy to provide whatever extra details you may need to assist me.
  11. Hi, The code below works perfectly except for one thing. I want to be able to either add a trailing slash or make it so that the url can work with a trailing slash and without one. So: www.mysite.com/paintings and www.mysite.com/paintings/ would both work. As it stands right now, the trailing slash does not work no matter what I do. I have tried a few rewrite scripts that I have found, but the issue is that my url ends up not working, and it will read like: mysite.com/folder/mysite/html/paintings.php. The scripts that I have tried are basically reading the entire root folder on the server instead of just the HTML folder. My second question is is there a way that I can rewrite all of the urls on my site without having to create new code inside the .htaccess file? For example, in the code below, if I add an orange.php page inside of my acrylics folder, I am going to have to paste: RewriteRule ^artwork/([paintings]+)/([a-z]+)/([0-9]+) paintings/acrylics/orange.php?page=$3 [L] RewriteRule ^artwork/([paintings]+)/([a-z]+)/([a-z]+) paintings/acrylics/orange.php?page=viewall [L] into the .htaccess file, and so on, as I add new pages. That just seems like the wrong way to go about things, and the .htaccess file can get large fairly quickly if I have lots of pages, but this stuff is fairly new to me, so I could be wrong. Any help given is much appreciated. Thank you! RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(.*)$ $1.html RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.xml -f RewriteRule ^(.*)$ $1.xml RewriteRule ^designs/([0-9]+) designs.php?page=$1 [L] RewriteRule ^designs/([a-z]+) designs.php?page=viewall [L] RewriteRule ^paintings/([0-9]+) paintings.php?page=$1 [L] RewriteRule ^paintings/([a-z]+) paintings.php?page=viewall [L] RewriteRule ^artwork/([paintings]+)/([a-z]+)/([0-9]+) paintings/acrylics/blue.php?page=$3 [L] RewriteRule ^artwork/([paintings]+)/([a-z]+)/([a-z]+) paintings/acrylics/blue.php?page=viewall [L] RewriteRule ^artwork/([women]+)/([a-z]+)/([0-9]+) artwork/oils/red.php?page=$3 [L] RewriteRule ^artwork/([women]+)/([a-z]+)/([a-z]+) artwork/oils/red.php?page=viewall [L]
  12. Hi, I have this code 95% finished, and it is doing everything I that need it to except for one thing and I can't seem to figure it out. I am using the php at the very bottom of this code in conjunction with some code in a different document to hide certain dropdowns based on what option is selected in another dropdown. That part works perfectly fine, the only thing that I can't figure out is how to clear the value of the dropdown that is being hidden so that it doesn't effect the filter results while it is hidden (which it currently does now). For example: if (isset($_GET['category']) && $_GET['category']=='designs') { $hideme2 = "style='display: none'"; } I need the ['category']=='designs' part to be reset back to ['category']=='' when the dropdown gets hidden. That is all that I need to fix in order for things to work exactly like I need them to. Can anyone help me with this? I do want to state that there are other parts of this code in other documents that I didn't post because it would be way too long, and I don't think those parts effect this particular issue. I believe/hope that I have included all of the code necessary to fix the issue. Thanks in advance for any help given! <div class='filter_container'> <form action="" method="GET" name="filter" id="filter"> <input type="hidden" name="sale" value=""> <input type="hidden" name="page" value="1"> <div class="dropdown_headings"><p>Category:</p></div> <div class="dropdown_container"> <select name="category" class='filter_dropdowns' id="category" onchange="javascript:document.forms['filter'].submit();"> <option class='dropdown_options' value="" <?php if (isset($_GET['category']) && $_GET['category']=='') { echo 'selected'; } ?>>All Available</option> <option class='dropdown_options' value="designs" <?php if (isset($_GET['category']) && $_GET['category']=='designs') { echo 'selected'; } ?>>Designs</option> <option class='dropdown_options' value="paintings" <?php if (isset($_GET['category']) && $_GET['category']=='paintings') { echo 'selected'; } ?>>Paintings</option> <option class='dropdown_options' value="sketches" <?php if (isset($_GET['category']) && $_GET['category']=='sketches') { echo 'selected'; } ?>>Sketches</option> </select> </div> <div class="hideme1" <?php echo $hideme1 ?>> <div class="dropdown_headings"><p>Filter 1:</p></div> <div class="dropdown_container"> <select name="filter1" class='filter_dropdowns' id="filter1" onchange="javascript:document.forms['filter'].submit();"> <option class='dropdown_options' value="" <?php if (isset($_GET['filter1']) && $_GET['filter1']=='') { echo 'selected'; } ?>>All Designs</option> <option class='dropdown_options' value="ads" <?php if (isset($_GET['filter1']) && $_GET['filter1']=='ads') { echo 'selected'; } ?>>Ads</option> <option class='dropdown_options' value="brochures" <?php if (isset($_GET['filter1']) && $_GET['filter1']=='brochures') { echo 'selected'; } ?>>Brochures</option> </select> </div> </div> <div class="hideme2" <?php echo $hideme2 ?>> <div class="dropdown_headings"><p>Filter 2:</p></div> <div class="dropdown_container"> <select name="filter2" class='filter_dropdowns' id="filter2" onchange="javascript:document.forms['filter'].submit();"> <option class='dropdown_options' value="" <?php if (isset($_GET['filter2']) && $_GET['filter2']=='') { echo 'selected'; } ?>>All Paintings</option> <option class='dropdown_options' value="oil paintings" <?php if (isset($_GET['filter2']) && $_GET['filter2']=='oil paintings') { echo 'selected'; } ?>>Oil Paintings</option> <option class='dropdown_options' value="watercolors" <?php if (isset($_GET['filter2']) && $_GET['filter2']=='watercolors') { echo 'selected'; } ?>>Watercolors</option> </select> </div> </div> </div> <div class="dropdown_headings"><p>Sort By:</p></div> <div class="dropdown_container"> <select name="sortby" class='filter_dropdown' onchange="javascript:document.forms['filter'].submit();"> <option class='options_options' value="" <?php if (isset($_GET['sortby']) && $_GET['sortby']=='') { echo 'selected'; } ?>>All Available</option> <option class='options' value="featured artwork" <?php if (isset($_GET['sortby']) && $_GET['sortby']=='featured artwork') { echo 'selected'; } ?>>Featured Artwork</option> <option class='options' value="new artwork" <?php if (isset($_GET['sortby']) && $_GET['sortby']=='new artwork') { echo 'selected'; } ?>>New Artwork</option> </select> </div> </form> </div> <?php { if (isset($_GET['category']) && $_GET['category']=='designs') { $hideme2 = "style='display: none'"; } if (isset($_GET['filter1']) && $_GET['filter1']=='ads') { $hideme2 = "style='display: none'"; } if (isset($_GET['filter2']) && $_GET['filter2']=='oil paintings') { $hideme1 = "style='display: none'"; } } ?>
  13. Of the code I saw posted, I didn't see any syntax problems. Does it give you a line number or any other info? Can you post the part of the sript you think is the culprit? Sure. This code below is giving me syntax errors in Dreamweaver on every line that has the $arr in it; <?php $arr = new array(); // color if(!empty($_POST['color']) $arr[] = "color = '".$_POST['color']."'"; // type if(!empty($_POST['type']) $arr[] = "type = '".$_POST['type']."'"; // size if(!empty($_POST['size']) $arr[] = "size = '".$_POST['size']."'"; $str = implode(" and ", $arr); if(!empty($str)) $str = "and ".$str; mysql_query("select * from table where 1 $str"); ?>
  14. The syntax error only happens when I put the new code in that was posted in this thread. Even when I put the new code in a PHP file by itself, there is still a syntax error. That's why I don't think my search script is causing the syntax error.
  15. Thanks, but I already have that at the top of my code. The syntax error inside of Dreamweaver usually means that something is typed incorrectly, like a " should be a ' or a : should be a ; Something along those lines.
  16. Is anyone else able to help me with this? I am really stuck and have no idea how to proceed.
  17. It is just giving me a syntax error in the coding part of Dreamweaver. That's all it says is syntax error, and it is on each of the lines similar to one I posted above. When I try to view the page in the web browser it is blank, but I haven't been able to figure out what the syntax error is.
  18. Thanks, I am going to try working with this now. BTW, I am getting syntax errors on these lines below in Dreamweaver. Do you know what could be wrong? $arr[] = "color = '".$_POST['color']."'";
  19. Thanks The Little Guy, Now with this code do I put it in the php code that contains my search script? If so, then what am I going to put on my dropdown menus? Are they basically going to "post" those variables once the ajax does it's thing?
  20. Yes you could That will be ajax How would I go about doing this? I am still learning this stuff and I am not sure how to go about achieving this? Are there any tutorials or anything you can point me to or possibly assist yourself? Any help given is very much appreciated. Thanks.
  21. I also forgot to add that I would like the dropdowns to instantly refresh and filter the results just how sites like eBay do it.
×
×
  • 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.