×
Kunena 5.1 RC 3 Released (16 Feb 2018)

The Kunena team is proud to announce the arrival of Kunena 5.1.0 RC3 [K 5.1.0] which is now available for download as a native Joomla extension for J! 3.8.x. This version addresses most of the issues that were discovered in K 5.1 and issues discovered during the development stages of K 5.1. This is a RC release.

× Please note: The Kunena project team takes NO responsibility for maintaining nor supporting anything in this category.

Question Put adsense ads within the forum topics

More
1 year 3 months ago #1 by neon26
neon26 created the topic: Put adsense ads within the forum topics
Hello, my English is translated by google translate since I am Spanish
In the new version of Kunena no longer like putting ads within the forum topics.
Before it was done as follows:
first you have to create the position in the file:
components/com_kunena/template/default/view/message.contents.php

<div class="kmsgbody">
<div class="kmsgtext">
<?php echo $this->messageHtml ?>
</div>
</div>


By:

<div class="kmsgbody">
<div class="kmsgtext">
<?php echo $this->messageHtml ?>
<?php CKunenaTools::showModulePosition('kunena_msg_in_' . $this->mmm) ?>
</div>
</div>

this is what I did before, in the old kunena, and ...
as is done now?


Thank so much

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #2 by 810
810 replied the topic: Put adsense ads within the forum topics
you can use this module positions, you don't need to modify the files.

'kunena_msg_' + number example: kunena_msg_5 = on the fifth message
'kunena_msg_row_' + number example kunena_msg_row_5 = every page the fifth message

Your feedback on the JED helps us improve Kunena!

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #3 by neon26
neon26 replied the topic: Put adsense ads within the forum topics

810 wrote: you can use this module positions, you don't need to modify the files.

'kunena_msg_' + number example: kunena_msg_5 = on the fifth message
'kunena_msg_row_' + number example kunena_msg_row_5 = every page the fifth message


you tell me this is to put ads between post but not within the message.

I indicated before the Kunena_msg_in_1 potion and that made me a notice within the message one now I can not.

As I can do it again?

Thank you

I hope I understand English as it is translated by google

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #4 by 810
810 replied the topic: Put adsense ads within the forum topics
add the module code here:
github.com/Kunena/Kunena-Forum/blob/K5.0...item/default.php#L52

module code:
echo $this->subLayout('Widget/Module')->set('position', 'kunena_msg_in_' . $this->message->replynum);

Your feedback on the JED helps us improve Kunena!

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago - 1 year 3 months ago #5 by neon26
neon26 replied the topic: Put adsense ads within the forum topics
I have included a code but do not leave me ads.
I may be doing wrong?
<?php
/**
 * Kunena Component
 * @package     Kunena.Template.Crypsis
 * @subpackage  Layout.Message
 *
 * @copyright   (C) 2008 - 2016 Kunena Team. All rights reserved.
 * @license     http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link        https://www.kunena.org
 **/
defined('_JEXEC') or die;
 
// @var KunenaForumMessage $message
 
$message = $this->message;
$isReply = $this->message->id != $this->topic->first_post_id;
$signature = $this->profile->getSignature();
$attachments = $message->getAttachments();
$attachs = $message->getNbAttachments();
$avatarname = $this->profile->getname();
$config = KunenaConfig::getInstance();
$subjectlengthmessage = $this->ktemplate->params->get('SubjectLengthMessage', 20);
 
if ($config->ordering_system == 'mesid')
{
	$this->numLink = $this->location;
}
else
{
	$this->numLink = $message->replynum;
}
 
$list = array();
?>
 
<small class="text-muted pull-right">
	<?php if ($this->ipLink) : ?>
	<?php echo KunenaIcons::ip();?>
	<span class="ip"> <?php echo $this->ipLink; ?> </span>
	<?php endif;?>
	<?php echo KunenaIcons::clock();?>
	<?php echo $message->getTime()->toSpan('config_post_dateformat', 'config_post_dateformat_hover'); ?>
	<?php if ($message->modified_time) :?> - <?php echo KunenaIcons::edit() . ' ' . $message->getModifiedTime()->toSpan('config_post_dateformat', 'config_post_dateformat_hover'); endif;?>
	<a href="#<?php echo $this->message->id; ?>" id="<?php echo $this->message->id; ?>" rel="canonical">#<?php echo $this->numLink; ?></a>
	<span class="visible-phone"><?php echo JText::_('COM_KUNENA_BY') . ' ' . $message->getAuthor()->getLink();?></span>
</small>
 
<div class="badger-left badger-info <?php if ($message->getAuthor()->isModerator()) : ?> badger-moderator <?php endif;?>  message-<?php echo $this->message->getState(); ?>"
	 data-badger="<?php echo (!$isReply) ? $this->escape($avatarname) . ' ' . JText::_('COM_KUNENA_MESSAGE_CREATED') . ' ' . KunenaForumMessage::getInstance()->getsubstr($message->subject, 0, $subjectlengthmessage) : $this->escape($avatarname) . ' ' . JText::_('COM_KUNENA_MESSAGE_REPLIED') . ' ' . KunenaForumMessage::getInstance()->getsubstr($message->subject, 0, $subjectlengthmessage); ?>">
	<div class="kmessage">
		<p class="kmsg">
			<?php  if (!$this->me->userid && !$isReply) : 
			[b]echo $this->subLayout('Widget/Module')->set('position', 'kunena_msg_in_' . $this->message->replynum);[/b][/color]
 
 
			else:
				echo (!$this->me->userid && $this->config->teaser) ? JText::_('COM_KUNENA_TEASER_TEXT') : $this->message->displayField('message');
			endif;?>
 
 
 
 
		</p>
	</div>
	<?php if ($signature) : ?>
		<div class="ksig">


it's wrong
Last Edit: 1 year 3 months ago by neon26.

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #6 by 810
810 replied the topic: Put adsense ads within the forum topics
<?php  if (!$this->me->userid && !$isReply) :  ?>
			<?php echo $this->subLayout('Widget/Module')->set('position', 'kunena_msg_in_' . $this->message->replynum);?>
			<?php else: ?>
				<?php echo (!$this->me->userid && $this->config->teaser) ? JText::_('COM_KUNENA_TEASER_TEXT') : $this->message->displayField('message');
			endif; ?>

Your feedback on the JED helps us improve Kunena!

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #7 by neon26
neon26 replied the topic: Put adsense ads within the forum topics

810 wrote:

<?php  if (!$this->me->userid && !$isReply) :  ?>
			<?php echo $this->subLayout('Widget/Module')->set('position', 'kunena_msg_in_' . $this->message->replynum);?>
			<?php else: ?>
				<?php echo (!$this->me->userid && $this->config->teaser) ? JText::_('COM_KUNENA_TEASER_TEXT') : $this->message->displayField('message');
			endif; ?>



I am where I have to put it? You can tell me online.
Or is the same line you told me before?

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #8 by 810
810 replied the topic: Put adsense ads within the forum topics
under <p class="kmsg">

Your feedback on the JED helps us improve Kunena!

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #9 by neon26
neon26 replied the topic: Put adsense ads within the forum topics

810 wrote: under <p class="kmsg">


I already did, but it does not work.

Ads only run in the first issue and if you are not registered in the forum, if you enter your user and password, the ad will no longer exits.

There is another problem, and that is if the ad goes, no longer out what the user wrote.

See if you can solve.

Thank you

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #10 by neon26
neon26 replied the topic: Put adsense ads within the forum topics
can anybody help me?

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to add attachements.
  • Not Allowed: to edit your message.
Time to create page: 0.101 seconds