Ejemplo n.º 1
0
}
if ($data['to_table'] == 'table_votes' and $data['to_table'] == 'table_votes') {
    $addtinal_style = "display:none;";
    // CI::model('users')->dataDeleteById($data['id']);
}
if ($data['to_table'] == 'table_options') {
    $addtinal_style = "display:none;";
    //CI::model('users')->dataDeleteById($data['id']);
}
if ($data['to_table'] == 'table_users_statuses') {
    //$addtinal_style = "display:none;";
    //CI::model('users')->dataDeleteById($data['id']);
}
?>
<? 
$log_check = get_log_item($data['id']);
 

if(!empty($log_check )): ?>
 

<li <? print $addtinal_style ?> id="log_item_<? print $log_check['id'] ?>"> <a href="<?php 
print site_url('userbase/action:profile/username:'******'username']);
?>
" class="user_photo" style="background-image: url('<?php 
print $thumb;
?>
')"></a> <a href="<?php 
print site_url('userbase/action:profile/username:'******'username']);
?>
" class="mw_blue_link"><? print user_name($author['id']); ?></a>
Ejemplo n.º 2
0
function get_dashboard_action($log_id)
{
    global $CI;
    $log = get_log_item($log_id);
    $data = $log;
    $to_return = array();
    switch ($data['to_table']) {
        case 'table_users_statuses':
            $stat = CI::model('statuses')->statusGetById(intval($data['to_table_id']));
            $stat = html_entity_decode($stat['status']);
            if (stristr($stat, 'http://') == true) {
                $term = 'shared a link';
                $stat = auto_link($stat);
                $embedly = true;
            } else {
                $term = 'said ';
                $embedly = false;
            }
            $to_return['allow_comments'] = true;
            $to_return['allow_likes'] = true;
            if ($embedly == false) {
                $to_return['msg'] = "{$term} " . $stat;
            } else {
                $to_return['msg'] = "<div class='embedly'>{$term} " . $stat . "</div>";
            }
            break;
        case 'table_users':
            $to_return['msg'] = "updated profile";
            $to_return['allow_comments'] = false;
            $to_return['allow_likes'] = false;
            break;
        case 'table_messages':
            $to_return['msg'] = "send a message to " . $data['to_table_id'] . ".. must be implemented";
            $to_return['allow_comments'] = false;
            $to_return['allow_likes'] = false;
            break;
        case 'table_comments':
            $to_return['allow_comments'] = true;
            $to_return['allow_likes'] = true;
            $comm = CI::model('comments')->commentGetById($data['to_table_id']);
            //p($comm);
            if ($comm['to_table'] == 'table_content') {
                $content_data = CI::model('content')->contentGetByIdAndCache($comm['to_table_id']);
                $url = CI::model('content')->getContentURLByIdAndCache($comm['to_table_id']);
                $comm_txt = $comm['comment_body'];
                $comm_txt = html_entity_decode($comm_txt);
                $comm_txt = auto_link($comm_txt);
                $thumb = thumbnail($content_data['id'], 90);
                //p($comm);
                $to_return['msg'] = "commented on <a href='{$url}'>{$content_data['content_title']}</a><br> {$comm_txt}";
                $to_return['msg'] .= "<div class='post_item'><div style='height:10px;'>&nbsp;</div><a href='{$url}'><img class='embed_img' src='{$thumb}' border='0'></a><h3 style='padding-bottom:5px;'><a href='{$url}'>{$content_data['content_title']}</a></h3> {$desc}  {$emded_txt} \t</div>";
            }
            if ($comm['rel_table'] == 'table_content') {
                $content_data = CI::model('content')->contentGetByIdAndCache($comm['rel_table_id']);
                $url = CI::model('content')->getContentURLByIdAndCache($comm['rel_table_id']);
                $comm_txt = $comm['comment_body'];
                $comm_txt = html_entity_decode($comm_txt);
                $comm_txt = auto_link($comm_txt);
                $thumb = thumbnail($content_data['id'], 90);
                //p($comm);
                $to_return['msg'] = "commented on <a href='{$url}'>{$content_data['content_title']}</a><br> {$comm_txt}";
                $to_return['msg'] .= "<div class='post_item'><div style='height:10px;'>&nbsp;</div><a href='{$url}'><img class='embed_img' src='{$thumb}' border='0'></a><h3 style='padding-bottom:5px;'><a href='{$url}'>{$content_data['content_title']}</a></h3> {$desc}  {$emded_txt} \t</div>";
            }
            if ($comm['to_table'] == 'table_users_statuses') {
            }
            break;
        case 'table_votes':
            $to_return['allow_comments'] = false;
            $to_return['allow_likes'] = false;
            $vote = CI::model('votes')->voteGetById($data['to_table_id']);
            if ($vote['to_table'] == 'table_content') {
                $more = CI::model('core')->getCustomFields('table_content', $vote['to_table_id']);
                $content_data = CI::model('content')->contentGetByIdAndCache($vote['to_table_id']);
                $url = CI::model('content')->getContentURLByIdAndCache($vote['to_table_id']);
                $to_return['msg'] = "liked <a href='{$url}'>{$content_data['content_title']}</a>";
                if ($more['embed_code']) {
                    $emded_txt = "<textarea>" . html_entity_decode($more['embed_code']) . "</textarea>";
                } else {
                    $emded_txt = false;
                }
                $thumb = thumbnail($content_data['id'], 90);
                $desc = codeClean($content_data['content_body']);
                $desc = character_limiter($desc, 140, '...');
                $desc = str_ireplace("\n", ' ', $desc);
                $desc = str_ireplace('\\n', ' ', $desc);
                $to_return['msg'] .= "<div class='post_item'><div style='height:10px;'>&nbsp;</div><a href='{$url}'><img class='embed_img' src='{$thumb}' border='0'></a><h3 style='padding-bottom:5px;'><a href='{$url}'>{$content_data['content_title']}</a></h3> {$desc}  {$emded_txt} \t</div>";
                break;
            } else {
            }
        case 'table_content':
            $content_data = CI::model('content')->contentGetById($data['to_table_id']);
            if (empty($content_data)) {
                CI::model('notifications')->logDeleteById($data['id']);
            } else {
                $more = CI::model('core')->getCustomFields('table_content', $content_data['id']);
                $url = post_link($data['to_table_id']);
                $to_return['allow_comments'] = true;
                $to_return['allow_likes'] = true;
                $to_return['msg'] = "published <a href='{$url}'>{$content_data['content_title']}</a>";
                if ($more['embed_code']) {
                    $emded_txt = "<textarea>" . html_entity_decode($more['embed_code']) . "</textarea>";
                } else {
                    $emded_txt = false;
                }
                $thumb = thumbnail($content_data['id'], 90);
                $desc = codeClean($content_data['content_body']);
                $desc = character_limiter($desc, 140, '...');
                $desc = str_ireplace("\n", ' ', $desc);
                $desc = str_ireplace('\\n', ' ', $desc);
                $to_return['msg'] .= "<div class='post_item'><div style='height:10px;'>&nbsp;</div><a href='{$url}'><img class='embed_img' src='{$thumb}' border='0'></a><h3 style='padding-bottom:5px;'><a href='{$url}'>{$content_data['content_title']}</a></h3> {$desc}  {$emded_txt} \t</div>";
                break;
            }
        case 'table_followers':
            $data = CI::model('core')->getById($data['to_table'], $data['to_table_id']);
            //p($data);
            if (!empty($data)) {
                $to_return['allow_comments'] = false;
                $to_return['allow_likes'] = false;
                $data2 = CI::model('users')->getUserById($data['follower_id']);
                $url = profile_link($data['follower_id']);
                $name = CI::model('users')->getPrintableName($data['follower_id']);
                $thumb = user_thumbnail($data['follower_id'], 70);
                $to_return['msg'] = "is friend with <a href='{$url}' class='user_photo' style='background-image:url({$thumb})'></a><a href='{$url}'>{$name}</a>";
            }
            break;
        default:
            p($data);
            break;
    }
    $to_return['allow_votes'] = $to_return['allow_likes'];
    return $to_return;
}