Diferencia entre revisiones de «Ver más funciones personalizadas»
De ActionApps Documentacion
(→Limpiar acentos) |
|||
Línea 12: | Línea 12: | ||
</pre> | </pre> | ||
+ | </code> | ||
+ | |||
+ | '''Popup para imágenes ''' | ||
+ | <code> | ||
+ | <pre> | ||
+ | function usr_popup ($columns, $col, $param) | ||
+ | { | ||
+ | #ejem {alias:img_upload......:f_u:usr_popup:h:100:h:500:'_#TITULAR_':thumbnail_left:_#LEYENDA_} | ||
+ | $parameters = split(":",$param); | ||
+ | |||
+ | list($func,$thumb_type_atr1, $thumb_val1, $popup_type_atr2, $popup_val2,$alt,$class,$leyenda) = $parameters; | ||
+ | |||
+ | $filepath = $columns[$col][0][value]; | ||
+ | |||
+ | $string2array = explode("/",$filepath); | ||
+ | |||
+ | $serverpath=IMG_UPLOAD_PATH.$string2array [count($string2array)-2]."/".$string2array [count($string2array)-1]; | ||
+ | |||
+ | $urlpath =$string2array [count($string2array)-3]."/".$string2array [count($string2array)-2]."/".$string2array [count($string2array)-1]; | ||
+ | |||
+ | |||
+ | $phpthumb = "http://".$_SERVER['SERVER_NAME']."/".AA_BASE_DIR."img.php?src=/".$urlpath."&".$popup_type_atr2."=".$popup_val2; | ||
+ | $a = getimagesize($phpthumb); | ||
+ | $ancho=$a[0]; | ||
+ | $alto=$a[1]; | ||
+ | |||
+ | |||
+ | $popup="<a href=\"javascript:popup('".$phpthumb."',".$ancho.",".$alto.",'".$leyenda."')\"><img src=\"/".AA_BASE_DIR."img.php?src=/".$urlpath."&".$thumb_type_atr1."=".$thumb_val1."\" alt=".$alt." class=\"".$class."\" border=\"0\"></a>"; | ||
+ | return $popup; | ||
+ | |||
+ | } | ||
+ | |||
+ | </pre> | ||
+ | |||
</code> | </code> |
Revisión del 15:40 21 nov 2007
Limpiar acentos
function usr_limpiar_acentos ($columns, $col, $param) #ejem {alias:headline........:f_u:usr_limpiar_acentos:} { $tofind = "ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ"; $replac = "AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn"; return(strtr($columns[$col][0][value],$tofind,$replac)); }
Popup para imágenes
function usr_popup ($columns, $col, $param) { #ejem {alias:img_upload......:f_u:usr_popup:h:100:h:500:'_#TITULAR_':thumbnail_left:_#LEYENDA_} $parameters = split(":",$param); list($func,$thumb_type_atr1, $thumb_val1, $popup_type_atr2, $popup_val2,$alt,$class,$leyenda) = $parameters; $filepath = $columns[$col][0][value]; $string2array = explode("/",$filepath); $serverpath=IMG_UPLOAD_PATH.$string2array [count($string2array)-2]."/".$string2array [count($string2array)-1]; $urlpath =$string2array [count($string2array)-3]."/".$string2array [count($string2array)-2]."/".$string2array [count($string2array)-1]; $phpthumb = "http://".$_SERVER['SERVER_NAME']."/".AA_BASE_DIR."img.php?src=/".$urlpath."&".$popup_type_atr2."=".$popup_val2; $a = getimagesize($phpthumb); $ancho=$a[0]; $alto=$a[1]; $popup="<a href=\"javascript:popup('".$phpthumb."',".$ancho.",".$alto.",'".$leyenda."')\"><img src=\"/".AA_BASE_DIR."img.php?src=/".$urlpath."&".$thumb_type_atr1."=".$thumb_val1."\" alt=".$alt." class=\"".$class."\" border=\"0\"></a>"; return $popup; }