Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Stephane

    (@passimal)

    Hello

    Its ok Ive found where and how to modify plugin : -)
    for tweeter : js/wall/twitter.js :
    add a function (timeConverter) to transform unixtimestamp to day month year …
    found here https://stackoverflow.com/questions/847185/convert-a-unix-timestamp-to-time-in-javascript

    After in line 116

    el.created_at = Date.parse(el.created_at);
    el.created_at = parseInt(el.created_at) / 1000;
    el.created_at = timeConverter(el.created_at);
    return {
    	share_panel: me.getSharePanel(el.link),
    	header: me.getImageHeader(me.getImage(el)),
    	section: me.getTextSection(txt, me.getCounters(el)) + me.getAuthorPanel(el),
    	footer: me.getFooter(el.link, el.user.name,el.created_at)
    };

    For instagram

    add the same function in astagram.js and
    in line 138

    el.created_time = timeConverter(el.created_time);
    return {
    	time: el.created_time,
    	share_panel: me.getSharePanel(el.link),
    	header: me.getImageHeader(el.images.standard_resolution.url),
    	section: me.getTextSection(txt, me.getCounters(el)) + me.getAuthorPanel(el),
    	footer: me.getFooter(el.link, el.user.full_name, el.created_time)
    };

    And now it s OK ….
    So resolved !

    I’m just trying this plugin and I also noticed the issue.
    The problem is inside the file js/wall/feed.js… waiting for the author reply, here it is how to solve.

    Edit the file /wp-content/plugins/gc-social-wall/js/walls/feed.js. On line 224 replace the whole function with the following one. Unfortunately it doesn’t support translations… anyway as the original one.

    this.getElapsedTime = function(time){
    		var str   = '';
    		var items = [];
    		var date  = new Date();
    		var d     = new Date();
    		var time  = date.getTime() - time;
    		var text  = '';
    		var unit  = 0;
    		var res   = {
    			year   : 0,
    			month  : 0,
    			day    : 0,
    			hour   : 0,
    			minute : 0,
    			second : 0
    		};
    
    	    var msPerMinute = 60 * 1000;
    	    var msPerHour = msPerMinute * 60;
    	    var msPerDay = msPerHour * 24;
    	    var msPerMonth = msPerDay * 30;
    	    var msPerYear = msPerDay * 365;
    	    var releative = '0 seconds ago';
    
    	    if (time < msPerMinute) {
    	         relative = Math.round(time/1000) + ' seconds ago';
    	    }
    
    	    else if (time < msPerHour) {
    	         return Math.round(time/msPerMinute) + ' minutes ago';
    	    }
    
    	    else if (time < msPerDay ) {
    	        return Math.round(time/msPerHour ) + ' hours ago';
    	    }
    
    	    else if (time < msPerMonth) {
    	        return 'approximately ' + Math.round(time/msPerDay) + ' days ago';
    	    }
    
    	    else if (time < msPerYear) {
    	        return 'approximately ' + Math.round(time/msPerMonth) + ' months ago';
    	    }
    
    	    else {
    			return 'approximately ' + Math.round(time/msPerYear ) + ' years ago';
    	    }
    	}
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘use /hour/ min/sec in bricks on the wall’ is closed to new replies.