All pastes #618978 Raw Edit

Mine

public text v1 · immutable
·published 2007-07-14 10:30 UTC
rendered paste body
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>#scripted dalnet - the premiere place to be</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1252" />
<link rel=stylesheet type=text/css href=../main.css>
<link href="./layouts/gnopaste/gnopaste.css" rel="stylesheet" type="text/css" />

<style>
a:visited { color: black; text-decoration: none; }
a:link { color: black; text-decoration: none; }
a:active { color: black; text-decoration: none; }
<?php

if ($_COOKIE['theme'] == 'red')
{
echo "a:hover { color: #aa0606; text-decoration: underline; font-weight: bold; }";
}
elseif ($_COOKIE['theme'] == 'green')
{
echo "a:hover { color: #06aa0a; text-decoration: underline; font-weight: bold; }";
}
elseif ($_COOKIE['theme'] == 'yellow')
{
echo "a:hover { color: #a8aa06; text-decoration: underline; font-weight: bold; }";
}
elseif ($_COOKIE['theme'] == 'purple')
{
echo "a:hover { color: #8906aa; text-decoration: underline; font-weight: bold; }";
}
elseif ($_COOKIE['theme'] == 'silver')
{
echo "a:hover { color: #B8B8B8; text-decoration: underline; font-weight: bold; }";
}
elseif ($_COOKIE['theme'] == 'grey')
{
echo "a:hover { color: #787878; text-decoration: underline; font-weight: bold; }";
}
elseif ($_COOKIE['theme'] == 'black')
{
echo "a:hover { color: #505050; text-decoration: underline; font-weight: bold; }";
}
else 
{
echo "a:hover { color: #00c0ff; text-decoration: underline; font-weight: bold; }";
}
?>
</style>
<script language="JavaScript" type="text/javascript">
<!--
function highlight(obj) {
    if ( Get_Cookie( 'theme' ) == "purple") {
      obj.style.backgroundColor = "#8906aa";
    }
    else if ( Get_Cookie( 'theme' ) == "red") {
      obj.style.backgroundColor = "#aa0606";
    }
    else if ( Get_Cookie( 'theme' ) == "green") {
      obj.style.backgroundColor = "#06aa0a";
    }
    else if ( Get_Cookie( 'theme' ) == "yellow") {
      obj.style.backgroundColor = "#a8aa06";
    }
    else if ( Get_Cookie( 'theme' ) == "grey") {
      obj.style.backgroundColor = "#787878";
    }
    else if ( Get_Cookie( 'theme' ) == "silver") {
      obj.style.backgroundColor = "#B8B8B8";
    }
    else if ( Get_Cookie( 'theme' ) == "black") {
      obj.style.backgroundColor = "#505050";
    }
    else {
      obj.style.backgroundColor = "#067eaa";
    }
    obj.style.textDecoration = "underline";
    obj.style.color = "white";
}
function Get_Cookie( name ) {
	
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}

function revert(obj) {
    obj.style.backgroundColor = "BLACK";
    obj.style.textDecoration = "none";
    obj.style.color = "silver";
}
//-->
</script>
</head>
<body bgcolor=white topmargin=25 leftmargin=0>
<table align=center width=680 cellpadding=0 cellspacing=0 border=1 bordercolor=black>

<tr>
<td>


<table align=left width=100% height=100% cellpadding=0 cellspacing=0 valign=top>
<tr>

<?php
    /** 
    * $Id $
    * vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
    *
    * This file is part of GNOPASTE
    *
    * @author   GNOPASTE Development Team <devel@ghcif.de>
    * @since    19/01/2005
    * @version  $Revision $
    *
    * Copyright (C) 2004-2007 by ghcif.de <devel@ghcif.de>
    *   
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation; either version 2 of the License, or
    * (at your option) any later version.
    *
    * This program is distributed in the hope that it will be useful, 
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    *
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    */

    /**
    * access check
    */
    define('IN_GNP', 1);
    /**
    * real path
    */
    define('GNP_REAL_PATH', dirname(__FILE__) . '/');
    /**
    * relative path
    */
    define('GNP_RELATIVE_PATH', ((dirname($_SERVER['PHP_SELF']) == '/') ? ('/') : (dirname($_SERVER['PHP_SELF']) . '/')));
    /**
    * url path
    */                  
    define('GNP_URL_PATH', ((!isset($_SERVER['HTTPS'])) ? ('http://') : ('https://')) . $_SERVER['HTTP_HOST'] . GNP_RELATIVE_PATH);
                        
                        
    /**                 
    * basic initialisation
    */                  
    include(GNP_REAL_PATH . 'includes' . DIRECTORY_SEPARATOR . 'common.php');
    include(GNP_REAL_PATH . 'includes' . DIRECTORY_SEPARATOR . 'functions.php');

    if($file_data = template_exists('header.tpl'))
    {
        /**
        * replace vars - header.tpl
        */
        $file_data = preg_replace ("/<#L_ACRONYM#>/", $lang['acronym'], $file_data);
        $file_data = preg_replace ("/<#L_CHARSET#>/", $lang['charset'], $file_data);
        $file_data = preg_replace ("/<#L_PAGE_TITLE#>/", $config['page_title'], $file_data);
        $file_data = preg_replace ("/<#L_SITENAME#>/", $config['site_name'], $file_data);
        $file_data = preg_replace ("/<#RELATIVE_PATH#>/", GNP_RELATIVE_PATH, $file_data);
        $file_data = preg_replace ("/<#SITEURL#>/", GNP_URL_PATH, $file_data);
        /**
        * output - header.tpl
        */







if ($_COOKIE['theme'] == 'red')
{
echo "<td height=140 background=../logo_red.png bgcolor=black valign=middle colspan=11>";
}
elseif ($_COOKIE['theme'] == 'green')
{
echo "<td height=140 background=../logo_green.png bgcolor=black valign=middle colspan=11>";
}
elseif ($_COOKIE['theme'] == 'yellow')
{
echo "<td height=140 background=../logo_yellow.png bgcolor=black valign=middle colspan=11>";
}
elseif ($_COOKIE['theme'] == 'purple')
{
echo "<td height=140 background=../logo_purple.png bgcolor=black valign=middle colspan=11>";
}
elseif ($_COOKIE['theme'] == 'purple')
{
echo "<td height=140 background=../logo_purple.png bgcolor=black valign=middle colspan=11>";
}
elseif ($_COOKIE['theme'] == 'silver')
{
echo "<td height=140 background=../logo_silver.png bgcolor=black valign=middle colspan=11>";
}
elseif ($_COOKIE['theme'] == 'grey')
{
echo "<td height=140 background=../logo_grey.png bgcolor=black valign=middle colspan=11>";
}
elseif ($_COOKIE['theme'] == 'black')
{
echo "<td height=140 background=../logo_black.png bgcolor=black valign=middle colspan=11>";
}
else
{
echo "<td height=140 background=../logo.png bgcolor=black valign=middle colspan=11>";
}










        echo($file_data);
    }
    if(isset($_GET['id']))
    {
        if(preg_match('/^[a-fA-F\d]{10}$/', $_GET['id']))
        {
            $sql = 'SELECT * FROM '.$tbl_prefix.'pastes WHERE cryptid = "'.$_GET['id'].'";';
            $query = mysql_query($sql) OR die(mysql_error());

            if(mysql_num_rows($query) > 0)
            {
                /**
                * output - begin
                */
                
                include(GNP_REAL_PATH . 'includes/highlight.php');
                
                while($row = mysql_fetch_assoc($query))
                {
                    if($file_data = template_exists('output.tpl'))
                    {
                        /**
                        * code highlighting
                        */
                        $parsedname = stripslashes($row['name']);
                        
                        $parsedname = ($parsedname == '0') ? ($lang['user_no_name']) : ($parsedname);
                        
                        $parseddate = date($lang['dateformat'], $row['time']);
                        
                        $description = stripslashes($row['description']);
                        $description = preg_replace("/\n/", "<br />\n", $description);

                        $description = ($description == '0') ? ($lang['user_no_description']) : ($description);
                        
                        $code = htmlspecialchars($row['code']);
                        $codelang = $row['code_lang'];

                        $code = preg_replace("/  /", "&nbsp; ", $code);
                        $code = preg_replace("/</", "&lt;", $code);
                        $code = preg_replace("/>/", "&gt;", $code);
                        $code = syntax_highlight($code, $codelang);
                        
                        $code = str_replace("\t", str_repeat('&nbsp;', $row['tab_length']), $code);
                
                        $explode = explode("\n", $code);

                        $view = (isset($_REQUEST['view'])) ? ($_REQUEST['view']) : ('');

                        switch($view)
                        {   
                            case 'nl':

                                $parsedcode = "<p id=\"codeblock\">\n";

                                for($i = 0; $i < count($explode); $i++)
                                {   
                                    $parsedcode .= $explode[$i] . "<br />\n";
                                }

                                $parsedcode .= "</p>\n";

                                $lineslink_data = ($config['mod_rewrite']) ? (GNP_RELATIVE_PATH . $row['cryptid'] . '.html') : (GNP_RELATIVE_PATH . 'index.php?id=' . $row['cryptid']);
                                $lineslink = sprintf('<a class=downloads href="%s">%s</a>', $lineslink_data, $lang['view_lines']);

                            break;

                            default:

                                $parsedcode = "<ol id=\"codeblock\">\n";

                                for($i = 0; $i < count($explode); $i++)
                                {   
                                    $classnumber = $i % 2;

                                    if(trim($explode[$i]) != '')
                                    {   
                                        $parsedcode .= "    <li class=\"rowstyle" . $classnumber . "\">" . $explode[$i] . "</li>\n";
                                    }
                                    else
                                    {
                                        $parsedcode .= "    <li class=\"rowstyle" . $classnumber . "\">&nbsp;</li>\n";
                                    }
                                }

                                $parsedcode .= "</ol>\n";

                                $lineslink_data = ($config['mod_rewrite']) ? (GNP_RELATIVE_PATH . $row['cryptid'] . '_nl.html') : (GNP_RELATIVE_PATH . 'index.php?id=' . $row['cryptid'] . '&amp;view=nl');
                                $lineslink = sprintf('<a class=downloads href="%s">%s</a>', $lineslink_data, $lang['no_lines']);

                            break;
                        }
                        
                        /**
                        * replace vars - output.tpl
                        */
                        $file_data = preg_replace ("/<#L_USERSETTINGS#>/", $lang['usersettings'], $file_data);
                        
                        $file_data = preg_replace ("/<#L_NAME#>/", $lang['name'], $file_data);
                        $file_data = preg_replace ("/<#S_NAME#>/", $parsedname, $file_data);
                        
                        $file_data = preg_replace ("/<#L_CODELANG#>/", $lang['codelang'], $file_data);
                        $file_data = preg_replace ("/<#S_CODELANG#>/", $row['code_lang'], $file_data);
                    
                        $file_data = preg_replace ("/<#L_TAB_WIDTH#>/", $lang['tab_width'], $file_data);
                        $file_data = preg_replace ("/<#S_TAB_WIDTH#>/", $row['tab_length'], $file_data);
                    
                        $file_data = preg_replace ("/<#L_DATE#>/", $lang['date'], $file_data);
                        $file_data = preg_replace ("/<#S_DATE#>/", $parseddate, $file_data);
                        
                        $file_data = preg_replace ("/<#L_IP#>/", $lang['ip'], $file_data);
                        $file_data = preg_replace ("/<#S_IP#>/", $row['ip'], $file_data);
                        
                        $file_data = preg_replace ("/<#L_DESCRIPTION#>/", $lang['description'], $file_data);
                        $file_data = preg_replace ("/<#S_DESCRIPTION#>/", $description, $file_data);
                        
                        $file_data = preg_replace ("/<#L_CODE#>/", $lang['code'], $file_data);
                        $file_data = str_replace ("<#S_CODE#>", $parsedcode, $file_data);
                        $file_data = str_replace ("<#LNLINK#>", $lineslink, $file_data);
                        
                        /**
                        * output - output.tpl
                        */
                        echo($file_data);
                    }
                }
                
                /**
                * output - end
                */
            }
            else
            {
                /**
                * error - unknown id
                */
                
                if($file_data = template_exists('info.tpl'))
                {
                    /**
                    * replace vars - info.tpl
                    */
                    $file_data = preg_replace ("/<#L_INFOTITLE#>/", $lang['error'], $file_data);
                    $file_data = preg_replace ("/<#L_INFOTEXT#>/", $lang['unknown_id'], $file_data);
                    $file_data = preg_replace ("/<#L_INFOLINK#>/", $lang['back_to_main'], $file_data);

                    $indexlink_data = ($config['mod_rewrite']) ? (GNP_RELATIVE_PATH . 'index.html') : (GNP_RELATIVE_PATH . 'index.php');
                    $file_data = preg_replace ("/<#A_INFOLINK#>/", $indexlink_data, $file_data);

                    /**
                    * output - info.tpl
                    */
                    echo($file_data);
                }
            }
        }
        else
        {
            /**
            * error - unserialized id
            */

            if($file_data = template_exists('info.tpl'))
            {
                /**
                * replace vars - info.tpl
                */                                                                                                      
                $file_data = preg_replace ("/<#L_INFOTITLE#>/", $lang['error'], $file_data);
                $file_data = preg_replace ("/<#L_INFOTEXT#>/", $lang['bad_id'], $file_data);
                $file_data = preg_replace ("/<#L_INFOLINK#>/", $lang['back_to_main'], $file_data);

                $indexlink_data = ($config['mod_rewrite']) ? (GNP_RELATIVE_PATH . 'index.html') : (GNP_RELATIVE_PATH . 'index.php');
                $file_data = preg_replace ("/<#A_INFOLINK#>/", $indexlink_data, $file_data);
                                                                                
                /**
                * output - info.tpl
                */                                                                                                                                              
                echo($file_data);
            }
        }
    }
    else
    {
        if(isset($_POST['submit']))
        {
            /**
            * processing - begin
            */

            $_SESSION['code_lang'] = trim($_POST['code_lang']);
            $_SESSION['tab_length'] = trim($_POST['tab_length']);
            $_SESSION['name'] = trim($_POST['name']);
            $_SESSION['description'] = $_POST['description'];
            $_SESSION['code'] = @$_POST['code'];
                                                                
            if(trim($_SESSION['code']) == '')
            {
                /**
                * error - no code
                */

                if($file_data = template_exists('info.tpl'))
                {
                    /**
                    * replace vars - info.tpl
                    */                                                                                                      
                    $file_data = preg_replace ("/<#L_INFOTITLE#>/", $lang['error'], $file_data);
                    $file_data = preg_replace ("/<#L_INFOTEXT#>/", $lang['empty_code'], $file_data);
                    $file_data = preg_replace ("/<#L_INFOLINK#>/", $lang['back_to_main'], $file_data);

                    $indexlink_data = ($config['mod_rewrite']) ? (GNP_RELATIVE_PATH . 'index.html') : (GNP_RELATIVE_PATH . 'index.php');
                    $file_data = preg_replace ("/<#A_INFOLINK#>/", $indexlink_data, $file_data);
                                                                
                    /**
                    * output - info.tpl
                    */                                                                                                                                              
                    echo($file_data);
                }
            }
            else
            {
                $codelang = (in_array($_SESSION['code_lang'], $language)) ? ($_SESSION['code_lang']) : ('Plain Text');
                $tablength = (is_numeric($_SESSION['tab_length']) AND $_SESSION['tab_length'] >= 0 AND $_SESSION['tab_length'] <= 9) ? ($_SESSION['tab_length']) : ($config['std_tab']);
                $name = ($_SESSION['name'] == '') ? (0) : (addslashes(htmlspecialchars($_SESSION['name'])));
                $description = (trim($_SESSION['description']) == '') ? (0) : (addslashes(htmlspecialchars($_SESSION['description'])));
                $code = addslashes($_SESSION['code']);

                $crypt_id = substr(md5(microtime()),0,10);

                $sql = 'INSERT INTO '.$tbl_prefix.'pastes (cryptid, name, description, code, tab_length, code_lang, time, ip) VALUES ("'.$crypt_id.'", "'.$name.'", "'.$description.'", "'.$code.'", "'.$tablength.'", "'.$codelang.'", UNIX_TIMESTAMP(), "'.$_SERVER['REMOTE_ADDR'].'");';
                mysql_query($sql) OR die(mysql_error());

                $cookiename = ($name == '0') ? ('') : ($name);
                setcookie('gnopaste_name', base64_encode($cookiename), time()+3600, '/', $_SERVER['SERVER_NAME'], 0);

                if($file_data = template_exists('info.tpl'))
                {
                    /**
                    * replace vars - info.tpl
                    */                                                                                                      
                    $file_data = preg_replace ("/<#L_INFOTITLE#>/", $lang['saved'], $file_data);
                    $file_data = preg_replace ("/<#L_INFOTEXT#>/", $lang['saved_text'], $file_data);

                    $pastelink_data = ($config['mod_rewrite']) ? (GNP_URL_PATH . $crypt_id . '.html') : (GNP_URL_PATH . 'index.php?id=' . $crypt_id);
                    $file_data = preg_replace ("/<#L_INFOLINK#>/", $pastelink_data, $file_data);

                    $pastelink_data = ($config['mod_rewrite']) ? (GNP_RELATIVE_PATH . $crypt_id . '.html') : (GNP_RELATIVE_PATH . 'index.php?id=' . $crypt_id);
                    $file_data = preg_replace ("/<#A_INFOLINK#>/", $pastelink_data, $file_data);

                    /**
                    * output - info.tpl
                    */                                                                                                                                              
                    echo($file_data);
                }

                session_destroy();
            }
        
            /**
            * processing - end
            */
        }
        else
        {
            /**
            * form - begin
            */
        
            if($file_data = template_exists('form.tpl'))
            {
                if(isset($_COOKIE['gnopaste_name'])) {
                    $_SESSION['name'] = stripslashes(base64_decode($_COOKIE['gnopaste_name']));
                }
                
                /**
                * replace vars - form.tpl
                */
                $file_data = preg_replace ("/<#L_CODELANG#>/", $lang['codelang'], $file_data);
                $file_data = preg_replace ("/<#L_TAB_WIDTH#>/", $lang['tab_width'], $file_data);
                $file_data = preg_replace ("/<#L_NAME#>/", $lang['name'], $file_data);
                $file_data = preg_replace ("/<#L_DESCRIPTION#>/", $lang['description'], $file_data);
                $file_data = preg_replace ("/<#L_CODE#>/", $lang['code'], $file_data);
                $file_data = preg_replace ("/<#L_POSTBUTTON#>/", $lang['postbutton'], $file_data);
                $file_data = preg_replace ("/<#L_SENDING#>/", $lang['sending'], $file_data);
                
                $file_data = preg_replace ("/<#S_LANG_OPTION#>/", $lang_option, $file_data);
                $file_data = preg_replace ("/<#S_TAB_OPTION#>/", $tab_option, $file_data);
                $file_data = preg_replace ("/<#S_NAME#>/", $_SESSION['name'], $file_data);
                $file_data = preg_replace ("/<#S_DESCRIPTION#>/", $_SESSION['description'], $file_data);
                $file_data = preg_replace ("/<#S_CODE#>/", $_SESSION['code'], $file_data);
                
                $file_data = preg_replace ("/<#L_USERSETTINGS#>/", $lang['usersettings'], $file_data);

                $indexlink_data = ($config['mod_rewrite']) ? (GNP_RELATIVE_PATH . 'index.html') : (GNP_RELATIVE_PATH . 'index.php');
                $file_data = preg_replace ("/<#RELATIVE_PATH_WITH_INDEX#>/", $indexlink_data, $file_data);

                /**
                * output - form.tpl
                */
                echo($file_data);
            }
        
            /**
            * form - end
            */
        }
    }
    if($file_data = template_exists('footer.tpl'))
    {
        $mtime = microtime();
        $mtime = explode(" ",$mtime);
        $mtime = $mtime[1] + $mtime[0];
        $endtime = $mtime;
        $gentime = round(($endtime - $starttime), 3).'s';

        /**
        * replace vars - footer.tpl
        */
        $file_data = preg_replace ("/<#L_FOOTER#>/", stripslashes($config['copyright']), $file_data);
        $file_data = preg_replace ("/<#GENERATED_IN#>/", $lang['generated'].' '.$gentime, $file_data);
        $file_data = preg_replace ("/<#GNOPASTE_VERSION#>/", $config['gnopaste_version'], $file_data);
        
        /**
        * output - footer.tpl
        */






echo "<br>";
echo "<a href=http://www.sf.net/projects/gnopaste>gnopaste</a>";


echo "</td>";
echo "</tr>";
echo "</table>";

echo "<br>";

echo "</td>";
echo "</tr>";
echo "</table>";

echo "<tr>";

if ($_COOKIE['theme'] == 'red')
{
echo "<td class=caption_red align=center colspan=11>";
}
elseif ($_COOKIE['theme'] == 'green')
{
echo "<td class=caption_green align=center colspan=11>";
}
elseif ($_COOKIE['theme'] == 'yellow')
{
echo "<td class=caption_yellow align=center colspan=11>";
}
elseif ($_COOKIE['theme'] == 'purple')
{
echo "<td class=caption_purple align=center colspan=11>";
}
elseif ($_COOKIE['theme'] == 'silver')
{
echo "<td class=caption_silver align=center colspan=11>";
}
elseif ($_COOKIE['theme'] == 'grey')
{
echo "<td class=caption_grey align=center colspan=11>";
}
elseif ($_COOKIE['theme'] == 'black')
{
echo "<td class=caption_black align=center colspan=11>";
}
else
{
echo "<td class=caption align=center colspan=11>";
}



        echo($file_data);





    }
    /**
    * stop buffering
    */
    $contents = ob_get_contents();
    ob_end_clean();
    echo($contents);
?> 

<?php 

/*************************************************************************** 
 *                            counter.php 
 *                            ---------------- 
 *   version              : version 1.0 
 *   begin                : July 29,  2003 
 *   copyright            : Jive Networks Resources 
 *   website              : http://www.jivenetworks.info 
 * 
 * 
 * 
 ***************************************************************************/ 


$ip = getenv("REMOTE_ADDR"); 
$name = "../logger.txt"; 

$fo = fopen($name,  "r"); 
$fr = fread($fo,  filesize($name)); 
fclose($fo); 

if(strstr($fr,  $ip)){ 

$file = file($name); 
$unique = array_unique($file); 
$hits = count($unique) - 1; 
$counter = "$hits"; 
print $counter; 

} else { 

$fp = fopen($name,  "w"); 
$fadd = $fr."\n".$ip; 
$fw = fwrite($fp,  $fadd); 
fclose($fp); 

} 

?>

 hits, copyright 2007 #scripted dalnet. all rights reserved.&nbsp;&nbsp;
</td>
</tr>

</tr>
</table>




</body>
</html>