Kayako logo
Modifications & Addon Releases Modification guides and addons are posted here to share with the community. Do not post requests in here!

Notices

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  (#1) Old
Sheep Offline
Member
 
Sheep's Avatar
 
Posts: 350
Join Date: Feb 2007
Location: Lyon, France
Popular knowledgebase articles RSS feed - 11-07-2007, 11:05 PM

Popular Knowledgebase Articles RSS> I'll do it tomorow (in 13hours) at my bored lunch pause, easy stuff (5mins coding)


Antoine "Sheep" BERMON
-- Lurking around there --

Last edited by Sheep; 11-07-2007 at 11:08 PM..
   
Reply With Quote
  (#2) Old
craigbrass Offline
Senior Member
 
Posts: 5,920
Join Date: Jun 2005
Location: Cumbria, UK
12-07-2007, 10:20 AM

Oooo, thanks Antoine


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
  (#3) Old
Sheep Offline
Member
 
Sheep's Avatar
 
Posts: 350
Join Date: Feb 2007
Location: Lyon, France
Cool 12-07-2007, 12:48 PM

in modules/knowledgebase/rss_view.php

Search
PHP Code:
if ($_SWIFT["settings"]["kb_enrss"] != 1)
{
 exit;

add after
PHP Code:
if (isset($_GET['do']) && $_GET['do']=="popular")
{
 
    
$maxitems intval($_SWIFT["settings"]["kb_maxpopulararticles"]);
    if (empty(
$maxitems))
    {
        
$maxitems $_SWIFT["settings"]["kb_maxpopulararticles"] = 6;
    }
    
$itemlist $kbarticleidlist = array();
    
$dbCore->query("SELECT kbarticles.*, kbarticlelinks.*, kbcategories.categorytype FROM `"TABLE_PREFIX ."kbarticles` AS kbarticles LEFT JOIN `"TABLE_PREFIX ."kbarticlelinks` AS kbarticlelinks ON (kbarticles.kbarticleid = kbarticlelinks.kbarticleid) LEFT JOIN `"TABLE_PREFIX ."kbcategories` AS kbcategories ON (kbarticlelinks.kbcategoryid = kbcategories.kbcategoryid) LEFT JOIN `"TABLE_PREFIX ."tgroupassigns` AS tgroupassigns ON (kbarticlelinks.kbcategoryid = tgroupassigns.toassignid AND tgroupassigns.type = '"TGROUP_KNOWLEDGEBASE ."') WHERE (tgroupassigns.tgroupid = '"intval($_SWIFT["tgroup"]["tgroupid"]) ."') OR (kbarticlelinks.kbcategoryid = 0) ORDER BY kbarticles.views DESC LIMIT "intval($maxitems) .";");
    
$index 1;
    while (
$dbCore->nextRecord())
    {
 
        if (
$dbCore->Record["articlestatus"] != "published" || $dbCore->Record["categorytype"] != "public")
        {
            continue;
        }
        if (!
in_array($dbCore->Record["kbarticleid"], $kbarticleidlist))
        {
            
$itemlist[$index] = $dbCore->Record;
            
$index++;
        }
    }
 
    
$xml->addParentTag("rss", array("version" => "2.0"));
    
$xml->addParentTag("channel");
        
$xml->addTag("title"sprintf($_SWIFT["language"]["rsskb"], $_kbcategory["title"]));
        
$xml->addTag("link"$_SWIFT["swiftpath"]."index.php?_m=knowledgebase&_a=view&parentcategoryid=".intval($_kbcategoryid));
        
$xml->addTag("description"sprintf($_SWIFT["language"]["rsskbdesc"], $_SWIFT["settings"]["general_companyname"]));
        
$xml->addTag("language"$_SWIFT["adminlanguage"]);
        
$xml->addTag("copyright"$_SWIFT["settings"]["general_companyname"]);
        foreach (
$itemlist as $key => $val)
        {        
            
$xml->addParentTag("item");
                
$xml->addTag("title"$val["subject"]);
                
$xml->addTag("link"$_SWIFT["swiftpath"]."index.php?_m=knowledgebase&_a=viewarticle&kbarticleid="intval($key));
                
$xml->addTag("description"$val["contents"]);
            
$xml->endParentTag("item");
        }          
 
    
$xml->endParentTag("channel");
    
$xml->endParentTag("rss");
    
header("Content-Type: text/xml".SWIFT_CRLF);
    echo 
$xml->returnXML();
    exit();


The SQL querry isn't enougth to display the content of the kb article (i'm too lazzy to do it). This is just a copy paste from a kayako's querry.

But you have the big idea

now go to
rss/index.php?_m=knowledgebase&_a=view&do=popular


Antoine "Sheep" BERMON
-- Lurking around there --

Last edited by Sheep; 12-07-2007 at 01:24 PM..
   
Reply With Quote
  (#4) Old
Jamie Edwards Offline
Operations Manager
 
Jamie Edwards's Avatar
 
Posts: 5,660
Join Date: Jan 2006
Location: United Kingdom
17-12-2007, 01:05 AM

Thread split. Thanks for coding this up, Antoine


Jamie Edwards (jamie.edwards ]at[ kayako.com)
----------------------------------------------------------------
---
   
Reply With Quote
  (#5) Old
sqzdog Offline
Member
 
sqzdog's Avatar
 
Posts: 89
Join Date: Jun 2007
Location: Virginia, USA
18-12-2007, 03:57 PM

What editor do I use to edit this code? It is just a bunch of jumbled characters.
   
Reply With Quote
  (#6) Old
craigbrass Offline
Senior Member
 
Posts: 5,920
Join Date: Jun 2005
Location: Cumbria, UK
18-12-2007, 04:11 PM

Your on a leased licence. Unfortunatly that doesn't come with source code (hence it being encoded). You can email jamie.edwards <!at!> kayako <!dot!> com to get the file(s) you need in unencoded form.


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
  (#7) Old
sqzdog Offline
Member
 
sqzdog's Avatar
 
Posts: 89
Join Date: Jun 2007
Location: Virginia, USA
18-12-2007, 04:12 PM

I would have NEVER figured that out. Thanks!
   
Reply With Quote
  (#8) Old
craigbrass Offline
Senior Member
 
Posts: 5,920
Join Date: Jun 2005
Location: Cumbria, UK
18-12-2007, 04:15 PM

Your welcome.


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
Reply

Tags
articles, feed, knowledgebase, popular, rss

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Knowledgebase - number of articles count Swish SupportSuite, eSupport and LiveResponse 41 23-11-2008 11:08 AM
How do I list more than 3 Popular Knowledgebase Articles? MoleEnd How do I? 3 12-05-2007 08:58 AM
All template groups' knowledgebase articles included in IRS - problem steveparks SupportSuite, eSupport and LiveResponse 16 25-10-2006 02:41 AM
Free RSS feed for ALL categories kenh Modifications & Addon Releases 4 21-08-2006 05:17 PM



Powered by vBulletin® Version 3.7.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Help desk software by Kayako.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48