How to use images in sneak/spy like digg's spy

Register an Account
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old 08-10-2007, 08:26 AM
Constant Pligger
Pligg Version: 9.7
Pligg Template: Yget
 
Join Date: Nov 2006
Posts: 154
Kbeever, any idea why my live page looks like the image i've posted above :-/

Thanks
Reply With Quote
  #12 (permalink)  
Old 08-10-2007, 09:00 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
A nice gimmick, maybe I´ll give it try if it works with v9.5+.

BTW: Does anyone know how to suppress voting messages at the live view? (http://forums.pligg.com/general-help...html#post35983, just this post)
Reply With Quote
  #13 (permalink)  
Old 08-10-2007, 09:03 AM
P1mpPanther's Avatar
Constant Pligger
 
Join Date: Feb 2007
Posts: 277
@nothingman

mine looked the same as yours when i tried it
Reply With Quote
  #14 (permalink)  
Old 08-10-2007, 09:23 AM
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
Here is what it looked like a year ago when I did it


It shouldn't be that much different now.
Reply With Quote
  #15 (permalink)  
Old 08-10-2007, 09:49 AM
Constant Pligger
Pligg Version: 9.7
Pligg Template: Yget
 
Join Date: Nov 2006
Posts: 154
Thanks for the reply kbeever, just wondering what this legend is about? and where do I need to place this in the live.php file

Quote:
Originally Posted by kbeeveer46 View Post
You should probably use your own images but here is the code for the legend:
PHP Code:
<p align="left" style="padding-right:10px; font-weight:bold"><img src="templates/mollio-beat/images/spy_new.gif" /> new/published&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="templates/mollio-beat/images/spy_vote2.gif" /> vote&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="templates/mollio-beat/images/spy_comment.gif" /> comment</p
Reply With Quote
  #16 (permalink)  
Old 08-10-2007, 10:07 AM
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
The legend is the 3 icons above the "live" section that tell what each image means. Basically it's just html with some <img> tags and html. I you'll probably have to put it towards the top of the live .tpl file.
Reply With Quote
  #17 (permalink)  
Old 08-10-2007, 10:16 AM
Constant Pligger
Pligg Version: 9.7
Pligg Template: Yget
 
Join Date: Nov 2006
Posts: 154
Sorry for bothering you so much kbeever, but its just not working. Could you post your live.php file? (sorry, if i'm asking too much

Reply With Quote
  #18 (permalink)  
Old 08-10-2007, 10:39 AM
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
It's probably because this css class isn't used anymore

Code:
<div class="sneaker-who">
look at the 9.7 code and see what you need to replace the sneaker stuff with. Make sure to replace all the references of "sneaker-___"
Reply With Quote
  #19 (permalink)  
Old 08-10-2007, 12:17 PM
Constant Pligger
Pligg Version: 9.7
Pligg Template: Yget
 
Join Date: Nov 2006
Posts: 154
Thanks Kbeever, worked like a charm. Here's the modified code just in case (after replacing all instances of sneaker)

Code:
function to_html(data) {
    var ts=new Date(data.ts*1000);
    var timeStr;

    var hours = ts.getHours();
    var minutes = ts.getMinutes();
    var seconds = ts.getSeconds();

    timeStr  = ((hours < 10) ? "0" : "") + hours;
    timeStr  += ((minutes < 10) ? ":0" : ":") + minutes;
    timeStr  += ((seconds < 10) ? ":0" : ":") + seconds;

    html = '<div class="live2-ts">'+timeStr+'</div>';

    if (data.type == 'problem')
        html += '<div class="live2-type"><span class="live2-problem">'+data.type+'</span></div>';
    else if (data.type == 'new' || data.type == 'published')
        html += '<div class="live2-type"><img src="templates/yget/images/spy_new.gif"></div>';            
    else if (data.type == 'comment')
        html += '<div class="live2-type"><img src="templates/yget/images/spy_comment.gif"></div>';
    else if (data.type == 'vote')
        html += '<div class="live2-type"><img src="templates/yget/images/spy_vote2.gif"></div>';    
    else        
        html += '<div class="live2-type">'+data.type+'</div>';

    html += '<div class="live2-votes">'+data.votes+'</div>';
    html += '<div class="live2-story"><a href="story.php?id='+data.link+'">'+data.title+'</a></div>';
    if (data.type == 'problem')
        html += '<div class="live2-who"><span class="live2-problem">'+data.who+'</span></div>';
    else if (data.uid > 0) 
        html += '<div class="live2-who"><a href="user.php?login='+data.who+'">'+data.who+'</a></div>';
    else 
        html += '<div class="live2-who">'+data.who+'</div>';
    html += '<div class="live2-status">'+data.status+'</div>';
    return html;
}
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
select images for submission in development ivytony Questions and Comments 74 02-20-2010 05:26 PM
RSS importer doesn't import images from feeds lostdeviant Questions and Comments 12 03-22-2009 10:35 PM
Profile Badges and Images EASY work 30 usd winner! bbrian017 Questions and Comments 0 04-25-2008 11:47 AM
Images with Lightbox in Desc w/ popup Thumb kanedaguy Questions and Comments 4 02-05-2007 09:12 PM
Images with Lightbox in Desc w/ popup Thumb kanedaguy Questions and Comments 0 02-02-2007 02:51 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development