How do I display latest "Wire" posts on Home page?

Hi All!

Is it possible for me to get the latest "wire" posts displayed on the Home page? If so can anyone guide me how to do it?

Many Thanks,

G.

Website is using Buddytalk theme at http://gardenerschat-shed.net

  •         require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php');
            gatekeeper();
            $content = get_input('content','');
            $content = explode(',',$content);
            $type = $content[0];
            $subtype = $content[1];
            $orient = get_input('display');
            $callback = get_input('callback');
            if ($type == 'all') {
                $type = '';
                $subtype = '';
            }
            $body = '';
            if (empty($callback)) {
                //set a view for the wire to extend
                $area1 = elgg_view("activity/thewire");
                //set a view to display newest members
                $area1 .= elgg_view("riverdashboard/newestmembers");   
                //set a view to display a welcome message
                $body .= elgg_view("riverdashboard/welcome");
                //set a view to display a site wide message
                $body .= elgg_view("riverdashboard/sitemessage");
            }
            switch($orient) {
                case 'mine':
                                $subject_guid = $_SESSION['user']->guid;
                                $relationship_type = '';
                                break;
                case 'friends':    $subject_guid = $_SESSION['user']->guid;
                                $relationship_type = 'friend';
                                break;
                default:        $subject_guid = 0;
                                $relationship_type = '';
                                break;
            }
            $river = elgg_view_river_items($subject_guid, 0, $relationship_type, $type, $subtype, '') . "</div>";
            // Replacing callback calls in the nav with something meaningless
            $river = str_replace('callback=true','replaced=88,334',$river);
            $nav = elgg_view('riverdashboard/nav',array(
                                                                'type' => $type,
                                                                'subtype' => $subtype,
                                                                'orient' => $orient
                                                            ));

    . . . etc other code leading to page_draw()

    ;-)

  • Dhrup,thanks! I'll try.

  • @Dhrup

    I can't work out with this code snippet because of my poor programming capabilities. My goal is displaying the latest wire post for users not logged in. Could you give me more hints? Thanks!

  • @ Blue

    Have you thought about using the custom index with widgets?  It provides this an many more possibilities without using any coding at all. :-)

    It was recently updated you can check it out here

     

     

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking