Post by fanha99 » Tue Feb 21, 2012 5:44 pm

philbydevil wrote:I'm happy to have the description showing, but should it be formatted somehow to show as HTML?

You can see it here: http://www.hahana.com.au/hot-stone-massage-australia

It's been automatically added by ckeditor in admin. I would like to be able to use <b></b> tags, etc in the category description.
hi really sorry, I have never tested the description before :)
pls download again the version 2.0.5, there is only small change in the catalog/controller/news/category.php
you just need to replace this file.

or just need to open that file, search the line

Code: Select all

$this->data['description'] = $category_info['description'];
then replace it by this line

Code: Select all

$this->data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');

News/Blog extension for opencart, show Tagging related product while reading article

FAQ System for opencart, allow user to give feedback on each article

Combo set and discount when buy full set


Active Member

Posts

Joined
Fri Jan 13, 2012 9:32 pm

Post by fanha99 » Tue Feb 21, 2012 5:50 pm

philbydevil wrote:BTW - I added the sub-category images to the sub-categories list. I think it's good this way. Might as well use the images if they're there.

EDIT - actually, this isn't working correctly. It's using the parent category thumb, not the individual thumb from each sub-category.
umh, you put that in the news/category.tpl right?
actually, you need to edit the cotroller/news/category.php to get the correct image for each category.

I will send that code to you later, or make it as an update? ::)

News/Blog extension for opencart, show Tagging related product while reading article

FAQ System for opencart, allow user to give feedback on each article

Combo set and discount when buy full set


Active Member

Posts

Joined
Fri Jan 13, 2012 9:32 pm

Post by philbydevil » Tue Feb 21, 2012 6:28 pm

Great, thank you!

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by philbydevil » Tue Feb 21, 2012 6:42 pm

One last error that I have in my log:

Code: Select all

Undefined variable: no_image in vqmod/vqcache/vq2-admin_view_template_news_article_form.tpl on line 117

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by fanha99 » Tue Feb 21, 2012 10:08 pm

philbydevil wrote:One last error that I have in my log:

Code: Select all

Undefined variable: no_image in vqmod/vqcache/vq2-admin_view_template_news_article_form.tpl on line 117
admin/view/template/news/article_form.tpl is one of my extension's file.

but the file vqmod/vqcache/vq2-admin_view_template_news_article_form.tpl was generate because of other extension.

are you using any vqmod extension which is change the view or layout of the admin panel?

or at least send me that file?

News/Blog extension for opencart, show Tagging related product while reading article

FAQ System for opencart, allow user to give feedback on each article

Combo set and discount when buy full set


Active Member

Posts

Joined
Fri Jan 13, 2012 9:32 pm

Post by fanha99 » Tue Feb 21, 2012 10:29 pm

philbydevil wrote:BTW - I added the sub-category images to the sub-categories list. I think it's good this way. Might as well use the images if they're there.

EDIT - actually, this isn't working correctly. It's using the parent category thumb, not the individual thumb from each sub-category.

Here's my code:

Code: Select all

  <?php } ?>
  <?php if ($categories) { ?>
  <h2>&nbsp;&nbsp;<?php echo $text_sub_category; ?></h2>
  <div class="category-list">
    <?php if (count($categories) <= 5) { ?>
    <ul>
      <?php foreach ($categories as $category) { ?>
      <li><?php if ($thumb) { ?><a href="<?php echo $category['href']; ?>"><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" img style="vertical-align:middle" /><?php } ?>
<b>&nbsp;&nbsp;&nbsp;<?php echo $category['name']; ?></a></b></li>
      <?php } ?>
    </ul>
    <?php } else { ?>
    <?php for ($i = 0; $i < count($categories);) { ?>
    <ul>
      <?php $j = $i + ceil(count($categories) / 4); ?>
      <?php for (; $i < $j; $i++) { ?>
      <?php if (isset($categories[$i])) { ?>
      <li><?php if ($thumb) { ?><a href="<?php echo $categories[$i]['href']; ?>"><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" img style="vertical-align:middle" /><?php } ?>
<b>&nbsp;&nbsp;&nbsp;<?php echo $categories[$i]['name']; ?></a></b></li>
      <?php } ?>
      <?php } ?>
    </ul>
    <?php } ?>
    <?php } ?>
  </div>
hi, to and the thumb to each subcategory, pls do like this:
- open the catalog/controller/news/category.php
- search this block

Code: Select all

$this->data['categories'][] = array(
'name'  => ($this->config->get('news_setting_article_count')) ? $result['name'] . ' (' . $article_total . ')' : $result['name'],
'href'  => $this->url->link('news/category', 'npath=' . $this->request->get['npath'] . '_' . $result['news_category_id'] . $url),
);
- right after the first line of that block, add this line:

Code: Select all

'thumb' => $this->model_tool_image->resize(($result['image']) ? ($result['image']) : 'news_logo.png', 100, 100),
- you can change the number 100 to other size you like
- in the block of you added code to the category.tpl, search

Code: Select all

<?php if ($thumb) { ?><a href="<?php echo $category['href']; ?>"><img src="<?php echo $thumb; ?>
- replace the $thumb with $category['thumb']

umh, how to say, I can't not make sure your code is correct to display as you like.
I have just show you how to get the individual thumb from each sub-category (by edit the category.php) and how to use that value in the code you added.

News/Blog extension for opencart, show Tagging related product while reading article

FAQ System for opencart, allow user to give feedback on each article

Combo set and discount when buy full set


Active Member

Posts

Joined
Fri Jan 13, 2012 9:32 pm

Post by philbydevil » Wed Feb 22, 2012 8:19 am

So, this:

Code: Select all

<?php if ($thumb) { ?><a href="<?php echo $category['href']; ?>"><img src="<?php echo $thumb; ?>
should change to this:

Code: Select all

<?php if ($category['thumb']) { ?><a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>
It doesn't seem to be working.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by philbydevil » Wed Feb 22, 2012 8:42 am

Code: Select all

<?php if ($thumb) { ?><a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>
Looks closer to working but doesn't show any image, just a box with a ? (ie. no actual image is being called)

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by philbydevil » Wed Feb 22, 2012 9:09 am

I have more than 5 sub-categories so here's what the code needed to be:

Code: Select all

<?php if ($thumb) { ?><a href="<?php echo $category['href']; ?>"><img src="<?php echo $categories[$i]['thumb']; ?>
I think that the code in the previous post should work for less than 5 sub-categories.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by philbydevil » Wed Feb 22, 2012 9:14 am

Also, I fixed the error that I was getting in my error log (a few posts back).

This code was missing from admin/controller/news/article.php:

Code: Select all

$this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
Should be after:

Code: Select all

		$this->load->model('tool/image');
		
		if (isset($news_info) && $news_info['image'] && file_exists(DIR_IMAGE . $news_info['image'])) {
			$this->data['preview'] = $this->model_tool_image->resize($news_info['image'], 100, 100);
		} else {
			$this->data['preview'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
		}

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by philbydevil » Wed Feb 22, 2012 9:17 am

Thank you for all of your help. It is greatly appreciated!

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by fanha99 » Wed Feb 22, 2012 11:19 am

philbydevil wrote:I have more than 5 sub-categories so here's what the code needed to be:

Code: Select all

<?php if ($thumb) { ?><a href="<?php echo $category['href']; ?>"><img src="<?php echo $categories[$i]['thumb']; ?>
I think that the code in the previous post should work for less than 5 sub-categories.
still not done for it?
maybe I need to add it into next update, with the thumb size config for it too :)
any vote for this feature in next version >:D

how about option to show thumb image in the blog category, and topmenu too?

I'm not know why need to add this line?

Code: Select all

$this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
maybe bug happen in some case, I will double check for it :)

News/Blog extension for opencart, show Tagging related product while reading article

FAQ System for opencart, allow user to give feedback on each article

Combo set and discount when buy full set


Active Member

Posts

Joined
Fri Jan 13, 2012 9:32 pm

Post by philbydevil » Wed Feb 22, 2012 11:45 am

It's all working now. This is the final code:

Code: Select all

  <div class="category-list">
    <?php if (count($categories) <= 5) { ?>
    <ul>
      <?php foreach ($categories as $category) { ?>
      <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?><?php echo $category['thumb']; ?></a></li>
      <?php } ?>
    </ul>
    <?php } else { ?>
    <?php for ($i = 0; $i < count($categories);) { ?>
    <ul>
      <?php $j = $i + ceil(count($categories) / 4); ?>
      <?php for (; $i < $j; $i++) { ?>
      <?php if (isset($categories[$i])) { ?>
      <li><a href="<?php echo $categories[$i]['href']; ?>"><?php echo $categories[$i]['name']; ?><?php echo $categories[$i]['thumb']; ?></a></li>
      <?php } ?>
      <?php } ?>
    </ul>
    <?php } ?>
    <?php } ?>
  </div>
Adding the thumb size config to admin would be good. It's easy to change in the code, but easier if it's in your settings.

I personally wouldn't use the thumb image in the top menu, but some people might.

Thanks again! Love the mod.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by fanha99 » Wed Feb 22, 2012 1:24 pm

philbydevil wrote:Also, I fixed the error that I was getting in my error log (a few posts back).

This code was missing from admin/controller/news/article.php:

Code: Select all

$this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
Should be after:

Code: Select all

		$this->load->model('tool/image');	
hi, this is correct :)
if don't have that line, it will have no effect when you click to the clear image link.
I'm still not know why I don't get any error in the error logs for this :)
philbydevil wrote: I personally wouldn't use the thumb image in the top menu
me too.

News/Blog extension for opencart, show Tagging related product while reading article

FAQ System for opencart, allow user to give feedback on each article

Combo set and discount when buy full set


Active Member

Posts

Joined
Fri Jan 13, 2012 9:32 pm

Post by rikkic » Tue Feb 28, 2012 2:51 am

Hello,

i have bought and installed this module but how do I use it? There is nothing for news within the admin? Or perhaps I haven't installed it right but I did follow the instructions.

Please help!

New member

Posts

Joined
Sat Jan 07, 2012 10:42 pm

Active Member

Posts

Joined
Fri Jan 13, 2012 9:32 pm

Post by rikkic » Tue Feb 28, 2012 5:07 pm

yes I installed the vqmod.


The website is http://www.mkmoto.co.uk

New member

Posts

Joined
Sat Jan 07, 2012 10:42 pm

Post by fanha99 » Tue Feb 28, 2012 5:32 pm

look like you are not copy the files to correct place.

if you did right, at least, this page will work:

http://www.mkmoto.co.uk/index.php?route ... r_name=aaa

please check again, to make sure there is 2 files inside the vqmod/xml folder:
news.xml
news_151.xml

or send me more info via email, my email is: fanha99@hotmail.com

News/Blog extension for opencart, show Tagging related product while reading article

FAQ System for opencart, allow user to give feedback on each article

Combo set and discount when buy full set


Active Member

Posts

Joined
Fri Jan 13, 2012 9:32 pm

Post by rikkic » Tue Feb 28, 2012 5:52 pm

Thanks for your help, I'll try that.

Which files/folders will i need to set permissions for also?

Thank you

New member

Posts

Joined
Sat Jan 07, 2012 10:42 pm
Who is online

Users browsing this forum: No registered users and 77 guests