Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed events not showing

  • Loading branch information...
commit e8858b5e7b451c7ea93f3ed4838028215eda45ff 1 parent f21708b
@NoahY authored
Showing with 11 additions and 8 deletions.
  1. +10 −7 qa-history-layer.php
  2. +1 −1  qa-plugin.php
View
17 qa-history-layer.php
@@ -219,25 +219,28 @@ function user_activity_form() {
$events = array();
$postids = array();
+ $count = 0;
while ( ($event=qa_db_read_one_assoc($event_query,true)) !== null ) {
- if(preg_match('/postid=([0-9]+)/',$event['params'],$m) == 1) {
+ if(preg_match('/postid=([0-9]+)/',$event['params'],$m) === 1) {
$event['postid'] = (int)$m[1];
$postids[] = (int)$m[1];
+ $events[$m[1].'_'.$count++] = $event;
}
- $events[$m[1]] = $event;
+ else
+ $events['nopost_'.($count++)] = $event;
}
// get post info, also makes sure post exists
$posts = null;
if(!empty($postids)) {
- $posts = qa_db_read_all_assoc(
+ $post_query = qa_db_read_all_assoc(
qa_db_query_sub(
'SELECT postid,type,parentid,BINARY title as title FROM ^posts WHERE postid IN ('.implode(',',$postids).')'
)
);
- foreach($posts as $post) {
- $events[(string)$post['postid']]['post'] = $post;
+ foreach($post_query as $post) {
+ $posts[(string)$post['postid']] = $post;
}
}
@@ -301,8 +304,8 @@ function user_activity_form() {
else if($type == 'badge_awarded') {
if(!qa_opt('badge_active') || !function_exists('qa_get_badge_type'))
continue;
- if(isset($event['post'])) {
- $post = $event['post'];
+ if(isset($params['postid'])) {
+ $post = $posts[$params['postid']];
if(strpos($post['type'],'Q') !== 0) {
$anchor = qa_anchor((strpos($post['type'],'A') === 0 ?'A':'C'), $params['postid']);
View
2  qa-plugin.php
@@ -3,7 +3,7 @@
Plugin Name: History
Plugin URI: https://github.com/NoahY/q2a-history
Plugin Description: Adds complete activity history list to user profile
- Plugin Version: 1.7
+ Plugin Version: 1.8
Plugin Date: 2011-10-26
Plugin Author: NoahY
Plugin Author URI: http://www.question2answer.org/qa/user/NoahY
Please sign in to comment.
Something went wrong with that request. Please try again.