Banner with tags are not displayed

Need help with the Administration of your Joomla! 2.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
whitetigeritaly
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sun Apr 15, 2012 11:34 am
Location: Milan, Italy
Contact:

Banner with tags are not displayed

Post by whitetigeritaly » Sun Jul 08, 2012 9:47 am

I've 20 customers with their banner associate with a tag in meta keyword.
In their 20 related articles I inserted the tag associate with the customer.
Finally I've configured banner module with:
- Client=No client
- Search by Tag=Yes
- Randomize=Sticky, Randomize

With this configuration I don't see banner.

If instead I change the Client option to the customer name, when I show the article with the correct tag I see the banner of the customer, and when I show an article with another tag, then I don't see banner.

But if this is the correct configuration, then I need twenty banner modules, one for each customer.

Where I wrong?
Thanks in advance.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27707
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Banner with tags are not displayed

Post by Per Yngve Berg » Sun Jul 08, 2012 6:28 pm

It should work with No Client.

Enable Debug in Global Configuration.
Find the sql query that gets the banners on the front-end. Try it in phpmyadmin and see if it return any rows.

whitetigeritaly
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sun Apr 15, 2012 11:34 am
Location: Milan, Italy
Contact:

Re: Banner with tags are not displayed

Post by whitetigeritaly » Mon Jul 09, 2012 5:08 am

Thank for your reply.

With System Debug ON I see a page that is like to a 500 Error Page, but with a lot of errors.
Above I see in a red box

500 - JDatabaseMySQLi::query: 1054 - Unknown column 'cat.metakey' in 'where clause' SQL=SELECT a.id as id,a.type as type,a.name as name,a.clickurl as clickurl,a.cid as cid,a.params as params,a.custombannercode as custombannercode,a.track_impressions as track_impressions,cl.track_impressions as client_track_impressions FROM j3ci_banners as a LEFT JOIN j3ci_banner_clients AS cl ON cl.id = a.cid WHERE a.state=1 AND (CURRENT_TIMESTAMP() >= a.publish_up OR a.publish_up = '0000-00-00 00:00:00') AND (CURRENT_TIMESTAMP() <= a.publish_down OR a.publish_down = '0000-00-00 00:00:00') AND (a.imptotal = 0 OR a.impmade <= a.imptotal) AND a.catid IN (36,37,38,39,40) AND ((a.own_prefix=1 AND a.metakey_prefix=SUBSTRING('qsl',1,LENGTH( a.metakey_prefix)) OR a.own_prefix=0 AND cl.own_prefix=1 AND cl.metakey_prefix=SUBSTRING('qsl',1,LENGTH(cl.metakey_prefix)) OR a.own_prefix=0 AND cl.own_prefix=0 AND 1) AND (a.metakey REGEXP '[[:<:]]qsl[[:>:]]' OR cat.metakey REGEXP '[[:<:]]qsl[[:>:]]')) ORDER BY a.sticky DESC,RAND()

In the center box of the page I see

JDatabaseMySQLi::query: 1054 - Unknown column 'cat.metakey' in 'where clause' SQL=SELECT a.id as id,a.type as type,a.name as name,a.clickurl as clickurl,a.cid as cid,a.params as params,a.custombannercode as custombannercode,a.track_impressions as track_impressions,cl.track_impressions as client_track_impressions FROM j3ci_banners as a LEFT JOIN j3ci_banner_clients AS cl ON cl.id = a.cid WHERE a.state=1 AND (CURRENT_TIMESTAMP() >= a.publish_up OR a.publish_up = '0000-00-00 00:00:00') AND (CURRENT_TIMESTAMP() <= a.publish_down OR a.publish_down = '0000-00-00 00:00:00') AND (a.imptotal = 0 OR a.impmade <= a.imptotal) AND a.catid IN (36,37,38,39,40) AND ((a.own_prefix=1 AND a.metakey_prefix=SUBSTRING('qsl',1,LENGTH( a.metakey_prefix)) OR a.own_prefix=0 AND cl.own_prefix=1 AND cl.metakey_prefix=SUBSTRING('qsl',1,LENGTH(cl.metakey_prefix)) OR a.own_prefix=0 AND cl.own_prefix=0 AND 1) AND (a.metakey REGEXP '[[:<:]]qsl[[:>:]]' OR cat.metakey REGEXP '[[:<:]]qsl[[:>:]]')) ORDER BY a.sticky DESC,RAND()

Call stack
# Function Location
1 JSite->render() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/index.php:48
2 JDocumentHTML->render() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/includes/application.php:271
3 JDocumentHTML->_renderTemplate() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/libraries/joomla/document/html/html.php:433
4 JDocumentHTML->getBuffer() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/libraries/joomla/document/html/html.php:655
5 JDocumentRendererModules->render() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/libraries/joomla/document/html/html.php:371
6 JDocumentRendererModule->render() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/libraries/joomla/document/html/renderer/modules.php:39
7 JModuleHelper::renderModule() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/libraries/joomla/document/html/renderer/module.php:107
8 include() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/libraries/joomla/application/module/helper.php:175
9 modBannersHelper::getList() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/modules/mod_banners/mod_banners.php:20
10 BannersModelBanners->getItems() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/modules/mod_banners/helper.php:30
11 JModelList->getItems() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/components/com_banners/models/banners.php:178
12 JModelList->getStart() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/libraries/joomla/application/component/modellist.php:128
13 JModelList->getTotal() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/libraries/joomla/application/component/modellist.php:265
14 JModel->_getListCount() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/libraries/joomla/application/component/modellist.php:231
15 JDatabaseMySQLi->execute() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/libraries/joomla/application/component/model.php:318
16 JError::raiseError() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/libraries/joomla/database/database/mysqli.php:396
17 JError::raise() /home/un2ybr4q/domains/mydomain.com/public_html/Portale/libraries/joomla/error/error.php:251

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27707
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Banner with tags are not displayed

Post by Per Yngve Berg » Mon Jul 09, 2012 9:56 am

Your database is not up to date. The column 'cat.metakey' is missing.

Extensions->Extension Manager->Database and do a repair.

If you are not on version 2.5.6, do an update.

whitetigeritaly
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sun Apr 15, 2012 11:34 am
Location: Milan, Italy
Contact:

Re: Banner with tags are not displayed

Post by whitetigeritaly » Mon Jul 09, 2012 10:19 am

:eek: :eek: :eek:

But I have Joomla 2.5.6 !
I read this in the footer of the Admin Panel.

Evidently the last upgrade is gone wrong.

I've fix the database and J showed this

Database table structure is up to date.

Database schema version (in #__schemas): 2.5.6.
Update version (in #__extensions): 2.5.6.
Database driver: mysqli.
66 database changes were checked successfully.
24 database changes did not alter table structure and were skipped.

But with debug ON I see the same error.
Now, what I must do?

Thank in advance
Last edited by whitetigeritaly on Mon Jul 09, 2012 10:26 am, edited 1 time in total.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27707
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Banner with tags are not displayed

Post by Per Yngve Berg » Mon Jul 09, 2012 10:22 am

Do the database repair as stated in my previous post.

whitetigeritaly
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sun Apr 15, 2012 11:34 am
Location: Milan, Italy
Contact:

Re: Banner with tags are not displayed

Post by whitetigeritaly » Mon Jul 09, 2012 10:28 am

Sorry, I've integrate my reply before of your.

If your read, I fixed the DB but without results

whitetigeritaly
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sun Apr 15, 2012 11:34 am
Location: Milan, Italy
Contact:

Re: Banner with tags are not displayed

Post by whitetigeritaly » Mon Jul 09, 2012 10:37 am

In which table must be this column?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27707
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Banner with tags are not displayed

Post by Per Yngve Berg » Mon Jul 09, 2012 11:12 am

There is no table cat in the query.
The table is only included if client filter is set.
The code is in the file components\com_banners\models\banners.php line 86-92 and 151-153

This is a bug in the component.

whitetigeritaly
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sun Apr 15, 2012 11:34 am
Location: Milan, Italy
Contact:

Re: Banner with tags are not displayed

Post by whitetigeritaly » Mon Jul 09, 2012 2:12 pm

Ok, thank you.
So I only waiting an upgrade, it's right?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27707
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Banner with tags are not displayed

Post by Per Yngve Berg » Mon Jul 09, 2012 2:27 pm

Try to move the joins out of the if block.

Code: Select all

		if ($cid) {
			$query->where('a.cid = ' . (int) $cid);
           }

			$query->join('LEFT', '#__banner_clients AS cl ON cl.id = a.cid');
			$query->join('LEFT', '#__categories as cat ON a.catid = cat.id');
			$query->select('cl.track_impressions as client_track_impressions');
			$query->where('cl.state = 1');
		

whitetigeritaly
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sun Apr 15, 2012 11:34 am
Location: Milan, Italy
Contact:

Re: Banner with tags are not displayed

Post by whitetigeritaly » Mon Jul 09, 2012 3:17 pm

I've done the change and in attach there is the file modified.

Now all the banner are not showed and with the debug I've now this error:

500 - JDatabaseMySQLi::query: 1066 - Not unique table/alias: 'cl' SQL=SELECT a.id as id,a.type as type,a.name as name,a.clickurl as clickurl,a.cid as cid,a.params as params,a.custombannercode as custombannercode,a.track_impressions as track_impressions,cl.track_impressions as client_track_impressions,cl.track_impressions as client_track_impressions FROM j3ci_banners as a LEFT JOIN j3ci_banner_clients AS cl ON cl.id = a.cid LEFT JOIN j3ci_banner_clients AS cl ON cl.id = a.cid LEFT JOIN j3ci_categories as cat ON a.catid = cat.id WHERE a.state=1 AND (CURRENT_TIMESTAMP() >= a.publish_up OR a.publish_up = '0000-00-00 00:00:00') AND (CURRENT_TIMESTAMP() <= a.publish_down OR a.publish_down = '0000-00-00 00:00:00') AND (a.imptotal = 0 OR a.impmade <= a.imptotal) AND a.cid = 3 AND cl.state = 1 AND a.catid IN (48) ORDER BY a.sticky DESC,a.ordering
You do not have the required permissions to view the files attached to this post.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27707
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Banner with tags are not displayed

Post by Per Yngve Berg » Mon Jul 09, 2012 3:55 pm

Code: Select all

		$query->join('LEFT', '#__categories as cat ON a.catid = cat.id');
		if ($cid) {
			$query->where('a.cid = ' . (int) $cid);
			$query->join('LEFT', '#__banner_clients AS cl ON cl.id = a.cid');
			$query->select('cl.track_impressions as client_track_impressions');
			$query->where('cl.state = 1');
		}

whitetigeritaly
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sun Apr 15, 2012 11:34 am
Location: Milan, Italy
Contact:

Re: Banner with tags are not displayed

Post by whitetigeritaly » Mon Jul 09, 2012 4:00 pm

:D :D :D :D

Thank you very much.

whitetigeritaly
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sun Apr 15, 2012 11:34 am
Location: Milan, Italy
Contact:

Re: Banner with tags are not displayed

Post by whitetigeritaly » Mon Jul 09, 2012 4:11 pm

Two only only questions.
Metakeyords must be put in the banner or is sufficient put them in the clients.
Because I see only the banners associate with tags inserted in the banner. Those with tags in the clients are not showed.

If I have tag with two words, like
power solution
or if I have two tags like
tags1 & tags2

what I have to insert ?
In the first example I've inserted
power solution

And in the second example I've inserted
tags1, tags2

It is right?
I ask this because the banners that are not showed have all a tag with double name or two tags, and are all in the client metakeyords.
===========
Another error 500 related to banner.
If I click in backend over "Banner/Tracks" I see an Error 500 about the link:
My Domain /Portale/administrator/index.php?option=com_banners&view=tracks
============

whitetigeritaly
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sun Apr 15, 2012 11:34 am
Location: Milan, Italy
Contact:

Re: Banner with tags are not displayed

Post by whitetigeritaly » Tue Jul 10, 2012 2:24 pm

Important!

Other previous note (please read the above post) after the change i'm not able to show in the debug position of my template the banner with code for ShinyStat Counter.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27707
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Banner with tags are not displayed

Post by Per Yngve Berg » Fri Jul 13, 2012 4:19 am

I don't think it's related to the change.

Is there any error message?

whitetigeritaly
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sun Apr 15, 2012 11:34 am
Location: Milan, Italy
Contact:

Re: Banner with tags are not displayed

Post by whitetigeritaly » Sat Jul 14, 2012 10:34 am

No, simply it is not showed.
Instead if I put online the original banners.php the banner is showed again.

The banner has a code, but I don't think that this is the problem.
It is published in debug position at the website http://www.common.it/Portale

whitetigeritaly
Joomla! Intern
Joomla! Intern
Posts: 77
Joined: Sun Apr 15, 2012 11:34 am
Location: Milan, Italy
Contact:

Re: Banner with tags are not displayed

Post by whitetigeritaly » Tue Jul 17, 2012 5:46 pm

Confirm that with your modify the banner with tags are showed, but then the banner with code for Shinystat counter and Google Analytics are no longer showed in "debug" position.

So I solved the problem with the code in Custom HTML Module.


Locked

Return to “Administration Joomla! 2.5”