mmcdonald 28 Posting Pro

Sounds like a good shout, the client isn't always right ;) Well to be honest in this scenario they are because there are solutions to this particular issue - they're just too much work :) You could technically hide the background image if the screens resolution is too low and set a background color to the body element?

mmcdonald 28 Posting Pro

Are you not able to get this sort of information from webmaster tools? perhaps request an increase to your crawl rate for a few days?

mmcdonald 28 Posting Pro

These gys are probably one of the best fre hosting providers out there. Remember, you can't ask for much when you aren't prepared to pay.

http://www.biz.nf/

mmcdonald 28 Posting Pro

That's a kickass question my friend! Requires a lot of time, have you instead revised transitioning and studied a healthy tutorial?

http://css3.bradshawenterprises.com/transitions/

Could recommend it enough for clarity making it dead easy to grasp :) I've got it bookmarked!

mmcdonald 28 Posting Pro

No worries Johnny :) Post back soon!

mmcdonald 28 Posting Pro

So when the new monthly depreciation is 20 the new accumulated depreciation becomes 120 because the previous accumulated value was 100? Am I correct?

Correcticus!

If an asset has the value of £1000 and depreciates over 24 months then it has an annual depreciation value of £500 and a monthly depreciation rate of £41.67. The Accumulated depreciation of the asset between months 1 and 10 is £416.70. The value of the asset at month end 12 is £500.

My assets all have fixed depriciation, thankfully! :)

cereal commented: thanks for the explanation +11
mmcdonald 28 Posting Pro

Just tested and that works, even back in the year 1066 :)

mmcdonald 28 Posting Pro

Then your code should work entirely with the datetime class as this isn't limited on date: http://php.net/manual/en/class.datetime.php (I believe you already were, apologies for overlooking the obvious mate!)

$date = new DateTime('1920-01-01');
$date->modify('+18 years');
echo $date->format('Y-m-d');

//Outputs: 1938-01-01

I believe that will do the job? (Untested!)

mmcdonald 28 Posting Pro

Would it not be more effective with the majority of the grey at the bottom such as in this edit: http://masterthepc.com/test.jpg in comparison to http://turningheadssalons.com/Images/Background_New.jpg

All I've done is twist the grey and drop it to the bottom.

mmcdonald 28 Posting Pro

Has the service stopped running?

On Windows:
Start Menu > Run > Type: 'services.msc' > Hit enter > Find 'mysql' > Right Click > Click 'Start' if not already running.

mmcdonald 28 Posting Pro

Welcome Taiba! Have fun in the forums :D

mmcdonald 28 Posting Pro
mmcdonald 28 Posting Pro

using PHP

mmcdonald 28 Posting Pro

My bad long-polling with Jquery returned: http://techoctave.com/c7/posts/60-simple-long-polling-example-with-javascript-and-jquery

Time for a read :)

mmcdonald 28 Posting Pro

Could you point me to an JQuery article that explains it please? Not too sure what I'd be searching for in this case. Or is it just available for HTML5? I I hate IE JorgeM :)

Cheers,

Michael

mmcdonald 28 Posting Pro

haha I have fun with calculating depreciation in an Excel spreadsheet - good luck getting it done in SQL :)

I'm sorry as I can't actually help, but I have to say, if you get this finished please do share. I'd even be willing to buy it if it was accurate and reliable. I'll have 100's of deprecating assets this time next year :'(

mmcdonald 28 Posting Pro

Push notifications... care to elaborate? :)

and I might actually run the check not a terrible shout, but it's still the same amount of queries no? If not more when the data has changed?

mmcdonald 28 Posting Pro

Okay great - cheers all!

mmcdonald 28 Posting Pro

Define bugger? :)

If your BG isn't always fitting 100% then you can use the new CCS3 properties:

html { 
    background: url(images/bg.jpg) no-repeat center center fixed; 
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
}

That works 100% in:
* Safari 3+
* Chrome Whatever+
* IE 9+
* Opera 10+ (Opera 9.5 supported background-size but not the keywords)
* Firefox 3.6+ (Firefox 4 supports non-vendor prefixed version)

This is another great option, very reliable:

img.bg {
    /* Set rules to fill background */
    min-height: 100%;
    min-width: 1024px;

    /* Set up proportionate scaling */
    width: 100%;
    height: auto;

    /* Set up positioning */
    position: fixed;
    top: 0;
    left: 0;
}

@media screen and (max-width: 1024px) { /* Specific to this particular image */
    img.bg {
        left: 50%;
        margin-left: -512px;   /* 50% */
    }
}

Works in:
* Any version of good browsers: Safari / Chrome / Opera / Firefox
* IE 6: Borked - but probably fixable if you use some kind of fixed positioning shim
* IE 7/8: Mostly works, doesn't center at small sizes but fills screen fine
* IE 9: Works

Don't be fooled - I didn't write the above, but I use it so regularly that I'd saved it in a text file in my development folder :) The original article can be found here.

mmcdonald 28 Posting Pro

I wish I had haha I usually do tbh...

Nope, only thing recovered was the title :3

mmcdonald 28 Posting Pro

I have no comments regarding navigation (sorry) but I would add some line height to your scrunched up paragraphs, see here: http://turningheadssalons.com/aboutus.html

The text looks really scrunched, add a line-height style. I usually set my line height value to 1.3 x font size. So if I'm using size 18 font I set my line-height to 23.

Looks like a nice design though - well done!

mmcdonald 28 Posting Pro

Yeah it's in script tags and located within a PHP file. I didn't mean to post

$('#responses').load('pages/community/load-responses.php?id=<?php echo $id;?>');

I'm not using it :)

Are there are risks involved when reloading a div so frequently?

mmcdonald 28 Posting Pro

Hi all, currently using the code below and it works fine. Are there any risks in reloading a div so frequently?

$('#responses').load('pages/community/load-responses.php?id=<?php echo $id;?>');

    function reloadResponses() {
        $('#responses').load('pages/community/load-responses.php?id=<?php echo $id;?>');                    
    }

    setInterval(reloadResponses, 4000)
mmcdonald 28 Posting Pro

I spent 20 minutes building a really large yet nice question, hit submit and BOOM. Could have cried :'( I had indented the code perfectly too haha This was about 2 hours ago GMT.

heyho, just another day in the office! Everything seems to be responding well now though.

mmcdonald 28 Posting Pro

As the other two said... don't do it, not when there are really cheap packages out there (and some free ones!). If you do this a lot and know a lot of people in a similar situation perhaps you can split the hosting host and setup come security. You should of course only do this if the other people you're sharing with are family or best friends. Even then it's VERY risky and just not ideal.

I have an old PC setup on my second line that has 1GB RAM and an 80GB HDD - it's got Ubuntu 10.04 installed (Well.. the complete LAMP stack), and I use it for when any friends, clients or family want to test/review an unfinished project. It also acts as a lovely server for all of my families photos and such :3 It's always nice to login and find that your mum has uploaded baby photos for the whole clan to see -.- using a laptop/desktop to host something isn't difficult, not at all, securing it without knowledge and keeping it up 24/7 is of course another kettle of fish.

mmcdonald 28 Posting Pro

I agree with perlexed, it looks as though you're asking for a game_id when... well when you already have one?

SELECT `game_id` FROM `games` WHERE `game_id`=

I personally would use the SQL like function, because if the users search term doesn't match your predefined name EXACTLY, you'll get no results.

The MySQL LIKE operator will return results with a similar value to the submitted search term.

mmcdonald 28 Posting Pro

I'm about 80% into my first attack on JQuery/AJAX... how would one correctly write this function:

    function reloadResponses(){
        $('#responses').load('pages/community/load-responses.php?id=<?php echo $id;?>'){
            window.setTimeout(reloadResponses, 10000);
            }; 
    };

I would like to reload <div id="reponses"></div> every 10 seconds. Is this the best way?

I am currently using this to reload the div every 10 seconds:

var auto_refresh = setInterval(
    function (){
        $('#responses').load('pages/community/load-responses.php?id=<?php echo $id;?>');
    }, 10000); 

but it appears to cause my chrome tab to crash randomly (right in the middle of me typing a massive paragraph!) Thoughts?

Thanks DW'ers,
Michael

mmcdonald 28 Posting Pro

AK777, if you have your answer please don't forget to mark the topic as solved :)

mmcdonald 28 Posting Pro

haha knew it would be something stupid, cheers guys xD

mmcdonald 28 Posting Pro

Wrong category and no explanation..?

mmcdonald 28 Posting Pro

It can't be a virus if you're not even in the OS, you're not even reading from your hard drive at that stage.

mmcdonald 28 Posting Pro

Create another file called 'populate.php' or something similar, in this file you're going to write standard PHP that includes a DB connection, the collection of data, based on the users input, and then the population of fields.

This in your original file (where the dropdown and the table exists) add something like: <div id="populatedTable"></div>.

What you then want to do is call in the populate.php script using AJAX, but with a variable URL containing the value of RMA; something like this:

<div id="populatedTable"></div>

<script type="text/javascript">
    // reloads populated table every 10 seconds

    var auto_refresh = setInterval(
        function (){
            $('#populatedTable').load('populate.php?rma=<?php echo $rma; ?>');
        }, 10000
    );
</script>

Then in populate.php you need to use $_GET['rma'] and construct your MySQL query based on that value.

Instead of the 10 second refresh timer you can choose to make it refresh once after the users imput is detected from the dropdown using JQuery.

To be honest, you're bascially asking someone to teach you AJAX, and we can't do that, it's simply too much. Teach yourself JQuery and AJAX from YouTube or another tutorial and then come back when you need some help with your new code, only then will our help be genuinely beneficial to you.

Michael

mmcdonald 28 Posting Pro

If you can get into the BIOS you're fine. If you're prompted for a password, you're screwed. If you don't get either then I hear the sound of corruption.

mmcdonald 28 Posting Pro

You can use HTML2Canvas to grab a screenshot of a remote URL and save the captured image locally, their libraries are dead easy to use/understand too, in fact, in 4-6 lines of code you could collect, name and store a screenshot of a URL.

If you want users to see 'live' updates you could have a cronjob constantly running with a loop, constantly getting new screenshots every cycle. Or you could use a class to collect a new screenshot and use it as an avatar every page load (NOT RECOMMENDED).

If you don't need to collect new screenshots that frequently that they seem live you could make your cronjob run every few hours or days.

mmcdonald 28 Posting Pro

Why don't you collect the URI using $_SERVER and see if it contains the term products? You can then use an IF statement, so if URL does contain that or one of several key terms redirect to 404:

<?php
    header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
    include("404-not-found.php");
?>

That way you're telling users and crawlers that the URL they have attempted to use no longer exists, however if you choose to navigate to that address you'll have access as you allowed your public IP in the IF statement.

Michael

mmcdonald 28 Posting Pro

Hi ggeoff,

How did it go for you?

Michael

mmcdonald 28 Posting Pro

Every unique item needs an identification number, so instead of having one ID for cars and then fart assin' around with colours, models and years I would have one unique ID for the red 2010 fiat punto and a unique ID number for every vehicle.

Most ecommerce store owners require this anywhom for their storage warehouses to accept delivery schedules (They're generically called SKU's).

Lets say for example that you sell silicon wristbands and you have three colours, red, white and blue. I would have a unique ID for wristbands such as 01 and a unique ID for each colour and size and so forth, example:

Silicon Wristband = 01
Small = 01
Medium = 02
Large = 03
X-Large = 04
Red = 01
White = 02
Blue = 03

So if someone ordered a large blue wristband the complete unique ID = 010303, then this can also act as my SKU reference. If you then think about OOP you'll start to see how you can then use the same size and colour ID's for multiple products.

I hope this helps your mind mapping!

Michael

mmcdonald 28 Posting Pro

I'll be damned if we didn't, he got every answer about favicon under the sun haha, and I agree with <M/>... it was most likely cached.

mmcdonald 28 Posting Pro

I've put the public link to my profile, can't it just be a typical URL with the target="_blank" attribute Dani?

mmcdonald 28 Posting Pro

Should be simple right? Well I've been at the PC for 16 hours so far and the answer is probably screaming at me in the face, but I can't hear it...

This code...
$differenceInSeconds = 448005;

if($differenceInSeconds >= "86400"){
    $calcDays = floor($differenceInSeconds / 86400);

    if($calcDays = "1"){
        $daysPlural = "day";
    }else{
        $daysPlural = "days";
    }

    $lastupdate = $calcDays." ".$daysPlural." ago";
}

echo $lastupdate;
Outputs this...
1 day ago
When it should output this...
5 days ago

Any ideas folks? Thanks,
Michael

mmcdonald 28 Posting Pro

Doesn't work for me either, #BugReport :')

mmcdonald 28 Posting Pro

Well I had mine added for 6 months and didn't get one...

(I am taking one for the team!)

I might just ask my 48 indian freelancers to add you now, every 24 hours if you decline, just for the lol's.

mmcdonald 28 Posting Pro

What Linux Distro are you using? There are different settings available to set connection and session timeouts. You could, say, set a timeout to 600 seconds (10 minutes) and have the countdown for each connected session restart when the users intreracts with the web service. Therefore only active users would remain connected.

In Ubuntu, for example, there is a default 30 or 60 second tcp timeout - you can use a similar configuration for closing waste connections.

mmcdonald 28 Posting Pro

Did you manage to get it sorted Ancient? Thanks for the rep mate,

Michael

mmcdonald 28 Posting Pro

Okay I wasn't aware of your requirement. Could you not atleast get the IP from the hostname and use the IP? I have a thing for using IP addresses in links :3

$ipAddress = gethostbyname('http://srv01');

What web service is currently running on srv01? Apache, IIS or? Are you going through any firewalls or proxies?

mmcdonald 28 Posting Pro

Do you currently have access to srv01? Are you able to get a response from the server? Have you used its IP address as recommended rather than its hostname?

mmcdonald 28 Posting Pro

This:
\srv01\CDS\ITEMS\ITEMLIST.xls

Becomes this:
//srv01/CDS/ITEMS/ITEMLIST.xls

Example:
<a href="http://srv01/CDS/ITEMS/ITEMLIST.xls" target="_blank">Item List</a>

If your servers have static IP addresses avoid using hostnames as this will allow the link to continue working even if DNS fails or the host name is changed in the future.

mmcdonald 28 Posting Pro

Sorry for the delay, all works golden now except for bullet points (They indent, but no bullets are visible) I tested some code within the code tags, didnt store anything past '<code>'. Also, the ordered list is just like the bullet points, they indent but no numbers show. Any ideas? Every other formatting feature works fine.

I currently use htmlspecialchars_decode(stripslashes($topicResponseInfo['response'])) to echo my data, and that appears to work perfectly. I'm missing something before I'm executing the store query. I am not currently doing anything before storing except binding. Suggestions dw'ers? Thanks for your assistance so far.

mmcdonald 28 Posting Pro

And the above three posts are exactly WHY you stop programming after the first 15 yawns :')

Cheers guys, let me make some mods and post back

mmcdonald 28 Posting Pro

I have used hostgator for a good 5 years, I abuse them for their unlimited storage :) Not bad for the price. They have the best support, have never gone down, and their live chat guys have any issues solved within minutes. I trust them, which is saying something!

For serious projects and web apps I used http://linode.com and setup my own LAMP stacks on VPS's with either CentOS or Ubuntu 10.04. Their support is bloody fast and well... they know Linux and web hosting better than their own families I'm sure.