From: moodler Date: Mon, 20 Mar 2006 07:45:55 +0000 (+0000) Subject: Add timemodified to blog_tag_instance records and some clean up X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2d642a137c3eb2ff933041b2b418f6765f44af22;p=moodle.git Add timemodified to blog_tag_instance records and some clean up --- diff --git a/blog/edit.php b/blog/edit.php index d7461964a8..fde08b6819 100755 --- a/blog/edit.php +++ b/blog/edit.php @@ -217,27 +217,26 @@ function do_save(&$post, &$bloginfo_arg) { // print 'Debug: created a new entry - entryId = '.$entryID.'
'; //debug // echo 'Debug: do_save() in edit.php calling blog_do_*back_pings
'."\n"; //debug + $otags = optional_param('otags','', PARAM_INT); $ptags = optional_param('ptags','', PARAM_INT); + + $tag = NULL; + $tag->entryid = $entryID; + $tag->groupid = $groupid; + $tag->courseid = $courseid; + $tag->userid = $USER->id; + $tag->timemodified = time(); + /// Add tags information foreach ($otags as $otag) { - $tag->entryid = $entryID; $tag->tagid = $otag; - $tag->groupid = $groupid; - $tag->courseid = $courseid; - $tag->userid = $USER->id; - insert_record('blog_tag_instance',$tag); } foreach ($ptags as $ptag) { - $tag->entryid = $entryID; $tag->tagid = $ptag; - $tag->groupid = $groupid; - $tag->courseid = $courseid; - $tag->userid = $USER->id; - insert_record('blog_tag_instance',$tag); } @@ -273,31 +272,29 @@ function do_update(&$post, &$bloginfo) { $blogentry->set_publishstate($post->publishstate); //we don't care about the return value here if ( !$error = $blogentry->save() ) { -// echo 'Debug: do_update in edit.php calling do_pings
'."\n"; //debug delete_records('blog_tag_instance', 'entryid', $blogentry->entryId); $otags = optional_param('otags','', PARAM_INT); $ptags = optional_param('ptags','', PARAM_INT); + + $tag = NULL; + $tag->entryid = $blogentry->entryId; + $tag->groupid = $groupid; + $tag->courseid = $courseid; + $tag->userid = $USER->id; + $tag->timemodified = time(); + /// Add tags information foreach ($otags as $otag) { - $tag->entryid = $blogentry->entryId; $tag->tagid = $otag; - $tag->groupid = $groupid; - $tag->courseid = $courseid; - $tag->userid = $USER->id; - insert_record('blog_tag_instance',$tag); } foreach ($ptags as $ptag) { - $tag->entryid = $blogentry->entryId; $tag->tagid = $ptag; - $tag->groupid = $groupid; - $tag->courseid = $courseid; - $tag->userid = $USER->id; - insert_record('blog_tag_instance',$tag); } + // only do pings if the entry is published to the world // Daryl Hawes note - eventually should check if it's on the same server // and if so allow pb/tb as well - especially now that moderation is in place