settings = $settings; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Member_blog_entry", 'method' => "add_member_blog", 'hook' => "user_register_end", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } if ($current > '1.0.0') { // Update queries for next version 1.0.1 } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Member_blog_entry'"); } // END // -------------------------------- // Add the member blog // -------------------------------- function add_member_blog($member_id) { global $DSP, $DB, $IN, $EXT; // Fetch the freshly registered member data $results = $DB->query("SELECT username, screen_name FROM exp_members WHERE member_id = ".$member_id.""); $entry_date = date('Y-m-d H:i A'); $entry_date = $LOC->set_human_time($LOC->now); $entry_date = $LOC->now; // Add the member blog title (make a readable Title and a url_title with their ID, followed by _comment) $qry = "INSERT INTO exp_weblog_titles (entry_id, weblog_id, author_id, site_id, ip_address, title, url_title, entry_date, edit_date, versioning_enabled, year, month, day, expiration_date, comment_expiration_date, sticky, status, allow_comments, allow_trackbacks, forum_topic_id, dst_enabled) VALUES ('', '3', '$member_id', '1', '".$_SERVER['REMOTE_ADDR']."', '".$results->row['screen_name']." comments', '".$member_id."_comments', '".$entry_date."', NOW(), 'n', '".date('Y')."', '".date('m')."', '".date('d')."', '0', '0', 'n', 'open', 'y', 'n', '0', 'n')"; $DB->query($qry); // Get entry ID $entry_id = $DB->insert_id; // Add to weblog data $qry = "INSERT INTO `exp_weblog_data` (`entry_id`, `site_id`, `weblog_id`) VALUES ('".$entry_id."', '1', '3')"; $DB->query($qry); // Update total entries $DB->query("UPDATE exp_members set total_entries = '1', last_entry_date = NOW() WHERE member_id = '$member_id'"); } // END } // END Class ?>