Dear Mate...
Good day
Please to help me to use badges in News Show Pro GK4, i'll use with badges from this badges .
thanks in advance Mate...
<span class="badge"></span>
teitbite wrote:Hi
I cannot open Your site. Circle is spinning and nothing appears. I'll try a little bit later. Please start from adding this to /html/modules.php
- Code: Select all
<span class="badge"></span>
if You will have problem with it please paste the code of this file here.
$GLOBALS['badges_in_use']=true;
echo '<div style="display:none;" id="'.$news_id.'_bvmpb_mod" class="product_badge"></div>';
teitbite wrote:Hi
Sorry, I do not know what this code does:
- Code: Select all
$GLOBALS['badges_in_use']=true;
echo '<div style="display:none;" id="'.$news_id.'_bvmpb_mod" class="product_badge"></div>';
It's really hard to help with this without seeing the site, but I have told You wrong already, becuase I was trying to tell You how to add badges for modules while You need it for NSP products. Unfortunately I cannot see a way You can specifie the badge inside product, since NSP is showing products only with standard data. Have You solved this problem already ?
teitbite wrote:Hi
We clearly do not understand each other Please send me an access to ftp and I'll make it for You.
teitbite wrote:Hi
I see nothing in my PM, You should try to send it again or use my email address.
teitbite wrote:Hi
I do not see an user in this mail. Can You please tell me the correct one ?
teitbite wrote:Hi
No no. I did received the mail, but I only got an url to cpanel and a password. I do not see an username to access this cpanel. Can You please send me this username ?
teitbite wrote:Hi
Now it's ok, but I realised that badger will be required per article not per module, so please let me know if You are using regular joomla articles or K2. So I'll know which function to work with.
// header generator
function header_k2($config, $news_id, $news_alias, $news_cat_id, $news_cat_alias, $news_title) {
//
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');
//
if($config['news_content_header_pos'] != 'disabled') {
$class = ' t'.$config['news_content_header_pos'].' f'.$config['news_content_header_float'];
$title = NSP_GK4_Utils::cutText(htmlspecialchars($news_title), $config['title_limit'], $config['title_limit_type'], '…');
$title = str_replace('"', """, $title);
$link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($news_id.':'.urlencode($news_alias), $news_cat_id.':'.urlencode($news_cat_alias))));
//
if($config['news_header_link'] == 1)
return '<h4 class="nspHeader'.$class.'"><a href="'.$link.'" title="'.htmlspecialchars(str_replace('"', '', $news_title)).'">'.$title.'</a></h4>';
else
return '<h4 class="nspHeader'.$class.'" title="'.htmlspecialchars(str_replace('"', '', $news_title)).'">'.$title.'</h4>';
} else
return '';
}
// header generator
function header_k2($config, $news_id, $news_alias, $news_cat_id, $news_cat_alias, $news_title) {
//
$badge = '<div class="badge badge'.$news_id.'"></div>';
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');
//
if($config['news_content_header_pos'] != 'disabled') {
$class = ' t'.$config['news_content_header_pos'].' f'.$config['news_content_header_float'];
$title = NSP_GK4_Utils::cutText(htmlspecialchars($news_title), $config['title_limit'], $config['title_limit_type'], '…');
$title = str_replace('"', """, $title);
$link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($news_id.':'.urlencode($news_alias), $news_cat_id.':'.urlencode($news_cat_alias))));
//
if($config['news_header_link'] == 1)
return $badge.'<h4 class="nspHeader'.$class.'"><a href="'.$link.'" title="'.htmlspecialchars(str_replace('"', '', $news_title)).'">'.$title.'</a></h4>';
else
return $badge.'<h4 class="nspHeader'.$class.'" title="'.htmlspecialchars(str_replace('"', '', $news_title)).'">'.$title.'</h4>';
} else
return $badge.'';
}
.badge101 {
background: url(path_to_image) no-repeat 0 0 transparent.
}
teitbite wrote:Hi
Ok. I've made an example on K2 header function. You will just need to add the same to VM header function in the same file which is: /modules/mod_news_pro_gk4/tmpl/layout.parts.php
this is an orginal code:
- Code: Select all
// header generator
function header_k2($config, $news_id, $news_alias, $news_cat_id, $news_cat_alias, $news_title) {
//
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');
//
if($config['news_content_header_pos'] != 'disabled') {
$class = ' t'.$config['news_content_header_pos'].' f'.$config['news_content_header_float'];
$title = NSP_GK4_Utils::cutText(htmlspecialchars($news_title), $config['title_limit'], $config['title_limit_type'], '…');
$title = str_replace('"', """, $title);
$link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($news_id.':'.urlencode($news_alias), $news_cat_id.':'.urlencode($news_cat_alias))));
//
if($config['news_header_link'] == 1)
return '<h4 class="nspHeader'.$class.'"><a href="'.$link.'" title="'.htmlspecialchars(str_replace('"', '', $news_title)).'">'.$title.'</a></h4>';
else
return '<h4 class="nspHeader'.$class.'" title="'.htmlspecialchars(str_replace('"', '', $news_title)).'">'.$title.'</h4>';
} else
return '';
}
and here is after my modifications
- Code: Select all
// header generator
function header_k2($config, $news_id, $news_alias, $news_cat_id, $news_cat_alias, $news_title) {
//
$badge = '<div class="badge badge'.$news_id.'"></div>';
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');
//
if($config['news_content_header_pos'] != 'disabled') {
$class = ' t'.$config['news_content_header_pos'].' f'.$config['news_content_header_float'];
$title = NSP_GK4_Utils::cutText(htmlspecialchars($news_title), $config['title_limit'], $config['title_limit_type'], '…');
$title = str_replace('"', """, $title);
$link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($news_id.':'.urlencode($news_alias), $news_cat_id.':'.urlencode($news_cat_alias))));
//
if($config['news_header_link'] == 1)
return $badge.'<h4 class="nspHeader'.$class.'"><a href="'.$link.'" title="'.htmlspecialchars(str_replace('"', '', $news_title)).'">'.$title.'</a></h4>';
else
return $badge.'<h4 class="nspHeader'.$class.'" title="'.htmlspecialchars(str_replace('"', '', $news_title)).'">'.$title.'</h4>';
} else
return $badge.'';
}
as You can see $badge appeared couple of times. Now You need to add a badge with css using article id as selector. For example:
- Code: Select all
.badge101 {
background: url(path_to_image) no-repeat 0 0 transparent.
}
When You set this please show me a result so I'll tell You one small fix for this badge to show over the article.
.badge115 {
background: url(path_to_image) no-repeat 0 0 transparent.
}
.badge116 {
background: url(path_to_image) no-repeat 0 0 transparent.
}
.badge117 {
background: url(path_to_image) no-repeat 0 0 transparent.
}
arthur2012 wrote:Hi
ok Thanks a lot Teitbite
i'll make it first and let you know.teitbite wrote:Hi
Ok. I've made an example on K2 header function. You will just need to add the same to VM header function in the same file which is: /modules/mod_news_pro_gk4/tmpl/layout.parts.php
this is an orginal code:
- Code: Select all
// header generator
function header_k2($config, $news_id, $news_alias, $news_cat_id, $news_cat_alias, $news_title) {
//
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');
//
if($config['news_content_header_pos'] != 'disabled') {
$class = ' t'.$config['news_content_header_pos'].' f'.$config['news_content_header_float'];
$title = NSP_GK4_Utils::cutText(htmlspecialchars($news_title), $config['title_limit'], $config['title_limit_type'], '…');
$title = str_replace('"', """, $title);
$link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($news_id.':'.urlencode($news_alias), $news_cat_id.':'.urlencode($news_cat_alias))));
//
if($config['news_header_link'] == 1)
return '<h4 class="nspHeader'.$class.'"><a href="'.$link.'" title="'.htmlspecialchars(str_replace('"', '', $news_title)).'">'.$title.'</a></h4>';
else
return '<h4 class="nspHeader'.$class.'" title="'.htmlspecialchars(str_replace('"', '', $news_title)).'">'.$title.'</h4>';
} else
return '';
}
and here is after my modifications
- Code: Select all
// header generator
function header_k2($config, $news_id, $news_alias, $news_cat_id, $news_cat_alias, $news_title) {
//
$badge = '<div class="badge badge'.$news_id.'"></div>';
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');
//
if($config['news_content_header_pos'] != 'disabled') {
$class = ' t'.$config['news_content_header_pos'].' f'.$config['news_content_header_float'];
$title = NSP_GK4_Utils::cutText(htmlspecialchars($news_title), $config['title_limit'], $config['title_limit_type'], '…');
$title = str_replace('"', """, $title);
$link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($news_id.':'.urlencode($news_alias), $news_cat_id.':'.urlencode($news_cat_alias))));
//
if($config['news_header_link'] == 1)
return $badge.'<h4 class="nspHeader'.$class.'"><a href="'.$link.'" title="'.htmlspecialchars(str_replace('"', '', $news_title)).'">'.$title.'</a></h4>';
else
return $badge.'<h4 class="nspHeader'.$class.'" title="'.htmlspecialchars(str_replace('"', '', $news_title)).'">'.$title.'</h4>';
} else
return $badge.'';
}
as You can see $badge appeared couple of times. Now You need to add a badge with css using article id as selector. For example:
- Code: Select all
.badge101 {
background: url(path_to_image) no-repeat 0 0 transparent.
}
When You set this please show me a result so I'll tell You one small fix for this badge to show over the article.
.nspArt {
position: relative;
}
.badge {
position: absolute;
top: 0;
right: 0;
height: {height_of_badge}px;
weight: {weight_of_badge}px;
}
teitbite wrote:Hi
Once again I cannot see Your site to tell the rest of the code, so I'll try guess. But before that please replace "path_to_image" in the code You have copied to the path of badge image.
Here is the code:
- Code: Select all
.nspArt {
position: relative;
}
.badge {
position: absolute;
top: 0;
right: 0;
height: {height_of_badge}px;
weight: {weight_of_badge}px;
}
teitbite wrote:Hi
Please paste the code You have right now in override.css and check if override is activated in template settings.