Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Integration with third-party extensions    Topic: JoomLeague Integration
Pages: [1]   Go Down
  Print  
Author Topic: JoomLeague Integration  (Read 9008 times)
0 Members and 1 Guest are viewing this topic.
zebil
Newbie
*

Karma: 0
Offline Offline

Posts: 4


« on: January 09, 2009, 16:25:36 »

Hi,
First of all thank you very much for these great component.
I have a patched Jomleague site. Is it possible to add comments to table tennis match details and match week pages?

Thank you,
Zebil

Match Details Page: http://www.kkmtb.org/lig/2008-2009/kordsa-global-vs.-izocam-5.html
Match Week Page:  http://www.kkmtb.org/lig/2008-2009/maclar.html

I added this codes to show_match_results.tpl.php but the comments shown not just related match details, it shown all matches details.

Code:
<?php
  
global $mosConfig_absolute_path;
  
$comments $mosConfig_absolute_path '/components/com_jcomments/jcomments.php';
  if (
file_exists($comments)) {
    require_once(
$comments);
    echo 
JComments::showComments($row->id'com_adsmanager'$row->ad_headline);
  }
?>


Here the show_match_results.tpl.php

Code:
<?php defined'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); ?>

<!-- Header with Project Name-->
<?php if ($showMatrix_config['show_project_heading'] == "1" OR $overall_config['show_project_heading'] == "1") { ?>
<div class="componentheading" <?php if ($showMatrix_config['show_print_button'] == "1" OR $overall_config['show_print_button'] == "1") echo 'style="float:left;"';?>><?php echo $project->name?></div>
<!-- Druckfunktion -->
<?php if ($showMatrix_config['show_print_button'] == "1" OR $overall_config['show_print_button'] == "1") {
HTML_joomleague::PrintIcon$row$paramsfalse'' );
};
?>

<!-- Druckfunktion Ende -->
<?php ?>
<!-- Header END -->

<?php

$match = new Match($database);
  
$match->load($mid);
  
$team1 = new JL_Team($database);
  
$team1->load($match->matchpart1);
  
$team2 = new JL_Team($database);
  
$team2->load($match->matchpart2);
  
$matchResults $project->getMatchResults($mid);
  
$playerNames = array();
  
$sets1=0;$sets2=0;$points1=0;$points2=0;
  
foreach ($matchResults as $result) {
  
$sets1=$sets1+$result->player1_sets;
  
$sets2=$sets2+$result->player2_sets;
  
$points1=$points1+$result->player1_points;
  
$points2=$points2+$result->player2_points;
  

  
$players[$result->player1_id] = " ";
  
$players[$result->player2_id] = " ";
  
if (isset($result->player1_partner_id)) {
  
$players[$result->player1_partner_id] = " ";
  
}
  
if (isset($result->player2_partner_id)) {
  
$players[$result->player2_partner_id] = " ";
  
}
  
}
  
$playerNames $project->getPlayerNames($players);

  
function show_player($id) {
global $playerNames,$p;

print '<a href="'.sefRelToAbs ("index.php?option=com_joomleague&amp;func=showPlayer&amp;p=$p&amp;pid=$id").'">';
print $playerNames[$id].'</a>';
}
  

?>

<div class="componentheading"><?php printf(_JL_TT_MATCH_REPORT,$team1->name,$team2->name); ?></div>
<br/>
<table width="100%" align="center" border="0" cellpadding="5" cellspacing="0">
<thead><tr>
<th>&nbsp;</th>
<th><?php echo $team1->name;?></th>
<th>-</th>
<th><?php echo $team2->name;?></th>
<?php for ($i=1;$i<=5;$i++) {
  echo "<th>$i.&nbsp;"._JL_TT_SET."</th>\n";}
?>

<th><?php echo _JL_TT_SETS?></th>
<th><?php echo _JL_TT_PLAYS?></th>
</tr></thead>

<?php 
foreach (
$matchResults as $result) {
if (isset($result->player1_partner_id)) {
$doppel "D";
} else {
unset($doppel);
}
print "<tr><td colspan='16'><hr/></td></tr>";

print "<tr><td>$doppel$result->pos1 : $doppel$result->pos2 </td>";

print "<td>"show_player($result->player1_id);
if (isset($doppel)) {
print "<br/>";show_player($result->player1_partner_id);
}
print "</td><td>-</td>";
print "<td>"show_player($result->player2_id);
if (isset($doppel)) {
print "<br/>"show_player($result->player2_partner_id);
}
print "</td>";

for ($i=1$i<=5;$i++) {
eval("\$a=\$result->result1_set$i;");
eval("\$b=\$result->result2_set$i;");
if (isset($a) && isset($b)) {  
printf("<td align='center'>%s:%s</td>",$a,$b);
} else {
print("<td align='center'>-</td>");
}
}
printf("<td align='center'>%s:%s</td>",$result->player1_sets,$result->player2_sets);
printf("<td align='center'>%s:%s</td>",$result->player1_points,$result->player2_points);
print "</tr>\n";
}
print "<tr><td colspan='16'><hr/></td></tr>";
print "<tr><td colspan='9'>&nbsp;</td>
<td align='center'>$sets1:$sets2</td><td align='center'>$points1:$points2</td></tr>"
;
?>

</table>

<?php
  
global $mosConfig_absolute_path;
  
$comments $mosConfig_absolute_path '/components/com_jcomments/jcomments.php';
  if (
file_exists($comments)) {
    require_once(
$comments);
    echo 
JComments::showComments($row->id'com_adsmanager'$row->ad_headline);
  }
?>


<!-- Back Button START -->
<?php if ($results_config['show_back_button'] > OR $overall_config['show_back_button'] > 0) {;?>
<?php if ($results_config['show_back_button'] == "1" OR $overall_config['show_back_button'] == "1") echo '<div align="left">'; else echo '<div align="right">';?>
<?php
$params 
= & new mosParameters'' );
$params->def'back_button'true );
$params->def'popup'false );
mosHTML::BackButton$params );
?>
</div>
<?php };?>
<!-- Back Button END -->
« Last Edit: January 09, 2009, 17:28:58 by zebil » Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: January 09, 2009, 19:47:29 »

I added this codes to show_match_results.tpl.php but the comments shown not just related match details, it shown all matches details.
you are use wrong code... take this instead:

Code:
<?php
  
global $mainframe;
  
$comments $mainframe->getCfg('absolute_path') . '/components/com_jcomments/jcomments.php';
  if (
file_exists($comments)) {
    require_once(
$comments);
    echo 
JComments::showComments($mid'com_joomleague'printf(_JL_TT_MATCH_REPORT,$team1->name,$team2->name));
  }
?>
« Last Edit: January 09, 2009, 19:50:41 by smart » Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
zebil
Newbie
*

Karma: 0
Offline Offline

Posts: 4


« Reply #2 on: January 09, 2009, 20:17:41 »

Dear @Smart thank you very much. It works now.

What about this page? I used same code that you gave for other page (match details) but all comments shown all week? Could you please help?

Code:
<?php defined'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/* JoomLeague Ligaverwaltung und Tippspiel für Joomla!
 * Copyright (C) 2007  Robert Moss
 *  
 * Homepage: http://www.joomleague.de
 * Support: htt://www.joomleague.de/forum/
 * 
 * This file is part of JoomLeague.
 *  
 * JoomLeague is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Please note that the GPL states that any headers in files and
 * Copyright notices as well as credits in headers, source files
 * and output (screens, prints, etc.) can not be removed.
 * You can extend them with your own credits, though...
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/copyleft/gpl.html.
*/ 

require_once "$mosConfig_absolute_path/components/com_joomleague/joomleague.js.php";?>


<a name="jl_top" id="jl_top"></a>
<!-- Header with Project Name-->
<?php if ($results_config['show_project_heading'] == "1" OR $overall_config['show_project_heading'] == "1") { ?>
<div class="componentheading" <?php if ($results_config['show_print_button'] == "1" OR $overall_config['show_print_button'] == "1") echo 'style="float:left;"';?>><?php echo $project->name?></div>
<!-- Druckfunktion -->
<?php if ($results_config['show_print_button'] == "1" OR $overall_config['show_print_button'] == "1") {
HTML_joomleague::PrintIcon$row$paramsfalse'' );
};
?>

<!-- Druckfunktion Ende -->
<?php ?>
<!-- Header END -->

<!-- section header e.g. ranking, results etc. -->

<?php 
if ($results_config['show_events']==1) { HTML_joomleague::init_tabs(); }
if (
$mytask=="edit"&&($allowed==1||(in_array($my->id$alloweds)&&$my->id>0))) {
require_once "$mosConfig_absolute_path/components/com_joomleague/js/JL_eventsediting.js.php";
//HTML_joomleague::init_edit_events();

}
?>

<table width="100%" class="contentpaneopen">
<tr>
<td class="contentheading">
<?php 
if ($current_round>0) {
      if (
$results_config['show_section_heading']==1) {
      
HTML_joomleague::show_matchdays_title(_JL_RESULTS$rounds[$current_round-1]->id, &$results_config);
    if ($allowed==1||($allowed==1||(in_array($my->id$alloweds)&&$my->id>0))) {
      
HTML_joomleague::show_edit_icon();}
}
}

else {
if ($results_config['show_section_heading']==1HTML_joomleague::show_matchdays_title(_JL_PLAN." - "$team->name0, &$results_config);
}
?>

    </td>
<?php 

// select navigation of matchdays for browsing mode START
if (isset($pageNav2)&&$mytask!="edit"&&$results_config['show_matchday_dropdown']==1) echo '<td align="right">'._JL_MATCHDAYS_SELECT.$pageNav2.'</td>';
// select navigation of matchdays for browsing mode ENDS    
?>

  </tr>

</table>
<?php
if ($mytask=="edit"&&($allowed==1||(in_array($my->id$alloweds)&&$my->id>0))) {
HTML_joomleague::init_edit_events();
HTML_joomleague::start_edit_form($current_round);
}
if (
$allowed==1) {
if (
$mytask=="edit"&&$project->current_round_auto==0) {
  echo 
'<table width="100%"><tr><td style="text-align:right"><b>'._JL_RESULTS_SET_MATCHDAY.'</b>'.$project->roundsdropdown($current_roundcount($rounds)).'</td></tr></table>';
  }
}
?>


<br />

<!-- Main START -->
<table width="96%" align="center" border="0" cellpadding="3" cellspacing="0">

<?php
// this shows the matches (DO NOT DISABLE) START
HTML_joomleague::show_results(&$matches, &$results_config);
// this shows the matches (DO NOT DISABLE) ENDS
?>

</table>
<!-- Main END -->
<?php
if ($mytask=="edit"&&($allowed==1||(in_array($my->id$alloweds)&&$my->id>0))) {
?>

<input type="hidden" class="button" name="save_data" value="1" />
</form>
<?php
HTML_joomleague
::close_edit_events($mdd);
};
?>


<!-- Matchdays Output  -->
<?php if (isset($pageNav)&&$results_config['show_matchday_pagenav']==1) { ?>

<table width="96%" align="center" border="0" cellpadding="3" cellspacing="0">
  <tr>
   <td align="center"><br /><?=$pageNav ?></td>
  </tr>
</table>
<?php };?>
<!-- Matchdays Output END -->

<!-- Print Button START -->
<?php if ($results_config['show_back_button'] > OR $overall_config['show_back_button'] > 0) {;?>
<?php if ($results_config['show_back_button'] == "1" OR $overall_config['show_back_button'] == "1") echo '<div align="left">'; else echo '<div align="right">';?>
<?php
$params 
= & new mosParameters'' );
$params->def'back_button'true );
$params->def'popup'false );
mosHTML::BackButton$params );
?>
</div>
<?php };?>
<!-- Print Button END -->

 
Logged
zebil
Newbie
*

Karma: 0
Offline Offline

Posts: 4


« Reply #3 on: January 12, 2009, 02:49:45 »

@smart, do you have any idea for Match Week Page:  http://www.kkmtb.org/lig/2008-2009/maclar.html ?
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #4 on: January 12, 2009, 03:05:50 »

@smart, do you have any idea for Match Week Page:  http://www.kkmtb.org/lig/2008-2009/maclar.html ?
I don't think about it yet. Currently I have no time for this. May be later...
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
zebil
Newbie
*

Karma: 0
Offline Offline

Posts: 4


« Reply #5 on: January 14, 2009, 00:08:29 »

@smart,
Your first fix is working you know. But at the jcomment admin page it doesn't show which comment is for which match?
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #6 on: January 14, 2009, 01:50:28 »

But at the jcomment admin page it doesn't show which comment is for which match?
yes, because we need make small plugin for this... some time later I'll make one and attach here...
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
markk
Newbie
*

Karma: 0
Offline Offline

Posts: 1


Email
« Reply #7 on: October 06, 2009, 18:16:55 »

yo guys,

Thanks for this amazing component! I got it working smoothly on my Joomleague website. Atm its running on the report page. But since u promised this plugin id like too get rid off the hack and use the plugin.

Thanks in advance for your reply and help!

Mark Cool
Logged
Heart
Newbie
*

Karma: 0
Offline Offline

Posts: 6


« Reply #8 on: October 10, 2011, 12:52:43 »

@smart,
Your first fix is working you know. But at the jcomment admin page it doesn't show which comment is for which match?
Any update to this would be fine!  Cry Wink
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Integration with third-party extensions    Topic: JoomLeague Integration
 
Jump to: