Programación Web

De JarfilWiki

Contenido

MySQL x.x

username length

b2evolution 2.0.2

Trackbacks for meneame.net - mixed post+get

diff --git a/inc/comments/_trackback.funcs.php b/inc/comments/_trackback.funcs.php
index 4ca6fc2..33793de 100644
--- a/inc/comments/_trackback.funcs.php
+++ b/inc/comments/_trackback.funcs.php
@@ -82,7 +82,7 @@ function trackback(
        // echo "url:$trackback_url
$sending:$query_string
"; $result = ; - if (strstr($trackback_url, '?')) + if (strstr($trackback_url, '?') && ! strstr($trackback_url, 'meneame.net') ) { echo '[get]'; $trackback_url .= "&".$query_string;; @@ -112,7 +112,9 @@ function trackback( if( ! empty($trackback_url['host']) && ! empty($trackback_url['path']) ) { // Only try trackback if we have host and path: $port = isset($trackback_url['port']) ? $trackback_url['port'] : 80; - $http_request = 'POST '.$trackback_url['path']." HTTP/1.0\r\n"; + $http_request = 'POST '.$trackback_url['path']; + $http_request .= isset($trackback_url['query']) ? '?'.$trackback_url['query'] : ; + $http_request .=" HTTP/1.0\r\n"; $http_request .= 'Host: '.$trackback_url['host']."\r\n"; $http_request .= 'Content-Type: application/x-www-form-urlencoded'."\r\n"; $http_request .= 'Content-Length: '.strlen($query_string)."\r\n";

Category URL names unique per-blog

  • $allow_cross_posting <= 2 => unique per-blog
  • $allow_cross_posting > 2 => unique per-system

SQL

ALTER TABLE `evo_categories` DROP INDEX `cat_urlname` 

conf/_admin.php

$allow_cross_posting = 1;

inc/chapters/model/_chapter.class.php

     /*
     if( Chapter::urlname_exists( $this->urlname, $this->ID ) )
     { // urlname is already in use
       param_error( 'cat_urlname', T_('This URL name is already in use by another category. Please choose another name.') );
     }
     */

inc/chapters/model/_chaptercache.class.php

 function & get_by_urlname( $req_urlname, $halt_on_error = true, $blog_ID = null )
 {
   global $DB, $Debuglog;

   if( !isset( $this->urlname_index[$req_urlname] ) )
   { // not yet in cache:
     // Load just the requested object:
     $Debuglog->add( "Loading $this->objtype($req_urlname) into cache" );
     $sql = "SELECT *
               FROM $this->dbtablename
              WHERE cat_urlname = ".$DB->quote($req_urlname);
     if ( $blog_ID !== null )
     {
       $sql .= " AND cat_blog_id = $blog_ID";
     }

inc/_blog_main.inc.php

         /**
          * @var Chapter
          */
         $Chapter = & $ChapterCache->get_by_urlname( $last_part, false, $blog->ID );
         if( empty( $Chapter ) && ( $Blog->ID !== null ) && ( $allow_cross_posting > 2 ) )
         { // We could not match a chapter in the current blog...
           // We are going to check for crossposted categories.
           $ChapterCache->clear();
           $Chapter = & $ChapterCache->get_by_urlname( $last_part, false );
         }

b2evolution 1.8.2

fallan permalinks al actualizar de 1.7

Sustituir por: $Item->permanent_url()

falla autor al actualizar de 1.7

Sustituir por: $Item->author()

SPAM de trackback

Renombrar htsrv/trackback.php a otra cosa, por ejemplo htsrv/trackback_123456.php

grep trackback.php * -R

Sustituir en:

  • inc/MODEL/items/_item.class.php
  • inc/_misc/_obsolete092.php

CAPTCHA de gatitos

  • skins/_feedback.php
  • htsrv/comment_post.php

jfcaptcha_plugin

Gravatar

  • skins/_lastcomments.php
  • skins/_feedback.php
  • inc/MODEL/skins/_skin.funcs.php - skin_base_tag($do_echo = true)

if (!$do_echo) { return $base_href; else { base_tag( $base_href ); }

MediaWiki 1.7.1

fallan los scripts de maintenance/*

  • Solución: Asegurarse de que se usa PHP 5. En Dreamhost: /usr/local/php5/bin/php

falla maintenance/rebuildImages.php

  • Solución: Comprobar que en LocalSettings.php están definidos $wgDBadminuser y $wgDBadminpassword.

falla rescalado de imágenes (chmod)

--- includes/Image.php.old       2008-02-08 01:56:51.000000000 +0100
+++ includes/Image.php   2008-02-08 01:55:05.000000000 +0100
@@ -1182,6 +1182,7 @@
                        wfProfileIn( 'convert' );
                        $err = wfShellExec( $cmd, $retval );
                        wfProfileOut( 'convert' );
+                       chmod($thumbPath, 604);
                } elseif( $wgCustomConvertCommand ) {
                        # Use a custom convert command
                        # Variables: %s %d %w %h

phpBB 3.0

Usar otro dominio para el nombre de servidor Jabber

  • Motivación: establecer un servidor jabber en una IP distinta a la del servidor web.
  • Problema: phpBB 3.0 incluye class.jabber.php, que no soporta la detección de SRV _xmpp-server._tcp.dominio
  • Solución:

En el fichero includes/functions_jabber.php hay que cambiar la línea:

if ($this->connector->open_socket("jabber." . $this->server, $this->port))

o, directamente:

if ($this->connector->open_socket("jabber.dominio", $this->port))

SquirrelMail 1.4.x

  • Problema: al responder un mensaje en UTF-8 desde un idioma con charset ISO-8859-1, la respuesta se muestra sin conversión
  • Solución:
config/config.php
 $default_charset = 'utf-8'; 

cp -p functions/i18n.php functions/i18n.php.old
cat functions/i18n.php.old |
 sed "s/CHARSET.. *=.*/CHARSET'] = 'utf-8';/" |
 sed -r "s/\['([^']*)'\]\['LOCALE'\].*;/['\1']['LOCALE']\t= array('\1.UTF-8','\1');/" |
 sed "s/,'uk_UA'/,'uk_UA','uk'/;s/'ka.UTF8','ka.UTF-8','ka'/'ka_GE.UTF-8','ka_GE','ka'/" > functions/i18n.php

USDA SR20

United States Department of Agriculture - Nutrient Database Standard Reference 20

Query: tryptophan content

SELECT FOOD_DES.Long_Desc, NUT_DATA.Nutr_Val, NUTR_DEF.Units
FROM NUT_DATA
 LEFT JOIN FOOD_DES ON (FOOD_DES.NDB_No = NUT_DATA.NDB_No)
 LEFT JOIN NUTR_DEF ON (NUTR_DEF.Nutr_no = NUT_DATA.Nutr_no)
WHERE NUT_DATA.Nutr_No = 501
 AND NUT_DATA.Nutr_val > 0.2
 AND FOOD_DES.Long_Desc NOT LIKE "%dried%"
 AND FOOD_DES.Long_Desc NOT LIKE "%concentrate%"
 AND FOOD_DES.Long_Desc NOT LIKE "%flour%"
 AND FOOD_DES.Long_Desc NOT LIKE "%isolate%"
ORDER BY NUT_DATA.Nutr_Val DESC
Herramientas personales