0 Пользователей и 1 Гость просматривают эту тему.
  • 32 Ответов
  • 5622 Просмотров
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
Задача следующая:

Хочу любому пользователю разрешить вводить результаты, но не всех команд, а только выбранных (1-3).

Ну начать я так полагаю нужно с того что только админы могут добавлять результаты. А нужно разрешить где то выбирать из пользователей.

Помогите, если есть какие-то мысли или покажите в каком направлении копать.
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
Немного продвинулся. Разобрался как сделать, чтобы результаты изменяли все зарегистрированные пользователи. Осталось только понять, как конкретному пользователю разрешить добавлять результат определенной команды.

Люди никто не реализовывал такое? Ну хоть покажите где это вообще копать
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
Захожу во меню турнира, команды, выбираю редактировать команду.

В строке Администратор команды, могу выбрать только админов. Как сделать, чтобы выбор был из зарегистрированных пользователей?
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
Захожу во меню турнира, команды, выбираю редактировать команду.

В строке Администратор команды, могу выбрать только админов. Как сделать, чтобы выбор был из зарегистрированных пользователей?

Я так понимаю за вывод этого списка отвечают вот эти файл:

1) form_details

Код
<?php defined('_JEXEC') or die('Restricted access');
?>

<fieldset class="adminform">
<legend>
<?php
echo JText::sprintf( 'JL_ADMIN_P_TEAM_TITLE_DETAILS',
'<i>' . $this->project_team->name . '</i>',
'<i>' . $this->projectws->name . '</i>');
?>
</legend>

<fieldset class="adminform">
<table class="admintable" border="0">
<tr>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_ADMIN'); ?>
</td>
<td>
//Вот эта строка!
<?php echo $this->lists['admin']; ?>
//Вот эта строка!
</td>
<?php
if ($this->projectws->project_type != 'DIVISIONS_LEAGUE') // No divisions
{
$colspan = ' colspan="3"';
}
else
{
$colspan = '';
}
?>
<td width="5%" <?php echo $colspan; ?>>&nbsp;</td>
<?php
if ($this->projectws->project_type == 'DIVISIONS_LEAGUE') // Has divisions
{
?>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php
echo JText::_('JL_ADMIN_P_TEAM_DIV');
?>
</td>
<td>
<?php
$inputappend='';
if ($this->project_team->division_id == 0)
{
$inputappend=' style="background-color:#bbffff"';
}
echo JHTML::_( 'select.genericlist',
$this->lists['divisions'],
'division_id',
$inputappend.'class="inputbox" size="1"',
'value','text', $this->project_team->division_id);
?>
</td>
<?php
}
?>
</tr>
<tr>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_VENUE'); ?>
</td>
<td >
<?php echo $this->lists['playgrounds']; ?>
</td>
<td width="5%">&nbsp;
</td>
</tr>

<tr>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_INSCORE'); ?>
</td>
<td>
<?php echo $this->lists['is_in_score']; ?>
</td>
</tr>
         
</table>
</fieldset>

<fieldset class="adminform">
<table class="admintable" border="0">
<tr>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_INIT_POINTS'); ?>
</td>
<td>
<input class="text_area" type="text" name="start_points" id="title" size="5" maxlength="5"
value="<?php echo $this->project_team->start_points;?>" />
</td>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_REASON_INIT_POINTS'); ?>
</td>
<td colspan="3">
<input class="text_area" type="text" name="reason" id="title" size="60" maxlength="100"
value="<?php echo $this->project_team->reason; ?>" />
</td>
</tr>
         
</table>
</fieldset>
<fieldset class="adminform">
<table class="admintable" border="0">

<tr>
<tr>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_USE_FINALLY'); ?>
</td>
<td>
<?php echo $this->lists['use_finally']; ?>
</td>
</tr>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_TOT_MATCH'); ?>
</td>
<td>
<input class="text_area" type="text" name="matches_finally" id="title" size="5" maxlength="5"
value="<?php echo $this->project_team->matches_finally; ?>" />
</td>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_TOT_POINTS'); ?>
</td>
<td>
<input class="text_area" type="text" name="points_finally" id="title" size="5" maxlength="5"
value="<?php echo $this->project_team->points_finally; ?>" />
</td>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_TOT_NEG_POINTS'); ?>
</td>
<td>
<input class="text_area" type="text" name="neg_points_finally" id="title" size="5" maxlength="5"
value="<?php echo $this->project_team->neg_points_finally; ?>" />
</td>
</tr>
<tr>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_WON'); ?>
</td>
<td>
<input class="text_area" type="text" name="won_finally" id="title" size="5" maxlength="5"
value="<?php echo $this->project_team->won_finally; ?>" />
</td>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_DRAW'); ?>
</td>
<td>
<input class="text_area" type="text" name="draws_finally" id="title" size="5" maxlength="5"
value="<?php echo $this->project_team->draws_finally; ?>" />
</td>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_LOST'); ?>
</td>
<td>
<input class="text_area" type="text" name="lost_finally" id="title" size="5" maxlength="5"
value="<?php echo $this->project_team->lost_finally; ?>" />
</td>
</tr>
<tr>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_TOT_HG'); ?>
</td>
<td>
<input class="text_area" type="text" name="homegoals_finally" id="title" size="5" maxlength="5"
value="<?php echo $this->project_team->homegoals_finally; ?>" />
</td>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_TOT_GG'); ?>
</td>
<td>
<input class="text_area" type="text" name="guestgoals_finally" id="title" size="5" maxlength="5"
value="<?php echo $this->project_team->guestgoals_finally; ?>" />
</td>
<td nowrap="nowrap" class="key" style="text-align:right; ">
<?php echo JText::_('JL_ADMIN_P_TEAM_TOT_DG'); ?>
</td>
<td>
<input class="text_area" type="text" name="diffgoals_finally" id="title" size="5" maxlength="5"
value="<?php echo $this->project_team->diffgoals_finally; ?>" />
</td>
</tr>
</table>
</fieldset>
</fieldset>

2) view.html.php
Код
<?php
/**
 * @copyright Copyright (C) 2006-2011 JoomLeague.net. All rights reserved.
 * @license GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */

// Check to ensure this file is included in Joomla!
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view' );
require_once(JPATH_COMPONENT.DS.'helpers'.DS.'imageselect.php');

/**
 * HTML View class for the Joomleague component
 *
 * @static
 * @package JoomLeague
 * @since 0.1
 */
class JoomleagueViewTeam extends JLGView
{
function display($tpl = null)
{
$mainframe =& JFactory::getApplication();

if($this->getLayout() == 'form')
{
$this->_displayForm($tpl);
return;
}

parent::display($tpl);
}

function _displayForm($tpl)
{
$mainframe =& JFactory::getApplication();
$db =& JFactory::getDBO();
$uri =& JFactory::getURI();
$user =& JFactory::getUser();
$model =& $this->getModel();

$lists = array();
//get the club
$team =& $this->get('data');
$isNew = ($team->id < 1);

// fail if checked out not by 'me'
if ($model->isCheckedOut( $user->get('id') ))
{
$msg = JText::sprintf( 'DESCBEINGEDITTED', JText::_( 'JL_ADMIN_TEAM_THETEAM' ), $team->name );
$mainframe->redirect( 'index.php?option=com_joomleague', $msg );
}

// Edit or Create?
if (!$isNew)
{
$model->checkout( $user->get('id') );
}
else
{
// initialise new record
//$season->published = 1;
$club->order = 0;
}

//build the HTML select list for admin
// $lists['admin'] = JHTML::_('list.users',  'admin', $club->admin);

// build the HTML select list for ordering
$query = 'SELECT ordering AS value, name AS text'
. ' FROM #__joomleague_team'
. ' ORDER BY ordering';

$lists['ordering'] = JHTML::_( 'list.specificordering', $team, $team->id, $query, 1 );

//build the HTML select list for clubs
$clubs[] = JHTML::_( 'select.option', '0', JText::_( 'JL_GLOBAL_SELECT_CLUB' ), 'id', 'name' );
if ( $res = & $this->get('Clubs') )
{
$clubs = array_merge( $clubs, $res );
}

if($team->club_id){
$selected_club = $team->club_id;
} else {
$selected_club = JRequest::getInt('cid',0);
}

$lists['clubs'] = JHTML::_( 'select.genericlist', $clubs, 'club_id', 'class="inputbox" size="1"', 'id', 'name', $selected_club );
unset($clubs);

$this->assignRef('lists', $lists);
$this->assignRef('team', $team);
/*
* extended data
*/
$paramsdata = $team->extended;
$paramsdefs = JPATH_COMPONENT . DS . 'assets' . DS . 'extended' . DS . 'team.xml';
$extended = new JLGExtraParams( $paramsdata, $paramsdefs );

$this->assignRef( 'extended', $extended );

//if there is no image selected, use default picture
$default = 'media/com_joomleague/placeholders/placeholder_450_2.png';
if (empty($team->picture)){$team->picture=$default;}

$imageselect=ImageSelect::getSelector('picture','picture_preview','teams',$team->picture,$default);
$this->assignRef('imageselect', $imageselect);

parent::display( $tpl );
}

}
?>
*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
Замените в view.html.php
Код
$lists['admin'] = JHTML::_('list.users',  'admin', $club->admin);
На:
Код
$lists['admin'] = JHTML::_('list.users',  'admin', $club->admin, 0, NULL, 'name', 0);
« Последнее редактирование: 05.02.2012, 22:30:36 от tranceRoller »
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
О спасибо!

Все заработало. Строчка помогла!

Вот только маленькая проблемка, помогите решить. Теперь я могу выбирать всех пользователей, но выбираю не ники, а имена. Как сделать выбор из ников?
« Последнее редактирование: 06.02.2012, 11:31:25 от jetjetjet »
*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
Файл view.html.php
Сменить
Код
$lists['admin'] = JHTML::_('list.users',  'admin', $club->admin, 0, NULL, 'name', 0);
на
Код
$lists['admin'] = JHTML::_('list.users',  'admin', $club->admin, 0, NULL, 'username', 0);

Файл ..\libraries\joomla\html\html\list.php
Строка 143
Сменить
Код
$query = 'SELECT id AS value, name AS text'
на
Код
$query = 'SELECT id AS value, username AS text'
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
Файл view.html.php
Сменить
Код
$lists['admin'] = JHTML::_('list.users',  'admin', $club->admin, 0, NULL, 'name', 0);
на
Код
$lists['admin'] = JHTML::_('list.users',  'admin', $club->admin, 0, NULL, 'username', 0);

Файл ..\libraries\joomla\html\html\list.php
Строка 143
Сменить
Код
$query = 'SELECT id AS value, name AS text'
на
Код
$query = 'SELECT id AS value, username AS text'

Блин огромное спасибо тебе.
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
Еще 1 вопрос появился по этой теме.

Чтобы вывести име пользователя (логин) нужно написать $this->teams[$this->ptid]->username
А как можно вывести ID пользователя, реально ли это?
*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
Цитировать
Чтобы вывести име пользователя (логин) нужно написать $this->teams[$this->ptid]->username
Где нужно записать?
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
Где нужно записать?

в teamplan


по сути хочу сделать в teamplan ссылку на профиль в kunena

чтобы сделать это, мне и нужно по сути id пользователя

default_plan.php

Код
<?php defined('_JEXEC') or die('Restricted access');
if (!isset($this->config['show_matchreport_column'])){$this->config['show_matchreport_column']=0;}
?>
<a name="jl_top" id="jl_top"></a>
<?php


if (!empty($this->matches))
{
$teamid=JRequest::getInt('tid');

?>
    <table>
    <tr>
    <td><?php
echo JText::_($this->teams[$this->ptid]->name); //вывожу имя
?></td>
    </tr>
<tr>
<td>
<?php
echo JoomleagueHelper::getPictureThumb($this->teams[$this->ptid]->logo_big,
$this->teams[$this->ptid]->name,
$this->config['150'],
$this->config['150'],1);

?>
</td>
    <td width="50"></td>
    <td>
 <table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><?php
echo JText::_('JL_RANKING_TEAM_ADMIN');
echo JText::_(':');
?></td>
            <td width="20">&nbsp;</td>
            <td><?php
echo JText::_($this->teams[$this->ptid]->username);
?></td>
          </tr>
          <tr>
                      <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td></td>
          </tr>
          <tr>
                      <td>&nbsp;</td>
            <td width="20">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
                      <td>&nbsp;</td>
            <td width="20">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </table>  
    </td>
</tr>
 </table>
 
<table class="fixtures" align="center">
<thead>
<tr class="sectiontableheader">
<?php
if ($this->config['show_events'])
{
?>
<th>&nbsp;</th>
<?php
}
?>

<th><?php echo JText::_('JL_TEAMPLAN_MATCHDAY'); ?></th>

<?php
if ($this->config['show_match_number'])
{
?>
<th><?php echo '&nbsp;'.JText::_('NUM').'&nbsp;'; ?></th>
<?php
}
?>

<?php
if (($this->project->project_type=='DIVISIONS_LEAGUE') && ($this->config['show_division']))
{
?>
<th><?php echo JText::_('JL_TEAMPLAN_DIVISION'); ?></th>
<?php
}
?>

<?php
if (($this->config['show_playground'] || $this->config['show_playground_alert']))
{
?>
<th><?php echo JText::_('JL_TEAMPLAN_PLAYGROUND'); ?></th>
<?php
}
?>

<th><?php echo JText::_('JL_TEAMPLAN_EDIT_DATE'); ?></th>

<?php
if ($this->config['show_time'])
{
?>
<th><?php echo JText::_('JL_TEAMPLAN_EDIT_TIME'); ?></th>
<?php
}
?>

<?php
if ($this->config['show_time_present'])
{
?>
<th><?php echo JText::_('JL_TEAMPLAN_TIME_PRESENT'); ?></th>
<?php
}

switch ($this->config['result_style'])
{
case 1 :

// Show home team marker
echo '<th>';
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_HOME_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_AWAY_TEAM');
}
echo '</th>';

// Create space for logo home team
if ($this->config['show_logo_small'])
{
echo '<th>&nbsp;</th>';
}

// Create room for the score to be displayed
echo '<th>'.JText::_('JL_TEAMPLAN_RESULT').'</th>';
// Create space for logo guest team
if ($this->config['show_logo_small'])
{
echo '<th>&nbsp;</th>';
}

// Show guest team marker
echo '<th>';
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_AWAY_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_HOME_TEAM');
}
echo '</th>';
break;
default :
case 0 :

// Show home team marker
echo '<th>';
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_HOME_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_AWAY_TEAM');
}
echo '</th>';

// Create space for logo home team
if ($this->config['show_logo_small'])
{
echo '<th>&nbsp;</th>';
}
echo '<th>&nbsp;</th>';

// Create space for logo guest team
if ($this->config['show_logo_small'])
{
echo '<th>&nbsp;</th>';
}
echo '<th>';

// Show guest team marker
if ($this->config['show_home_guest_team_marker'] && !$this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_AWAY_TEAM');
}
elseif ($this->config['show_home_guest_team_marker'] && $this->config['switch_home_guest'])
{
echo JText::_('JL_TEAMPLAN_HOME_TEAM');
}
echo '</th>';
echo '<th>'.JText::_('JL_TEAMPLAN_RESULT').'</th>';
break;
}
?>

<?php
if ($this->config['show_referee'])
{
?>
<th><?php echo JText::_('JL_TEAMPLAN_REFEREE'); ?></th>
<?php
}
?>

<?php
if (($this->config['show_thumbs_picture']) & ($teamid>0))
{
?>
<th>&nbsp;</th>
<?php
}
?>

<?php
if ($this->config['show_matchreport_column'])
{
?>
<th><?php echo JText::_('JL_MATCHREPORT_PAGE_TITLE'); ?></th>
<?php
}
?>
</tr>
</thead>
<?php

$k = 0;
$counter = 1;
$round_date = '';

foreach($this->matches as $match)
{
$hometeam=$this->teams[$match->projectteam1_id];
$home_projectteam_id=$hometeam->projectteamid;

$guestteam=$this->teams[$match->projectteam2_id];
$guest_projectteam_id=$guestteam->projectteamid;

$class=($k==0)? 'sectiontableentry1' : 'sectiontableentry2';

if ($match->team1==$this->favteams)
{
$highlight="highlight";
}
else
{
$highlight=$class;
}

if (!empty($this->ptid))
{
$home=$hometeam->name;
if ($match->team1==$this->ptid)
{
$home=sprintf('%s',$hometeam->name);
}
}
else
{
$home=$hometeam->name;
if ($match->team2)
{
$home=sprintf('%s',$hometeam->name);
}
}

if (!empty($this->ptid))
{
$away=$guestteam->name;
if ($match->team2==$this->ptid)
{
$away=sprintf('%s',$guestteam->name);
}
}
else
{
$away=$guestteam->name;
if ($match->team2)
{
$away=sprintf('%s',$guestteam->name);
}
}

$homeclub=$hometeam->club_id;
$awayclub=$guestteam->club_id;

?>
<tr class="<?php echo $highlight; ?>" style="border:1px solid #DCDCDC;">
                <?php
// start events
if ($this->config['show_events'])
{
?>
<td width='5' class='ko'><?php
$are_there_events=$this->model->getMatchEvents($match->id);
$link="javascript:void(0);";
$img=JHTML::image( 'media/com_joomleague/jl_images/events.png',
'events.png');
$params=array();
$params["onclick"]='switchMenu(\'info'.$match->id.'\');return false;';
$params["title"]=JText::_('JL_TEAMPLAN_EVENTS');
if (count($are_there_events) > 0)
{
echo JHTML::link($link,$img,$params);
}
?></td>
<?php }
// end events
?>

<td width='5%'><?php
echo JText::_($match->roundcode);
?></td>

<?php
if ($this->config['show_match_number'])
{
?>
   <td>
<?php if (empty($match->match_number)){$match->match_number='-';} echo $match->match_number; ?>
   </td>
<?php
}
if (($this->project->project_type=='DIVISIONS_LEAGUE') && ($this->config['show_division']))
{
?>
   <td>
<?php echo JoomleagueHelperHtml::showDivisonRemark($hometeam,$guestteam,$this->config); ?>
   </td>
<?php
}
if (($this->config['show_playground'] || $this->config['show_playground_alert']))
{
?>
   <td>
<?php JoomleagueHelperHtml::showMatchPlayground($match); ?>
   </td>
<?php
}
/*
echo JoomleagueModelTeamPlan::showPlayground( $hometeam,
$guestteam,
$match,
$this->config['show_playground_alert'],
$this->config['show_playground'],
$match->project_id);
*/
?>

<td width="10%"><?php
if (!strstr($match->match_date,"0000-00-00"))
{
echo JHTML::date($match->match_date,JText::_('JL_GLOBAL_CALENDAR_DATE'));
}
else
{
echo "&nbsp;";
}
?></td>

<?php
if ($this->config['show_time'])
{
?>
<td width="10%"><?php echo JoomleagueHelperHtml::showMatchTime( $match,
$this->config,
$this->overallconfig,
$this->project); ?></td>
<?php
}
?>

<?php
if ($this->config['show_time_present'])
{
?>
<td width='10%'><?php if (empty($match->time_present)){$match->time_present='-';} echo $match->time_present; ?></td>
<?php
}
?>

<?php
// Define some variables which will be used
$class1 = "right";
$teamA = '';
$class2 = "left";
$class3 = "small2";
$teamB = '';
$score = "";

// Check if the home and guest team should be switched arround
if ($this->config['switch_home_guest']){$class1='left'; $class2='right';}
$isFavTeam = in_array($hometeam->id,$this->favteams);

$teamA .= '<td class="'.$class1.'">';
if($this->config['show_teamplan_link']) {
$link=JoomleagueHelperRoute::getTeamPlanRoute($this->project->slug,$hometeam->team_slug);
$teamA .= JHTML::link($link,$home);
} else {
$teamA .= JoomleagueHelper::formatTeamName($hometeam,"g".$match->id."t".$hometeam->id,$this->config,$isFavTeam,0,$this->project->id);
//$teamA .= $hometeam->name;
   $teamA .= '</br><span class="'.$class3.'">';
$showRow = $hometeam;
$team_link  = JoomleagueHelperRoute::getTeamPlanRoute($this->project->id, $showRow->id, 0, 0);
$teamA .= JHTML::link($team_link, $hometeam->username);
}
$teamA .= '</span></td>';

// Check if the user wants to show the club logo or country flag
switch ($this->config['show_logo_small'])
{
case 1 :
{
$teamA .= '<td class="'.$class1.'">';
$teamA .= ' '.JoomleagueModelProject::getClubIconHtml($hometeam,1);
$teamA .= '</td>';

$teamB .= '<td class="'.$class2.'">';
$teamB .= JoomleagueModelProject::getClubIconHtml($guestteam,1).' ';
$teamB .= '</td>';
}
break;

case 2 :
{
$teamA .= '<td class="'.$class1.'">';
$teamA .= Countries::getCountryFlag($hometeam->country);
$teamA .= '</td>';

$teamB .= '<td class="'.$class2.'">';
$teamB .= Countries::getCountryFlag($guestteam->country);
$teamB .= '</td>';
}
break;

case 3:
{
$teamA .= '<td class="'.$class1.'">';
$teamA .= JoomleagueHelper::getPictureThumb($hometeam->picture,
$hometeam->name,
$this->config['team_picture_width'],
$this->config['team_picture_height'],1);

$teamA .= '</td>';

$teamB .= '<td class="'.$class2.'">';
$teamB .= JoomleagueHelper::getPictureThumb($guestteam->picture,
$guestteam->name,
$this->config['team_picture_width'],
$this->config['team_picture_height'],1);
$teamB .= '</td>';
}
break;
}

$seperator ='<td width="10">'.$this->config['seperator'].'</td>';
$isFavTeam = in_array($guestteam->id, $this->favteams);

$teamB .= '<td class="'.$class2.'">';
if($this->config['show_teamplan_link']) {
$link=JoomleagueHelperRoute::getTeamPlanRoute($this->project->slug,$guestteam->team_slug);
$teamB .= JHTML::link($link,$away);
} else {
$teamB .= JoomleagueHelper::formatTeamName($guestteam,"g".$match->id."t".$guestteam->id,$this->config, $isFavTeam,0,$this->project->id);
//$teamB .= $guestteam->name;
$teamB .= '</br><span class="'.$class3.'">';
$showRow = $guestteam;
$team_link  = JoomleagueHelperRoute::getTeamPlanRoute($this->project->id, $showRow->id, 0, 0);
$teamB .= JHTML::link($team_link, $guestteam->username);
};
$teamB .= '</span></td>';

if (!$match->cancel)
{
if ($match->alt_decision)
{
$team1_result = (isset($match->team1_result_decision))? $match->team1_result_decision : 'X';
$team2_result = (isset($match->team2_result_decision))? $match->team2_result_decision : 'X';
}
else
{
if ($this->config['show_part_results'] && ($match->team1_result_split != ";") && ($match->team2_result_split != ";"))
{
$team1_result = explode(";", $match->team1_result_split);
$team2_result = explode(";", $match->team2_result_split);
}
else
{
$team1_result = $match->team1_result;
$team2_result = $match->team2_result;
}
}
if ($this->config['switch_home_guest'])
{
$part_results_left = $team2_result;
$part_results_right = $team1_result;
}
else
{
$part_results_left = $team1_result;
$part_results_right = $team2_result;
}
if (!is_array($part_results_left))  { $part_results_left = array($part_results_left); }
if (!is_array($part_results_right)) { $part_results_right = array($part_results_right); }
$config_seperator = $this->config['seperator'];
$score = "<td><table align='center'><tbody>";
for ($i = 0; $i < count($part_results_left); $i++)
{
if ($this->config['results_linkable'])
{
if (isset($part_results_left[$i]))
{
$link=JoomleagueHelperRoute::getMatchReportRoute($this->project->slug,$match->id);
$part_results_left[$i] = JHTML::link($link,$part_results_left[$i]);
$part_results_right[$i] = JHTML::link($link,$part_results_right[$i]);
}
else
{
$link=JoomleagueHelperRoute::getNextMatchRoute($this->project->slug,$match->id);
}
$result_seperator = JHTML::link($link,$config_seperator);
}
$score .= sprintf('<tr><td>%snumb</td><td width="5px">%svs</td><td>%snumb</td></tr>',
$part_results_left[$i], $result_seperator, $part_results_right[$i]);
}
$score .= "</tbody></table></td>";
}
else
{
$score='<td>'.JText::_($match->cancel_reason).'</td>';
}
switch ($this->config['result_style'])
{
case 1 :
{
if ($this->config['switch_home_guest'])
{
echo $teamB.$score.$teamA;
}
else
{
echo $teamA.$score.$teamB;
}
}
break;

default;
case 0 :
{
if ($this->config['switch_home_guest'])
{
echo $teamB.$seperator.$teamA.$score;
}
else
{
echo $teamA.$seperator.$teamB.$score;
}
}
break;
}
?>

<?php
if ($this->config['show_referee'])
{
?>
<td><?php
if ((isset($match->referees)) && (count($match->referees)>0))
{
if ($this->project->teams_as_referees)
{
$output='';
$toolTipTitle=JText::_('Match Referees');
$toolTipText='';

for ($i=0; $i<count($match->referees); $i++)
{
if ($match->referees[$i]->referee_name != '')
{
$output .= $match->referees[$i]->referee_name;
$toolTipText .= $match->referees[$i]->referee_name.'&lt;br /&gt;';
}
else
{
$output .= '-';
$toolTipText .= '-&lt;br /&gt;';
}
}
if ($this->config['show_referee']==1)
{
echo $output;
}
elseif ($this->config['show_referee']==2)
{
?> <span class='hasTip'
title='<?php echo $toolTipTitle; ?> :: <?php echo $toolTipText; ?>'>
<img
src='<?php echo JURI::root(); ?>media/com_joomleague/jl_images/icon-16-Referees.png'
alt='' title='' /> </span> <?php
}
}
else
{
$output='';
$toolTipTitle=JText::_('Match Referees');
$toolTipText='';

for ($i=0; $i<count($match->referees); $i++)
{
if ($match->referees[$i]->referee_lastname != '' && $match->referees[$i]->referee_firstname)
{
$output .= '<span class="hasTip" title="'.JText::_('Referee function').'::'.$match->referees[$i]->referee_position_name.'">';
$ref=$match->referees[$i]->referee_lastname. ','.$match->referees[$i]->referee_firstname;
$toolTipText .= $ref.' ('.$match->referees[$i]->referee_position_name.')'.'&lt;br /&gt;';
if ($this->config['show_referee_link'])
{
$link=JoomleagueHelperRoute::getRefereeRoute($this->project->slug,$match->referees[$i]->referee_id,3);
$ref=JHTML::link($link,$ref);
}
$output .= $ref;
$output .= '</span>';

if (($i + 1) < count($match->referees))
{
$output .= ' - ';
}
}
else
{
$output .= '-';
}
}

if ($this->config['show_referee']==1)
{
echo $output;
}
elseif ($this->config['show_referee']==2)
{
?> <span class='hasTip'
title='<?php echo $toolTipTitle; ?> :: <?php echo $toolTipText; ?>'>
<img
src='<?php echo JURI::root(); ?>media/com_joomleague/jl_images/icon-16-Referees.png'
alt='' title='' /> </span> <?php
}
}
}
else
{
echo '-';
}
?></td>
<?php
}
?>

<?php
if (($this->config['show_thumbs_picture']) & ($teamid>0))
{

if ($teamid==$hometeam->id)
{
$team1=$match->team1_result;
$team2=$match->team2_result;
}
else
{
$team2=$match->team1_result;
$team1=$match->team2_result;
}

if (isset($team1) && isset($team2) && ($team1==$team2))
{
?>
<td><?php echo JHTML::image( 'media/com_joomleague/jl_images/draw.png',
'draw.png',
array('title' => JText::_('JL_GLOBAL_DRAW'))); ?></td>
<?php
}
else
{
if ($team1 > $team2)
{
?>
<td><?php echo JHTML::image( 'media/com_joomleague/jl_images/thumbs_up.png',
'thumbs_up.png',
array('title' => JText::_('JL_GLOBAL_WON'))); ?></td>
<?php
}
elseif ($team2 > $team1)
{
?>
<td><?php echo JHTML::image( 'media/com_joomleague/jl_images/thumbs_down.png',
'thumbs_down.png',
array('title' => JText::_('JL_GLOBAL_LOST'))); ?></td>
<?php
}
else
{
?>
   <td>
    
<?php

$date1=JHTML::date($match->match_date,$format = '%d-%m');
$date2=JHTML::date($date = null,$format = '%d-%m');

            $arr1 = explode(" ", $date1);
            $arr2 = explode(" ", $date2);  
            $arrdate1 = explode("-", $arr1[0]);
            $arrdate2 = explode("-", $arr2[0]);
            $timestamp1 = (mktime(0, $arrdate1[1],  $arrdate1[0],  $arrdate1[2]));
$timestamp2 = (mktime(0, $arrdate2[1],  $arrdate2[0],  $arrdate2[2]));

          if ($timestamp1 <= $timestamp2)

 {
 
 if ($timestamp1+2 >= $timestamp2)
 {
$link = JoomleagueHelperRoute::getResultsRoute
($this->project->slug,$match->roundid, $this->model->divisionid, $this->model->mode, $this->model->order, 'form');
$imgTitle = JText::_( 'JL_RESULTS_ENTER_EDIT_RESULTS' );
$desc = JHTML::image( 'media/com_joomleague/jl_images/edit.png', $imgTitle, array( ' title' => $imgTitle ) );
echo ' ';
echo JHTML::link( $link, $desc );
 }
  else
 
 {
 JText::_('&nbsp;');
 
 }
 }
?>
</td>
<?php
}
}
}
if ($this->config['show_matchreport_column'])
{
?>
<td><?php
if (isset($match->team1_result))
{
if ($this->config['show_matchreport_image']) {
$href_text = JHTML::image($this->config['matchreport_image'], JText::_('JL_TEAMPLAN_VIEW_MATCHREPORT'));
} else {
$href_text = JText::_('JL_TEAMPLAN_VIEW_MATCHREPORT');
}

$link=JoomleagueHelperRoute::getMatchReportRoute($this->project->slug,$match->id);
$viewReport=JHTML::link($link, $href_text);
echo $viewReport;
}
else
{
if ($this->config['show_matchreport_image']) {
$href_text = JHTML::image($this->config['matchpreview_image'], JText::_('JL_TEAMPLAN_VIEW_MATCHPREVIEW'));
} else {
$href_text = JText::_('JL_TEAMPLAN_VIEW_MATCHPREVIEW');
}
$link=JoomleagueHelperRoute::getNextMatchRoute($this->project->slug,$match->id);
$viewPreview=JHTML::link($link, $href_text);
echo $viewPreview;
}
?></td>
<?php
}
?>
    <td width="20px"></td>
</tr>
<?php
if (($this->config['show_events'] > 0) && (count($are_there_events) > 0))
{
?>
<tr>
<td colspan="6">
<div id="info<?php echo $match->id; ?>" style="display:<?php echo (count($are_there_events) > 0)? 'none' : 'block'; ?>">
<?php
$this->showEvents($match,$are_there_events);
?>
</div>
</td>
</tr>
<?php
}

$k=1 - $k;
$counter++;
}
?>
</table>
<?php
}
else
{
?>
<h3><?php echo JText::_('JL_TEAMPLAN_NO_MATCHES'); ?></h3>
<?php
}
?>
*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
Цитировать
по сути хочу сделать в teamplan ссылку на профиль в kunena
На профиль игрока из событий матча?
Если да, то всё это дело формируется в файле
..\components\com_joomleague\views\teamplan\view.html.php

функция showEvents
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
Все спасибо решение нашел.
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
Вот что хотел сделать:

*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
Цитировать
Вот что хотел сделать:
Будет замечательно, если поделитесь решением с участниками форума.
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
да в принципе все просто вот код:

Код
<?php 
$user = JFactory::getUser($this->teams[$this->ptid]->username);
echo JHTML::link(JRoute::_('index.php?option=com_kunena&func=profile&userid=' . $user->id . '&Itemid=55" rel="nofollow"'),
$this->teams[$this->ptid]->username);
*

z-7mark

  • Осваиваюсь на форуме
  • 43
  • 1 / 0
  • Верстка для Joomla
Сделал все как было описано, спасибо большое за нужный материал. Но сам хочу пойти еще дальше - чтобы пользователь мог сам вписывать результаты матчей. Кто нибудь делал что то подобное или может знает как это сделать?
*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
Тема начиналась:
Цитировать
Задача следующая:

Хочу любому пользователю разрешить вводить результаты, но не всех команд, а только выбранных (1-3).
Чем это отличается от Вашего пожелания:
Цитировать
хочу пойти еще дальше - чтобы пользователь мог сам вписывать результаты матчей.
*

z-7mark

  • Осваиваюсь на форуме
  • 43
  • 1 / 0
  • Верстка для Joomla
все никак не могу понять как прикрутить с фронтенда управление итогами матча - в этом то и проблема:( сделал командам админов из пользователей, а вот понять как им заполнять результаты матчей не могу :(
*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
Результаты матча с фронта изменяются со страницы "Результаты тура" (Results).
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
А что конкретно нужно. Я вообще реализовал как. На странице teamplan напротив каждого тура стоит кнопка ввести результат



и после ввода эта кнопка заменяется картинкой (победа, поражение или ничья). Таким образом я немного урезал функционал, т.е. нету страницы туров.
« Последнее редактирование: 19.04.2012, 19:54:28 от jetjetjet »
*

jetjetjet

  • Осваиваюсь на форуме
  • 46
  • 2 / 0
все никак не могу понять как прикрутить с фронтенда управление итогами матча - в этом то и проблема:( сделал командам админов из пользователей, а вот понять как им заполнять результаты матчей не могу :(

Ну а вообще если ты этого не понимаешь, то остальное тем более не поймешь. Сори если обидел.
« Последнее редактирование: 19.04.2012, 19:55:18 от jetjetjet »
*

z-7mark

  • Осваиваюсь на форуме
  • 43
  • 1 / 0
  • Верстка для Joomla
Спасибо за помощь, теперь все стало логично и понятно) правда выглядит у меня все еще очень криво и очень по английски, но основной функционал сделал, теперь только пилить напильником осталось))) хотя многие вкладки для меня все еще остаются загадкой, тем более что в футболе я не разбираюсь... Спасибо всем за помощь!
*

sopila

  • Захожу иногда
  • 60
  • 0 / 0
Замените в view.html.php
Код
$lists['admin'] = JHTML::_('list.users',  'admin', $club->admin);
На:
Код
$lists['admin'] = JHTML::_('list.users',  'admin', $club->admin, 0, NULL, 'name', 0);
в какой папке искать этот файл?
*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
Настоятельно рекомендую использовать технологии по поиску текста в файлах.
*

sopila

  • Захожу иногда
  • 60
  • 0 / 0
Перелопатил все файлы в папке Z:\home\nova\www\components\com_joomgallery,но такой строки не нашел.Где ее можно найти ?
*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
*

sopila

  • Захожу иногда
  • 60
  • 0 / 0
Нашел )))
Решение проблемки в этом файле www\administrator\components\com_joomleague\views\team  строка 73
*

Роман

  • Осваиваюсь на форуме
  • 20
  • 0 / 0
Ребята подскажите. Человек с ником-jetjetjet немного выше выложил код
Код
<?php 
$user = JFactory::getUser($this->команды[$this->ptid]->имя пользователя);
Эхо JHTML:link(JRoute::_('index.php?опция=com_kunena&func=профиль&userid=' . $user->id . '&Itemid=55" rel="nofollow"'),
$this->команды[$this->ptid]->имя пользователя);
, а место куда его вставлять не подсказал... если кто знает, подскажите пожалуйста!
*

tranceRoller

  • Захожу иногда
  • 452
  • 37 / 0
Вставлять его надо в components/com_joomleague/views/teamplan/tmpl/default_plan.php
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Привязка команды к реальному профилю пользователя

Автор Outstanding

Ответов: 5
Просмотров: 1351
Последний ответ 09.07.2013, 13:03:28
от Outstanding
Информация о команде. Кто может осуществить задуманное за денежное вознаграждение?

Автор mfcup

Ответов: 0
Просмотров: 1215
Последний ответ 22.04.2013, 12:31:06
от mfcup
Информация о команде

Автор Dynamik

Ответов: 2
Просмотров: 1769
Последний ответ 13.07.2012, 12:26:32
от Dynamik
как присвоить отдельный класс (css) определенному шаблону (tree)

Автор Gugolovski

Ответов: 3
Просмотров: 2279
Последний ответ 21.06.2012, 11:07:48
от tranceRoller
Проблема с редактированием информации о команде\клубе

Автор vitkus123

Ответов: 8
Просмотров: 2143
Последний ответ 12.02.2011, 16:37:08
от chernblx