Welcome, Guest
Please Login or Register.    Lost Password?

Fireboard Integration - Latest Posts Working
(1 viewing) (1) Guest
Pre-RC Discussion
Go to bottomPage: 1
TOPIC: Fireboard Integration - Latest Posts Working
#5980
Fireboard Integration - Latest Posts Working 3 Years, 1 Month ago Karma: 25
Hi All,

So I now have my Latest Posts from the Group Forum showing up on the Group Detail Page.

Again, my environment;
J 1.5.8 fresh on Localhost
CB 1.2 RC 4
FB 1.0.5RC2
GJ 1.7 v0.29a
FB Plugin 1.7d


After the changes listed here; http://www.groupjive.org/index.php?option=com_kunena&Itemid=45&func=view&catid=223&id=5872&limit=6
I have group forums working with links from the detail pages, but no "Latest Posts" information. I traced the problem to com_profiler\plugin\user\plug_gjfireboard\fireboard.php in the getlatestposts function starting on line 122. I added two lines to get the proper category ID and they now display fine. I will include the entire function here. As I have said in the past, I do not think of myself as a programmer and what I have done may not be best practice, but it is working.

Code:

function getLatestPosts ( $group, $success, $_GJ_TEMPLATES) {
global $_CB_database, $_CB_framework, $gjConfig;

if ($group->type > 1 && !$group->userActive) {
return;
}

$runFireboard =$this->params->get('runfireboard');
$absolutepath  = $_CB_framework->getCfg('absolute_path');
$prefix  = '';
$forumpath = '';

// check if Joomlaboard or Fireboard
if (file_exists($absolutepath.'/components/com_kunena/fireboard.php')) {
$forumpath  ='com_kunena';
$prefix  ='fb';
}
else {
$forumpath  ='com_joomlaboard';
$prefix  ='sb';
}

// check if joomlaboard is installed
if (!file_exists('components/'.$forumpath) || !$runFireboard) {
return;
}
//braineater hack
// get Category ID
$_CB_database->setQuery("SELECT category_id FROM #__gj_jb WHERE group_id='$group->id'");
$cat_id = $_CB_database->loadResult();

$query="SELECT * FROM #__".$prefix."_messages "
. "WHERE catid='".$cat_id."' ORDER BY time DESC LIMIT 2"; // Change to the number you want listed...
/* . _GJ_CONF_COUNT_FORUM_POSTS; */  // This is supposed to be the number of Latest Posts shown.

$_CB_database->setQuery($query);
if(!$result=$_CB_database->query()) {
return $_CB_database->stderr();

}

$rows=$_CB_database->loadObjectList();
$total=count($rows);

$content = "<h3 class=\"componentheading\">".GJ_LATESTFORUM."</h3>";
$content .= "<ul id=func-inc_latest_forum>";

if($total > 0) {
foreach ($rows as $row) {
$content .= "<li><a href=\""
. cbSef("index.php?option=".$forumpath."&"
. "func=view&id=".$row->id."&amp;catid="
. $row->catid."#".$row->id)
. "\">".$row->subject."</a><br /><small>".GJ_BY."&nbsp;<a href=\""
. cbSef("index.php?option=com_groupjive&"
. "task=userProfile&amp;user=".$row->userid)."\">"
. $row->name.'</a>&nbsp;('.date('y-m-d',$row->time).")</small></li>";
}
$content .= "</ul>";
}
else {
$content .= GJ_NO_FORUM_POSTS;
}
$_GJ_TEMPLATES->addContent($content, 'center');
}



Good luck & have fun. Please let me know if this helps at all.
Aaron (with huge thanks to Stiggi & the GJ Team!!)
Braineater
Moderator
Posts: 189
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#5988
Re:Fireboard Integration - Latest Posts Working 3 Years, 1 Month ago Karma: 3
didn't do anything for me. latest forum posts still not showing.
arsoy
Roadie
Posts: 58
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#5989
Re:Fireboard Integration - Latest Posts Working 3 Years, 1 Month ago Karma: 1
I had applied this and it was working on my site. I came to the forum to report this when I saw that Micha has now fixed the problem. Please see This Post.

Cheers
Dave
Creator
Roadie
Posts: 64
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: Braineater
RocketTheme Joomla Templates