Results 1 to 3 of 3

Thread: Show Upcoming News in homepage

  1. #1
    New Pligger kamash2006's Avatar
    Joined
    Apr 2007
    Posts
    6

    Show Upcoming News in homepage

    I have pligg install in sub directory and would like to show upcoming news titles on my home page like yahoo does. In a new file how can I display titles from only one category like this

  2. #2
    Banned Geoserv's Avatar
    Joined
    Feb 2007
    Posts
    796

  3. #3
    Constant Pligger xiesi's Avatar
    Joined
    Jun 2007
    Posts
    223
    So a lot of you have been asking how to display the number of upcoming stories in the tabs like Digg has. Well, I wanted to know how to do this too. So I did some research and digging around the code.

    And using my very very ninja-like programming skills (which is noobie level), I have figured out the magic formula to the magic potion:

    1.) Open up libs/smartyvariables.php with a text editor and find:
    Code:
    ################################################## ############
    //remove this after we eliminate the need for do_header
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if($canIhaveAccess == 1){$main_smarty->assign('isgod', 1);}
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if($canIhaveAccess == 1){$main_smarty->assign('isadmin', 1);}

    check_actions('all_pages_top');
    ################################################## ################

    add below it:
    Code:

    ################################################## ################
    // show count of upcoming stories
    $queued = $db->get_var('SELECT count(*) from ' . table_links . ' where link_status = "queued";');
    $main_smarty->assign('queued', $queued);and now you can use {$queued} to display the number of upcoming stories.

    ################################################## ################

    or, for those who don't know what I'm talking about... open up template/header.tpl and find:
    Code:

    ################################################## ################
    <div id="cab">
    <ul>
    {if $pagename eq "upcoming"}
    <li><a href="{$my_base_url}{$my_pligg_base}" class="navbut3"><span>{#PLIGG_Visual_Published_New s#}</span></a></li>
    <li><a href="{$URL_upcoming}" class="navbut4"><span>{#PLIGG_Visual_Pligg_Queued# }</span></a></li>
    <li><a href="{$URL_submit}" class="navbut3"><span>{#PLIGG_Visual_Submit_A_New_ Story#}</span></a></li>
    {elseif $pagename eq "published"}
    <li><a href="{$my_base_url}{$my_pligg_base}" class="navbut4"><span>{#PLIGG_Visual_Published_New s#}</span></a></li>
    <li><a href="{$URL_upcoming}" class="navbut3"><span>{#PLIGG_Visual_Pligg_Queued# }</span></a></li>
    <li><a href="{$URL_submit}" class="navbut3"><span>{#PLIGG_Visual_Submit_A_New_ Story#}</span></a></li>
    {elseif $pagename eq "submit"}
    <li><a href="{$my_base_url}{$my_pligg_base}" class="navbut3"><span>{#PLIGG_Visual_Published_New s#}</span></a></li>
    <li><a href="{$URL_upcoming}" class="navbut3"><span>{#PLIGG_Visual_Pligg_Queued# }</span></a></li>
    <li><a href="{$URL_submit}" class="navbut4"><span>{#PLIGG_Visual_Submit_A_New_ Story#}</span></a></li>
    {else}
    <li><a href="{$my_base_url}{$my_pligg_base}" class="navbut3"><span>{#PLIGG_Visual_Published_New s#}</span></a></li>
    <li><a href="{$URL_upcoming}" class="navbut3"><span>{#PLIGG_Visual_Pligg_Queued# }</span></a></li>
    <li><a href="{$URL_submit}" class="navbut3"><span>{#PLIGG_Visual_Submit_A_New_ Story#}</span></a></li>
    {/if}
    </ul>
    </div>
    ################################################## ######################

    and replace it with:
    Code:

    ################################################## ################
    <div id="cab">
    <ul>
    {if $pagename eq "upcoming"}
    <li><a href="{$my_base_url}{$my_pligg_base}" class="navbut3"><span>{#PLIGG_Visual_Published_New s#}</span></a></li>
    <li><a href="{$URL_upcoming}" class="navbut4"><span>{#PLIGG_Visual_Pligg_Queued# } ({$queued})</span></a></li>
    <li><a href="{$URL_submit}" class="navbut3"><span>{#PLIGG_Visual_Submit_A_New_ Story#}</span></a></li>
    {elseif $pagename eq "published"}
    <li><a href="{$my_base_url}{$my_pligg_base}" class="navbut4"><span>{#PLIGG_Visual_Published_New s#}</span></a></li>
    <li><a href="{$URL_upcoming}" class="navbut3"><span>{#PLIGG_Visual_Pligg_Queued# } ({$queued})</span></a></li>
    <li><a href="{$URL_submit}" class="navbut3"><span>{#PLIGG_Visual_Submit_A_New_ Story#}</span></a></li>
    {elseif $pagename eq "submit"}
    <li><a href="{$my_base_url}{$my_pligg_base}" class="navbut3"><span>{#PLIGG_Visual_Published_New s#}</span></a></li>
    <li><a href="{$URL_upcoming}" class="navbut3"><span>{#PLIGG_Visual_Pligg_Queued# } ({$queued})</span></a></li>
    <li><a href="{$URL_submit}" class="navbut4"><span>{#PLIGG_Visual_Submit_A_New_ Story#}</span></a></li>
    {else}
    <li><a href="{$my_base_url}{$my_pligg_base}" class="navbut3"><span>{#PLIGG_Visual_Published_New s#}</span></a></li>
    <li><a href="{$URL_upcoming}" class="navbut3"><span>{#PLIGG_Visual_Pligg_Queued# } ({$queued})</span></a></li>
    <li><a href="{$URL_submit}" class="navbut3"><span>{#PLIGG_Visual_Submit_A_New_ Story#}</span></a></li>
    {/if}
    </ul>
    </div>

    ################################################## ################

    OK,cheers

Similar Threads

  1. redirect homepage from published to /upcoming
    By vladr in forum Questions & Comments
    Replies: 4
    Last Post: 01-23-2012, 06:04 PM
  2. Replies: 0
    Last Post: 12-05-2008, 05:40 AM
  3. turns to homepage instead of upcoming after sumbition?
    By jackpu in forum Questions & Comments
    Replies: 5
    Last Post: 08-12-2008, 08:41 PM
  4. No upcoming news module on pages other than published news?
    By AshMCairo in forum Questions & Comments
    Replies: 2
    Last Post: 08-07-2007, 06:25 AM
  5. Replies: 5
    Last Post: 05-07-2006, 05:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •