Story Display on other sites

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 03-26-2007, 02:36 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
Code last updated: 21st June, 2007

I made a small mod to let a user display the latest stories from a pligg site on their own. Demo here. It can be used in 1 of 2 ways:

Code:
<script type="text/javascript" src="http://domain.com/feed/display.php"></script>
This will display a default configuration - the 5 latest published stories.

Code:
<script type="text/javascript">pligg_number='5'; pligg_status='1'; pligg_votes='1';</script>
<script type="text/javascript" src="http://domain.com/feed/display.php"></script>
This will let the user configure what stories they want to display.

pligg_number = number of stories to show (max 10, default 5)
pligg_author = stories from a particular author (use author username)
pligg_status = published stories (1), upcoming stories (2), discarded stories (3)
pligg_category = display stories from a particular category only
pligg_votes = display vote total next to title (1), or not (0)

Uses an xml feed to keep the display updated, whilst keeping database calls to a minimum.
Attached Files
File Type: zip feed.zip (3.7 KB, 93 views)

Last edited by Simon; 06-21-2007 at 03:10 PM.
Reply With Quote
  #2 (permalink)  
Old 03-26-2007, 02:42 PM
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
Nice Job! Keep up the good work. Something is wrong with the forum attachments. Can you possibly add a mirror for the files?
Reply With Quote
  #3 (permalink)  
Old 03-26-2007, 02:45 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
Sure thing - Mirror Here
Reply With Quote
  #4 (permalink)  
Old 03-26-2007, 04:27 PM
jitgos's Avatar
Constant Pligger
 
Join Date: Apr 2006
Location: Indiana (soon New Hampshire)
Posts: 315
Perfect! Very sweet!
Reply With Quote
  #5 (permalink)  
Old 03-26-2007, 05:26 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
I really need to create a more efficient method of output. Right now it is 6 db calls for a 5 story output. It will probably end up being an xml / rss file that gets re-generated every x minutes, and then parsed when called in the iframe, to minimise database usage.
Reply With Quote
  #6 (permalink)  
Old 03-27-2007, 12:00 AM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
Just updated the display so that it now uses an xml feed of the stories to reduce calls to the database. If installing, you will need to set up a cron job (to run as frequently as you think necessary) on xml.php - to keep the feed updated on a regular basis.
Reply With Quote
  #7 (permalink)  
Old 05-01-2007, 01:22 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
Just made a small update to the mod (see download in 1st post), to parse out any bad characters like & etc...
Reply With Quote
  #8 (permalink)  
Old 05-01-2007, 01:58 PM
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
Thanks. I knew the thread existed but could never find it again.
Reply With Quote
  #9 (permalink)  
Old 05-01-2007, 02:47 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
I didn't do the best naming job on this thread lol.
Reply With Quote
  #10 (permalink)  
Old 05-02-2007, 04:08 PM
Casual Pligger
 
Join Date: Oct 2006
Posts: 89
would it be possible to display a certain user... say the user wants to display his stories on his site?
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Story will not display when title is clicked... justinmyoung Questions and Comments 3 09-28-2008 11:33 AM
Would like video to display in full story view, not summary view aaronpais Questions and Comments 8 11-13-2007 05:21 AM
Display story id in the story aaronpais Questions and Comments 1 06-03-2007 10:02 PM
How do you display the whole story in RSS? mightyb Questions and Comments 3 04-18-2007 12:31 PM
Idea for scalable story promotion jvallery Questions and Comments 6 04-18-2006 10:41 PM


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