- August
- 8th
- 2008
LPT Wireless Print Server Hacked –> 8bits output
Posted by MaEl in: Bits-and-Bytes, Code-Programming, Do-it-Yourself Comments (0)
LPT port pinouts
- June
- 2nd
- 2008
WP-Geo resetting image stylesheet
Posted by MaEl in: Code-Programming Comments (0)
By default, if your theme stylesheet(css) have a setting for images to have a background colours and borders, maybe some thing like this
/* images */
img {
background: #fff;
border: 1px solid #E5E5E5;
padding: 5px;
}
the zoom level and map indicator icons will not show up, because it used your theme css.
We could alternatively resetting those img css. I myself simply add these code to the wp-geo.php.
In function shortcode_wpgeo_map, just add
<style type="text/css">#wp_geo_map_' . $id . ' img {background:none;border:none;}</style>
before the div. So it should look like these
return '<style type="text/css">#wp_geo_map_' . $id . ' img {background:none;border:none;padding:0px;}</style><div id="wp_geo_map_' . $id . '" style="width:' . $wp_geo_options['default_map_width'] . ‘; height:’ . $wp_geo_options['default_map_height'] . ‘;”>’ . $content . ‘</div>’;
Now, I have my theme img css work and the zoom level and map indicator icons works.
- May
- 27th
- 2008
WP-o-Matic : Cron job done! but no campaigns processed
Posted by MaEl in: Code-Programming Comments (33)
After struggling to make cron job work properly, now it doesn’t process the campaigns. It processes the campaigns only if the campaign is new. For the 2nd time, it doesn’t worked. the campaigns status in dashboard still showing next! even if I manually access the secret WP-o-Matic cron url. Browsing the source code and I found out that there are several bugs in the wpomatic.php. The process stucked at getCampaigns function.
function getCampaigns($args = '')
{
global $wpdb;
extract(WPOTools::getQueryArgs($args, array('fields' => '*',
'search' => '',
'orderby' => 'created_on',
'ordertype' => 'DESC',
'where' => '',
'unparsed' => false,
'limit' => null)));
if(! empty($search))
$where .= " AND title LIKE '%{$search}%' ";
if($unparsed)
$where .= " AND active = 1 AND (frequency + lastactive) < ". current_time('timestamp', true) . " ";
$sql = "SELECT $fields FROM `{$this->db['campaign']}` WHERE 1 = 1 $where ”
. “ORDER BY $orderby $ordertype $limit”;
return $wpdb->get_results($sql);
}
And that tell me why it does work for the first time only. The data for ‘lastactive’ is in ‘2008-05-27 01:00:00′ format while the ‘frequency’ is in second. We need to use UNIX_TIMESTAMP to convert the ‘lastactive’ to second. So, that the math can work.