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.
Not a member yet? Click here to register.
Forgot Password?

PANEL SNIPPIT:: Affiliates & Friends Panel

Asked Modified Viewed 3,430 times
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
asked
Fusioneer

Affiliates & Friends Panel

This is the Affiliates & Friends Panel from PHPFusion 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.


/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2013 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Name: Affiliates & Friends
| Version: 1.00
| Author: PHPFusion 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();
0 replies

2 posts

S
SCPA
S
SCPA 10
  • Junior Member, joined since
  • Contributed 39 posts on the community forums.
  • Started 13 threads in the forums
answered
Junior Member

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.
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Read the code see.

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


Change that number 4.
Edited by Craig on 26-02-2015 10:23,
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 2 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
S
S
SCPA 10
  • Junior Member, joined since
  • Contributed 39 posts on the community forums.
  • Started 13 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet