-
AuthorPosts
-
December 28, 2010 at 5:51 pm #157975
Hello, is there any way to insert the JAComment component inside another custom component?
Thanks.
nghiatd Friendnghiatd
- Join date:
- October 2009
- Posts:
- 324
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 7
- Thanked:
- 39 times in 37 posts
December 29, 2010 at 4:03 am #369045Hello wwp_electroniks,
Jacomment can integrate with custom component.
The first:
You have to set up Plugin JAComment system with component jacomment
And add this code in detail file of custom component:
{jacomment contentid=ID_OF_ITEM option=COMPONENT_NAME contenttitle=TITLE_OF_ITEM}
ID_OF_ITEM is “ID of item”
COMPONENT_NAME is “Name of custom component”
TITLE_OF_ITEM is “Name of title of item”
Eg:
I use jacomment in javoice and I add code in file detail of voice:
{jacomment contentid=<?php echo $item->id?> option=com_javoice contenttitle=<?php echo $item->title ?>}Best Regards.
December 29, 2010 at 9:55 pm #369223Where I have to paste exactly this line of code that you say…
Thanks a lot
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
December 29, 2010 at 9:57 pm #369224That all depends on which custom component you are looking to put it in.
December 29, 2010 at 10:26 pm #369229I am developing a component of auctions and I would add Ja comment on all my pages of auction_details:
index.php?option=com_subastas&view=detalle&sub=41
December 30, 2010 at 7:50 pm #369418Please help me or tell me where I have to go to solve the problem with this pay extension…
Thanks
Phill ModeratorPhill
- Join date:
- February 2014
- Posts:
- 7013
- Downloads:
- 40
- Uploads:
- 77
- Thanks:
- 917
- Thanked:
- 2206 times in 1818 posts
December 30, 2010 at 8:01 pm #369420Sorry, but without knowing your code we cannot help you. If you are developing an extension then you should have the required skills to work out where to put that token. You just need to put it in whatever file in your custom component outputs the display on your page.
December 31, 2010 at 3:26 pm #369528The code of my default.php in components/com_subastas/views/detalle/tmpl:
[PHP]
<?php defined(‘_JEXEC’) or die(‘Restricted access’); ?>
<?php
function curPageURL() {
$pageURL = ‘http’;
if ($_SERVER[“HTTPS”] == “on”) {$pageURL .= “s”;}
$pageURL .= “://”;
if ($_SERVER[“SERVER_PORT”] != “80”) {
$pageURL .= $_SERVER[“SERVER_NAME”].”:”.$_SERVER[“SERVER_PORT”].$_SERVER[“REQUEST_URI”];
} else {
$pageURL .= $_SERVER[“SERVER_NAME”].$_SERVER[“REQUEST_URI”];
}
return $pageURL;
}
?>
<script type=”text/javascript”>
function switchPicture(newPic) {
var element = document.getElementById(‘main_pic’);
element.src=newPic;
}jQuery(document).ready(function(){
jQuery(‘#sponsor’).corner();
jQuery(‘#detail_right_panel’).corner();
});
</script>
<div id=”subs_content”>
<div id=”detail_content”>
<h1 class=”item_name” style=”margin:0″><?php echo $this->subasta->name ?></h1>
<div class=”article-tools clearfix” style=”margin-bottom:15px;width:660px”>
<dl class=”article-info clearfix”>
<dd class=”createdby”>
<strong><?php echo JText::_(‘Por’) ?></strong>: administrador
</dd>
<dd class=”category-name”>
<strong><?php echo JText::_(‘En’) ?></strong>: Subastas Inversas
</dd>
<dd class=”hits”>
<strong>Hits</strong>: <span><?php echo $this->subasta->hits; ?></span>
</dd>
</dl>
<?php echo ‘<a class=”subs_link” href=”index.php?option=com_subastas&view=subastas&Itemid=125″><< Subastas</a>’; ?>
</div>
<div id=”detail_picture”>
<img id=”main_pic” style=”width:<?php echo $this->pic_max_width;?>px;height:<?php echo $this->pic_height;?>px;” src=”administrator/images/<?php echo $this->subasta->picture ?>” alt=”<?php echo $this->subasta->name?>” />
</div>
<div id=”detail_right_panel”>
<table style=”border-width: 0px;”>
<tr>
<td class=”table_title”><h3>Valoración:</h3></td>
<td class=”table_value”><span id=”detail_cost”><?php echo $this->subasta->cost ?> €</span></td>
<tr style=”border-width: 0px;”>
<tr>
<td class=”table_title”><h3>Último en pujar:</h3></td>
<td class=”table_value”><span id=”last_bidder”><?php echo $this->last_bidder != ” ? $this->last_bidder:’Sé el primero’; ?></span></td>
</tr>
<tr>
<td class=”table_title”><h3>Faltan:</h3></td>
<td class=”table_value”><span id=”bids_left”> <?php echo $this->subasta->bids_left; ?> </span> <strong>Pujas</strong></td>
</tr>
<tr>
<td class=”table_title”><h3>Cateogría:</h3></td>
<td class=”table_value”><span id=”item_category”> <?php echo $this->subasta->category_name; ?> </span></td>
</tr>
<tr>
<td class=”table_title”><h3>Alta subasta:</h3></td>
<td class=”table_value”><span id=”item_date”><?php echo date(‘d/m/Y’,$this->subasta->created_date); ?></span> </td>
</tr>
<tr>
<td class=”table_title”><h3>Valido En:</h3></td>
<td class=”table_value”><span id=”item_country”> <?php echo $this->subasta->country_name != ” ? $this->subasta->country_name:’Internacional’; ?> </span></td>
</tr>
<tr>
<td id=”time_left” colspan=”2″>
<?php echo $this->time_left != ” ? $this->time_left. ‘ aprox.’:’Tiempo estimado…’; ?>
</td>
</tr>
<tr>
<td class=”subs_button” colspan=”2″>
<a style=”margin-bottom: 5px” class=”ja-typo-btn btn-rounded ja-typo-btn-big btn-green” href=”index.php?option=<?php echo JRequest::getVar(‘option’);?>&view=participa&sub=<?php echo $this->subasta->id; ?>”>
¡Puja GRATIS!
</a><br/>
<span>Participar en nuestras promociones es <a href=””>totalmente gratis</a>. <br /> Portes pagados, lo recibirás en casa sin coste alguno.</span>
</td>
</tr>
</table>
</div>
</div>
<div id=”gallery” style=””>
<?php
for ($i = 1; $i <= 3; $i++) {
$fieldName = ‘extra_pic’.$i;
if ($i == 2) {
$class = ‘gallery_pic_middle’;
} else {
$class = ‘gallery_pic’;
}
$fileName = $this->subasta->$fieldName;if ($fileName != ”) {
echo ‘<img class=”‘.$class.'” onclick=”switchPicture(‘. “‘administrator/images/”.$fileName.”‘)”. ‘” src=”administrator/images/thumb’.$fileName.'” />’;
} else {
echo ‘<img class=”‘.$class.'” style=”display:inline” src=”images/sin_imagen.gif” />’;
}
} ?>
</div>
<div id=”sponsor”>
<a href=””><img class=”sponsor_pic” src=”administrator/images/<?php echo $this->subasta->provider_picture ?>”/></a>
</div>
<br>
<br><div class=”ja-before-content” style=”height: 36px;clear:both;display:block;margin-bottom:2px”>
<div class=”ja-before-inner clearfix” style=”height:31px”>
<div class=”ja-social-toolbox-small”>
<div class=”inner clearfix”>
<div class=”articleCreated”>
<span class=”date”><?php echo $this->day; ?></span>
<span class=”month”><?php echo $this->month; ?></span>
<span class=”year”><?php echo $this->year; ?></span>
</div>
<div class=”ja-retweet-horizontal-home”>
<iframe allowtransparency=”true” frameborder=”0″ scrolling=”no” tabindex=”0″ class=”twitter-share-button twitter-count-horizontal” src=”http://platform0.twitter.com/widgets/tweet_button.html?_=1293136710078&count=horizontal&counturl=<?php echo curPageURL(); ?>&lang=en&text=Subasta&url=<?php echo curPageURL(); ?>” style=”width: 110px; height: 20px; ” title=”Twitter For Websites: Tweet Button”></iframe>
<script type=”text/javascript” src=”http://platform.twitter.com/widgets.js”></script>
</div><div style=”float:left;margin: 3px 10px 0 0px;”>
<a onclick=”window.open(‘http://www.tuenti.com/share?url=<?php echo curPageURL(); ?>’, ‘_blank’, ‘height=375,width=600’); return false;”
href=”http://www.tuenti.com/share?url=<?php echo curPageURL(); ?>”>
<img src=”http://estaticosak1.tuenti.com/layout/web2-Zero/images/corporate/5_share_es_ca.e0bf75da86.png” />
</a>
</div><div class=”ja-facebookshare-button_count-home”>
<a name=”fb_share” type=”button” share_url=”<?php echo curPageURL(); ?>”>Compartir en Facebook</a>
<script src=”http://static.ak.fbcdn.net/connect.php/js/FB.Share” type=”text/javascript”></script>
</div>
</div>
</div>
<div class=”fb-button” style=”float:left;margin-top:4px”>
<iframe src=”http://www.facebook.com/plugins/like.php?href=<?php echo curPageURL(); ?>&layout=button_count&show_faces=true&width=250&action=like&colorscheme=light&height=40″ scrolling=”no” frameborder=”0″ style=”border:none; overflow:hidden; width:170px; height:35px;” allowTransparency=”true”></iframe>
</div>
</div>
</div>
<div id=”detail_description”>
<h1 class=”desc_title”>DESCRIPCIÓN:</h1>
<h2 class=”desc_item_name”><?php echo $this->subasta->name; ?></h2>
<?php echo $this->subasta->description; ?>
</div>
</div>
[/PHP]I want the Jacomment component at the end of the document.
If you prefer I send you my FTP credentials (private message) to fix it directly.
Please heelp!! 😉
And Happy new year 2011!!!
nghiatd Friendnghiatd
- Join date:
- October 2009
- Posts:
- 324
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 7
- Thanked:
- 39 times in 37 posts
January 3, 2011 at 5:04 am #369765Dear wwp_electroniks,
Please use code:
<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
<script type="text/javascript">
function switchPicture(newPic) {
var element = document.getElementById('main_pic');
element.src=newPic;
}jQuery(document).ready(function(){
jQuery('#sponsor').corner();
jQuery('#detail_right_panel').corner();
});
</script>
<div id="subs_content">
<div id="detail_content">
<h1 class="item_name" style="margin:0"><?php echo $this->subasta->name ?></h1>
<div class="article-tools clearfix" style="margin-bottom:15px;width:660px">
<dl class="article-info clearfix">
<dd class="createdby">
<strong><?php echo JText::_('Por') ?></strong>: administrador
</dd>
<dd class="category-name">
<strong><?php echo JText::_('En') ?></strong>: Subastas Inversas
</dd>
<dd class="hits">
<strong>Hits</strong>: <span><?php echo $this->subasta->hits; ?></span>
</dd>
</dl>
<?php echo '<a class="subs_link" href="index.php?option=com_subastas&view=subastas&Itemid=125"><< Subastas</a>'; ?>
</div>
<div id="detail_picture">
<img id="main_pic" style="width:<?php echo $this->pic_max_width;?>px;height:<?php echo $this->pic_height;?>px;" src="administrator/images/<?php echo $this->subasta->picture ?>" alt="<?php echo $this->subasta->name?>" />
</div>
<div id="detail_right_panel">
<table style="border-width: 0px;">
<tr>
<td class="table_title"><h3>Valoración:</h3></td>
<td class="table_value"><span id="detail_cost"><?php echo $this->subasta->cost ?> €</span></td>
<tr style="border-width: 0px;">
<tr>
<td class="table_title"><h3>Último en pujar:</h3></td>
<td class="table_value"><span id="last_bidder"><?php echo $this->last_bidder != '' ? $this->last_bidder:'Sé el primero'; ?></span></td>
</tr>
<tr>
<td class="table_title"><h3>Faltan:</h3></td>
<td class="table_value"><span id="bids_left"> <?php echo $this->subasta->bids_left; ?> </span> <strong>Pujas</strong></td>
</tr>
<tr>
<td class="table_title"><h3>Cateogría:</h3></td>
<td class="table_value"><span id="item_category"> <?php echo $this->subasta->category_name; ?> </span></td>
</tr>
<tr>
<td class="table_title"><h3>Alta subasta:</h3></td>
<td class="table_value"><span id="item_date"><?php echo date('d/m/Y',$this->subasta->created_date); ?></span> </td>
</tr>
<tr>
<td class="table_title"><h3>Valido En:</h3></td>
<td class="table_value"><span id="item_country"> <?php echo $this->subasta->country_name != '' ? $this->subasta->country_name:'Internacional'; ?> </span></td>
</tr>
<tr>
<td id="time_left" colspan="2">
<?php echo $this->time_left != '' ? $this->time_left. ' aprox.':'Tiempo estimado...'; ?>
</td>
</tr>
<tr>
<td class="subs_button" colspan="2">
<a style="margin-bottom: 5px" class="ja-typo-btn btn-rounded ja-typo-btn-big btn-green" href="index.php?option=<?php echo JRequest::getVar('option');?>&view=participa&sub=<?php echo $this->subasta->id; ?>">
¡Puja GRATIS!
</a><br/>
<span>Participar en nuestras promociones es <a href="">totalmente gratis</a>. <br /> Portes pagados, lo recibirás en casa sin coste alguno.</span>
</td>
</tr>
</table>
</div>
</div>
<div id="gallery" style="">
<?php
for ($i = 1; $i <= 3; $i++) {
$fieldName = 'extra_pic'.$i;
if ($i == 2) {
$class = 'gallery_pic_middle';
} else {
$class = 'gallery_pic';
}
$fileName = $this->subasta->$fieldName;if ($fileName != '') {
echo '<img class="'.$class.'" onclick="switchPicture('. "'administrator/images/".$fileName."')". '" src="administrator/images/thumb'.$fileName.'" />';
} else {
echo '<img class="'.$class.'" style="display:inline" src="images/sin_imagen.gif" />';
}
} ?>
</div>
<div id="sponsor">
<a href=""><img class="sponsor_pic" src="administrator/images/<?php echo $this->subasta->provider_picture ?>"/></a>
</div>
<br>
<br><div class="ja-before-content" style="height: 36px;clear:both;display:block;margin-bottom:2px">
<div class="ja-before-inner clearfix" style="height:31px">
<div class="ja-social-toolbox-small">
<div class="inner clearfix">
<div class="articleCreated">
<span class="date"><?php echo $this->day; ?></span>
<span class="month"><?php echo $this->month; ?></span>
<span class="year"><?php echo $this->year; ?></span>
</div>
<div class="ja-retweet-horizontal-home">
<iframe allowtransparency="true" frameborder="0" scrolling="no" tabindex="0" class="twitter-share-button twitter-count-horizontal" src="http://platform0.twitter.com/widgets/tweet_button.html?_=1293136710078&count=horizontal&counturl=<?php echo curPageURL(); ?>&lang=en&text=Subasta&url=<?php echo curPageURL(); ?>" style="width: 110px; height: 20px; " title="Twitter For Websites: Tweet Button"></iframe>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</div><div style="float:left;margin: 3px 10px 0 0px;">
<a onclick="window.open('http://www.tuenti.com/share?url=<?php echo curPageURL(); ?>', '_blank', 'height=375,width=600'); return false;"
href="http://www.tuenti.com/share?url=<?php echo curPageURL(); ?>">
<img src="http://estaticosak1.tuenti.com/layout/web2-Zero/images/corporate/5_share_es_ca.e0bf75da86.png" />
</a>
</div><div class="ja-facebookshare-button_count-home">
<a name="fb_share" type="button" share_url="<?php echo curPageURL(); ?>">Compartir en Facebook</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
</div>
</div>
</div>
<div class="fb-button" style="float:left;margin-top:4px">
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo curPageURL(); ?>&layout=button_count&show_faces=true&width=250&action=like&colorscheme=light&height=40" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:170px; height:35px;" allowTransparency="true"></iframe>
</div>
</div>
</div>
<div id="detail_description">
<h1 class="desc_title">DESCRIPCIÓN:</h1>
<h2 class="desc_item_name"><?php echo $this->subasta->name; ?></h2>
<?php echo $this->subasta->description; ?>
</div>
{jacomment contentid=<?php $this->subasta;?> option=com_subastas contenttitle=<?php echo $this->subasta->name; ?>}
</div>I added jacomment code in this file.
Happy new year 2011.
Best Regards.
1 user says Thank You to nghiatd for this useful post
-
AuthorPosts
This topic contains 9 replies, has 3 voices, and was last updated by nghiatd 13 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum