Tag Archives: Wordpress

ddsmoothmenu arrow dynamic paths

Working with ddsmoothmenu Smooth Navigation Menu by Dynamic Drive for a WordPress project I encountered a stupid lack of setting to provide image paths dynamically. This is a jQuery-based dropdown menu which seems and works fine but requires a static path to the images. Only two images though, for the arrows down and right, but it would be a serious issue when releasing a website or migrating to a new server.

So I decided to add a new setting configurable through the JavaScript call in your call-menu file where you could use php/java/python/whateva to retrieve the correct path dynamically and just pass it. I'm using v.1.5 and I did 2 corrections:

  1. in the ddsmoothmenu.js file replaced all smoothmenu.arrowimages strings with setting.arrowimages (just changing 'smoothmenu' to 'setting' in these three lines). There are 5 strings to be replaced at lines 75 to 77. What I do is add a new setting for them in the next section.
  2. Adding the paths to the images as a setting. So at the end my call includes the dynamic path to be used in the menus. Since I'm using WordPress, here there is my code for calling the menu:
  1.  
  2. ddsmoothmenu.init({
  3. mainmenuid: "header_top_menu",
  4. orientation: 'h',
  5. classname: 'ddsmoothmenu',
  6. arrowimages: {down:['downarrowclass', '<?php bloginfo("template_url"); ?>/img/down.gif', 23], right:['rightarrowclass', '<?php bloginfo("template_url"); ?>/img/right.gif']},
  7. contentsource: "markup"
  8. });
  9.  
del.icio.us Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati ReadMe.ru Dobavi.com Dao.bg Lubimi.com Ping.bg Pipe.bg Svejo.net Web-bg.com

Subscribe to comments has to be integrated

WordPress is still number 1 platform for blogging. Top used blogging functionality is blog posting and commenting to blog threads. 

However, people that comment on a blog post normally have no way to get feedback eventually if anyone comments back in the same post. The post author (and administrator) receives notification for the comment but the comment author, on the other hand, has no natural way to be pinged back for a reply. This is a serious leak in the WP standard functionality. It is at least unethical not to inform someone for the reply (which might occur in a day, month, year even more).

WordPress comes with a standard feed for latest posts and feed for recent comments as well. However subscribing for all comments in a blog or finding a specific thread to subscribe for is not usable and not practical as well. The solution is the Subscribe To Comments plugin that adds a checkbox to the comment form which allows one to subscribe for further comments in the same thread. This is completely optional and up to ones preferences, but instead of breaking the whole conversation because of the 'echoing' this provides the instrumentation for a real communication.

WordPress.com uses Subscribe To Comments for 2 years or something, it's integrated in their web service. So why is it not included in the platform yet?

del.icio.us Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati ReadMe.ru Dobavi.com Dao.bg Lubimi.com Ping.bg Pipe.bg Svejo.net Web-bg.com

WordPress not resolving hosts – strace magical cure

It's been a week for my WordPress being unable to resolve some external host services via URL address. It was working for a while, couple of months, with no changes by my side, and suddenly the dashboard RSS and stats data stopped responding. The error was: 

RSS Error: WP HTTP Error: Couldn't resolve host 'blogsearch.google.com'

I haven't changed the httpd.conf file recently, neither the PHP settings or something. I thought about any possible update settings from my Fedora system, but no clue.

Restarted the apache server few times. The /etc/resolv.conf file was standard. One of the common failures is DNS server change and no flushing/refresh from the Apache. But mine was still there, no changes applied.

The solution was calling the httpd process via strace. It's been auto magic - just call it once via strace, then stop or kill the stracing process and start the server as normally. It worked here.

So, I stopped my apache server (which is in /usr/sbin/httpd here, could be in /usr/local/apache2 or /opt/lampp or somewhere else) and I reincarnated it that way:

strace -f -s 128 -o dbg /usr/sbin/httpd -k start

Once debugging started, the services updated by themselves. I killed the service and ran it again as usual:

/usr/sbin/httpd -k start

and everything went back to normal.

Thanks to maniax for the help 
 

del.icio.us Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati ReadMe.ru Dobavi.com Dao.bg Lubimi.com Ping.bg Pipe.bg Svejo.net Web-bg.com