-
AuthorPosts
-
issay Friend
issay
- Join date:
- November 2009
- Posts:
- 114
- Downloads:
- 0
- Uploads:
- 22
- Thanks:
- 26
- Thanked:
- 5 times in 1 posts
May 21, 2011 at 5:17 am #164260I want to show author alias in home page’s JA news pro. but if there is no Alias I would like to show Creator’s name. not ‘JUser’
I caheged this line in file:in modulesmod_janewstmplblog_item.php
<span class="createby"><?php echo $row->creator;?></span>
to
<span class="createby"><?php echo $row->created_by_alias;?></span>
i got only Alias. but some articles does not have Alias. so I want to show Creator in these situations
note: iam using Joomla1.6.3 , JA TELINE IV
himangi Friendhimangi
- Join date:
- April 2011
- Posts:
- 1406
- Downloads:
- 1
- Uploads:
- 86
- Thanks:
- 21
- Thanked:
- 345 times in 332 posts
May 21, 2011 at 7:29 am #392200Hi,
To display alias and in case of alias not being there, to display creator name, you can use following code..
<blockquote><php if ($row->created_by_alias) { ?>
<span class=”createby”><?php echo $row->created_by_alias;?></span>
<?php } else { ?>
<span class=”createby”><?php echo $row->creator;?></span>
<?php } ?></blockquote>issay Friendissay
- Join date:
- November 2009
- Posts:
- 114
- Downloads:
- 0
- Uploads:
- 22
- Thanks:
- 26
- Thanked:
- 5 times in 1 posts
May 21, 2011 at 3:10 pm #392244thank you himangi. you are the first one helped me in this forum
iguinee Friendiguinee
- Join date:
- December 2009
- Posts:
- 453
- Downloads:
- 10
- Uploads:
- 39
- Thanks:
- 58
- Thanked:
- 32 times in 1 posts
May 26, 2011 at 12:41 pm #393013<em>@himangi 241720 wrote:</em><blockquote>Hi,
To display alias and in case of alias not being there, to display creator name, you can use following code..</blockquote>
Hi,
I cannot get this right.
What do I change exactly and where to add the code.
This is my php code.
[PHP]<?php
/*
# ————————————————————————
# JA News Pro module for Joomla 1.6
# ————————————————————————
# Copyright (C) 2004-2009 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license – Copyrighted Commercial Software
# Author: J.O.O.M Solutions Co., Ltd
# Websites: http://www.joomlart.com – http://www.joomlancers.com
# This file may not be redistributed in whole or significant part.
# ————————————————————————
*/
$cls_sufix = trim($params->get(‘blog_theme’,”));
if($cls_sufix) $cls_sufix = ‘-‘.$cls_sufix;
$class = ”;
if(JRequest::getInt(‘subcat’, 0)) $class = ‘subcontents-‘.JRequest::getInt(‘subcat’);$showcreator = $helper->get( ‘showcreator’, 0 );
$showdate = $helper->get( ‘showdate’, 0 );
$maxchars = intval (trim( $helper->get( ‘maxchars’, 200 ) ));
$showreadmore = intval (trim( $helper->get( ‘showreadmore’, 1 ) ));
$showsubcattitle = trim( $helper->get( ‘showsubcattitle’, 1));$params_new = new JParameter(”);
$catid = $secid;
$cooki_name = ‘mod’.$moduleid.’_’.$catid;
/*if(isset($_COOKIE[$cooki_name]) && $_COOKIE[$cooki_name]!=”){
$cookie_user_setting = $_COOKIE[$cooki_name];
$arr_values = explode(‘&’, $cookie_user_setting);
if($arr_values){
foreach ($arr_values as $row){
list($k, $value) = explode(‘=’, $row);
if($k!=”){
$params_new->set($k, $value);
}
}
}
}*/$introitems = intval (trim( $params_new->get( ‘introitems’, $helper->get( ‘introitems’, 1 ) )));
$linkitems = intval (trim( $params_new->get( ‘linkitems’, $helper->get( ‘linkitems’, 0 ) ) ));
$showimage = intval (trim( $params_new->get( ‘showimage’, $helper->get( ‘showimage’, 1 ) ) ));
$showtooltip = intval (trim( $helper->get( ‘showtooltip’, 1 ) ));?>
<div class=”ja-box column ja-zintheme<?php echo $cls_sufix;?><?php if (isset($y) && $y==0) echo ‘ ja-box-first’ ?> <?php echo $class?>” style=”clear: both;”>
<div class=”ja-box-inner clearfix”>
<?php
foreach ($rows as $i=>$row){
if($i>=$introitems) break;
?><div class=”ja-zincontent clearfix”>
<?php if($showimage) echo $row->image; ?>
<h4 class=”ja-zintitle”>
<a href=”<?php echo $row->link;?>” title=”<?php echo strip_tags($row->title);?>”><?php echo $row->title;?></a>
</h4><?php if ( $showcreator || $showdate ) : ?>
<p class=”ja-zinmeta”>
<?php if ($showdate) : ?>
<span class=”createdate”>
<?php echo $row->created?>
<?php if ($showcreator) : ?> | <?php endif; ?>
</span>
<?php endif; ?>
<?php if ($showcreator) : ?>
<span class=”createby”><?php echo $row->creator;?></span>
<?php endif; ?>
</p>
<?php endif; ?><?php
if($maxchars > strlen($row->introtext1)) {
echo $row->introtext;
} else {
echo $row->introtext1;
}
?>
<?php if ($showreadmore) : ?>
<p class=”readmore”>
<a href=”<?php echo $row->link; ?>” title=”<?php echo JText::sprintf(‘LA SUITE…’);?>”>
<span><?php echo JText::sprintf(‘LA SUITE…’);?></span>
</a>
</p>
<?php endif; ?>
</div>
<?php unset($rows[$i])?>
<?php }?><?php if($rows){?>
<div class=”ja-zinlinks clearfix”>
<strong><?php echo JTEXT::_(‘PLUS DE NEWS:’)?></strong>
<ul class=”jazin-links”>
<?php foreach ($rows as $row){?>
<?php
$introtext = “”;
if(strlen(strip_tags($row->introtext))>300){
$intro_process = strip_tags($row->introtext);
$intro_process = substr($intro_process, 0, 300);
$last_space = strrpos($intro_process, ‘ ‘);
$introtext = substr($intro_process, 0, $last_space).’…’;
}else{
$introtext = $row->introtext;
}
?>
<li>
<span <?php if($showtooltip){?>class=”editlinktip jahasTip” title=”<?php echo trim(strip_tags($row->title), ‘”‘); ?>::<?php echo htmlspecialchars($row->image.$introtext)?>”<?php }?>>
<a href=”<?php echo $row->link; ?>”>
<?php echo $row->title; ?>
</a>
</span>
</li>
<?php }?>
</ul>
</div>
<?php }?></div>
</div>
[/PHP]iguinee Friendiguinee
- Join date:
- December 2009
- Posts:
- 453
- Downloads:
- 10
- Uploads:
- 39
- Thanks:
- 58
- Thanked:
- 32 times in 1 posts
May 26, 2011 at 11:35 pm #393070would anyone please guide me here!
himangi Friendhimangi
- Join date:
- April 2011
- Posts:
- 1406
- Downloads:
- 1
- Uploads:
- 86
- Thanks:
- 21
- Thanked:
- 345 times in 332 posts
May 27, 2011 at 3:27 am #393085Hi iguinee,
In the php code you have, there is this code <blockquote><?php if ($showcreator) : ?>
<span class=”createby”><?php echo $row->creator;?></span>
<?php endif; ?> </blockquote>If you replace above code with the code below then it will display Creator alias and in case of alias not being there, it will display creator’s name. if ($showcreator) condition is kept as it is so that the creator name / alias will be displayed only when the param in articles / menu options is set to display the name.
<blockquote><?php if ($showcreator) : ?>
<php if ($row->created_by_alias) { ?>
<span class=”createby”><?php echo $row->created_by_alias;?></span>
<?php } else { ?>
<span class=”createby”><?php echo $row->creator;?></span>
<?php } ?>
<?php endif; ?></blockquote>iguinee Friendiguinee
- Join date:
- December 2009
- Posts:
- 453
- Downloads:
- 10
- Uploads:
- 39
- Thanks:
- 58
- Thanked:
- 32 times in 1 posts
May 27, 2011 at 8:07 am #393139I have done that, but it gives me an error message
[php]modules/mod_janewspro/tmpl/linear/blog_item.php on line 72[php]
Also, please see below how my code is:
http://www.joomlart.com/forums/topic/how-to-show-alias-name-in-ja-news-pro/#post-393013
himangi Friendhimangi
- Join date:
- April 2011
- Posts:
- 1406
- Downloads:
- 1
- Uploads:
- 86
- Thanks:
- 21
- Thanked:
- 345 times in 332 posts
May 27, 2011 at 8:57 am #393163Hi,
Can you PM me yous side admin and ftp access? I will need to take a look at the error before I can give any solution.
iguinee Friendiguinee
- Join date:
- December 2009
- Posts:
- 453
- Downloads:
- 10
- Uploads:
- 39
- Thanks:
- 58
- Thanked:
- 32 times in 1 posts
May 28, 2011 at 10:47 am #393357<em>@himangi 242960 wrote:</em><blockquote>Hi,
Can you PM me yous side admin and ftp access? I will need to take a look at the error before I can give any solution.</blockquote>
I have sent you the the credentials.
himangi Friendhimangi
- Join date:
- April 2011
- Posts:
- 1406
- Downloads:
- 1
- Uploads:
- 86
- Thanks:
- 21
- Thanked:
- 345 times in 332 posts
June 1, 2011 at 7:46 am #394032Hi iguinee,
I have implemented the code I had suggested you in yourblog_item.php file. Now if you specify ‘Created By Alias’ for some article, it will be shown in your JA News Pro module. But if you dont specify creator alias, like it is for all articles right now, then JUser showing up as a creator. I am not sure why JUser is showing up instead of creator’s username.. I am trying to find it out and will get back to you on the same..
iguinee Friendiguinee
- Join date:
- December 2009
- Posts:
- 453
- Downloads:
- 10
- Uploads:
- 39
- Thanks:
- 58
- Thanked:
- 32 times in 1 posts
June 1, 2011 at 10:29 am #394074Hello Himangi
Thank you for your help. I believe the problem persists still and I will wait to hear from you again.
Also, I have been struggling with JA Top Panel. Please see attached image.
Thank you for your continued support.
himangi Friendhimangi
- Join date:
- April 2011
- Posts:
- 1406
- Downloads:
- 1
- Uploads:
- 86
- Thanks:
- 21
- Thanked:
- 345 times in 332 posts
June 1, 2011 at 2:04 pm #394134Hi,
Your Top panel module is working fine now. I have added <block name=”top-panel” type=”modules” style=”raw” main-inner=”1″>top</block> this new position at the top in your default layout.
I have published the JA Top Panel module in the newly created top position and modules published at user12 position are being displayed in this Top Panel module. If you click on Top Panel text from frontend, you will see the module content loaded in it..The only issue right now is that the top panel is showing up quite below the topbar. This is happening because there is some content published :
# Contact
# Ajouter Votre Feedback
# Tous les Feedbacks
etc. If you remove this then your Top Panel link will go up..Please check this and let me know if it’s fine. Also tell me the ticket id, you have raised for this top panel issue, so that I can close the ticket.
1 user says Thank You to himangi for this useful post
iguinee Friendiguinee
- Join date:
- December 2009
- Posts:
- 453
- Downloads:
- 10
- Uploads:
- 39
- Thanks:
- 58
- Thanked:
- 32 times in 1 posts
June 3, 2011 at 8:51 am #394455Problem solved.
Thank you for all your assistance in resolving these issues.
AuthorPostsViewing 13 posts - 1 through 13 (of 13 total)This topic contains 13 replies, has 3 voices, and was last updated by iguinee 13 years, 5 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
how to show Alias name in Ja News pro
Viewing 13 posts - 1 through 13 (of 13 total)