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?

SNIPPIT:: Latest weblinks from a category Panel

Asked Modified Viewed 4,009 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

Here is a panel for displaying the latest 10 weblinks from a weblink category.

Look in the code below and change...
$cat_id ="4";

to the category id you wish to display latest 10 weblinks from.


Paste this code in a new panel in Admin >>> System >>> Panels >>> New Panel, save and enable as a side panel.

openside("Affiliates & Friends");

include LOCALE.LOCALESET."weblinks.php";

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

$result = dbquery("SELECT
      weblink_id,
      weblink_name,
      weblink_datestamp 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 DESC LIMIT 0,10");

if (dbrows($result)) {
     while($data = dbarray($result)) {
            $weblink_name = trimlink($data['weblink_name'], 23);
              echo THEME_BULLET." <a href='".BASEDIR."weblinks.php?weblink_id=".$data['weblink_id']."' title='".$data['weblink_name']."' class='side' target='_blank'>".$weblink_name."</a> <br />\n";
           }
       } else {
       echo "<div style='text-align:center'>".$locale['431']."</div>\n";
  }
closeside();
0 replies

4 posts

P
PHPar
P
PHPar 10
  • Member, joined since
  • Contributed 118 posts on the community forums.
  • Started 7 threads in the forums
answered
Member

good job here

u can do it for news and articles ;)
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

Sure yes. I am the man I can do it soon after my coffee. (Chai)
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Thanks for sharing Craig ;)
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

Quote

Ankur wrote:

Thanks for sharing Craig ;)


Your welcome, I'm good that way when it comes to sharing. :P
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 4 posts
  • Votes 0 votes
  • Topic users 3 members

3 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
P
P
PHPar 10
  • Member, joined since
  • Contributed 118 posts on the community forums.
  • Started 7 threads in the forums
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet