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

Thread: CMPS Module - Latest or Hot Links

  1. #1
    Administrator Brian's Avatar
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,467

    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 Attached Files
    Last edited by Brian; 10-10-2004 at 10:12 AM.

  2. #2
    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

  3. #3
    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!

  4. #4
    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

  5. #5

    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,

  6. #6
    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.

  7. #7

    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,

  8. #8

    Arrow Re: CMPS Module - Latest or Hot Links

    Anyone??

  9. #9

    Default Re: CMPS Module - Latest or Hot Links

    Any pointers are appreciated

    Greets,

  10. #10

    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,

  11. #11

    Default Re: CMPS Module - Latest or Hot Links

    Has anyone figured out a valid XHTML way of doing this? This method breaks validation horribly.

  12. #12

    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!

  13. #13

    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.

  14. #14
    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.

  15. #15
    Administrator Brian's Avatar
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,467

    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.

  16. #16
    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 Attached Images

  17. #17
    Administrator Brian's Avatar
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,467

    Default Re: CMPS Module - Latest or Hot Links

    Strange... Would you mind submitting a support ticket so I can have a look?

  18. #18
    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 Attached Images

  19. #19
    Administrator Brian's Avatar
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,467

    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).

  20. #20
    Junior Member
    Join Date
    Sep 2004
    Posts
    11

    Default Re: CMPS Module - Latest or Hot Links

    Brian you are my hero. Thank you!

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. Replies: 27
    Last Post: 10-09-2010, 02:21 PM
  2. Integrate the Links Directory with the CMPS
    By Brian in forum Modifications
    Replies: 48
    Last Post: 08-19-2006, 12:57 AM
  3. [REQ] - Top 10 or Latest Links side block.
    By ricoche in forum Modifications
    Replies: 1
    Last Post: 01-27-2005, 10:36 AM
  4. Links Module
    By suttercane in forum Add-On Modules & Modifications
    Replies: 0
    Last Post: 07-08-2004, 03:13 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
  •