I have been puzzled also how to make that work and here is the solution. Maybe it is not the right one , but at least works for me.
Here is the action.showshortcategory.php which I have changed. I have got it from action.showcategory.php
Code: Select all
<?php
if (!isset($gCms) || !isset($params["catid"])) return;
$catid=$params["catid"];
$category=$this->GetCategory($catid);
if ($this->GetPreference("enablebreadcrumb")=="1") {
$this->smarty->assign('breadcrumb', $this->GetBlogBreadcrumb($id,$returnid, $this->GetPreference("breadcrumbroot"),$catid));
}
$numentries=-1; if (isset($params["numentries"])) $numentries=$params["numentries"];
$shortlength=$this->GetPreference("shortwordlength",30);
if (isset($params["shortlength"])) $shortlength=$params["shortlength"];
$moretext=$this->GetPreference("moretext","...");
if (isset($params["moretext"])) $moretext=$params["moretext"];
$oldestfirst=false;
if (isset($params["oldestfirst"]) && ($params["oldestfirst"]=="true")) {
$oldestfirst=true;
}
$dbentries=$this->GetEntries(true,$catid,$numentries,$oldestfirst);
if ($dbentries===false) return;
$entries=array();
if (count($dbentries)==0) {
$this->smarty->assign('noentriestext', $this->Lang("noentries"));
} else {
$mostrecent=true;
foreach ($dbentries as $db_entry) {
$onerow = new stdClass();
if ($mostrecent) {
$onerow->mostrecent=1;
$mostrecent=false;
} else {
$onerow->mostrecent=0;
}
/* $onerow->title=$this->CreateLink($id, 'showentry', $returnid, $db_entry["title"], array('entryid'=>$db_entry["id"]));*/
///////////////////////////////////////////// ADDED/////////////////////////////////////////
//LINK "entryid"
$prettyurl = 'Blogs/'.$db_entry['id'].'/'.$returnid.'/'.strtolower(munge_string_to_url($db_entry['title']));
$onerow->title=$this->CreateLink($id, 'showentry', $returnid, $db_entry["title"], array('entryid'=>$db_entry["id"]),
'', false, false, '', false, $prettyurl);
// $onerow->title=$this->CreateLink($id, 'showentry', $returnid, $db_entry["title"], array('entryid'=>$db_entry["id"]),
// '', false, false, '', false, 'Blogs/'.$db_entry["id"].'/'.$returnid);
////END "entryid"////////////////////////////
$onerow->author=$db_entry["author"];
/* $shorttextlink=$this->CreateLink($id, 'showentry', $returnid, $moretext, array('entryid'=>$db_entry["id"]));
$onerow->shorttext=strip_tags(substr($db_entry["text"],0,$shortlength))." ".$shorttextlink;*/
////////LINK "moretext"
$onerow->morelink=$this->CreateLink($id, 'showentry', $returnid, $moretext,
array('entryid'=>$db_entry["id"]), '', false, false, '', false, $prettyurl);
/////////////////////////////////////////////END ADDED/////////////////////////////////////////
$onerow->shorttext=strip_tags($this->TruncateText($entry["text"],$shortlength))." ".$onerow->morelink;
$onerow->truncatedtext=strip_tags($this->TruncateText($entry["text"],$shortlength));
$onerow->text=nl2br($db_entry["text"]);
$onerow->unixtime=$db_entry["createtime"];
$onerow->time=$this->Lang("created").": ".$this->MakeDateTime($db_entry["createtime"]);
$onerow->dateonly=$this->MakeDate($db_entry["createtime"]);
$onerow->timeonly=$this->MakeTime($db_entry["createtime"]);
$latestcommenttime=$this->GetLatestCommentTime($db_entry["id"]);
//$latestcommenttime=$db_entry["commenttime"];
if ($latestcommenttime>0) {
$onerow->time.=" ".$this->Lang("latestcomment").": ".$this->MakeDateTime($latestcommenttime);
}
$nocomments=$this->CountComments($db_entry["id"]);
if ($nocomments==1) $nocomments.=" ".$this->Lang("comment"); else $nocomments.=" ".$this->Lang("comments");
/* $onerow->comments=$this->CreateLink($id, 'showentry', $returnid, $nocomments, array('entryid'=>$db_entry["id"]));*/
///////////////////////////////////////////// ADDED/////////////////////////////////////////
//LINK "comments"
$onerow->comments=$this->CreateLink($id, 'showentry', $returnid, $nocomments, array('entryid'=>$db_entry["id"]),
'');
$onerow->comments=$this->CreateLink($id, 'showcategory', $returnid, $nocomments,
array('entryid'=>$db_entry["id"]), '', false, false, '', false, 'Blogs/'.$db_entry["id"].'/'.$returnid);
/////////////////////////////////////////////END ADDED/////////////////////////////////////////
$onerow->files=$this->GetEntryFileLinks($db_entry["id"]);
array_push($entries, $onerow);
}
$this->smarty->assign_by_ref('items', $entries);
}
if ($this->GetPreference("showrssicons")=="1") {
$link="<img src='modules/Blogs/icons/rss.png' alt=\"RSS\" /> ".$this->Lang("subscribecategory");
//$params=array("showtemplate"=>"false",'show'=>"category","catid"=>$catid);
$href="<a href='".$this->config["root_url"]."/modules/Blogs/rssfeed.php?id=$id&show=category&catid=$catid&returnid=$returnid' target='_blank'>".$link."</a>";
// $href=$this->CreateLink($id, 'rss', $returnid, $link, $params,'',false,false,'',true,'news/rss');
$this->smarty->assign('rsslink', $href);
}
$this->smarty->assign('itemcount', count($entries));
$this->smarty->assign('categorytitle', $category["title"]);
$this->smarty->assign('categorydescription', nl2br($category["description"]));
echo $this->ProcessTemplateFromDatabase('showshortcategory');
?>