Page 1 of 4 1234 LastLast
Results 1 to 20 of 67

Thread: Latest or Hot Links Module (Updated for version 3 of Links Directory)

  1. #1
    Join Date
    Mar 2008
    Posts
    367

    Default Latest or Hot Links Module (Updated for version 3 of Links Directory)

    Thanks to nostalgia, who provided this hack here: http://www.vbadvanced.com/forum/showthread.php?t=18416

    To avoid confusion, I open this new thread with the file that is required to make the hack work with version 3 of Links Directory.

    What It Does:
    It grabs links from your Links Directory and allows you to display the latest, highest rated, most viewed, random links or most replied links on your CMPS pages.

    1. To install, first add these two templates:

    adv_portal_latestlinks
    Code:
    $linkbits
    adv_portal_linkbits
    Code:
    <tr>
    		<td class="$getbgrow">
    <div><a href="$linkurl/showlink.php?$session[sessionurl]do=showdetails&amp;l=$link[linkid]">$link[name]</a></div>
    <div class="smallfont">
    $vbphrase[by] 
    <if condition="$link['userid']"><a href="$vboptions[bburl]/member.php?$session[sessionurl]u=$link[userid]">$link[username]</a>
    <else />
    $vbphrase[guest]
    </if><br />
    $link[date] <span class="time">$link[time]</span><br />
    <a href="$linkurl/browselinks.php?$session[sessionurl]c=$link[catid]">$link[catname]</a><br />
    $link[posts] $vbphrase[replies], $link[views] $vbphrase[views]
    
    </div>
    	</td>
    	</tr>
    2. latestlinks.php : Then download the latestlinks.php attachement below. Upload the file to your /forum/modules directory.

    3. Now add a new module with the following information

    Module Title: Latest Links (or whatever you would like to call this module on your CMPS)
    File to Include: latestlinks.php
    Identifier: latestlinks
    Templates Used: adv_portal_latestlinks, adv_portal_linkbits
    Use Module Shell Template: Yes
    Module Link: {$vbulletin->options[bburl]}/links/browselinks.php?do=newlinks&cutoffdate

    4. According to where you have installed Links Directory, you need to make one last step:
    Assuming you are using links directory like that: http://www.domain.com/links/ change the links in the template adv_portal_linkbits like that:
    <a href="/links/$linkurl/showlink.php?$session[sessionurl]do=showdetails&amp;l=$link[linkid]">$link[name]</a>
    <a href="/links/$linkurl/browselinks.php?$session[sessionurl]c=$link[catid]">$link[catname]</a>

    Enjoy


    ----------------------------------------------------------------------


    Modifikation for showing thumbs:

    If you want to show the link-thumbs inside the module, please use the following code for the template adv_portal_linkbits. Make sure, also to change the link
    <a href="$linkurl/showlink.php?$session[sessionurl]do=goto&amp;l=$link[linkid]&amp;linkurl=$link[linkurl]" target="_blank">
    to
    <a href="$linkurl/links/showlink.php?$session[sessionurl]do=goto&amp;l=$link[linkid]&amp;linkurl=$link[linkurl]" target="_blank">
    if you are using Links Directory like that:
    http://www.domain.com/links/

    adv_portal_linkbits :
    Code:
    <tr>
    		<td class="$getbgrow">
    <div><a href="$linkurl/showlink.php?$session[sessionurl]do=showdetails&amp;l=$link[linkid]">$link[name]</a></div>
    <div class="smallfont">
    $vbphrase[by] 
    <if condition="$link['userid']"><a href="$vboptions[bburl]/member.php?$session[sessionurl]u=$link[userid]">$link[username]</a>
    <else />
    $vbphrase[guest]
    </if><br />
    $link[date] <span class="time">$link[time]</span><br />
    <a href="$linkurl/browselinks.php?$session[sessionurl]c=$link[catid]">$link[catname]</a><br />
    <a href="$linkurl/showlink.php?$session[sessionurl]do=goto&amp;l=$link[linkid]&amp;linkurl=$link[linkurl]" target="_blank">
    <img src="http://open.thumbshots.org/image.pxf?url=$link[linkurl]" border="0" alt="$link[name]" /></a><br />
    $link[posts] $vbphrase[replies], $link[views] $vbphrase[views]
    
    </div>
    	</td>
    	</tr>
    Last edited by larina; 11-22-2008 at 01:42 PM.

  2. #2

    Default

    is there a simple way to make this a "Featured Links" module?

    in effect allowing me to pick certain links which will appear on the home page?

  3. #3
    Join Date
    Mar 2008
    Posts
    367

    Default

    Yes, you could use the field for notes, which only moderators can view. So when you submit or edit a link, write "featured" into this private notes field (without the quotes).

    To make it work, you need to edit the file latestlinks.php like that:
    Search for:
    WHERE links.valid = 1 AND links.open = 1 $privcats
    And replace this line with:
    WHERE links.notes LIKE '%featured%' AND links.valid = 1 AND links.open = 1 $privcats

    Now only links are shown, which have the note "featured".

    larina

  4. #4
    Join Date
    Jul 2007
    Location
    Vermont
    Posts
    247

    Default

    Very nice!

    I had to change the module link though since my links are at http://www.vermontoutdoors.net/links/ and not in /forum/links/

  5. #5
    Join Date
    Nov 2008
    Posts
    3

  6. #6
    Join Date
    Jul 2004
    Posts
    12

    Default

    Groovy - any chance it could be updated to support SEO friendly URLs?

  7. #7

    Default

    Look great! How would I incorporate this with my Ajax Tabs?

  8. #8
    Join Date
    Mar 2008
    Posts
    367

    Default

    Sorry that I don't answer all questions. Whenever I can help, I surely do answer. But I did not code this hack, and I am no programmer, so some questions I simply cannot answer.

    If someone will make additions to this hack (for example seo friendly urls, or thumbs) I'll be glad to update post #1 to include those additions.

    larina

  9. #9
    Join Date
    Mar 2008
    Posts
    367

    Default

    Thanks to HenrikHansen we now can show thumbs inside the module. You only need to change the template adv_portal_linkbits. Look in post #1 for the Modifikation.

    Thanks again, HenrikHansen!!

    larina

  10. #10
    Join Date
    Mar 2008
    Posts
    367

    Default

    I just saw ... the code for the template adv_portal_linkbits - when using the one to show thumbs - was not xhtml-valid. Sorry. So I edited post #1, now everything is xhtml-valid.

    larina

  11. #11
    Join Date
    Apr 2008
    Location
    New Zealand
    Posts
    66

    Default

    Cool!

    Larina, three questions - all how-to's:
    • Putting the thumb on top of each link text?
    • Little more space between the bottom of the link and the first line of text?
    • Centering thumbs? - and,
    • Only three links instead of the five I have.


    Right now the module looks somewhat 'cramped' - see here.

    Great stuff! Thanks for this...

  12. #12
    Join Date
    Mar 2008
    Posts
    367

    Default

    For only three links instead of five open the file latestlinks.php and change
    $limit = 5;
    to
    $limit = 3;

    For your other questions you just need to edit the html-code in the template adv_portal_linkbits to suit your needs.

    larina

  13. #13
    Join Date
    Apr 2008
    Location
    New Zealand
    Posts
    66

    Default Vertical & Horizontal Module Layout

    Larina,

    I am probably risking being seen as a complete noob here but... how to change the module's vertical layout to horizontal?

    Second - I'd like to add text between the module's title - "Recent Links" - and the actual display of the thumbs/links. Perhaps best to give you the code I was given:

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    .bodybold {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 18px;
    font-weight: bold;
    }
    .bodynormal {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-style: normal;
    line-height: 18px;
    font-weight: normal;
    background-position: left;
    }
    .bodysmall {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-style: normal;
    line-height: normal;
    font-weight: bold;
    color: #333333;
    }
    .bodynormalRed {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-style: normal;
    line-height: 18px;
    font-weight: normal;
    background-position: left;
    color: #990000;
    text-align: right;
    }
    -->
    </style>
    </head>

    <body>
    <table width="100%" border="0" cellspacing="10" cellpadding="2">
    <tr>
    <td rowspan="2" valign="top"><img src="http://gblcg.com/images/editorial/gblcg_links.gif" width="80" height="80" longdesc="http://gblcg.com/images/editorial/gblcg_links.gif" /></td>
    <td valign="top" class="bodynormal"><p align="left"><strong class="bodybold">Links &ndash; Fuel Your Knowledge - </strong>Browse an ever expanding catalogue of hand-picked links, each presenting ideas you should know about. Contact thought leaders. Rate their sites and discuss their intellectual worth. Recommend other sites, including yours to increase traffic and exposure. And, while you're at it, you might as well recommend your own site to scoop-up extra traffic. </p> </td>
    </tr>
    Where to put this piece to have it displayed once only over the links/thumbs?

    Will appreciate your wisdom on this!
    Last edited by Mondi; 12-19-2008 at 07:47 PM.

  14. #14
    Join Date
    Mar 2008
    Posts
    367

    Default

    Mondi, sorry, everything you are asking in your post is just simple html. Don't you have a software like frontpage, to play around a bit?

    Text you can add into the template adv_portal_latestlinks before $linkbits. But you should not insert the whole code you posted, instead just the table itself with it's contents.

    larina

  15. #15
    Join Date
    Mar 2008
    Posts
    367

    Default

    Hmm, hopefully this didn't sound to bad, sorry again.

    But the module gives you all the functions you need to show links/categories/thumbs. How you place them (the styling) is completely up to you. You can change the html-code around those functions how ever you want. Software like Frontpage or Dreamweaver gives nice help for html-newbies to learn the basics without having to study html-books, as you can use the wysiwyg-editor and at the same time you can check the according html-code.

  16. #16
    Join Date
    Aug 2008
    Location
    New England
    Posts
    24

    Default

    I would like to create a module that displays 5 horizontal random links with thumbnails.

    Can you post the code needed in latestlinks.php to do that?

    Thanks for your help!
    Last edited by Don Z.; 12-23-2008 at 12:57 PM.

  17. #17
    Join Date
    Mar 2008
    Posts
    367

    Default

    Don, in the file latestlinks.php set $order to 5 and $limit also to 5.

    For a horizontal display you need to edit the template adv_portal_linkbits like that:
    Find
    <td class="$getbgrow">
    (it is the second row in the code I posted above)
    and replace this row with:
    <td class="$getbgrow" rowspan="5" valign="top">

    larina

  18. #18
    Join Date
    Aug 2008
    Location
    New England
    Posts
    24

    Thumbs up

    Thanks larina, that worked great!

    I created a new horizontal module, php file and template so I can drop either horizontal or vertical displays into a page. That's the ticket!

    Thanks again! Ho, Ho, Ho.

  19. #19

    Default

    can this be made into a module with automated template edits etc?

  20. #20
    Join Date
    Jul 2008
    Posts
    19

    Default Links from a certain category...

    Very nice stuff. But i am looking to use links from a certain category instead of random or latest. I am pretty sure it is a simple change...
    http://cloudhostrating.com - Rate and review your hosting company!

Page 1 of 4 1234 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Latest or Hot Links Module (CMPS 2.2.1 + Links D.2.0rc1)
    By nostalgia in forum Add-On Modules (version 3.x & 2.x)
    Replies: 114
    Last Post: 03-06-2009, 11:25 PM
  2. Replies: 1
    Last Post: 06-02-2008, 01:57 PM
  3. Replies: 2
    Last Post: 05-14-2007, 02:31 PM
  4. vBa Links Directory Updated For vB 3.6
    By Brian in forum Announcements
    Replies: 27
    Last Post: 10-02-2006, 12:34 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
  •