Virtual pets and Sim games community

Would you like to become a member of the most successful virtual pets and sim games community on the internet? Virtual pet list has been opened since 2011 and we've been providing game developers(owners), artists, players and writers with the most relevant, up to date, quality and in depth content covering the entire online pet games, sim games and browser based games industry. So, if if you're interested in discussing virtual pet games, game development or online sims, our flourishing forum is perfect for you. Our sneak peeks forum is designed for new owners to showchase their upcoming in development games.

You can learn how to manage, make money and learn all aboutonline pet game management or discuss the best ways of developing a sim game. Find new sites to play in our online games directory. Currently, there's a total of over 80 pet games and over 70 sim games in our directory. So, feel free to post a review, a comment, or leave a like on any online game that we have listed. If you like a game that we have listed, please help us out by sharing it on social media.

  1. An upcoming virtual pet site that's owned by one of our moderators, Pepper-headIn icey them pet game Kaylune, a virtual pet site Breed online pet eliyo
    Managed Web Hosting by Liquid Web breed horses on this very active sim game

    Browse our Online Games Directory
    Admin and webmasters community - Browser games Beastkeeper
    Gaming Reinvented

Coding problem, help needed

Discussion in 'Programming General' started by Hituro, Jun 1, 2012.

  1. Okay, I have a coding problem I just can't get my head around, so I thought I would throw it out there and see if anyone has any ideas.
    origins virtual pet site origins kickstarter
    When you load a page on Grophland you may get one or more random events. Some of these events require complex CSS. Since they can appear on any page the CSS is in the main site CSS, taking up pointless room, so I want it out of there. However events are triggered by including a script (events.php) *after* the header file, so CSS for the page is already set. This means I can't remove the CSS to optional stylesheets.

    Now I can move generation of events to earlier in the process, before the header is sent, so I can use optional CSS. However not every page shows events. This means if I generate events before the rest of the page loads then they may not actually get displayed on that page, which could mean some important notification being missed. I don't want to go and change every page (out of hundreds) to pass some value saying they are, or are not, going to display events and messages, but I can't see how else to avoid generating the events on pages that won't show them.

    Any ideas?
    origins virtual pet site origins kickstarter

    Your banner/button can be located here for an entire month or year, please see our advertising on virtualpetlist thread for more information.

  2. Can you not take the events css out of the header and have it only display if you do have a random event on the page?
  3. Style tags can work in the body, it's not that big of a deal. If you must be politically correct then make the CSS inline and use an older DOCTYPE. Echo it in the same block as the HTML of the actual event itself. Every unnecessary byte adds up to quite a bit when it comes to mobile phones or your site's bandwidth.

  4. That might be the best idea, can I do an inline style with an @import?
  5. Bundle all your css-files to one, compress and timestamp/hash-mark it, thus the browser can do proper caching. You have PLENTY of whitespace and each single asset increases load time.

    This is how we do in our production enviroment:

    There are tools out for this kind of stuff. Luckily, Rails does this automagically for me. However, you might also take look at SASS

Share This Page

  • About VPL, the #1 forum for pet sites, and online sims

    We are an online community of passionate artists, writers, game developers and general users who have a vested interest in virtual pet games, game dev & sim games. Our members are from different backgrounds and yet we group together with one goal, to ensure our pet games, game dev, and sims forum is one of the best!
  • Like VPL on Facebook!

  • Support VPL

    If you love our community and you'd like to help us cover our monthly costs, we'd greatly appreciate it if you could help us out by supporting us! If you can't donate, we totally understand. You can also support us by using our social media sharing buttons or by writing about us on other sites.

    Donate to VPL!