Top Today sidebar for published and submitted news

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 03-13-2008, 01:26 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
What is necessary to have a Top Today for published and for submitted news? (http://forums.pligg.com/suggestions/...s-sidebar.html)

A suggestion how to add the submitted news of that day to the current list in Top Today would also be fine!
Reply With Quote
  #2 (permalink)  
Old 03-13-2008, 07:02 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
Any ideas?
Reply With Quote
  #3 (permalink)  
Old 03-13-2008, 09:10 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
If I would know the place of the SQL query I could try it on my own.
Reply With Quote
  #4 (permalink)  
Old 03-14-2008, 05:42 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
After a lot of trial and error Iīve found the solution:

The important file/function is /libs/sidebarstories.php. It allows just 'all'. 'queued' or 'published'. So you have to build a clone of Top Today for Queued Today.

So I copied sidebar_stories_u.php in the same folder and renamed it as sidebar_stories_new.php (the name is up to you).

Then Iīve copied the following code form sidebar_stories_u.php above if(isset($_REQUEST['category']))
Code:
$ss->filterToStatus = "queued";
$ss->link = getmyurl("upcoming");
For some reason now you have to be as specific with sidebar_stories_u.php. So write at the same place there
Code:
$ss->filterToStatus = "published";
$ss->link = my_base_url.my_pligg_base;
Next step is to replace PLIGG_Visual_Top_Today in sidebar_stories_new.php. Normally, you would have to define a new variable in libs/lang.conf. Since I donīt use sidebar_stories anymore Iīve 'recycled' and renamed PLIGG_Visual_Pligg_Queued.

Next step is to announce the file to your template. You go to /templates/yget/sidebar.tpl and add
Code:
{assign var=sidebar_module value="sidebar_stories_new"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}
In /templates/yget/sidebar_modules you copy sidebar_stories_u.tpl and rename it as sidebar_stories_new.tpl. Inside the file, you change 'u' to 'new'.

Thatīs it!

The only thing that is still unclear to me is how I get piggy2727īs word shortening code (http://forums.pligg.com/pligg-mods/7...html#post57683) into /libs/sidebarstories.php!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto recognizing the title of submitted news ruptan Questions and Comments 0 02-02-2009 03:24 PM
Link Error for User Submitted News rubber2002 Questions and Comments 7 02-28-2008 05:51 PM
[SOLVED] Few strange items (edit story..., Top Today, and Published News) newsome Questions and Comments 3 12-09-2007 11:27 PM
Display number of posts submitted today gragland Questions and Comments 0 12-11-2006 11:34 AM
Social News with No VOTING noyp Questions and Comments 1 11-22-2006 12:27 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