Welcome, Guest
Username Password: Remember me

Tip: How to show AUP rank image in kunena posts
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: Tip: How to show AUP rank image in kunena posts

Tip: How to show AUP rank image in kunena posts 1 year, 3 months ago #14596

  • samanoqo
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Points: 35
  • Karma: 2
Hi

This is a hack made by me! I hope you like it!
using Kunena 1.6.2 and AlphaUserPoints 1.5.13

WARNING: BACKUP FIRST AND USE IT AT YOUR OWN RISK!!!

find and open this file:

http://www.yoursite.com/com_kunena/template/yourtemplate/view/profile.vertical.php

Find the line:

defined ( '_JEXEC' ) or die (); ?>


Right after the line insert this code

<?php // Call AUP Functions BEGIN ?>
       
<?php
$livesite = JURI::base();
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
	if ( file_exists($api_AUP))
	{
		require_once ($api_AUP);
		$userrankinfo = AlphaUserPointsHelper::getUserRank('', $this->profile->userid);
	}
	$rank = $userrankinfo->rank;
?>        

<?php // Call AUP Functions END ?>


This will call Alphauserpoints ranking functions.

Now find this line:

<?php echo $this->userrankimage ?>


Delete it (or comment it) and insert this code instead:

<?php if($rank !=NULL && $userrankinfo->image !=NULL)
	echo '<img src="'.$livesite.'components/com_alphauserpoints/assets/images/awards/large/'.$userrankinfo->image.'" alt="'.JText::_($userrankinfo->rank).'" />'; ?>


This will insert the image

Finally edit the style and the size of the image via your Kunena template css.

----------------------------------

If you want to show the name of AlphUserPoints ranks instead of Kunena ranks (for example: silver member instead of fresh border) find this line:

<?php echo $this->escape($this->userranktitle) ?>


and change it to:

<?php echo $userrankinfo->rank; ?>


That's all


Hope that someday Kunena team make this feature native...

Re: Tip: How to show AUP rank image in kunena posts 1 year, 3 months ago #14600

  • Mortti
  • OFFLINE
  • Administrator
  • Posts: 544
  • Points: 3056
  • Karma: 16
Hope that someday Kunena team make this feature native...


In one previous Kunena version was already RANK integration by default... it is removed now...

start here /administrator/components/com_kunena/libraries/integration/alphauserpoints
Finnish Translation & Testing Partner from Official Finnish Joomla! Community. www.joomlaportal.fi
Mortti in Twitter: twitter.com/mortti
Last Edit: 1 year, 3 months ago by Mortti.

Re: Tip: How to show AUP rank image in kunena posts 1 year, 3 months ago #14614

  • samanoqo
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Points: 35
  • Karma: 2
Thanks for your reply Mortti.

I'm not an expert and I didn't know this. I just got what I could from this extension and put it in kunena profile

extensions.joomla.org/extensions/extensi...lder-activities/8630

and I don't know why such feature removed from new versions of kunena

but I beleive It is gonna be good to let people chose among several community systems for each part of their profile.

maybe a plugin system in kunena 2.0 would do it.

Regards
Saman

Re: Tip: How to show AUP rank image in kunena posts 11 months, 1 week ago #16172

  • Nihil
  • OFFLINE
  • Senior Boarder
  • Posts: 41
  • Points: 252
  • Karma: 0
i really hope this works. i'll give it a shot tomorrow.

Re: Tip: How to show AUP rank image in kunena posts 11 months, 1 week ago #16178

  • samanoqo
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Points: 35
  • Karma: 2
Dear Nihil

Here is a working example:

Forum page

Profile Page

Hope that you make it work too

Re: Tip: How to show AUP rank image in kunena posts 11 months ago #16182

  • Nihil
  • OFFLINE
  • Senior Boarder
  • Posts: 41
  • Points: 252
  • Karma: 0
Parse error: syntax error, unexpected '<' in /home/gotrus1/public_html/components/com_kunena/template/default/view/profile.vertical.php on line 17

// Added for AUP medals
<?php // Call AUP Functions BEGIN ?>
       
<?php
$livesite = JURI::base();
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
	if ( file_exists($api_AUP))
	{
		require_once ($api_AUP);
		$userrankinfo = AlphaUserPointsHelper::getUserRank('', $this->profile->userid);
	}
	$rank = $userrankinfo->rank;
?>        

<?php // Call AUP Functions END ?>
// Added for AUP medals

if (!isset($this->showUnusedSocial)) $this->showUnusedSocial = false;
?>
	<ul class="kpost-profile">
		<li class="kpost-username">
			<?php echo CKunenaLink::GetProfileLink ( intval($this->profile->userid), $this->escape($this->username) ); ?>
		</li>
		<?php if ($this->usertype) : ?>
		<li class="kpost-usertype">
			<span class = "kmsgusertype">( <?php echo $this->escape($this->usertype) ?> )</span>
		</li>
		<?php endif ?>
		<?php if ($this->avatar) : ?>
		<li class="kpost-avatar">
		<?php echo CKunenaLink::GetProfileLink ( intval($this->profile->userid), $this->avatar ); ?>
		</li>
		<?php endif; ?>
		<?php if ($this->profile->userid): ?>

		<li><span class="kicon-button kbuttononline-<?php echo $this->profile->isOnline(true) ?>"><span class="online-<?php echo $this->profile->isOnline(true) ?>"><span><?php echo $this->profile->isOnline() ? JText::_('COM_KUNENA_ONLINE') : JText::_('COM_KUNENA_OFFLINE'); ?></span></span></span></li>

		<?php if ($this->userranktitle) : ?>
		<li class="kpost-userrank">
			<?php echo $this->escape($this->userranktitle) ?>
		</li>
		<?php endif ?>
		<?php if ($this->userrankimage) : ?>
		<li class="kpost-userrank-img">
			<?php echo $this->userrankimage ?>
			
			// Added for AUP Medals
			<?php if($rank !=NULL && $userrankinfo->image !=NULL)
			echo '<img src="'.$livesite.'components/com_alphauserpoints/assets/images/awards/large/'.$userrankinfo->image.'" alt="'.JText::_($userrankinfo->rank).'" />'; ?>
			// Added for AUP Medals
		</li>
		<?php endif ?>


Do i have to comment out the userrangimage line? i'd like to have both if possible. How do i fix this?
  • Page:
  • 1
  • 2
Moderators: adroussel, dalekurt, migus, some1new
Time to create page: 0.66 seconds
Goto Top