ActionApps

Migrando bases de datos con charset

mysql -uroot -p --default-character-set=utf8 asocam < asocam_db.sql

Juegos de caracteres de MySQL: UTF-8 Unicode (utf8)
Cotejamiento de las conexiones MySQL: UTF-8_general_ci

Ver

http://www.hackszine.com/blog/archive/2007/05/mysql_database_migration_l...

Obtiene el id del grupo al que pertenece el usuario logueado

Obtiene el id del grupo al que pertenece el usuario logueado
Va en apc-aa/include/usr_aliasfnc.php3

require_once AA_INC_PATH."easy_scroller.php3";
require_once AA_INC_PATH."sliceobj.php3";
require_once AA_INC_PATH."perm_core.php3";    // needed for GetAuthData();
require_once AA_INC_PATH."files.class.php3";  // file wrapper for {include};
 
 class AA_Stringexpand_idgrupo extends AA_Stringexpand {      
#sintaxis {idgrupo}  	
  	function expand() {        
  		$user=$GLOBALS["auth"]->auth['uname'];	//obtiene el nombre del usuario actual
  		$sql = "SELECT groupid FROM memb

Mostrar enlace ADD ITEMS según usuario

Para esto se usa

print "";
var_dump(get_defined_vars());
print "";

se lo coloca en el encabezado del archivo /apc-aa/includes/menu.php3
luego se ubica la línea respectica y se reemplaza por

if ($GLOBALS["auth"]->auth['uname']=='adam' AND $GLOBALS['g_modules']['b35e7bc9fbd2456a650cd03484991ed7']['name']==='Noticias') {
$aamenus["additem"] = array ();
}

else {
$aamenus["additem"] = array (
"label" => _m("Add Item"),
"href" => "admin/itemedit.php3?encap=false&add=1$input_view",
"level" => "main");
}

Contador de descargas de archivos

En modulo de sitio

===============

if (isset($g) and isset($i)) {

$db=new DB_AA;
$short_id= $i;#i trae el shortid del item
$campo=split('/',$g);#g trae el url del archivo
$file=$campo[count($campo)-1];
$FILES_DIR="/img_upload/d50b9481e4320dc850313baa3d4545e2/";

if(empty($file)) {
echo "No File Specified";
exit;
}
if(strpos($file, "..") !== FALSE) {
echo "HACK ATTEMPT!";
exit;
}
if(strpos($file, "://") !== FALSE) {
echo "Invalid File";
exit;
}

$cookie = urlencode(str_replace(".", "_", $file)); //cookie fix

Popup para thumbnail

Una funcion para popup, donde se tiene que indicar la ruta a las carpetas que contienen las fotos.

===================================================

function usr_popup ($columns, $col, $param)
{
#{alias:img_upload......:f_u:usr_popup:h:100:h:500:_#TIT_PUBL:.thumb:_#RESU_PUB}

$parameters = split(":",$param);

list($func,$thumb_type_atr1, $thumb_val1, $popup_type_atr2, $popup_val2,$alt,$class,$leyenda) = $parameters;

$str2array = split("/",$columns[$col][0][value]);

$rutas = array ('/img_upload/74656d706c6174657771777771776e6d/', #biblioteca

Como hacer reportes en AA?

Hola a tod@s
Hace poco tuvimos la necesidad por enesima vez de hacer reportes de nuestros datos.
Necesitamos contar cuantas personas se habian inscrito en un taller. Todos los talleres estaban organizados en un campo denominado Talleres
como una lista de constantes.
La pregunta era ¿como saber cuantos participantes por taller se habian inscrito?

Bueno, para ello se hace lo sgte:

1. Se crea una vista tipo listado, en el ENCABEZADO HTML ponemos el siguiente alias _#ID_COUNT , que es un campo clave que viene en todos

Pasos para usar el MLXGetText

1. Crear un canal que almacenará las varias traducciones que una palabra puede tener. Llamemosle Translator.
2. En ese canal Translator usar el campo headline........ como campo para el lenguaje por defecto. No se necesita configurar nada más en
ese campo. Digamos que lo nombramos ES

Cálculo de edad

Message: 2
Date: Tue, 21 Feb 2006 12:25:10 -0500 (GMT-05:00)
From: Jeff Haney
Reply-To: Jeff Haney
To: apc-aa-general@lists.sourceforge.net
Subject: [Apc-aa-general] Re: Calculating age

I guess I answered my own question; I just wrote my first custom alias function which wasn't as hard as I thought it would be. In case anybody is interested, the function is added to the /include/usr_aliasfnc.php3 file and is as follows:

function usr_calc_age($columns, $col, $param="") {
$age = $columns[$col][0][value];

MLXGettext

Tomado de
http://mimo.gn.apc.org/index.php/MLXGetText
=========================================================================
MLXGet Text

(or mimo's language extension GetText)

(C) Michael Moritz mimo/at/restoel.net
MLX Screenshots also has some screenshots for MLXGetText

This is a AA database driven gettext that allows to translate short strings (with parameters) similiar to GNU gettext. Nice about it is that it allows to edit translations in AA admin interface and secondly that it can automatically add items for unknown texts -- it can be trained.
Quickstart:

*

Script apc-aa/misc/file2slice/importer.php3

========================
importando.php3
========================

<?php

// Example script for importing tabuller data into slice
// Modify this script and then run it, in order to import your data
// For more information see:
// http://apc-aa.sourceforge.net/faq/index.shtml#312

$actions = array(

"headline........" => array("action" => "storewithoutaddslashes", "from" => "Título de la Publicación"),
"text...........1" => array("action" => "storeparsemultitrans", "delimiter" => ";", "from" => "Categoría - Ejes y temas", "trans"=>array(

Distribuir contenido