Jump to content

mlin

Members
  • Posts

    91
  • Joined

  • Last visited

Posts posted by mlin

  1. rameshfaj: that looks like a subquery rather than a join.

     

    the l and i are aliases to reference that tables your selecting from. they get defined in the from line of the query...ie: logger l, identities i

     

    if you replace your 1st query, with the query I posted earlier, you should have everything you need in one resultset. You can then get rid of the 2nd query inside your loop and work with the results as normal.

     

    On 2nd look, I do have a couple columns missing from the query I posted for your script. be sure to add referer and time to the select line of the query. Use the aliases. l == logger table, and i == identities table

  2. I've played around with ajax chat a bit, but I don't really have a working solution that I'm happy with.

     

    This is gonna be buggy and once you get in the code it should be overly dirty, yet as simple as I could keep it.

     

    I had planned on cleaning it up, fixing the bugs and then posting, but here it is...

     

    http://linardy.com/chat/

     

    I still haven't even taken my own advice to slow down the setTimeout calls when a user has been idle for a certain amount of time. If I were you, I'd move the setTimeout function call to the callback function and do a bit of work to determine how long until the next call. The more amount of time since the user's last action, the longer the Interval. If they've been idle way too long for your taste...provide some sort of feedback letting them know they've timed out with a link or something to get back and dont set the next interval to happen until the user provides some sort of action (post, refresh, js_link, etc...)

     

    I haven't touched the code for a couple months and was just waiting for a bit more time to fool around with it. consider it lgpl and do whatever you want with it.

     

    good luck!

  3. Yeah, I just mention'd *nix since if they no longer need office, they might as well abandon winblows for something that owns 99% of server market for a reason. And *nix distros are usually free as in speech, you can do anything you want...even modify their programs. Since when did you have access to source code for stuff that matters on a proprietary system.

  4. check your computer means run virus/malware scans to try to get rid of anything you don't want.

     

    Advanced users don't usually think they know what an infected system looks like (zero-day exploits, etc...), but if you know what a Clean system should look like...you can catch most garbage manually using hijackThis (ask google)

     

    Or, you could Abandon winblows for a better platform ;) debian, ubuntu, and gNewSense all rock. All free of fee, but gNewSense is completely free as in speech. Have a look around. They're all also easy to dual boot so that you can dev on a *nix system, and still have winblows there for your games.

  5. instead of saving the temp config files on your server's disk, consider reading the file to the browser as a dl rather than presenting a link.

     

    In the long run it'll be easier on you, and your users (eliminating the click step. The user will submit the form and file will be read to their browser as a download)

  6. javascript has the style stuff...umm

     

    say you've got:

     

    <a onclick='change_style();'>Change Style</a>

     

    <div id='styleable'>

      bunch of text...

    </div>

     

    you can define your js function like so:

     

    function change_style() {

      var div = document.getElementById('styleable');

      div.style.font-weight = 'bold';

      div.style.color = 'grey';

    }

     

    so once the link is clicked, the styles of the div id'd as styleable will be changed to bold and grey text. Most CSS can be manipulated dynamically the same way ;)

     

    hope that helps ;)

     

  7. "HTML pages but setting the content type to a word document"

     

    that's probably the best answer you can get, but don't work too hard on it since MS doesn't conform to standards therefore word will expect the html to be MS way, not the right way.

     

    Install office and keep on going, or better yet, go *nix and create pdf's?

  8. return will ALWAYS end your function and Return the value you asked it to.

     

    Without reading the entire thread...this looks like what your looking for:

     

    function get_post_vars() {

        foreach ($_POST as $v) {

                $post = $v;

        }

     

        return (isset($post) ? $post : false;

    }

     

    that way you'll go loop through the entire array and return After the loop rather than return on the 1st value. the ternary(spelling?) operators help to quickly return false if post hasn't been set at all due to an empty $_POST superglobal

     

    hope that helps ;) but to tell you the truth I think your either overthinking it, or your sacrificing a bit of performance in order to make your code look better to yourself, but not necessarily for the next developer to help you with your app.

  9. In the sense your thinking of...no (say that since we've all been there ;))

     

    Your gonna have to read your file into a variable. Set another var with the content you'd like at the beginning of your file, and concantenate them together, then rewrite the file.

     

    $old_file = file_get_contents(...);

    $new_stuff = '...';

     

    $file = $new_stuff . "\n" . $old_file;

     

    //rewrite the file

     

    best we get for flat files, but that goes for most scripting languages. Even if there is some magic function in other languages, this is probably the process when you get down to the meat and potatoes.

     

    beaten to it again...gotta stop being so longwinded ;)

  10. It means that your using too much memory. Personally I've never run into this issue, but there are ini variables you can use to allocate more memory to php.

     

    in your php.ini file, look for memory_limit and up it's value to something that will work for your app is one way you could get around it, but should be last resort.

     

    I really think your app could be optimized one way or another to avoid this error. If you can, post the code so we can have a look.

×
×
  • 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.