vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > Add-On Modules & Modifications > vBa CMPS v3.x & 2.x > Add-On Modules (version 3.x & 2.x)

Reply
 
Thread Tools Display Modes
  #1  
Old 11-08-2008, 03:06 PM
larina larina is offline
Senior Member
 
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>
Attached Files
File Type: php latestlinks.php (2.4 KB, 287 views)

Last edited by larina; 11-22-2008 at 12:42 PM.
Reply With Quote
  #2  
Old 11-12-2008, 04:26 AM
turbosatan turbosatan is offline
Member
 
Join Date: Jan 2008
Posts: 55
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?
Reply With Quote
  #3  
Old 11-13-2008, 12:26 AM
larina larina is offline
Senior Member
 
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
Reply With Quote
  #4  
Old 11-14-2008, 08:20 PM
dismas dismas is offline
Senior Member
 
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/
Reply With Quote
  #5  
Old 11-15-2008, 05:33 PM
al3ade al3ade is offline
Junior Member
 
Join Date: Nov 2008
Posts: 3
Default

WoW !! fantastic work
Reply With Quote
  #6  
Old 11-20-2008, 11:58 AM
benFF benFF is offline
Junior Member
 
Join Date: Jul 2004
Posts: 8
Default

Groovy - any chance it could be updated to support SEO friendly URLs?
Reply With Quote
  #7  
Old 11-20-2008, 12:29 PM
doc1975 doc1975 is offline
Member
 
Join Date: Dec 2007
Posts: 67
Default

Look great! How would I incorporate this with my Ajax Tabs?
Reply With Quote
  #8  
Old 11-20-2008, 01:13 PM
larina larina is offline
Senior Member
 
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
Reply With Quote
  #9  
Old 11-21-2008, 08:07 AM
larina larina is offline
Senior Member
 
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
Reply With Quote
  #10  
Old 11-22-2008, 12:44 PM
larina larina is offline
Senior Member
 
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
Reply With Quote
  #11  
Old 11-27-2008, 04:50 AM
Mondi's Avatar
Mondi Mondi is offline
Member
 
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...
Reply With Quote
  #12  
Old 11-27-2008, 11:44 AM
larina larina is offline
Senior Member
 
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
Reply With Quote
  #13  
Old 12-19-2008, 06:19 PM
Mondi's Avatar
Mondi Mondi is offline
Member
 
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:

Quote:
<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 06:47 PM.
Reply With Quote
  #14  
Old 12-20-2008, 01:24 PM
larina larina is offline
Senior Member
 
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
Reply With Quote
  #15  
Old 12-20-2008, 01:36 PM
larina larina is offline
Senior Member
 
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.
Reply With Quote
  #16  
Old 12-23-2008, 11:49 AM
Don Z. Don Z. is offline
Junior Member
 
Join Date: Aug 2008
Location: New England
Posts: 21
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 11:57 AM.
Reply With Quote
  #17  
Old 12-23-2008, 06:58 PM
larina larina is offline
Senior Member
 
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
Reply With Quote
  #18  
Old 12-24-2008, 01:23 PM
Don Z. Don Z. is offline
Junior Member
 
Join Date: Aug 2008
Location: New England
Posts: 21
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.
Reply With Quote
  #19  
Old 01-02-2009, 09:53 AM
turbosatan turbosatan is offline
Member
 
Join Date: Jan 2008
Posts: 55
Default

can this be made into a module with automated template edits etc?
Reply With Quote
  #20  
Old 01-28-2009, 10:42 AM
maikju maikju is offline
Junior Member
 
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!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -4. The time now is 12:26 PM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.