vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced Links Directory > vBa Links Directory v1.0 Support > Modifications

Reply
 
Thread Tools Display Modes
  #1  
Old 07-23-2004, 12:42 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Arrow CMPS Module - Latest or Hot Links

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 />
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>

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.
Attached Files
File Type: php latestlinks.php (2.7 KB, 304 views)

Last edited by Brian; 10-10-2004 at 10:12 AM.
Reply With Quote
  #2  
Old 07-23-2004, 10:23 PM
ricoche ricoche is offline
J-Gals Japan
 
Join Date: Jul 2004
Location: Nagano, Japan
Posts: 17
Default Re: CMPS Module - Latest or Hot Links

Thank you! This is great.

- Jim
Reply With Quote
  #3  
Old 08-04-2004, 11:02 PM
pdatotaal pdatotaal is offline
Rollercoaster junkie
 
Join Date: Jan 2004
Location: Holland (temp Canada)
Posts: 78
Default Re: CMPS Module - Latest or Hot Links

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!
Reply With Quote
  #4  
Old 08-26-2004, 04:43 PM
hpwilhelm hpwilhelm is offline
Junior Member
 
Join Date: Jan 2004
Location: Norway
Posts: 26
Default Re: CMPS Module - Latest or Hot Links

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
Reply With Quote
  #5  
Old 09-03-2004, 03:51 PM
Nordinho Nordinho is offline
Senior Member
 
Join Date: Aug 2004
Posts: 182
Question Re: CMPS Module - Latest or Hot Links

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,
Reply With Quote
  #6  
Old 09-04-2004, 08:15 PM
socals socals is offline
Junior Member
 
Join Date: Aug 2004
Location: California
Posts: 21
Default Randomize the View

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;
Now above it add:

Code:
function make_seed()
{
    list($usec, $sec) = explode(' ', microtime());
    return (float) $sec + ((float) $usec * 100000);
}
srand(make_seed());
$randval = rand();

$order = rand(1, 4);
Update the switch statement a few lines down with:

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';
}
I just added $modtitle to the switch elements.

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.
Reply With Quote
  #7  
Old 09-05-2004, 06:51 PM
Nordinho Nordinho is offline
Senior Member
 
Join Date: Aug 2004
Posts: 182
Question Re: CMPS Module - Latest or Hot Links

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,
Reply With Quote
  #8  
Old 09-07-2004, 09:36 AM
Nordinho Nordinho is offline
Senior Member
 
Join Date: Aug 2004
Posts: 182
Arrow Re: CMPS Module - Latest or Hot Links

Anyone??
Reply With Quote
  #9  
Old 09-10-2004, 10:04 AM
Nordinho Nordinho is offline
Senior Member
 
Join Date: Aug 2004
Posts: 182
Default Re: CMPS Module - Latest or Hot Links

Any pointers are appreciated

Greets,
Reply With Quote
  #10  
Old 09-17-2004, 12:53 PM
Nordinho Nordinho is offline
Senior Member
 
Join Date: Aug 2004
Posts: 182
Default Re: CMPS Module - Latest or Hot Links

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,
Reply With Quote
  #11  
Old 09-26-2004, 09:04 AM
58sniper 58sniper is offline
Member
 
Join Date: Apr 2004
Posts: 80
Default Re: CMPS Module - Latest or Hot Links

Has anyone figured out a valid XHTML way of doing this? This method breaks validation horribly.
Reply With Quote
  #12  
Old 09-26-2004, 11:55 AM
nexia nexia is offline
Member
 
Join Date: May 2004
Posts: 76
Default Re: CMPS Module - Latest or Hot Links

Quote:
Originally Posted by 58sniper
Has anyone figured out a valid XHTML way of doing this? This method breaks validation horribly.
it's always the same... vBulletin is not built to suite the XHTML compliance in any way, it use tables all the way around... but you can deal with it via css and divs if you really need it to be compliant!
Reply With Quote
  #13  
Old 09-26-2004, 11:58 AM
58sniper 58sniper is offline
Member
 
Join Date: Apr 2004
Posts: 80
Default Re: CMPS Module - Latest or Hot Links

Quote:
Originally Posted by nexia
it's always the same... vBulletin is not built to suite the XHTML compliance in any way, it use tables all the way around... but you can deal with it via css and divs if you really need it to be compliant!
For the most part, vBulletin is completely xHTML compliant.
Reply With Quote
  #14  
Old 10-05-2004, 03:10 PM
tfw2005 tfw2005 is offline
Senior Member
 
Join Date: Aug 2004
Posts: 352
Default Re: CMPS Module - Latest or Hot Links

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.
Reply With Quote
  #15  
Old 10-06-2004, 12:36 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: CMPS Module - Latest or Hot Links

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.
Reply With Quote
  #16  
Old 10-07-2004, 01:50 PM
tfw2005 tfw2005 is offline
Senior Member
 
Join Date: Aug 2004
Posts: 352
Default Re: CMPS Module - Latest or Hot Links

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.
Attached Images
File Type: jpg latest1.jpg (36.6 KB, 132 views)
File Type: jpg latest2.jpg (49.8 KB, 99 views)
Reply With Quote
  #17  
Old 10-07-2004, 02:23 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: CMPS Module - Latest or Hot Links

Strange... Would you mind submitting a support ticket so I can have a look?
Reply With Quote
  #18  
Old 10-09-2004, 06:41 PM
Debbi Debbi is offline
Junior Member
 
Join Date: Sep 2004
Posts: 11
Default Re: CMPS Module - Latest or Hot Links

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!
Attached Images
File Type: jpg Image11.jpg (38.1 KB, 156 views)
Reply With Quote
  #19  
Old 10-10-2004, 10:12 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: CMPS Module - Latest or Hot Links

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).
Reply With Quote
  #20  
Old 10-10-2004, 10:15 AM
Debbi Debbi is offline
Junior Member
 
Join Date: Sep 2004
Posts: 11
Default Re: CMPS Module - Latest or Hot Links

Brian you are my hero. Thank you!
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
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


All times are GMT -4. The time now is 07:40 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.