Welcome, Guest
Username: Password: Remember me
Support questions related to GPS Tools can be asked here

TOPIC: GPS tools module

GPS tools module 2 years 10 months ago #7089

2 things:

1: How can I make it so that the category and author in the GPS tools module link to the corresponding section?

2: When the user is clicked, it opens jomsocial within the gps page which makes everything crunched up. How can I make it so that it links to the actual jomsocial profile?

Thanks!
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7095

  • Maverick
  • Maverick's Avatar
  • OFFLINE
  • Developer
  • Posts: 8528
  • Thank you received: 775
  • Karma: 167
1. Edit modules/mod_gpstools/tmpl/latest_tracks.php(or popular_tracks.php)
Find below code
<td align="left"><?php echo $item->category; ?></td>
Change it to
<td align="left"><a href="<?php echo JRoute::_('index.php?option=com_gpstools&view=gpstools&task=list&catid='.$item->catid.':'.$item->calias.$itemid);"><?php echo $item->category; ?></a></td>

2. I will look into the issue. Let me know where I can see the issue.
If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory (direct links are given below).
Community PollsCommunity AnswersCommunity QuizCommunity QuotesCommunity Surveys
Community CrosswordsGPS ToolsArticle SuggestionsCjBlog
Last Edit: 2 years 10 months ago by Maverick.
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7096

1. The php edit didn't work for me. It said there was a syntax error.

2. When you go to the gps routes page, and you click on one of the avatars, it opens up jomsocial inside of the gps page (which I don't want). If you click on the profile tab that is now visible in the jomsocial toolbar, it will lead you to the actual jomsocial profile page (which is what I do want). Hope that clears it up.

Thanks Mav!
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7097

  • Maverick
  • Maverick's Avatar
  • OFFLINE
  • Developer
  • Posts: 8528
  • Thank you received: 775
  • Karma: 167
Sorry for the typo. Try this
<td align="left"><a href="<?php echo JRoute::_('index.php?option=com_gpstools&view=gpstools&task=list&catid='.$item->catid.':'.$item->calias.$itemid);?>"><?php echo $item->category; ?></a></td>
If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory (direct links are given below).
Community PollsCommunity AnswersCommunity QuizCommunity QuotesCommunity Surveys
Community CrosswordsGPS ToolsArticle SuggestionsCjBlog
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7098

Awesome! That worked for the category, but not for the author too. How can I link the author?

Thanks! :-)
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7101

  • Maverick
  • Maverick's Avatar
  • OFFLINE
  • Developer
  • Posts: 8528
  • Thank you received: 775
  • Karma: 167
Since you are using JomSocial, you need to get the author using JomSocial api.
$jspath = JPATH_BASE.DS.'components'.DS.'com_community';
if(file_exists($jspath.DS.'libraries'.DS.'core.php')){
	include_once($jspath.DS.'libraries'.DS.'core.php');

	// Get CUser object
	$jsuser =& CFactory::getUser($item->created_by);
	$usrname = $jsuser->username;
	$avatarLoc = $jsuser->getThumbAvatar();
	$link = CRoute::_('index.php? option=com_community&view=profile&userid='.$item->created_by.'&Itemid='.JRequest::getInt('Itemid'));
	$avatar = '<a href="'.$link.'"><img class="hasTip" style="border: 1px solid #cccccc; height: '.$height.'px;" src="'.$avatarLoc.'" alt="'.$usrname.'" title="'.$usrname.'"/></a>';
	echo $avatar;
	}
Replaced above code in php tags in place of the author name in same file.
If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory (direct links are given below).
Community PollsCommunity AnswersCommunity QuizCommunity QuotesCommunity Surveys
Community CrosswordsGPS ToolsArticle SuggestionsCjBlog
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7104

This is the code for the author that is already there. Where exactly do I place that in here? Or just replace the whole thing? Thanks!

<?php if ( $params->get('showauthor') ) { ?>
<td align="left"><?php echo ($item->username)?$item->username:JText::_('GUEST'); ?></td>
<?php } ?>
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7108

  • Maverick
  • Maverick's Avatar
  • OFFLINE
  • Developer
  • Posts: 8528
  • Thank you received: 775
  • Karma: 167
Change it with this:

<?php if ( $params->get('showauthor') ) { ?>
<?php
PASTE CODE AS MENTIONED ABOVE
$avatar = '';
?>
<td align="left"><?php echo ($item->username)?$avatar:JText::_('GUEST'); ?></td>
<?php } ?>
If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory (direct links are given below).
Community PollsCommunity AnswersCommunity QuizCommunity QuotesCommunity Surveys
Community CrosswordsGPS ToolsArticle SuggestionsCjBlog
Last Edit: 2 years 10 months ago by Maverick.
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7110

Not sure if I did it correctly: syntax error.

Here is what it looks like from that part to the end:

<?php if ( $params->get('showauthor') ) { ?>
<?php$jspath = JPATH_BASE.DS.'components'.DS.'com_community';
if(file_exists($jspath.DS.'libraries'.DS.'core.php')){
include_once($jspath.DS.'libraries'.DS.'core.php');

// Get CUser object
$jsuser =& CFactory::getUser($item->created_by);
$usrname = $jsuser->username;
$avatarLoc = $jsuser->getThumbAvatar();
$link = CRoute::_('index.php? option=com_community&view=profile&userid='.$item->created_by.'&Itemid='.JRequest::getInt('Itemid'));
$avatar = '<a href="'.$link.'"><img class="hasTip" style="border: 1px solid #cccccc; height: '.$height.'px;" src="'.$avatarLoc.'" alt="'.$usrname.'" title="'.$usrname.'"/></a>';
echo $avatar;
}
$avatar = '';
?>
<td align="left"><?php echo ($item->username)?$avatar:JText::_('GUEST'); ?></td>
<?php } ?>

<?php if ( $params->get('showhits') ) { ?>
<td align="center"><?php echo $item->hits; ?></td>
<?php } ?>
</tr>
<?php
$i++;
$k = 1 - $k;
}
?>
</tbody>
</table>
<?php
}
?>
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7111

  • Maverick
  • Maverick's Avatar
  • OFFLINE
  • Developer
  • Posts: 8528
  • Thank you received: 775
  • Karma: 167
Use this code:
<?php if ( $params->get('showauthor') ) { ?>
<?php
$avatar = '';
$jspath = JPATH_BASE.DS.'components'.DS.'com_community';
if(file_exists($jspath.DS.'libraries'.DS.'core.php')){
include_once($jspath.DS.'libraries'.DS.'core.php');

// Get CUser object
$jsuser =& CFactory::getUser($item->created_by);
$usrname = $jsuser->username;
$avatarLoc = $jsuser->getThumbAvatar();
$link = CRoute::_('index.php? option=com_community&view=profile&userid='.$item->created_by.'&Itemid='.JRequest::getInt('Itemid'));
$avatar = '<a href="'.$link.'"><img class="hasTip" style="border: 1px solid #cccccc; height: '.$height.'px;" src="'.$avatarLoc.'" alt="'.$usrname.'" title="'.$usrname.'"/></a>';
}
?>
<td align="left"><?php echo ($item->username)?$avatar:JText::_('GUEST'); ?></td>
<?php } ?>
If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory (direct links are given below).
Community PollsCommunity AnswersCommunity QuizCommunity QuotesCommunity Surveys
Community CrosswordsGPS ToolsArticle SuggestionsCjBlog
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7112

Oh I didn't realize that the thumbnail would show on the list. It takes up 4 lines and would make the list look poor with multiple items. How can I just make it just the name (text), but still link to profile?

Sorry for being such a pain, Mav. I really appreciate your time.
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7113

  • Maverick
  • Maverick's Avatar
  • OFFLINE
  • Developer
  • Posts: 8528
  • Thank you received: 775
  • Karma: 167
Use this code
<?php if ( $params->get('showauthor') ) { ?>
<?php
$link = '';
$jspath = JPATH_BASE.DS.'components'.DS.'com_community'.DS.'libraries'.DS.'core.php';
if(file_exists($jspath)) {
	include_once($jspath);
	$link = '<a href="' . CRoute::_('index.php? option=com_community&view=profile&userid='.$item->created_by) . '">' . $item->username . '</a>';
}
<td align="left">
	<?php echo ($item->created_by)?$link:JText::_('GUEST'); ?>
</td>
<?php } ?>
If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory (direct links are given below).
Community PollsCommunity AnswersCommunity QuizCommunity QuotesCommunity Surveys
Community CrosswordsGPS ToolsArticle SuggestionsCjBlog
Last Edit: 2 years 10 months ago by Maverick.
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7114

Syntax error:
This is what it looks like:

<?php if ( $params->get('showcategory') ) { ?>
<td align="left"><a href="<?php echo JRoute::_('index.php?option=com_gpstools&view=gpstools&task=list&catid='.$item->catid.':'.$item->calias.$itemid);?>"><?php echo $item->category; ?></a></td>
<?php } ?>

<?php if ( $params->get('showauthor') ) { ?>
<?php
$link = '';
$jspath = JPATH_BASE.DS.'components'.DS.'com_community'.DS.'libraries'.DS.'core.php';
if(file_exists($jspath)) {
include_once($jspath);
$link = '<a href="' . CRoute::_('index.php? option=com_community&view=profile&userid='.$item->created_by) . '">' . $item->username . '</a>';
}
<td align="left">
<?php echo ($item->created_by)?$link:JText::_('GUEST'); ?>
</td>
<?php } ?>

<?php if ( $params->get('showhits') ) { ?>
<td align="center"><?php echo $item->hits; ?></td>
<?php } ?>
</tr>
<?php
$i++;
$k = 1 - $k;
}
?>
</tbody>
</table>
<?php
}
?>
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7118

  • Maverick
  • Maverick's Avatar
  • OFFLINE
  • Developer
  • Posts: 8528
  • Thank you received: 775
  • Karma: 167
Is it possible to get your ftp details so that I can fix it directly?
If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory (direct links are given below).
Community PollsCommunity AnswersCommunity QuizCommunity QuotesCommunity Surveys
Community CrosswordsGPS ToolsArticle SuggestionsCjBlog
The administrator has disabled public write access.

Re: GPS tools module 2 years 10 months ago #7122

That would be great. Sending now.
The administrator has disabled public write access.
Time to create page: 0.136 seconds
Powered by Kunena Forum