function save_translation($like_id, $translation) { global $mongo; $db = $mongo->combined; $likes = $db->likes; $like = $likes->findOne(array('id' => $like_id)); $like['translation'] = $translation; $likes->save($like); $internal_like_id = get_object_by_external_id($like_id); $translation_object_id = set_object('translation', $translation); set_object_relation($internal_like_id, 'like', $translation_object_id, 'translation'); }
function save_forum_relation($like_id, $forum_id) { set_object_relation($like_id, 'like', $forum_id, 'forum'); save_forum_relation_db($like_id, $forum_id); }
flush(); $links = process($like_object, $additional, $user_id); } $ids = array(); //If we have cached categories if (is_array($links['categories'])) { $categories[$like_id] = $link['categories']; $cachedCategories = true; } else { foreach ($links as $link) { if ($link == "empty") { continue; } if (preg_match("/showthread\\.php\\?t\\=([0-9]+)\$/", $link['url'], $m)) { //if (preg_match("/t-([0-9]+)\.html/" , $link->url, $m)){ set_object_relation($like_id, 'like', $forum_id, 'forum'); echo "("; ob_flush(); flush(); save_forum_relation_db($like_id, $forum_id); echo ")"; ob_flush(); flush(); $ids[] = $m[1]; } } if (!is_array($ids)) { continue; } $items[$like_object['id']] = join(",", $ids); //var_dump($items[$like_object['id']]);