| 38 | | if ($activities = get_records_sql('SELECT u.username,wc.*,wp.ident AS weblogpost,wp.title AS weblogtitle, wp.weblog AS weblog |
|---|
| 39 | | FROM '.$CFG->prefix.'weblog_comments wc LEFT JOIN '.$CFG->prefix.'weblog_posts wp ON wp.ident = wc.post_id |
|---|
| 40 | | LEFT JOIN '.$CFG->prefix.'users u on u.ident = wp.weblog |
|---|
| 41 | | WHERE wc.posted >= ? AND wp.owner = ? |
|---|
| 42 | | ORDER BY wc.posted DESC',array($starttime,$page_owner))) { |
|---|
| | 38 | // TODO: the foreach loops are identical and could possibly do with being functionised - Sven |
|---|
| | 39 | |
|---|
| | 40 | if ($activities = get_records_sql('SELECT wc.*, u.username,u.name as weblogname, wp.ident AS weblogpost,wp.title AS weblogtitle, wp.weblog AS weblog |
|---|
| | 41 | FROM '.$CFG->prefix.'weblog_comments wc |
|---|
| | 42 | LEFT JOIN '.$CFG->prefix.'weblog_posts wp ON wp.ident = wc.post_id |
|---|
| | 43 | LEFT JOIN '.$CFG->prefix.'users u ON u.ident = wp.weblog |
|---|
| | 44 | WHERE wc.posted >= ? AND wp.owner = ? |
|---|
| | 45 | ORDER BY wc.posted DESC',array($starttime,$page_owner))) { |
|---|
| | 46 | |
|---|
| 46 | | $commentposter = sprintf(gettext("<b>%s</b> commented on weblog post '%s' in %s:"),stripslashes($activity->postedname), stripslashes($activity->weblogtitle), stripslashes($activity->weblogname)); |
|---|
| | 50 | $activity->postedname = stripslashes($activity->postedname); |
|---|
| | 51 | $activity->weblogname = stripslashes($activity->weblogname); |
|---|
| | 52 | if ($activity->weblog == $USER->ident) { |
|---|
| | 53 | $activity->weblogname = gettext("your blog"); |
|---|
| | 54 | } |
|---|
| | 55 | if ($activity->owner == $USER->ident) { |
|---|
| | 56 | $commentposter = sprintf(gettext("<b>You</b> commented on weblog post '%s' in %s:"), stripslashes($activity->weblogtitle), $activity->weblogname); |
|---|
| | 57 | } else { |
|---|
| | 58 | $commentposter = sprintf(gettext("<b>%s</b> commented on weblog post '%s' in %s:"), $activity->postedname, stripslashes($activity->weblogtitle), $activity->weblogname); |
|---|
| | 59 | } |
|---|
| 60 | | if ($activities = get_records_sql('SELECT wc.*, u.username, u.name as weblogname, wp.weblog, wp.ident AS weblogpost, wp.title AS weblogtitle, wp.weblog AS weblog |
|---|
| 61 | | FROM '.$CFG->prefix.'weblog_comments wc |
|---|
| 62 | | left join '.$CFG->prefix.'weblog_watchlist wl on wl.weblog_post = wc.post_id |
|---|
| 63 | | left join '.$CFG->prefix.'weblog_posts wp on wp.ident = wc.post_id |
|---|
| 64 | | left join '.$CFG->prefix.'users u on u.ident = wp.weblog |
|---|
| 65 | | where wc.posted > ? and wl.owner = ? order by wc.posted desc',array($starttime, $page_owner))) { |
|---|
| | 73 | if ($activities = get_records_sql('SELECT wc.*, u.username, u.name as weblogname, wp.weblog, wp.ident AS weblogpost, wp.title AS weblogtitle, wp.weblog AS weblog |
|---|
| | 74 | FROM '.$CFG->prefix.'weblog_comments wc |
|---|
| | 75 | LEFT JOIN '.$CFG->prefix.'weblog_watchlist wl ON wl.weblog_post = wc.post_id |
|---|
| | 76 | LEFT JOIN '.$CFG->prefix.'weblog_posts wp ON wp.ident = wc.post_id |
|---|
| | 77 | LEFT JOIN '.$CFG->prefix.'users u ON u.ident = wp.weblog |
|---|
| | 78 | WHERE wc.posted > ? AND wl.owner = ? |
|---|
| | 79 | ORDER BY wc.posted DESC',array($starttime, $page_owner))) { |
|---|
| 69 | | $commentposter = sprintf(gettext("<b>%s</b> posted on weblog post '%s'"),stripslashes($activity->postedname), stripslashes($activity->weblogtitle)); |
|---|
| 70 | | $body .= templates_draw( array( |
|---|
| 71 | | 'context' => 'databox1', |
|---|
| 72 | | 'name' => $commentposter, |
|---|
| 73 | | 'column1' => $commentbody |
|---|
| 74 | | ) |
|---|
| 75 | | ); |
|---|
| | 83 | $activity->postedname = stripslashes($activity->postedname); |
|---|
| | 84 | $activity->weblogname = stripslashes($activity->weblogname); |
|---|
| | 85 | if ($activity->weblog == $USER->ident) { |
|---|
| | 86 | $activity->weblogname = gettext("your blog"); |
|---|
| | 87 | } |
|---|
| | 88 | if ($activity->owner == $USER->ident) { |
|---|
| | 89 | $commentposter = sprintf(gettext("<b>You</b> commented on weblog post '%s' in %s:"), stripslashes($activity->weblogtitle), $activity->weblogname); |
|---|
| | 90 | } else { |
|---|
| | 91 | $commentposter = sprintf(gettext("<b>%s</b> commented on weblog post '%s' in %s:"), $activity->postedname, stripslashes($activity->weblogtitle), $activity->weblogname); |
|---|
| | 92 | } |
|---|
| | 93 | $body .= templates_draw(array( |
|---|
| | 94 | 'context' => 'databox1', |
|---|
| | 95 | 'name' => $commentposter, |
|---|
| | 96 | 'column1' => $commentbody |
|---|
| | 97 | ) |
|---|
| | 98 | ); |
|---|