n3paste.de

::

a haskell happstack pastebin

  • New paste
  • View pastes

  • Login

  • About
  • Most recent pastes (filtered)

    Filter pastes (help):

    21:40 - Thu 2017.02.09

    PHP

    Paste: /db0q/Show related

    No description.

    <?php
    	print("Hello world!");
    ?>
    

    14:29 - Sat 2016.12.24

    PHP

    Paste: /nTc/Show related

    No description.

    <?php
    $ordner="a-start";
    $titel="nanocamp-Audio";
    $erstellung=date('Y-m-d');
    $ablauf=date('D, d M Y', strtotime('+1 week'));
    $suchwort="musik, philips, cd, cdm, cdm1, tda, 1540, 1541, 100, 104, 204, 304, cd100, non, oversampling, klein, cd104, cd204, cd304, simultan, i2s, spieler, tda1541a, tda1540 ";
    $beschreibung="Institut für Musikapparatekunst";
    
    $sites = array(
        "versand" => array(
            "titel" => "Verpackung und Versand",
            "ordner"=>"a-versand",
            "suchwort"=> "",
            "beschreibung" => "Richtige Verpackung des CD-Spielers"),
        "impressum" => array(
            "titel" => "Impressum",
            "ordner"=>"a-impressum",
            "suchwort"=> "nano, camp",
            "beschreibung" => "nanocamp Impressum"),
        "bier" => array(
    

    14:17 - Sat 2016.12.24

    PHP

    Paste: /m2po/Show related

    No description.

    <?php
    $ordner="a-start";
    $titel="nanocamp-Audio";
    $erstellung=date('Y-m-d');
    $ablauf=date('D, d M Y', strtotime('+1 week'));
    $suchwort="musik, philips, cd, cdm, cdm1, tda, 1540, 1541, 100, 104, 204, 304, cd100, non, oversampling, klein, cd104, cd204, cd304, simultan, i2s, spieler, tda1541a, tda1540 ";
    $beschreibung="Institut für Musikapparatekunst";
    
    $sites = array(
        "versand" => array(
            "titel" => "Verpackung und Versand",
            "ordner"=>"a-versand",
            "suchwort"=> "",
            "beschreibung" => "Richtige Verpackung des CD-Spielers"),
        "impressum" => array(
            "titel" => "Impressum",
            "ordner"=>"a-impressum",
            "suchwort"=> "nano, camp",
            "beschreibung" => "nanocamp Impressum"),
        "bier" => array(
    

    19:03 - Tue 2016.08.16

    PHP

    Paste: /C70/Show related

    /etc/httpd/conf/extra/httpd-wordpress.conf

    Alias /myblog "/home/jamie/public_html/wordpress"
    <Directory "/home/jamie/public_html/wordpress">
    	AllowOverride All
    	Options FollowSymlinks
    	Require all granted
    	php_admin_value open_basedir "/srv/:/tmp/:/usr/share/webapps/:/etc/webapps:/mnt/data/srv:/home/jamie/public_html:$"
    </Directory>
    

    19:03 - Tue 2016.08.16

    PHP

    Paste: /FCzz/Show related

    /etc/httpd/conf/extra/httpd-wordpress.conf

    Alias /myblog "/home/jamie/public_html/wordpress"
    <Directory "/home/jamie/public_html/wordpress">
    	AllowOverride All
    	Options FollowSymlinks
    	Require all granted
    	php_admin_value open_basedir "/srv/:/tmp/:/usr/share/webapps/:/etc/webapps:/mnt/data/srv:/home/jamie/public_html:$"
    </Directory
    

    23:32 - Tue 2015.05.05

    PHP

    Paste: /8V2/Show related

    php

    	static function addRelation($acc1, $acc2)
    	{
    		$core = self::getCoreNode($acc1);
    		$query = "INSERT INTO account_relations VALUES('".$core."', '".$acc2."', 'test')";
    		MySQLMgr::executeUpdate($query);
    	}
    
    	static function getCoreNode($acc)
    	{
    		$query = "SELECT id1 FROM account_relations WHERE id2 = '".$acc."'";
    		$result = MySQLMgr::executeSingle($query, false);
    		if (!$result)
    			return($acc);
    		else
    			return(self::getCoreNode($result));
    	}
    

    10:25 - Tue 2014.01.21

    PHP

    Paste: /kU/Show related

    Implementation of hook_install

    <?php
    
    function hkl_product_install(){
    
        dpm(__FUNCTION__);
    
        $product_large = image_style_save(array(
            'name' => 'product_large',
            'label' => 'Product Large',
        ));
    
        $scale = array(
            'name' => 'image_scale',
            'data' => array(
                'width' => 465,
                'height' => '',
                'upscale' => 1,
            ),
    
            'isid' => $product_large['isid'],
    

    13:32 - Mon 2013.09.09

    PHP

    Paste: /oe/Show related

    feedhash.module

    <?php
    
    function feedhash_aggregator_process($feed){
    
        foreach($feed->items as $item){
    
            $feedhash = feedhash_load($item['guid']);
            $hash = md5($item['description']);
    
    
            if($item['guid'] && (!$feedhash || ($hash != $feedhash['hash'] && !$feedhash['frozen']))){
    
                if($feedhash){
    
                    $feedhash['hash'] = $hash;
    
                    $updated = db_update('aggregator_item')
                        ->fields(array(
                            'description' => $item['description']
                        ))
    

    09:00 - Wed 2013.08.14

    PHP

    Paste: /Zck9/Show related

    No description.

    <?php
    /*
     * Load a single product by barcode
     *
     */
    function inventory_product_by_barcode($barcode){
    
        $query = new EntityFieldQuery();
        $res = $query   ->entityCondition('entity_type', 'commerce_product')
                        ->fieldCondition('field_barcode', 'value', $barcode)
                        ->execute();
    
        if(count($res)){
            if(isset($res['commerce_product']) && count($res['commerce_product'])){
                if(($p =  array_pop($res['commerce_product'])) && ($p = commerce_product_load($p->product_id))){
                    return $p;
                }
            }
        }
    
    

    20:46 - Sat 2013.05.04

    PHP

    Paste: /nlt/Show related

    loginbox

    function print_loginbox()
    {
        echo <<<HTML
        <table class="centered" width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
            <tr>
                <form name="form1" method="post" action=\"admin/checklogin.php\">
                <td>
                <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
                <tr>
                    <td colspan="3"><strong>Login </strong></td>
            </tr>
         <tr>
             <td width="78">Username</td>
             <td width="6">:</td>
             <td width="294"><input name="username" type="text" id="username"></td>
         </tr>
         <tr>
             <td>Password</td>
            <td>:</td>
            <td><input name="password" type="password" id="password"></td>
    

    12:27 - Fri 2013.03.22

    PHP

    Paste: /B1H/Show related

    Drupal STAHP

    <?php
    
      // This works
      $res = db_query('SELECT nid FROM {node} WHERE type=\'video\' AND status = 1 AND NOT nid in (:blacklist) ORDER BY created LIMIT 10',
      array(
        ':blacklist' => $blacklist,
      ));
    
      // This doesn't
      $res = db_query('SELECT nid FROM {node} WHERE type=\'video\' AND status = 1 AND NOT nid in (:blacklist) ORDER BY created LIMIT :limit',
      array(
        ':blacklist' => $blacklist,
        ':limit' => 10,
      ));
    

    09:27 - Tue 2013.03.05

    PHP

    Paste: /A5/Show related

    Implementation of hook_theme

    function multicolor_theme($existing, $type, $theme, $path){
    
      return array(
        'multicolor_formatter' => array(
          'variables' => array(
            'entity_type' => '',
            'entity' => NULL,
            'delta' => -1,
            'item' => array(),
            'template' => 'multicolor',
          ),
        ),
      );
    }
    

    14:00 - Thu 2013.02.28

    PHP

    Paste: /fLa/Show related

    fuck up ALL THE BLOCKS

    function mediaprint_block($op = 'list', $delta = 0, $edit = array()){
    
      if($op == 'list'){
    
        return array(
          'supercategories' => array(
            'info' => 'Product supercategories',
          ),
        );
    
      } elseif($op == 'view'){
        dpm('view block');
        if($delta == 'supercategories'){
    
          /*$res = db_query('SELECT nid FROM {node} WHERE type = "category" AND status = 1');
    
          $nodes = array();
          while($row = db_fetch_array($res)){
            $node = node_load($row['nid']);
            $nodes[$row['nid']] = $node;
    

    16:42 - Wed 2012.12.19

    PHP

    Paste: /J2DM/Show related

    asdasd

    <div class="control-group">
    		{{ Form::label('goals', 'Goal(s)', array('class'=>'control-label'))}}
    		<div class="controls">
    			<div>
    				@foreach($goals as $goal)
    				<label class="checkbox">
    				{{ Form::checkbox('goals[]', $goal->id, in_array($goal->id, Input::old('goals', array()))) . ' ' . $goal->name }}
    				</label>
    				@endforeach
    			</div>
    		</div>
    	</div>
    

    15:42 - Wed 2012.11.28

    PHP

    Paste: /bkhy/Show related

    Failing module

    <?php
    
    function witten_menu(){
      $items = array();
    
      $items['kanzlei/kanzleileitung'] = array(
        'title' => 'Kanzleileitung',
        'page callback' => 'witten_page_kanzleileitung',
        'access arguments' => array('accesss content'),
        'type' => MENU_CALLBACK,
      );
    
      return $items;
    }
    
    
    function witten_page_kanzleileitung(){
    
      $build = array(
        'items' => array(),
    

    12:03 - Tue 2012.10.30

    PHP

    Paste: /EfL/Show related

    php lessons in østfold

    <?
    function addName ($name) {
            $fh = fopen('names.txt','a');
    
            $pad = '                                                                                 ';
            $padded = $name . $pad;
            $clip = substr($padded,0,50);
    
            fwrite($fh,$clip);
            fclose($fh)
    
            $fs = filesize('$names.txt');
    
            $i = $fs / 50 -1;
    
            return $i;
    }
    ?>
    

    10:54 - Tue 2012.10.16

    PHP

    Paste: /DS/Show related

    No description.

    <?php
     $tall1=rand();
     $tall2=rand();
    
     $svar1=$tall1+$tall2;
     $svar2=$tall1-$tall2;
     $svar3=$tall1*$tall2;
     $svar4=$tall1/$tall2;
    
     $svar= array($svar1, $svar2, $svar3, $svar4);
     $tegn= array('+','-','*','/');
     $randNum=rand(0,1,2,3);
    
     echo 'hva blir svaret på' , $tall1 $tegn[$randNum] $tall2 '?';
    ?>
    

    16:01 - Tue 2012.08.28

    PHP

    Paste: /Cdd/Show related

    blargh

    function errorMessage($code)
    {
      define_syslog_variables();
      openlog( "VORLESUNGSVERWALTUNG", LOG_PID | LOG_NDELAY, LOG_LOCAL0 );
      syslog( LOG_WARNING, "Errorcode: $code, Client: $REMOTE_ADDR ($HTTP_USER_AGENT)");
      switch($code)
      {
        case 100 : die("Es ist ein interner Fehler beim Zugriff auf die Datenbank aufgetreten. Bitte klicken Sie auf 'erneut Laden'. Wenn der Fehler bestehen bleibt, wenden Sie sich bitte an den Administrator");
        case 101 : die("Es konnte keine Verbindung zur Datenbank hergestellt werden. Bitte wenden Sie sich an den Administrator");
        case 123 : return true; # fuer Spezifikation
        case 200 : die("Sie sind nicht berechtigt, diese Funktion aufzurufen.");
        case 201 : die("Der angegebene Benutzer exisitert nicht. Bitte klicken Sie auf 'zur&uuml;ck' und versuchen es noch einmal.");
        case 202 : die("Ihre Sessiondaten sind ungueltig. Bitte loggen Sie sich neu ein");
        case 203 : die("Es ist ein interner Fehler aufgetreten. Bitte wenden Sie sich an den Systemadministrator.");
        case 204 : die("Sie haben keine Befugnis diese Abgabe einzusehen oder zu ver&auml;ndern.");
        default : die("Unbekannter Fehler. Bitte wenden Sie sich den Systemadministrator.");
      }
    }
    

    22:14 - Wed 2012.06.20

    PHP

    Paste: /gfu5/Show related

    news

    <?php
    // @File:	core.php
    // @Author:	Luca Derderian
    // @Descr:	Create new news-entry and save it
    
    // Checks if user is logged on correctly
    
    // uncomment this for debugging
    error_reporting(E_ALL|E_STRICT);
    
    // important configuration
    $syscheck = 'XXXXXXXXXX';
    require_once('../config.php');
    require_once('core.php');
    
    if (!$_POST)
    {
    	// show form
    	$page['content'] = file_get_contents('new_tpl.html');
    	$page['content'] = preg_replace('~\{\{form_action\}\}~', $_SERVER['PHP_SELF'], $page['content']);
    

    09:14 - Tue 2012.05.15

    PHP

    Paste: /mj/Show related

    phpdocumentor is magic

    <?php
    
    /**
     * OMG PWNIES
     *
     * This is a test file to properly try out phpdoc.
     * It serves no practical purpose.
     *
     * @author phryk <input@phryk.net>
     * @license http://sam.zoy.org/wtfpl WTFPL
     */
    
    
    /**
     * Define pony.
     *
     * A pony has three properties:
     * * A name
     * * A cutiemark (or more to cover the case of cutiepox)
     * * An array of friends