Archivo

Archivo del autor

Roundcube 1.x Larry skin for netbook and tablets

Sábado, 30 de agosto de 2014

Roundcube is a very good mail client but suffers from waste of screen space

The rant:
Now I hate, i really hate this new fashion of making screens one inch high 10 feet wide.
Specially as microsoft for example has not realized that and proposes office with a toolbar that is like 2 inched wide and is horizontal… Arghhh… Forget word and a Netbook for example.

Finally to the point:
The default Larry skin that comes with roundcube is beautiful but has a lot of wasted horizontal space and i hated to check mails in my tablet or netbook, I looked around but everybody seems to charge for the skins and you can’t really test them to see if they satisfy your needs.

So i took a bit ofmy time and did my best (I’m no programmer or anything but know my way around css) and created an extension of Larry skin removing or repositioning stuff to gain some horizintal space.

Also I tried my best to take advantage of the portrait orientation mode of what tablet i could get my hands to test.

Also I tried to modify the less possible number of files to keep stuff simple (6 files).
Some core functions blocked me from implementing some ideas I had as I did not wanted to mess with core files.

I’m sure that someone who knows roundcube better than I do can make a better job, but it fits my needs as is and I wished to give something back so I’m releasing it in my site.

Just download it and put it in your skins folder, then activate it on the preferences.

If someone decides it is useful and is willing to enhance it I will appreciate if he/she shares the result for free, but that is up to you.

Here is the link: Larry-netbook

Capture


Author: Categories: English Tags:

Solution to: WP 3.5 “An error occurred in the upload. Please try again later.”

Lunes, 23 de diciembre de 2013

Originally posted on the 28th of january 2013, updated with a new finding on december 2013.


 

UPDATE december 2013: the problem came back on 3.6 or 3.7 I dug more in the possible cause and found another possibility.

Closing PHP tags inside the functions.php file and reopening them will produce this error too… 

in my case i was using it to write html as part of a function as it is easier to escape the quotes in html than php.


If after upgrading to WordPress 3.5 you cannot insert images follow this steps:

  • Start by disabling all the plugins. (I know you already did it but bear with me)

Try now uploading.

If it worked then you have a problem with plugins (Go read  1 below)   /    If that doesn’t work, leave them disabled.

  • go to your theme folder and rename the functions.php to whatever name you want.

Try uploading now…

If it worked then you have a problem with your functions (Go read 2  below)

 If that doesn’t work neither and you are using a child theme make sure there is no functions.php on the parent theme folder

(if you don’t know what i am speaking about leave a comment and i will help you by email).

  • Still don’t work, what do I do now ?.

This problem is mainly caused by Java Script / jQuery conflicts between core WordPress and custom code you installed in your blog for plugins or functions you got from the Internet.

The implementation of Java Script in WordPress is complicated to say the least…

Java Script is difficult to troubleshoot unless you are a JS developer and then you would not be reading this…

(Go read 3 below)

1 .- PLUGINS trouble shooting:

  • You should have done this already there are plenty of posts in WP support…
  • Disable all the plugins and re-enable them one by one until the uploader breaks.
  • If disabling the plugins dont fix your uploader, Rename your Plugins folder and try to upload to see if that fixes it.

2 .- FUNCTIONS.PHP

  • Make sure you don’t have any lines with comments in HTML mark up (Example <!– I am a HTML code comment –> )
  • Make sure you open and close the PHP tags ONLY ONCE!!! in the file.

that fixed my uploader.

3.- JavaScript Problems

The reason there is not much support for this problem is because WordPress works, and the problem is coming from something you or your theme developer broke.

Lets start with some basic troubleshooting: (You have Chrome and / or Mozilla installed don’t you ? )

  • First Step: Chrome; go to the home page of your WordPress blog.

Right click anywhere on the screen and on the menu that pops click on inspect element this will open a pseudo-window  with information about your page source code etc…

In the bottom right of this window there is a cog (gear)  icon and next to it a little red circle with a white x on it, next to that usually is a number (That lists parsing errors when your page loaded.

If you have any number next to the red circle click on it to see the detail of the error.

You can ignore any Port error: bla bla (this don’t break the uploader and is another different matter).

IGNORE: Port error: Could not establish connection. Receiving end does not exist.

If you have 404 errors listed this means that you are missing some files, this is not usually the culcript but you should try to solve those because is not good anyway.

We are interested in Java Script errors usually something like this:

Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method ‘widget’ jquery-ui-interactions.js:13
If you dont see anything here do your best to keep both your blog and this Developer Tools Window visible and navigate to your wp-admin page, always keeping an eye on the errors on the other window.
Try to upload and see if you get any errors.
Usually the errors that break the uploader show in the front page and not in the back-end.
What you need to do is keep an eye in the JavaScript errors in the front-end because once JS finds an error it stops executing the rest of the scripts on the page.
Last bit of advice:
The most common reason for this to happen is that someone is calling somewhere the jQuery libraries and WordPress calls its own tested version of jQuery, calling jQuery twice specially different versions slows down your page, and also can break the delicate balance of WordPress and the universe.
WordPress calls jQuery only when it needs it, and if you added somewhere in your theme or template a call to jQuery the uploader will break.
If none of these steps helped you fix your uploader drop a note here, I will try to check your site and give you some personal advice (time permits)
If I helped leave a comment it feeds my ego and makes me feel better

Author: Categories: English Tags:

CSS Centra un elemento en mero centro de la pantalla

Martes, 12 de febrero de 2013

Necesitas conocer las medidas del elemento, pero pueden ser pixeles, em porcentaje, palitos, piezas de lego… detrás un poquito de matemáticas…

No necesitas, Java, ni jquery no nada de eso… larga vida al rock y al CSS

 

 

 

 

el CSS:

// Reemplaza <strong>X</strong> y <strong>Z</strong> con un numero y "<strong>u</strong>" con un tipo de unidad. Haz un poquito de matemática simple, y remueve los paréntesis
.div_centrado {
   width: Xu;
   height: Zu;
   position: absolute;
   top: 50%;
   left: 50%;
   margin-left: -(X/2)u;
   margin-top: -(Z/2)u;
}

Por ejemplo: Centrar un DIV
(mantén números pares para que sea mas fácil calcular)


.div_centrado {
   width: 30%;
   height: 26%;
   position: absolute;
   top: 50%;
   left: 50%;
   margin-left: -15%;   // Presta atencion al signo negativo!!!
   margin-top: -13%;   // Presta atencion al signo negativo!!!
}

Ya esta, en el mero centro de la mitad del medio….


Author: Categories: Español Tags:

Mod for Roundcube CSS to use better screen space

Lunes, 4 de febrero de 2013

RoundCube is a good Webmail client, but the default skin leaves much to be desired.

In these ages of 1000/9 screens were you get 1 inch high, 3 miles wide screens, use 360 pixels to display a logo and 3 buttons is just bad practice.

Happily by changing a few lines in the CSS files you can solve this.

Roundcube - Css - Hack

Roundcube - Css - Hack

  1. Logo becomes 1px * 1px big so is invisible
  2. Search fields take the old Logo position
  3. The buttons now are shown on hover
  4. bottom margin changed from 20px to 0 as is not used to display anything

this means you recover 240 pixels height. Very important on Netbooks or Tablets with a  resolution of 1024*600px.

 

 

 

 

How to do it ?:

Done!…

If you don’t trust my CSS get it and see the changes, sorry i’m too lazy to have documented them.

Remember to keep a copy of your original files!


Author: Categories: English Tags:

CSS Hack para Roundcube (mejor uso del espacio en pantalla)

Lunes, 4 de febrero de 2013

RoundCube es un buen cliente de Webmail, pero el diseño de la “Skin” por defecto deja mucho que desear, el gris es triston, pero eso no es tan malo.

Algo que me tenia harto era que el espacio superior de la pagina estaba muy mal utilizado. En esta epoca en la que las pantallas miden un kilometro de ancho por 1 centimetro de alto es inaceptable utilizar 350 Pixeles de altura para mostrar un logo y 4 botones, al principio trate de de mover los botones a una barra vertical pero esto no funciono.

Al re-dimensionar la pagina se volvía un desastre y la barra cambia según la vista. Así que abandone esa opción por algo mas sencillo.

Roundcube - Css - Hack

Roundcube - Css - Hack

Para lograrlo hay que modificar 2 archivos CSS, el mail.css y el common.css, solo se tocan 3 declaraciones.

Con ello obtienes:

  1. Darle 1x1px al logo y hacerlo desaparecer.
  2. Mover los campos de búsqueda a la parte donde estaba el logo
  3. Ponerle una propiedad hover a la barra de botones de email (responder, reenviar Etc.)
  4. también reduje el margen inferior que no se utiliza para nada 

Con esto ganas 240 pixels de altura. lo cuales importante por ejemplo en un Netbook o un tablet con una resolución de 1024*600px

Como hacerlo:

Listo!


Author: Categories: Español Tags:

Como pedir ayuda a un “Geek” y obtenerla

Domingo, 3 de febrero de 2013

Los Geek son el nuevo Cool en este milenio de tecnologías de información, son seres extraños que viven de Pizza y Coca-cola, no se parecen en nada a los Nerds de las películas de los ochenta, (bueno un poquito a “Bugger”) y hablan un lenguaje extraño que solo ellos son capaces de entender.

“¿A tratado de encenderla y apagarla?”

Hay variantes de Geek; tatuados, rockeros, híper-nerd, pero todos hablan ese lenguaje.
Están a cargo de la mayoría de servicios de cosas de tecnología de información y lamentablemente para ti, un usuario que está tratando de obtener su ayuda, si no eres capaz de hablar aunque sea un poquito de su idioma serás recibido con un “Grunt“… o un “¿A tratado de encenderla y apagarla?”   y si están de buen humor puede que te respondan: “Google es tu AMIGO”.

 

Claro tú sigues perdido y tratas de explicarte… y eso solo logra ponerlos de peor humor.
A continuación te damos algunos lineamientos para que eso no te pase:

1 .- Trata de ponerte en su lugar.

    • Un geek pasa el día mirando código verde como hacia el operador de la Matriz en la película, por lo que para responderte deben salir de ese mundo para escuchar lo que un ser humano tiene que decirle.

2.- Explica tu problema de manera concisa y sencilla. 

    • Esto quiere decir Explica el problema, no lo que estabas haciendo ni el porqué… Si logras abrir un canal de comunicación y el qué y el porqué son importantes el geek te preguntara…

3.- ¡ANOTA! Todo mensaje de error, y lo que hiciste para que apareciera (mejor aun, una captura de la pantalla dice más que mil palabras)

    • Nada altera mas a un geek que escuchar: Hice click allí y salió un no-se-que que decía no-se-que-mas… al escuchar esto el geek te dirá con toda seguridad que “Google es tu amigo”.

4.- Antes de preguntarle al geek, reintenta.

    • Trata de nuevo, si recibes el mismo error, trata de nuevo por tercera vez, anotando cada paso de lo que hiciste para lograr el error. Esto le dará al geek una información muy importante: por un lado sabrá decirte si el error (como en el 90% de los casos) viene del usuario o si es un problema en el sistema, y aun mas importante, que es un error REPRODUCIBLE. En ambos casos eso es carnada de Geeks, pues o se ponen a investigar el problema y ser los primeros en encontrar una solución,  o te explican que en el paso 3 debiste hacer tal y tal cosa en vez de hacer… o que te falto el paso 3.01 entre el 3 y el 4…

“Google es tu amigo”

En conclusión:

Para obtener ayuda es necesario proporcionar:

    • Información apropiada
    • Relacionada con el problema
    • Clara, precisa y técnica.

Un ejemplo:

Usuario: Buenos días.

  • Sabes, trate de seguir los pasos que muestran en el post: Blabla, de tal-sitio-punto-com.
  • Pero al hacer el paso 1 y hacer click en propiedades, el ordenador se bloqueo y luego de unos segundos apareció el siguiente mensaje: “Windows es un sistema operativo mal hecho, lamentablemente; Linux no es amigable y Mac es muy restrictivo. Desea enviar información sobre el error?”
  • Le tome una foto a la pantalla con mi teléfono, mira (Aquí sacas el teléfono y le muestras la foto)
  • Busque el mensaje de error en Google pero no entendí las respuestas, y continuo teniendo el primer problema.
  • Reinicié el equipo y volví a intentar, pero ocurrió lo mismo,  al hacer click volvió a aparecer el mensaje de error.

Geek: Ummm… (Aquí el pobre esta desarmado, sus respuestas prefabricadas han sido intentadas y el usuario parece conocer los principios básicos de resolución de problemas “apagar y encender, dándole una patada al ordenador”, no le queda otra opción que levantarse e ir a mirar contigo.)


Author: Categories: Español Tags:

WordPress Frontpage slide show plugin

Sábado, 2 de febrero de 2013

I did not made this plugin, however the author removed it from WordPress and I still had a copy.

In line 588 the plugin called his website to generate an ID

I commented this line and hardcoded a *Fake ID*, this makes it run faster (No external calls) and removes a error that was appearing on the admin area.

Also this “call home” behavior  seems to be a bad practice

If you need help you can always try leaving a message here.

Line 588 commented (hardcoded value added to remove the error):

/*$req = file_get_contents('https://www.modulaweb.fr/wp-plugins-support/?args='.urlencode(json_encode($args)));
 $req = json_decode($req, true);*/
 $rec['ID'] = 76567674;
 $plugin_ID = $req['ID'];

You can see the plugin at work on the main page of the site: http://rockdio.org/ayudatech/
or in the main site: http://rockdio.org

Download here: http://rockdio.org/frontpage-slideshow.zip

To install just download, unzip and copy to your /wp-content/plugins folder.


Author: Categories: Español Tags:

Epson All in one Stylus SX-425-W Troubleshooting (problem Scanning on WIFI)

Jueves, 31 de enero de 2013

Epson Built to perform, just not as expected

After spending 2 days installing and re installing the driver, calling technical support, dealing with the stupid interface for chatting with Epson UK (Seriously, the chat window is not re-sizable  if you zoom the browser the text disappears  and also they can push files directly to your PC) but one image says more than a thousand swords… (I wish i had one sword i mean).

Everything worked in the printer, except  the scanner button , if i tried to scan from the PC it would work, it would print.. All good… but Scan to PC from the Printer will return a bloody code W-21

After 1 hour on that tiny horrid chat, time spent basically redoing every single thing I had done for the last 2 days (and the expense report still awaiting its attachments), the Tech Representative (who claim to be called Rachael, but i heavily suspect something in the lines of Sanjey, I must say before making it work i had to restart the PC and lost the Chat with Rachel/Rachaid… Windows restarts First thing i do is test the scanner and ! Yes it works!!Vinay or Rashid…) pushed me a version of the Epson Event Manager, this thing apparently comes with drivers bundled… After 3 failed attempts to install on Windows 7 it finally worked.

I look at my tray and i have 3 instances of the Event-manager, three instances of the other shit that tries to sell you  Ink and what not…

So I remove the three Epson printers that I don’t have and kept what looked like the latest one.

Well I kept one that doesn’t not only wont scan but also wont print…

Uninstalled all the bundled software that comes with the printer (Which is a effing lot) and re installed from the CD, after that  Ran the Event manager Rachid pushed to my PC, restarted windows and Voila!.. NO… don’t work…

Finally i found the solution and it takes only a few steps:

  1. Disconnect the printer (all cables, everything)
  2. Put it on a hard flat surface
  3. Jump on top it
  4. If still in 1 piece go get a hammer (that should suffice, else get a sledge hammer)
  5. Go to your Computer Hardware  Store and get a real printer from any other brand, anyway nodaways the printer is cheaper than the Ink

That’s all your printer should work as intended now, and the best of all you wont need Rashid and his stupid chat window anymore


WordPress 3.51 the proper way to get custom avatars

Miércoles, 30 de enero de 2013

WordPress does not have an option to remove calls to gravatar.com, nor to set default site avatars or add custom user avatars outside gravatar.com Many people claims that calls to gravatar.com slow down the sites and some are just bored of the silly default mystery man or the monsters. You can disable Avatars completely but this plugin adds functionality to set your custom avatar and the site default one.

Buy me a beer

Previously I had created a code for my functions.php in my theme see here but then I upgraded to 3.51 and it worked but in the back end there where some problems.

Also I realized I was not protecting the input fields against injections which is a very bad thing.

So I did the sensible thing and started coding again, I ended up making a plugin out of it.

This plugin adds the following functionality:

  1. Show Avatars
  2. Remove calls to gravatar.com
  3. Use local default Avatar
  4. Add custom avatar for the blog users
  5. Display Custom avatar for blog users
  6. Display default avatar for unregistered commenter
  7. Display custom avatar for comment replies

Installation:

  1. Extract the download on your computer and upload the proper-avatars folder to wp-content/plugins/.
  2. Enable the plugin from the ‘Plugins’ page.
  3. Go to settings -> discussion; Scroll down to the option to set the site wide default avatar
  4. type or Paste the URL of the Avatar image you would like to use in the field
  5. Go to your user profile and add the url to your avatar (Every user can do that)
  6. type or Paste the URL of the Avatar image you would like to use in the field
Get it now!

Author: Categories: English Tags:

WordPress 3.4 and higher Custom Avatars the proper way

Domingo, 27 de enero de 2013

There is a new version of this that works with 3.51 read it here:  WordPress 3.51 the proper way to get custom avatars
There are about 1 million results in google to implement avatars, local avatars, remove gravatars, some even explain how to turn off all avatars from the back-end.

I had this project where i needed to:

  • Show Avatars
  • Remove calls to gravatar.com
  • Use local default Avatar
  • Add custom avatar for the blog users
  • Display Custom avatar for blog users
  • Display default avatar for unregistered commenter
  • Display custom avatar for comment replies


Buy me a beer

Digging for 3 days around google got me two posts which gave me the initial code:

Add default Custom Avatar: http://studio412design.com/custom-default-avatar-for-wp-comments

Custom Avatar Field by Bill Erickson: http://www.billerickson.net/wordpress-custom-avatar/

However the first one only allows to define a custom local default avatar. (Still calls gravatar.com and if nothing found displays a local image)
The second one only works properly on pages, while on comments shows the avatar of the author of the page for unregistered commenter.

During a few days struggling with code examples that did not completely solve my problem I decided to develop a solution myslef.
I dug into wp-includes/pluggable.php and after a struggle understood how WordPress was calling the avatars and what needed doing to get the results I wanted.

No core files should be modified and that was the hardest part.

So I came up with a nice modification in functions.php which i decided to convert in a plugin for the less savvy users.

To use it:

  • Download the file
  • extract the ZIP (1 folder: proper-avatars containing 2 files readme.txt and proper-avatars.php)
  • copy the folder to your /wordpress/wp-content/plugins folder
  • go to the admin area and start defining avatars for your users (the field is added at the end of user profiles)

Alternatively: copy the code at the end of the article in your functions.php file in your theme folder

The demo is available  on the main site: http://rockdio.org

<!--?php /* Plugin Name: Proper Custom Avatars Plugin URI: http://rockdio.org/ayudatech/wordpress-3-4-and-higher-custom-avatars-the-proper-way/ Description: Proper way of displaying Custom avatars, remove calls to http://gravatar.com, Use local default Avatar, Add custom avatar for the blog users,Display Custom avatar for blog users, Display default avatar for unregistered commenter, Display custom avatar for comment replies. Version: 0.1.0 License: GPL Author: Nathaniel Narvaez (RockDio.org) Author URI: http://rockdio.org */ /*===================================================================================  * Add default Custom Avatar   * @ http://studio412design.com/custom-default-avatar-for-wp-comments  * =================================================================================*/ add_filter( 'avatar_defaults', 'newgravatar' ); function newgravatar ($avatar_defaults) { $myavatar = get_bloginfo('stylesheet_directory').'/imagenes/escucha.jpg';		// Change this to point to where your custom 												// avatar is stored $avatar_defaults[$myavatar] = "Avatar de Rockdio"; 					// Change this to describe your Default Avatar return $avatar_defaults; }  /*===================================================================================  * Use Custom Avatar if Provided  * If no Avatar is found the default from the function above is used  * =================================================================================*/ function be_gravatar_filter($avatar, $id_or_email, $size, $default, $alt) { 	if (!is_object($id_or_email)) { 												//Returns the Local Avatar for Posts and Pages 			$custom_avatar = get_the_author_meta('be_custom_avatar'); 			if(!empty($custom_avatar)) 			$avatarfound = $custom_avatar; 			elseif(empty($custom_avatar)){ 												//Returns the Local Avatar for ADMIN AREA  				$id = $id_or_email; 				$custom_avatar = get_user_meta($id,'avatar',true);   				if(!empty($custom_avatar)){ 				$avatarfound = $custom_avatar; 				} 			} 		} 	elseif ( !empty($id_or_email--->user_id) ) {
												//Returns the Local Avatar for Comments
			$id = (int) $id_or_email->user_id;
			$user = get_userdata($id);
			if ( $user){
												//Returns the Local Avatar for comments if User has one
				$email = $user->user_email;
				$custom_avatar = get_user_meta($user,'be_custom_avatar',true);
				$avatarfound = $custom_avatar;
			}
		}
	elseif ( !empty($id_or_email->comment_author_email) ) {
												//Returns the DEFAULT Local Avatar for comments
			$email = $id_or_email->comment_author_email;
			$avatarfound = $default;
		}

	if ($avatarfound =='')
			$avatarfound = $default;

	$avatar = "</pre>
<img class="avatar avatar-{$size} photo" src="{$avatarfound}" alt="{$safe_alt}" width="{$size}" height="{$size}" />
<pre>";
	return $avatar;

}
add_filter('get_avatar', 'be_gravatar_filter', 1, 5);
//
print_r($custom_avatar)

/*===================================================================================
 * Add Custom Avatar Field @param object $user
 * @link http://www.billerickson.net/wordpress-custom-avatar/
 * =================================================================================*/
function be_custom_avatar_field( $user ) { ?></pre>
<h3>Custom Avatar</h3>
<table>
<tbody>
<tr>
<th><label for="be_custom_avatar">Custom Avatar URL:</label></th>
<td>
<input id="be_custom_avatar" style="width: 400px;" type="text" name="be_custom_avatar" value="<?php echo esc_attr( get_the_author_meta( 'be_custom_avatar', $user->ID ) ); ?>" />

 <span>Type in the URL of the image you'd like to use as your avatar. This will override your default Gravatar, or show up if you don't have a Gravatar.
<strong>Image should be 70x70 pixels.</strong></span></td>
</tr>
</tbody>
</table>
<pre>	<!--?php  } add_action( 'show_user_profile', 'be_custom_avatar_field' ); add_action( 'edit_user_profile', 'be_custom_avatar_field' );   /*===================================================================================  * Save Custom Avatar Field @param int $user_id @author Bill Erickson  * @link http://www.billerickson.net/wordpress-custom-avatar/  * =================================================================================*/ function be_save_custom_avatar_field( $user_id ) { 	if ( !current_user_can( 'edit_user', $user_id ) ) { return false; } 		update_usermeta( $user_id, 'be_custom_avatar', $_POST['be_custom_avatar'] ); } add_action( 'personal_options_update', 'be_save_custom_avatar_field' ); add_action( 'edit_user_profile_update', 'be_save_custom_avatar_field' ); ?-->

Author: Categories: English Tags: