function joomla_myblog_set_map in Joomla to Drupal 6
Same name and namespace in other branches
- 7.2 joomla_myblog.module \joomla_myblog_set_map()
- 7 joomla_myblog.module \joomla_myblog_set_map()
1 call to joomla_myblog_set_map()
File
- ./
joomla_myblog.module, line 111
Code
function joomla_myblog_set_map($myblogcategoryid, $tid) {
$map = db_fetch_object(db_query('SELECT * FROM {joomla_myblog_categories} WHERE myblogcategoryid = %d', $myblogcategoryid));
if ($map) {
if ($map->tid == $tid) {
// Mapping does not need updating
return NULL;
}
// Update the existing mapping
$map->tid = $tid;
return drupal_write_record('joomla_myblog_categories', $map, 'myblogcategoryid');
}
$map = new stdClass();
$map->myblogcategoryid = $myblogcategoryid;
$map->tid = $tid;
// Create a new mapping
return drupal_write_record('joomla_myblog_categories', $map);
}