Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

PANEL SNIPPIT:: Affiliates & Friends Panel


Print Track
Affiliates & Friends Panel

This is the Affiliates & Friends Panel from PHP-Fusion Mods UK.

It displays Web links from the one specified web links category.

To assign a Category just change it in the code where it is commented.


Go to Admin >>> System >>> Panels >>> Add a new Side Panel

Paste in the code, save and enable.

CodeDownload  

/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2013 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Name: Affiliates & Friends
| Version: 1.00
| Author: PHP-Fusion Mods UK
| Developer: Craig
| Site: http://www.phpfusionmods.co.uk
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

include LOCALE.LOCALESET."weblinks.php";

//Category ID to show latest weblinks from
$cat_id ="4";

openside("Affiliates & Friends");

$result = dbquery("SELECT * FROM ".DB_WEBLINKS." tl
   LEFT JOIN ".DB_WEBLINK_CATS." tc
   ON tl.weblink_cat=tc.weblink_cat_id
   WHERE ".groupaccess('tc.weblink_cat_access')." AND tc.weblink_cat_id=".$cat_id."
   ORDER BY weblink_datestamp ASC LIMIT 0,20");

   if (dbrows($result)) {
   while($data = dbarray($result)) {
      
      $weblink_name = trimlink($data['weblink_name'], 23);

      echo "<div class=''>".THEME_BULLET." <a href='".$data['weblink_url']."' title='".$data['weblink_name']."' class='side' target='_blank'>".$weblink_name."</a>";

      if ($data['weblink_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
         $new = " [<span class='small' style='color: #ff0000;'>NEW</span>]";
         echo"<div style='float: right; padding-right:5px;' class='small'>".$new."</div>\n";
      } else {
         $new = "";
      }
      
      echo"</div>";
   }
   } else {
      echo "<div style='text-align:center'>".$locale['431']."</div>\n";
   }

closeside();

2 replies

HI, im new to this but would lke to enable this function..when I do this as is, I get the 'no web have been added to this categorie' I do have web links, 2 different sections..what line number do I change please in order to make this work? Sorry..new to all this.
Read the code see.

CodeDownload  
//Category ID to show latest weblinks from
$cat_id ="4";



Change that number 4.
author Craig
forumCode Snippet and functions - 8
replies3 posts
viewed2,613 times
activeLast updated on 4 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Craig, SCPA