![]() |
|
#1
|
||||
|
||||
|
For all of those running both the CMPS and the links directory, here's a module that will allow you to display the latest, highest rated, most viewed, or most replied to links on your CMPS pages. To install, first add these two templates:
adv_portal_latestlinks Code:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%"> <tr> <td class="tcat"><span class="smallfont"><strong>$vba_options[portal_blockbullet] $mods[title]</strong></span></td> </tr> $linkbits </table> <br /> 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> Then download the latestlinks.php attachement below. In the first few lines of the file you will see a place to set the different options. Once you have them set as you would like, upload the file to your /forum/modules directory. 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 Templates Used: adv_portal_latestlinks, adv_portal_linkbits Save the module and you're done.
Last edited by Brian; 10-10-2004 at 10:12 AM. |
|
#2
|
|||
|
|||
|
Thank you! This is great.
- Jim |
|
#3
|
|||
|
|||
|
Would be nice if you can choice the links Category in the (extra) pages. Like you can do with News, Latest Threads and Poll ! But it works great btw!
|
|
#4
|
|||
|
|||
|
Thanks Brian!
![]() Just want to add that if this module is active in the 'linksdirectory' page of the CMPS you get a MySQL error. So don't select 'update all pages' if you've got the Linksdirectory integrated with the CMPS. (Or remember to deselect it from the 'linksdirrectory' settings page... ).- HP |
|
#5
|
|||
|
|||
|
Heya,
Is it possible to display a small linkdescription (like the first 15 words of the description) and the rating of the link(if rated) in this latest links block as well?? I've played with it a little, but I didn't came any further then a red cross, where the rating should be. Any help is appreciated!! Greets Nordinho, |
|
#6
|
|||
|
|||
|
If you look at the file Brian posted, it supports 4 different views. It just happens to default to the Recent Links query. I wanted it to randomly pick a view, so here's how to do it:
Find "$order = 2;" and comment it out (as shown commented out): Code:
// The order you would like to pull the links in. // Enter 1 for newest, 2 for most viewed, 3 for most comments, 4 for highest rated //$order = 2; Code:
function make_seed()
{
list($usec, $sec) = explode(' ', microtime());
return (float) $sec + ((float) $usec * 100000);
}
srand(make_seed());
$randval = rand();
$order = rand(1, 4);
Code:
switch($order)
{
case 2:
$orderby = 'views DESC';
$modtitle = 'Top Links';
break;
case 3:
$orderby = 'posts DESC';
$modtitle = 'Top Replied Links';
break;
case 4:
$votequery = 'IF(votenum >= ' . $vboptions['showvotes'] . ', votenum, 0) AS votenum, IF(votenum >= ' . $vboptions['showvotes'] . ' AND votenum> 0, votetotal / votenum, 0) AS voteavg,';
$modtitle = 'Top Rated Links';
$orderby = 'voteavg DESC, votenum DESC';
break;
default:
$orderby = 'dateline DESC';
$modtitle = 'Latest Links';
}
Now go into the adv_portal_latestlinks template and search and replace $mods[title] with $modtitle. That's it. A random view will now be displayed. Last edited by socals; 09-04-2004 at 08:57 PM. |
|
#7
|
|||
|
|||
|
Hmmm, thinking about this module again...is it possible to display the whole 'newest 10 links' block from the links mainpage on the portal homepage??
Greets Nordinho, |
|
#8
|
|||
|
|||
|
Anyone??
|
|
#9
|
|||
|
|||
|
Any pointers are appreciated
![]() Greets, |
|
#10
|
|||
|
|||
|
I tried creating a new module with the content of some of the link templates and I created a new linkbit file, but as you might have guessed, it doesn't work...any other idea's?? I really would like to display the content of the newest 10 links from the linkpage on the frontpage as a module!!
Greets Nordinho, |
|
#11
|
|||
|
|||
|
Has anyone figured out a valid XHTML way of doing this? This method breaks validation horribly.
|
|
#12
|
|||
|
|||
|
Quote:
|
|
#13
|
|||
|
|||
|
Quote:
|
|
#14
|
|||
|
|||
|
Any way to use 2 modules at the same time? I renamed the module to latestlinks1.php, and installed it a second time, 1 for new, one for most popular, and its calling the first module blocks content into the second modules block, THEN listing the second modules content.
Im figuring its the way the call is, not sure how to fix it, if even possible. |
|
#15
|
||||
|
||||
|
Open the file and look for:
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_latestlinks') . '";'); Right above that, add: $DB_site->free_result($getlinks); unset($link); See if that helps.
|
|
#16
|
|||
|
|||
|
I added it to latestlinks.php and latestlinks1.php, didnt work. Added it to just latestlinks1.php, didn't work. Added it to just latestlinks.php, didn't work.
Would creating a second set of templates in the CP and relinking to those do anything? Doesn't seem like it would, but I dont know for sure. Images of what is happening are attached, turned off to all but admins right now. |
|
#17
|
||||
|
||||
|
Strange... Would you mind submitting a support ticket so I can have a look?
|
|
#18
|
|||
|
|||
|
I know this is picky but I'm a freaky perfectionist LOL. How would I remove this space to make it look like the block above it? I know it's a template thing but I suck horribly in that area. Any help would be greatly appreciated. Thanks!
|
|
#19
|
||||
|
||||
|
Change the 'adv_portal_latestlinks' template to the new one in the first post (I didn't realize I had a mistake in the code).
|
|
#20
|
|||
|
|||
|
Brian you are my hero. Thank you!
|
![]() |
| 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 |
| Add Links Awaiting Moderation to Your vBa CMPS Quick Moderation Module | Brian | Modifications | 27 | 10-09-2010 02:21 PM |
| Integrate the Links Directory with the CMPS | Brian | Modifications | 48 | 08-19-2006 12:57 AM |
| [REQ] - Top 10 or Latest Links side block. | ricoche | Modifications | 1 | 01-27-2005 09:36 AM |
| Links Module | suttercane | Add-On Modules & Modifications | 0 | 07-08-2004 03:13 PM |