Jump to content

richrock

Members
  • Posts

    213
  • Joined

  • Last visited

About richrock

  • Birthday 08/08/1975

Contact Methods

  • MSN
    richard_cheesman@hotmail.co.uk
  • Website URL
    http://www.blabr.co.uk

Profile Information

  • Gender
    Male
  • Location
    Wales, UK

richrock's Achievements

Advanced Member

Advanced Member (4/5)

1

Reputation

  1. Hi, Tearing my hair out with this one, it seems that the inevitable choices of solutions are both intensive pieces of work. I've created a delivery/invoice note generated by FPDF from a shopping cart object in PHP. It's fine, it's been working well, some teething issues and then this: We had some orders from abroad, namely Saudi Arabia and Israel. The system uses country codes which are sent to the payment gateway, and the system also determines regions within a country as linked drop-down list with country. So, in one example, someone has selected Israel, and some indecipherable region/state within Israel. This renders in the PDF as: מחוז המרכז Which is no good to anyone! So I tried to convert DejaVuSans (as recommended in a St***k O******w thread) using the makefont tool, using CP1252 encoding, which is the default. No luck. Tried with ISO-8859-1 - still no luck. Also reran versions with utf8_encode (and utf8_decode just to see what it would do - I was getting desperate at this point). Nothing. The best I got was: ???? ????? Which showed me that FPDF is generating the region - country parts of the address. I now have two options: 1. Convert every non-english address using english characters. A massive job as the cart system doesn't do this, but has the capability (?!?) 2. Create a pdf system for each encoding type - something I would like to avoid too, as some of them may never place orders. The ideal solution, and my question is - is there a font or way I can render foreign character sets without determining the encoding of the PDF? Hope that all makes sense. tl:dr - Can't make fonts work in FPDF for foreign places. Want one solution that doesn't involve masses of work editing databases or files.
  2. You are a genius - I'll have to make a note of this. We had a run of clients who bought .co domains and now regret it for some reason.... Thanks
  3. Right, I'm fairly comfortable with redirecting other tld's, typically we'll redirect a .com to .co.uk - easy stuff. But I'm stuck with someone who bought these : .co, .com and .co.uk They want the .co.uk to be primary. I've sorted the .com like this: RewriteCond %{HTTP_HOST} ^(www\.)?thedomain\.com RewriteRule (.*) http://www.thedomain.co.uk/$1 [R=301,L] Which works fine. However, when I do RewriteCond %{HTTP_HOST} ^(www\.)?thedomain\.co RewriteRule (.*) http://www.thedomain.co.uk/$1 [R=301,L] I get an infinite loop error, obviously caused by the .co.uk being included in the RewriteCond rule and then redirecting again.... Any ideas how I can resolve this?
  4. Wondering if anyone can help - I'm not entirely sure I'm getting this right. Actually, I know I'm, because it ain't working! I've retrieved a set of pages using cURL, all working fine, and then using a foreach loop to process each page which will either have one main image, or a main image and thumbnails. I've been scratching my head for many hours trying to figure out the logic to get either the thumbnails (and then I can retrieve the bigger images) or just the one big image. Here's the part of the loop: if($node->nodeName == 'div' && $node->getAttribute('id') == 'bigImageWindow' && $node->getAttribute('class') == 'hasThumbnails') { // We have more than 1 image, so use the thumbs approach //echo "a:<br />"; $setImageSrc = "a"; } elseif($node->nodeName == 'ul' && $node->getattribute('id') == 'thumbPage0') { //echo "b:<br />"; $setImageSrc = "b"; } if($setImageSrc == 'a') { if($node->nodeName == 'img' && $node->getAttribute('id') == 'largeImage') { $instr_images[] = $node->getAttribute('src'); } } else { if($node->nodeName == 'ul' && $node->getAttribute('id') == 'thumbPage0') { $vnodes = $node->childNodes; foreach($vnodes as $vnode) { if($vnode->nodeName == 'li') { $wnodes = $vnode->childNodes; foreach($wnodes as $wnode) { if($wnode->nodeName == 'a'){ $xnodes = $wnode->childNodes; foreach($xnodes as $xnode){ if($xnode->nodeName == 'img'){ $instr_images[] = $xnode->getAttribute('src'); } } } } } } } } I know it's a bit long-winded, but the idea is simple. If the page has thumbnails, use those, else, just grab the main image. As you can see from the latest attempt, I'm trying to set a $setImageSrc to process either option a or option b. At best, I've managed to get all the images, but a duplicated first image - this is due to it reading both the big image AND thumbnails - despite the logic that it should be doing either/or... Any ideas?
  5. Hi, I've been looking at using slideToggle() in jQuery for expanding hidden content. Unfortunately, to make it pretty standard I have opted to fix the text height, and need to expand to 100% of the content.... slideToggle() performs the required animation, but toggles between coompletely hidden and the starting height... for($b = 0; $b < $num_bios; $b++) { if(($b > 0 ) && ($b%2 == 0)) { $margins = ' style="margin-right: 20px;"'; } else { $margins = ' style="margin-right: 20px;"'; } ?> <div class="box-wide" <?php echo $margins; ?>> <div class="heading"><div class="icon-bio"><h2>Biography</h2></div></div> <div class="inner"> <h4 class="label">Biography from: <?php echo $this->bios[$b]->book_title; ?></h4> <div class="first_content"id="extra_<?php echo $b; ?>"> <p><?php echo $this->bios[$b]->content; ?></p> </div> </div> <div class="morelink" style="border: 1px solid red; padding-right: 28px; text-align: right;"><a href="#" id="morelink_<?php echo $b; ?>">Read more</a></div> </div> <?php } This is the loop of boxes, set to min-height of 350px; the content in first_content is set to 230px, which splits the content line nicely. And I know the margins is duplicated, but I'll sort that after. Then the jQuery thus far: <script type="text/javascript"> $(document).ready(function(){ // Hide boxes as soon as DOM ready //$('#extra_0').hide(); // Commented to see if it toggled from the set height up but it hid instead, // Toggle the hidden slickbox $('#morelink_0').click(function() { //var id = $(this).attr('id'); // For when I figure this, it's in a loop. //var newid = id.replace("slick-toggle","#extrainfo"); // Same here. $('#extra_0').slideToggle(400); return false; }); }); </script> Can this be done? The total heights will vary, but the starting point is always 230px; Hence a toggle between a low height and the entire content, whatever that may be. TIA.
  6. Thanks for the reply... When I hover over the series of thumbnails that another script would generate, they will be inserted via a pre-existing piece of Javascript that changes the image. The addimagezoom function does work on the initial image, but not on the changed images. I tried to get the url of the images, hence var img_url = document,.....etc. I'm using noConflict as there is a ton of other jquery stuff going on with this site... What I'm trying to do is get that var img_url to change the largeimage: <variable here>, which only seems to work on fixed strings rather than a dynamic item. Hopefully that makes sense?
  7. I've got a jquery plugin to zoom on images, which works great. However, as you would hover over a series of thumbnails, another script switches the image. I've passed that through a hidden element (a bit of an ugly hack, but it works) however, I'm stumped on the last part. Here's my code so far: <script type="text/javascript"> var stinky = jQuery.noConflict(); var img_url = document.getElementById("null_image"); alert(img_url); stinky(document).ready( function() { // Magnifier stinky('#main_image').addimagezoom({ zoomrange: [6, 6], magnifiersize: [520,384], largeimage: , cursorshade: true }); }); </script> The addimagezoom utilises jquery, and works on the primary image - but I want to make the largeimage option variable based on the innerHTML value of null_image. I tried using the var img_url, adding document.getElementById and also by trying +img_url+. Any ideas or is this possible -to get img_url into the largeimage: '(variable here)',
  8. I've seen plenty of examples of jQuery scripts that would allow a user to scroll back to the top of the page, but is there anything that could do the reverse? I have a client who seems to think that everyone who uses his new site doesn't realise that they can in fact scroll DOWN, despite there being a scrollbar... Anyway, in order to appease the anger of the clients , I need a pointer to anything that would say, move the browser down 500px or so with each click. I can't find anything, and JS is not my language. Pointers welcome, I'm sure I could figure something out. Cheers in advance!
  9. Please be aware - I didn't set this up. Not a problem to alter/edit/nuke though I have a database with a set of price fields for auctions - with starting, buyitnow, reserve, makeanoffer_min and makeanoffer_auto. All of these fields deal with financial amounts. None of the amounts will include pence, so it will never have 1.99, but would be either 1 or 2. All of these fields are set to 'double' in mysql except for the last one (auto) which is set to decimal(10,0). I believe we've spotted a problem where one item has a reserve of £2,012,000 - but the database has stored the reserve as 2. Is this correct for double? I don't realy understand single and double-precision numbers, something I'm off to try and figure out.. But any help on formats for these fields would be great.
  10. Right, sent code back to client, and they're still getting issues with this form sending either previous or next. I'm stumped. Works on our machines, can't find any solutions. Here's the code now: <button type="submit" name="task" class="button validate signup_prev" style="position: absolute; left: 0px;" value="back"></button> <button type="submit" name="task" class="button validate signup_next" style="position: absolute; right: 0px;" value="next"></button> Any ideas why this doesn't work in IE? Firefox, Chrome and Safari have all tested okay, and our client's getting shirty
  11. Well, I'm debugging someone else's code - they've since moved on and left me a whole load of work :-(
  12. Many thanks - I will update and test. Just needed confirmation of this. Seems Firefox and Chrome just detect the '<!' and add the '--' - Firebug showed this : <!-- -next--> Thanks again :-)
  13. I've got some buttons, and for sake of reference, they have comments in them to define them, eg: <button type="submit" name="task" class="button validate signup_prev" style="position: absolute; left: 0px;" value="back"><!--back--></button> <button type="submit" name="task" class="button validate signup_next" style="position: absolute; right: 0px;" value="next"><!-next--></button> You'll notice that the second one has a typo - my bad. Instead of <!-- it's got <!- What I'd like to know is can this cause the button tag to stop working? I've got loads of complaints about the next button not working (although it does on my IE8) and am trying to narrow down potential areas of issue.
  14. Does anyone know if a mysql database can store registration information on children including: Name, Age, Date of Birth along with the Parent/Guardian details which contains: Name, Address, Contact Number and Email Just being super cautious, but would appreciate if anyone knows anything about this, as I've spent some time trawling google and getting lost in legalese. It's for a Holiday company, they're all CRB checked, insured, etc, etc... Well established around 15 years + Simple yes or no would be awesome, any links would be even more awesome, like a pound of bacon.
  15. Yup - stoopid filepaths Thanks a lot for your help there!
×
×
  • 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.