![]() |
|
#1
|
|||
|
|||
|
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 Code:
<tr> <td class="$getbgrow"> <div><a href="$linkurl/showlink.php?$session[sessionurl]do=showdetails&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> 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&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&l=$link[linkid]&linkurl=$link[linkurl]" target="_blank"> to <a href="$linkurl/links/showlink.php?$session[sessionurl]do=goto&l=$link[linkid]&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&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&l=$link[linkid]&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 12:42 PM. |
|
#2
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
WoW !! fantastic work
|
|
#6
|
|||
|
|||
|
Groovy - any chance it could be updated to support SEO friendly URLs?
|
|
#7
|
|||
|
|||
|
Look great! How would I incorporate this with my Ajax Tabs?
|
|
#8
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
Cool!
Larina, three questions - all how-to's:
Right now the module looks somewhat 'cramped' - see here. Great stuff! Thanks for this... |
|
#12
|
|||
|
|||
|
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
|
||||
|
||||
|
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: Quote:
Will appreciate your wisdom on this! Last edited by Mondi; 12-19-2008 at 06:47 PM. |
|
#14
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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 11:57 AM. |
|
#17
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
can this be made into a module with automated template edits etc?
|
|
#20
|
|||
|
|||
|
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! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Latest or Hot Links Module (CMPS 2.2.1 + Links D.2.0rc1) | nostalgia | Add-On Modules (version 3.x & 2.x) | 114 | 03-06-2009 10:25 PM |
| Is there an ETA on the new version of Links Directory? 3 months? 6 months? | pcoskat | Pre-Sale Questions | 1 | 06-02-2008 12:57 PM |
| all page links points to the forums directory and not to the links directory | scsa20 | Troubleshooting & Problems | 2 | 05-14-2007 01:31 PM |
| vBa Links Directory Updated For vB 3.6 | Brian | Announcements | 27 | 10-02-2006 11:34 AM |