How I can display "new links" at index page?

Discussion in 'Common Questions' started by ultimate, May 24, 2006.

  1. ultimate

    ultimate Paid Customer

    I would like to display a new links also at index page. How I can do it?
  2. Nick Collins

    Nick Collins Guest

    Welcome to our forum, ultimate! Which version of eSyndiCat do you use?
  3. ultimate

    ultimate Paid Customer

    Thanks! eSyndiCat v. 1.5 Free
  4. Vincent Wright

    Vincent Wright New Member

    The answer depends on whether you want New Links block to be displayed in the 1) main content area where all the categories are displayed or 2) in the right column where featured/sponsored/etc links are displayed.

    So, please specify which option is more suitable for you -- 1 or 2.

    P.S.

    By default Free 1.5 doesn't have functionality to enable/disable new link display on index page. But the modification should not be very complicated.
  5. Bangkok Bob

    Bangkok Bob Paid Customer

    eSyndiCat Pro v1.2

    Hi eSyndiCaters,

    First, many thanks for the increased power (functionality) of Pro 1.2.

    I like the unique template for a category so I can pull in a JavaScript affiliate feed via a custom template and incorporate the page in eSyndiCat site navigation.

    Also, the CMS web page builder for non-directory pages makes website construction a breeze.

    To this thread I would like to add:

    I have eSyndiCat Pro v1.2 installed and would like the New Links block to be displayed in the main content area of the index page.

    Best regards,
    Bangkok Bob
  6. Vincent Wright

    Vincent Wright New Member

    Here is a quick mod that displays new links on index page. But first, let me explain how it works. It uses the same mechanism to display a list of links that is used in any subcategory. But instead of subcategory links we substitute new links. Only slight changes are necessary to achieve the effect.

    Ok, let's jump straight to the gory details.

    1. Open index.php in your directory script root folder. Go to the very bottom. Right before the last two lines of code:

    Code:
    $gDirSmarty->display("index{$templ}.tpl");
    ?>
    
    insert this snippet:

    Code:
    if (0 == $category['id'])
    {
        $new_links =& $gDirDb->getNewLinks(0, 5);
        $gDirSmarty->assign_by_ref('links', $new_links);
        $gDirSmarty->assign('show_as_new', true);
    }
    
    The condition 0 == $category['id'] means this is ROOT category, or index page. In the block below new links are fetched. I used 5 as the number of new links to return from getNewLinks() function call. You can vary this number if you need more or less new links on index page.

    The next two lines assign Smarty variables. An important variable here is 'show_as_new' -- this is a flag to differentiate between regular and new links because the same template is used to display both. Well, it's use is described below. Read on....

    ... but before, save changes to index.php and close the file.

    2. The next step is to slightly adjust template file. Go to your template folder. By default it is templates/GreenLeaves. Open index.tpl file.

    Find the piece of code that displays links. In my distribution it is line 20 and starts like this:

    Code:
    {if $links}
        <div class="box">
            <div class="box-caption-right">
                <div class="box-caption-left">
                    [b]<div class="box-caption">{$lang.links}</div>[/b]
                </div>
            </div>
            <div class="box-content">
    
    The line in bold gets replaced with the line below (in bold as well):

    Code:
    {if $links}
        <div class="box">
            <div class="box-caption-right">
                <div class="box-caption-left">
                    [b]<div class="box-caption">{if $show_as_new}{$lang.new_links}{else}{$lang.links}{/if}</div>[/b]
                </div>
            </div>
            <div class="box-content">
    
    You see, we only had to change one line of code in the template file to complete this mod. This line displays block title correctly -- "Links" for regular pages (subcategory pages) and "New Links" for index page.

    Save changes, close the index.tpl file and give it a try!

    Is it what you wanted to see? Yes? Great! :)

    P.S.
    If you have trouble implementing this mod feel free to ask.
  7. Bangkok Bob

    Bangkok Bob Paid Customer

    eSyndiCat Pro v1.2

    Hi Vincent,

    Works for me!

    Many thanks for your clear and detailed instructions.

    New Links are now displayed in the main content area of the index page of my eSyndiCat Pro v1.2 installation.

    Perhaps this modification can be incorporated in a future release as an admin configurable option???

    I love this program for the flexibility and ease of use. Plus the professional way the scripts are written, commented and documented. The best bang for the buck I ever got for $149.00 with the Unlimited Domains license.

    Vincent, thanks again for your mod.

    Best regards,
    Bangkok Bob
  8. Vincent Wright

    Vincent Wright New Member

    You are welcome, Bangkok Bob.

    A handful of people have already requested this mod. I think it will be implemented as a configurable option in one of the upcoming patches or versions.
  9. ultimate

    ultimate Paid Customer

    Hi Vincent,
    it works fine!

    Thanks. But root menu (home index) shows a "New Links" as active...
    Last edited: Jun 1, 2006
  10. Nick Collins

    Nick Collins Guest

    Welcome to our forum, ultimate!
  11. Vincent Wright

    Vincent Wright New Member

    What is "New Links as active"?

    to ultimate

    I don't quite understand what you mean by saying that home page shows New Links as active. What does it mean? What's wrong with that? And what should be displayed instead?
  12. Cougar

    Cougar Paid Customer

    Hi Vincent,

    So what is the simplest way to display the new links on the right side (in the footer.tpl)? I've tried a few things but can't seem to get them to show up.

    Thanks!
    Mike
  13. Vincent Wright

    Vincent Wright New Member

    I checked QueerSeek.com -- there doesn't seem to be much room in the right sidebar there.

    Well, if you give me ftp credentials and tell where EXACTLY you want to display new link I could "play" with it.
  14. Cougar

    Cougar Paid Customer

    LOL:] It is getting a little crowded down that side isn't it?
    I would remove a few things to make way for it.

    I actually had new links on the front page before. I removed it and now just have to try and remember how I did it. It was before your mod which sped up the new links loading. I actually had them scrolling with a dynamic scroll box.

    I'll try and figure it out when I have time. If I get it working I'll post the mod for everyone to use.

    Cheers!
    Mike
  15. Vincent Wright

    Vincent Wright New Member

    Ok, thank you Mark.

Share This Page