Kunena integration

you will find here.
mett
Newbie
Posts: 8
Joined: Sun Apr 27, 2008 3:08 pm

Kunena integration

Postby mett » Thu Apr 30, 2009 12:42 pm

This code will help you to integrate joomleague 0.93 and kunena 1.0.9 so users can discuss games/results in Kunena.

Please test it before use it in live sites.

Step1

Search for

else if ($do == "newFromBot" && (hasPostPermission($database, $catid, $replyto, $my->id, $fbConfig->pubwrite, $is_Moderator)))

Step 2

scroll down to line 689, here you will see following code:
                        //--
                        //echo "";
                }
Step 3

after, add code from below:

Code: Select all

//adaugat Joomleague
            else if ($do == "newFromJoomLeague" && (hasPostPermission($database, $catid, $replyto, $my->id, $fbConfig->pubwrite, $is_Moderator)))
                { // The Mosbot "discuss on forums" has detected an unexisting thread and wants to create one
                    $parentid = 0;
                    $replyto = (int)$replyto;
                    $setFocus = 0;
                    //                $resubject = base64_decode($resubject); //per mf#6100  -- jdg 16/07/2005
                    $resubject = base64_decode(strtr($resubject, "()", "+/"));
                    $resubject = str_replace("%20", " ", $resubject);
                    $resubject = preg_replace('/%32/', '&', $resubject);
                    $resubject = preg_replace('/%33/', ';', $resubject);
                    $resubject = preg_replace("/\'/", ''', $resubject);
                    $resubject = preg_replace("/\"/", '"', $resubject);
                    //$table = array_flip(get_html_translation_table(HTML_ENTITIES));
                    //$resubject = strtr($resubject, $table);
                    $fromBot = 1; //this new topic comes from the discuss mambot
                    $authorName = htmlspecialchars($my_name);
                    $rowid = mosGetParam($_REQUEST, 'rowid', 0);
                    $rowItemid = mosGetParam($_REQUEST, 'rowItemid', 0);
//start content url
                    if ($rowItemid) {
                        $contentURL = sefRelToAbs('index.php?option=com_content&task=view&Itemid=' . $rowItemid . '&id=' . $rowid);
                    }
                    else {
                        $contentURL = sefRelToAbs('index.php?option=com_content&task=view&Itemid=1&id=' . $rowid);
                    }

                    $contentURL = _POST_DISCUSS . ': [url=' . $contentURL . ']' . $resubject . '[/url]';
//end content url


To not use link back to article (doesn't work for me, maybe because i use Joomla 1.5.10 with default sef activated), comment out or remove following lines from code above:

Code: Select all

//start content url
                    if ($rowItemid) {
                        $contentURL = sefRelToAbs('index.php?option=com_content&task=view&Itemid=' . $rowItemid . '&id=' . $rowid);
                    }
                    else {
                        $contentURL = sefRelToAbs('index.php?option=com_content&task=view&Itemid=1&id=' . $rowid);
                    }

                    $contentURL = _POST_DISCUSS . ': [url=http://' . $contentURL . ']' . $resubject . '[/url]';
//end content url

mett
Newbie
Posts: 8
Joined: Sun Apr 27, 2008 3:08 pm

Re: Kunena integration

Postby mett » Sat May 30, 2009 6:18 pm

Few modifications for Kunena 1.0.10.

You should add all this code in post.php file

Code: Select all

            //begin Joomleague
            else if ($do == "newFromJoomLeague" && (hasPostPermission($database, $catid, $replyto, $my->id, $fbConfig->pubwrite, $is_Moderator)))
                { // The Mosbot "discuss on forums" has detected an unexisting thread and wants to create one
                    $parentid = 0;
                    $replyto = (int)$replyto;
                    $setFocus = 0;
                    //                $resubject = base64_decode($resubject); //per mf#6100  -- jdg 16/07/2005
                    $resubject = base64_decode(strtr($resubject, "()", "+/"));
                    $resubject = str_replace("%20", " ", $resubject);
                    $resubject = preg_replace('/%32/', '&', $resubject);
                    $resubject = preg_replace('/%33/', ';', $resubject);
                    $resubject = preg_replace("/\'/", ''', $resubject);
                    $resubject = preg_replace("/\"/", '"', $resubject);
                    //$table = array_flip(get_html_translation_table(HTML_ENTITIES));
                    //$resubject = strtr($resubject, $table);
                    $fromBot = 1; //this new topic comes from the discuss mambot
                    $authorName = htmlspecialchars($my_name);
                    $rowid = mosGetParam($_REQUEST, 'rowid', 0);
                    $rowItemid = mosGetParam($_REQUEST, 'rowItemid', 0);
//start content url
                    if ($rowItemid) {
                        $contentURL = sefRelToAbs('index.php?option=com_content&task=view&Itemid=' . $rowItemid . '&id=' . $rowid);
                    }
                    else {
                        $contentURL = sefRelToAbs('index.php?option=com_content&task=view&Itemid=1&id=' . $rowid);
                    }

                    $contentURL = _POST_DISCUSS . ': [url=' . $contentURL . ']' . $resubject . '[/url]';
//end content url
                   ?> <form action = "<?php echo sefRelToAbs(KUNENA_LIVEURLREL."&func=post");?>" method = "post" name = "postform" enctype = "multipart/form-data">
                        <input type = "hidden" name = "parentid" value = "<?php echo $parentid;?>"/>

                        <input type = "hidden" name = "catid" value = "<?php echo $catid;?>"/>

                        <input type = "hidden" name = "action" value = "post"/>

                        <input type = "hidden" name = "contentURL" value = "<?php echo $contentURL ;?>"/>

                        <?php
                        //get the writing stuff in:
                        if (file_exists(KUNENA_ABSTMPLTPATH . '/fb_write.html.php')) {
                            include (KUNENA_ABSTMPLTPATH . '/fb_write.html.php');
                        }
                        else {
                            include (KUNENA_ABSPATH . '/template/default/fb_write.html.php');
                        }
                        //--
                        //echo "</form>";
                }
//end joomleague

davindersangha
.
Posts: 36
Joined: Sun May 03, 2009 11:57 pm

Re: Kunena integration

Postby davindersangha » Tue Jun 30, 2009 1:27 pm

Can anyone explain which files are supposed to be edited to add Kunena integration into JoomLeague.

User avatar
benio07
.
Posts: 457
Joined: Fri Feb 08, 2008 9:24 am
Contact:

Re: Kunena integration

Postby benio07 » Sat Jul 11, 2009 5:37 pm

I need hack to Kunena 1.5.3
Joomla 1.5.14 joomleague 1.505a

crazystone
Newbie
Posts: 2
Joined: Wed Jul 18, 2007 2:32 pm

Re: Kunena integration

Postby crazystone » Tue Jul 28, 2009 10:46 pm

Replace 3 Entries com_fireboard with com_kunena in /components/com_joomleague/joomleague.html.php (Joomla 1.5 Please Save as UTF-8 and upload this)

Search in /com_kunena/template/default/post.php at the same Position and paste in...

also after this                         //echo "";
                                          }

Code: Select all

 //begin Joomleague
            else if ($do == "newFromJoomLeague" && (hasPostPermission($database, $catid, $replyto, $my->id, $fbConfig->pubwrite, $is_Moderator)))
                { // The Mosbot "discuss on forums" has detected an unexisting thread and wants to create one
                    $parentid = 0;
                    $replyto = (int)$replyto;
                    $setFocus = 0;
                    //                $resubject = base64_decode($resubject); //per mf#6100  -- jdg 16/07/2005
                    $resubject = base64_decode(strtr($resubject, "()", "+/"));
                    $resubject = str_replace("%20", " ", $resubject);
                    $resubject = preg_replace('/%32/', '&', $resubject);
                    $resubject = preg_replace('/%33/', ';', $resubject);
                    $resubject = preg_replace("/\'/", ''', $resubject);
                    $resubject = preg_replace("/\"/", '"', $resubject);
                    //$table = array_flip(get_html_translation_table(HTML_ENTITIES));
                    //$resubject = strtr($resubject, $table);
                    $fromBot = 1; //this new topic comes from the discuss mambot
                    $authorName = htmlspecialchars($my_name);
                    $rowid = mosGetParam($_REQUEST, 'rowid', 0);
                    $rowItemid = mosGetParam($_REQUEST, 'rowItemid', 0);
//start content url
                    if ($rowItemid) {
                        $contentURL = sefRelToAbs('index.php?option=com_content&task=view&Itemid=' . $rowItemid . '&id=' . $rowid);
                    }
                    else {
                        $contentURL = sefRelToAbs('index.php?option=com_content&task=view&Itemid=1&id=' . $rowid);
                    }

                    $contentURL = _POST_DISCUSS . ': [url=' . $contentURL . ']' . $resubject . '[/url]';
//end content url
                   ?> <form action = "<?php echo sefRelToAbs(KUNENA_LIVEURLREL."&func=post");?>" method = "post" name = "postform" enctype = "multipart/form-data">
                        <input type = "hidden" name = "parentid" value = "<?php echo $parentid;?>"/>

                        <input type = "hidden" name = "catid" value = "<?php echo $catid;?>"/>

                        <input type = "hidden" name = "action" value = "post"/>

                        <input type = "hidden" name = "contentURL" value = "<?php echo $contentURL ;?>"/>

                        <?php
                        //get the writing stuff in:


                        if (file_exists(KUNENA_ABSTMPLTPATH . '/fb_write.html.php')) {
                            include (KUNENA_ABSTMPLTPATH . '/fb_write.html.php');
                        }
                        else {
                            include (KUNENA_PATH_TEMPLATE_DEFAULT .DS. 'fb_write.html.php');
                        }
                        //--
                        //echo "</form>";
                }
//end joomleague


It's works great with Joomleague 0.93b, Joomla! 1.5.12 Stable and Kunena 1.5.4

Very important to save not in ANSI - PLEASE SAVE AS UTF-8 and upload thise File!!!

User avatar
sokratex
Newbie
Posts: 1
Joined: Sat Oct 11, 2008 11:54 am
Location: Reykjavik
Contact:

Re: Kunena integration

Postby sokratex » Thu Jul 30, 2009 12:24 am

Hi crazystonge, would it be possible for you to attach your post.php file for kunena here?
It would be very helpfull, as I have tried your fix and it did not quite work out for me. Maybe because I was not sure where to paste in the code snippet.
JoomLeague - 0.93b

crazystone
Newbie
Posts: 2
Joined: Wed Jul 18, 2007 2:32 pm

Re:Kunena integration

Postby crazystone » Sun Aug 16, 2009 9:41 am

Anything late...

Here is my modified post.php

I hope is helpful for you!
You do not have the required permissions to view the files attached to this post.

User avatar
Lord_Helmchen
.
Posts: 45
Joined: Fri Aug 03, 2007 1:56 pm
Joomleague version: 2.0.x
Location: Germany
Contact:

Re:Kunena integration

Postby Lord_Helmchen » Mon Sep 21, 2009 8:30 pm

Here are some changes i made. Maybe someone could need this. I changed some things in post.php (Kunena) and joomleague.html.php (Joomleague of course)

In post.php i changed the URL to point to the game report sheet.

Code: Select all

            
//begin Joomleague
            else if ($do == "newFromJoomLeague" && (hasPostPermission($database, $catid, $replyto, $my->id, $fbConfig->pubwrite, $is_Moderator)))
                { // The Mosbot "discuss on forums" has detected an unexisting thread and wants to create one
                    $parentid = 0;
                    $replyto = (int)$replyto;
                    $setFocus = 0;
                    //                $resubject = base64_decode($resubject); //per mf#6100  -- jdg 16/07/2005
                    $resubject = base64_decode(strtr($resubject, "()", "+/"));
                    $resubject = str_replace("%20", " ", $resubject);
                    $resubject = preg_replace('/%32/', '&', $resubject);
                    $resubject = preg_replace('/%33/', ';', $resubject);
                    $resubject = preg_replace("/\'/", ''', $resubject);
                    $resubject = preg_replace("/\"/", '"', $resubject);
                    //$table = array_flip(get_html_translation_table(HTML_ENTITIES));
                    //$resubject = strtr($resubject, $table);
                    $fromBot = 1; //this new topic comes from the discuss mambot
                    $authorName = htmlspecialchars($my_name);
          $mid = JRequest::getInt('mid', 0);
                    $p = JRequest::getInt('p', 0);
//start content url
                    if ($mid && $p) {
                        $contentURL = sefRelToAbs('index.php?option=com_joomleague&func=showReport&p=' . $p . '&mid=' . $mid . '&Itemid=1');
                    }
                    else {
                        $contentURL = sefRelToAbs('index.php?option=com_joomleague&Itemid=1');
                    }

                    $contentURL = _POST_DISCUSS . ': [url=' . $contentURL . ']' . $resubject . '[/url]';
//end content url
                   ?> <form action = "<?php echo sefRelToAbs(KUNENA_LIVEURLREL."&func=post");?>" method = "post" name = "postform" enctype = "multipart/form-data">
                        <input type = "hidden" name = "parentid" value = "<?php echo $parentid;?>"/>

                        <input type = "hidden" name = "catid" value = "<?php echo $catid;?>"/>

                        <input type = "hidden" name = "action" value = "post"/>

                        <input type = "hidden" name = "contentURL" value = "<?php echo $contentURL ;?>"/>

                        <?php
                        //get the writing stuff in:


                        if (file_exists(KUNENA_ABSTMPLTPATH . '/fb_write.html.php')) {
                            include (KUNENA_ABSTMPLTPATH . '/fb_write.html.php');
                        }
                        else {
                            include (KUNENA_PATH_TEMPLATE_DEFAULT .DS. 'fb_write.html.php');
                        }

                        //--
                        //echo "</form>";
                }
//end joomleague


In joomleague.html.php i added the date to the subject and changed some stuff from com_fireboard to com_kunena
Just replace the whole function make_forumlink

Code: Select all

function make_forumlink(&$match){
     global $joomleague, $database;
     static $sbItemid = 0; //doesn't change much from one call to he other...
    
     if ( $sbItemid == 0 ) { //this way, we only trig this request once
        $database->setQuery("SELECT id FROM #__menu WHERE link='index.php?option=com_kunena'");
        $sbItemid = $database->loadResult();
     }
     if($joomleague->enable_sb == 0) return '';
     $shown_time = strftime("%d.%m.%y %H:%M",strtotime($match->match_date));
     $title = sprintf("[%s] %s - %s",addslashes($shown_time),addslashes($match->home),addslashes($match->away));
   
     $query = sprintf("SELECT id FROM #__fb_messages WHERE catid =%s AND subject = '%s'",$joomleague->sb_catid, $title);
     $database->setQuery($query);
     $resultid = $database->loadResult();
   
     $title = sprintf("[%s] %s - %s",$shown_time,$match->home,$match->away);
     if ($resultid == ""){
       $showlink = ("index.php?option=com_kunena&Itemid=$sbItemid"
       . "&mid=" . $match->match_id
       . "&p=" . $joomleague->id
       . "&func=post&do=newFromJoomLeague&resubject=".strtr(base64_encode($title), "+/", "()")."&catid=".$joomleague->sb_catid
       ."");
       $countPosts = 0;
       return sprintf('<a href="%s"><img src="'.JL_TEMPLATE_FOLDERS_URL
       .'/images/discuss.gif" border="0" alt="%s" title="%s" /></a>',$showlink,_JL_RESULTS_JOOMLABOARD_LINK,_JL_RESULTS_JOOMLABOARD_LINK);
     }
     else{
       
       $joomleague->_db->setQuery("SELECT count(id) from #__fb_messages where thread = $resultid");
       $countPosts = $joomleague->_db->loadResult();
   
       $showlink = sefRelToAbs("index.php?option=com_kunena&Itemid=" .$sbItemid. "&func=view&id=" .$resultid. "&catid=" .$joomleague->sb_catid. "");
       return sprintf('<a href="%s"><img src="'.JL_TEMPLATE_FOLDERS_URL.'/images/discuss_active.gif" border="0" alt="%s %s" title="%s %s" /></a>',$showlink,$countPosts,_JL_RESULTS_JOOMLABOARD_COUNT,$countPosts,_JL_RESULTS_JOOMLABOARD_COUNT);
     }
   }


I use Joomleague 0.93b, Joomla 1.5.14 and Kunena 1.5.5. You can see an example here http://www.evr-fans.de/index.php?option ... 275#128275

shaq_attack
Newbie
Posts: 1
Joined: Thu Sep 17, 2009 11:01 am

Re:Kunena integration

Postby shaq_attack » Fri Oct 16, 2009 12:52 pm

I get an error when I want to confirm the message created. :(

I use Joomleague 0.93b, Joomla 1.5.11 and Kunena 1.5.6

"Fatal error: Unable to load post.\nDB function reports no errors in .../components/com_kunena/lib/kunena.debug.php on line 58"

zel
Newbie
Posts: 3
Joined: Tue Aug 25, 2009 1:15 pm

Re:Kunena integration

Postby zel » Fri Oct 23, 2009 12:04 pm

also me.... same error.... how can we resolve the problem?

User avatar
johncage
.
Posts: 953
Joined: Fri May 11, 2007 11:49 pm
Location: Somewhere under the rainbow
Contact:

Re:Kunena integration

Postby johncage » Sat Oct 24, 2009 2:28 am

i searched kunena forum for joomleague threads, why is there any question about joomleague? or is it for everybody common joomleague will support any component out there just because times ago component supported this? (and there was no feed back as far as i know)... ask your board programmer to give a suitable connection to a sport component many want to use, and there might be more opportunities than only hacks soon!
sorry for not beeing gentle... and sweet, and nice.....
but FU** *** *** having a problem with this, cause it's not personally for anyone posting here....
Look, you've got it all wrong! You don't NEED to follow ME, You don't NEED to follow ANYBODY! You've got to think for your selves! You're ALL individuals!
So keep a clear head and always carry a lightbulb.

User avatar
kubik
.
Posts: 618
Joined: Tue Nov 03, 2009 7:20 pm
Joomleague version: 2.0.x
Location: Oberschlesien
Contact:

Re:Kunena integration

Postby kubik » Tue Mar 16, 2010 11:29 pm

:confused:

My link to Kunena from match schedule works fine, but I found little bug in post made by link...

Who knows how to delete this fellow?
You do not have the required permissions to view the files attached to this post.
Joomla 2.5.x & 3.x
JoomLeague - Latest Git Version
GG Network No : 5739578
www.RegioLiga.pl

User avatar
Lord_Helmchen
.
Posts: 45
Joined: Fri Aug 03, 2007 1:56 pm
Joomleague version: 2.0.x
Location: Germany
Contact:

Re:Kunena integration

Postby Lord_Helmchen » Tue Mar 30, 2010 10:48 am

This could be a problem with magic_quote settings in php.ini.

Try to change in post.php around line 215 from

Code: Select all

if ($contentURL != "empty") {
                                    $message = $contentURL . "\n\n" . $message;
                                }


to

Code: Select all

if ($contentURL != "empty") {
                                    $message = $contentURL . '\n\n' . $message;
                                }

User avatar
kubik
.
Posts: 618
Joined: Tue Nov 03, 2009 7:20 pm
Joomleague version: 2.0.x
Location: Oberschlesien
Contact:

Re:Kunena integration

Postby kubik » Thu Apr 01, 2010 9:26 pm

:thx: m8
Joomla 2.5.x & 3.x
JoomLeague - Latest Git Version
GG Network No : 5739578
www.RegioLiga.pl

bezimienny
.
Posts: 139
Joined: Tue Jan 29, 2008 9:58 am
Contact:

Re:Kunena integration

Postby bezimienny » Fri Apr 02, 2010 1:09 pm

I have a problem, after upgrading from version 1.5.7 Kunena 1.5.9 lost the opportunity to discuss the match in the forum. Clicking on the link to go to the forum without creating a post.
Version of joomleague 0.93 tested 1.5.0 alpha
Version of joomla: 1.5.x
http://www.sp-poland.com

User avatar
Lord_Helmchen
.
Posts: 45
Joined: Fri Aug 03, 2007 1:56 pm
Joomleague version: 2.0.x
Location: Germany
Contact:

Re:Kunena integration

Postby Lord_Helmchen » Tue Apr 13, 2010 12:59 pm

Did you edit post.php again?

bezimienny
.
Posts: 139
Joined: Tue Jan 29, 2008 9:58 am
Contact:

Re:Kunena integration

Postby bezimienny » Thu Apr 15, 2010 9:06 pm

Yes, post.php was changed again.
The attached view of the button that directs Discuss in the forum
You do not have the required permissions to view the files attached to this post.
Version of joomleague 0.93 tested 1.5.0 alpha
Version of joomla: 1.5.x
http://www.sp-poland.com

aespinola
Newbie
Posts: 1
Joined: Sun Aug 22, 2010 8:04 am

Re: Kunena integration

Postby aespinola » Sun Aug 22, 2010 9:14 am

hello!!
I have been using joomleague for a while and it is awesome!! thanks for such a great tool to manage our own leagues!!
However I do have an issue. I want to link my joomleague 0.93 with my Kunena forum 1.5x...and I have followed all the instructions of the post above ...but I am still getting an error on line 692 in the post.php file

T_CONSTANT_ENCAPSED_STRING

the new line is: $resubject = preg_replace("/\"/", '"', $resubject);
the former one was: $resubject = preg_replace("/\"/", '&quot;', $resubject);

that happen when I do a Replacement, if i do just an addition of this script I have exactly the same error.

My results so far are good just because I edit the joomleague.html.php
( when I click on the link of the result in joomleague it does forward me to the right kunena forum , but it does not show any post inside or new post although there a few there.) . I just could do 50% of the job properly
Hopefully some one can help me out.thx!!
Antonio

Becks
.
Posts: 87
Joined: Wed May 07, 2008 5:33 pm
Contact:

Re: Kunena integration

Postby Becks » Sat Aug 28, 2010 12:41 pm

Can some one post working post.php for kunena.


Return to “Tips, Tricks, SourceCodeChanges”

Who is online

Users browsing this forum: No registered users and 1 guest

cron