Joomla! Discussion Forums



It is currently Tue Nov 24, 2009 1:56 am (All times are UTC )

 




Post new topic Reply to topic  [ 24 posts ] 
Author Message
Posted: Mon Jun 26, 2006 8:14 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Aug 20, 2005 12:32 pm
Posts: 990
Location: Tewkesbury, UK
Ref: http://forum.joomla.org/index.php/topic ... #msg374349

Quote:
It appears that mambots are now fired on module content as well as content items! This was not the case before Joomla 1.0.10 (Or at least it never appeared so). this could effect all mambots

Please read my blog post on the difference and the impact it had on the Tags component (was ok on J 1.0.9 before Joomla 1.0.10, tags mambot never changed)
http://blog.phil-taylor.com/2006/06/26/ ... component/


Apparently its not just my components! Here is an email from a customer with a free module from someone else:

Quote:
Hey Phil

It seems that as a result of the upgrade to ver 1.10.0, joomla is now treating the "Creative commons license module" as a comment item - thats why the joomla deliciousbot bot was putting links above (and then below when I changed the bot settings) the CC liscense module in the left sidebar.

So, for now, I just turned off the CC module. I'd like to get this straightened out, but....

....

_________________
Phil Taylor - Full Time Expert Joomla-Only Developer
Blue Flame IT Ltd.
-- http://www.phil-taylor.com/
SPEED UP Joomla 1.5.x Admin Console with this: http://extensions.joomla.org/extensions ... 53/details


Last edited by stingrey on Fri Aug 18, 2006 8:48 pm, edited 1 time in total.

Top
   
 
Posted: Mon Jun 26, 2006 10:12 pm 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Mon Aug 15, 2005 4:36 pm
Posts: 2399
Location: Marikina, Metro Manila, Philippines
Short answer is that yes content mambots will now affect custom/new module content as of 1.0.10

It was deemed a shortfall that was addressed in previous versions of 1.0.x and fixed in 1.0.10

_________________
God grant me the Serenity to Accept the things I cannot change, the Courage to change the things I can and the Wisdom to know the Difference.


Top
  E-mail  
 
Posted: Tue Jun 27, 2006 6:01 am 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Thu Aug 25, 2005 5:48 pm
Posts: 2801
Location: Geneva mostly
What does that mean now?
It is a feature, not a bug?
How can this be turned of?
:(

_________________
Sometimes one pays most for the things one gets for nothing.
The important thing is not to stop questioning. Curiosity has its own reason for existing. AE
http://joomla15.blogspot.com for J! 1.5 screenshots
http://www.eyezberg.com


Top
  E-mail  
 
Posted: Tue Jun 27, 2006 7:16 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Aug 20, 2005 12:32 pm
Posts: 990
Location: Tewkesbury, UK
stingrey wrote:
Short answer is that yes content mambots will now affect custom/new module content as of 1.0.10

It was deemed a shortfall that was addressed in previous versions of 1.0.x and fixed in 1.0.10


Thank you for the confirmation.  Now that I know I was not going crazy I can patch all my components as almost all of them are effected :-)

I think this is going to become a FAQ :-)

_________________
Phil Taylor - Full Time Expert Joomla-Only Developer
Blue Flame IT Ltd.
-- http://www.phil-taylor.com/
SPEED UP Joomla 1.5.x Admin Console with this: http://extensions.joomla.org/extensions ... 53/details


Top
   
 
Posted: Tue Jun 27, 2006 8:24 am 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Thu Aug 25, 2005 5:48 pm
Posts: 2801
Location: Geneva mostly
Phil, any pointers as to how to patch everything to get rid of this?

_________________
Sometimes one pays most for the things one gets for nothing.
The important thing is not to stop questioning. Curiosity has its own reason for existing. AE
http://joomla15.blogspot.com for J! 1.5 screenshots
http://www.eyezberg.com


Top
  E-mail  
 
Posted: Tue Jun 27, 2006 8:42 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Aug 20, 2005 12:32 pm
Posts: 990
Location: Tewkesbury, UK
~Well according to the devs it doesnt need fixing as its meant to be that way :-)

However, I know my components do not need this "feature" so I have added a few lines of code in my mambot to check if the $row it is processing is a module or a content item.  There seems to be no easy way to guess which it is. Mambots process content's $row->text (Which is a join of introtext and fulltext), and content doesnt have the $row->content var when inside the mambot (Only modules send this into $row)

So based on this (loose) observation I have the following code at the right point (near the top of the bot's function) that simple returns if the $row->content is set or has a value (It appears to work, and the reports from customers confirm that this is a useable fix),

Code:
if (@$row->content){
   return;
}

_________________
Phil Taylor - Full Time Expert Joomla-Only Developer
Blue Flame IT Ltd.
-- http://www.phil-taylor.com/
SPEED UP Joomla 1.5.x Admin Console with this: http://extensions.joomla.org/extensions ... 53/details


Top
   
 
Posted: Tue Jun 27, 2006 9:06 am 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Thu Aug 25, 2005 5:48 pm
Posts: 2801
Location: Geneva mostly
Thank you, will test on a few bots ;)

_________________
Sometimes one pays most for the things one gets for nothing.
The important thing is not to stop questioning. Curiosity has its own reason for existing. AE
http://joomla15.blogspot.com for J! 1.5 screenshots
http://www.eyezberg.com


Top
  E-mail  
 
Posted: Tue Jun 27, 2006 1:46 pm 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Wed Aug 17, 2005 10:12 pm
Posts: 1686
Location: Germany-Bad Abbach
Thanks Phil,

easy and simple solution works without a prob ;)

_________________
The "Humor, Fun and Games" forum has  more than 2500 Posts, so why not build a "Humor, Fun and Games Working" Group?
.....
Malicious tongues say we have this WG right from the start, they call it core team :D


Top
   
 
Posted: Tue Jun 27, 2006 8:29 pm 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Thu Aug 25, 2005 5:48 pm
Posts: 2801
Location: Geneva mostly
Phil,
just added that code to various bots: works GREAT!
Thanks a bunch.

_________________
Sometimes one pays most for the things one gets for nothing.
The important thing is not to stop questioning. Curiosity has its own reason for existing. AE
http://joomla15.blogspot.com for J! 1.5 screenshots
http://www.eyezberg.com


Top
  E-mail  
 
Posted: Wed Jun 28, 2006 2:38 pm 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Mon Aug 15, 2005 4:36 pm
Posts: 2399
Location: Marikina, Metro Manila, Philippines
Will look to add a param to allow enabling/diabling of mambot parsing per custom/new module

_________________
God grant me the Serenity to Accept the things I cannot change, the Courage to change the things I can and the Wisdom to know the Difference.


Top
  E-mail  
 
Posted: Fri Jun 30, 2006 10:13 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Oct 28, 2005 2:04 am
Posts: 43
Thank You for the solution.

BSB

PhilTaylor-Prazgod wrote:
~Well according to the devs it doesnt need fixing as its meant to be that way :-)

However, I know my components do not need this "feature" so I have added a few lines of code in my mambot to check if the $row it is processing is a module or a content item.  There seems to be no easy way to guess which it is. Mambots process content's $row->text (Which is a join of introtext and fulltext), and content doesnt have the $row->content var when inside the mambot (Only modules send this into $row)

So based on this (loose) observation I have the following code at the right point (near the top of the bot's function) that simple returns if the $row->content is set or has a value (It appears to work, and the reports from customers confirm that this is a useable fix),

Code:
if (@$row->content){
   return;
}


_________________
PR6 Web Directory - http://www.mingleon.com/


Top
  E-mail  
 
Posted: Mon Jul 03, 2006 3:36 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sun Sep 04, 2005 3:59 pm
Posts: 522
Location: Hong Kong
Thanks Phil, this worked great for the Google AdSense mambot.


Top
   
 
Posted: Tue Aug 15, 2006 7:21 pm 
Joomla! Intern
Joomla! Intern
Offline

Joined: Tue Apr 04, 2006 10:58 pm
Posts: 58
As an absolute non-coder, where in the mambot do I place this code? FWIW, I'm looking to edit ComboMax.

Thanks.


Top
  E-mail  
 
Posted: Wed Aug 16, 2006 9:54 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sun Sep 04, 2005 3:59 pm
Posts: 522
Location: Hong Kong
kai920 wrote:
Thanks Phil, this worked great for the Google AdSense mambot.


Actually, if anyone is still reading this... I have a question... how do I stop this mambot from firing for components?

In my SMF logs I see a ton (and I mean A TON) of bot_adsense errors when users access the forums (com_smf).


Top
   
 
Posted: Wed Aug 16, 2006 12:53 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Sep 10, 2005 10:31 pm
Posts: 823
kai920 wrote:
Actually, if anyone is still reading this... I have a question... how do I stop this mambot from firing for components?

In my SMF logs I see a ton (and I mean A TON) of bot_adsense errors when users access the forums (com_smf).


Content mambots are only fired for content items by Joomla!. If a content mambot is fired for com_smf, then this component does so itself.

Insert this into the mambot function to stop it from working when com_smf is called:

Code:
global $option;
if ($option == 'com_smf') {
     return;
}

_________________
We may not be able to control the wind, but we can always adjust our sails


Top
   
 
Posted: Wed Aug 16, 2006 12:59 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Sep 10, 2005 10:31 pm
Posts: 823
cmeinck wrote:
As an absolute non-coder, where in the mambot do I place this code? FWIW, I'm looking to edit ComboMax.


You need to put it into the mambot function. Usually, a mambot looks like this:

Quote:
$_MAMBOTS->registerFunction( 'onAfterStart', 'botSomething' );
function botSomething() {
    [INSERT HERE]
    [OLD MAMBOT CODE HERE]
}

_________________
We may not be able to control the wind, but we can always adjust our sails


Top
   
 
Posted: Wed Aug 16, 2006 1:06 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Aug 20, 2005 12:32 pm
Posts: 990
Location: Tewkesbury, UK
Quote:
Content mambots are only fired for content items by Joomla!


Factually incorrect.

Content Mambots are fired on modules as well as content items since Joomla 1.0.10 (It was considered a bug that they did not fire on modules before this version so the developers "fixed" the bug and introduced this annoying "feature")

_________________
Phil Taylor - Full Time Expert Joomla-Only Developer
Blue Flame IT Ltd.
-- http://www.phil-taylor.com/
SPEED UP Joomla 1.5.x Admin Console with this: http://extensions.joomla.org/extensions ... 53/details


Top
   
 
Posted: Wed Aug 16, 2006 1:11 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Sep 10, 2005 10:31 pm
Posts: 823
PhilTaylor-Prazgod wrote:
Quote:
Content mambots are only fired for content items by Joomla!


Factually incorrect.

Content Mambots are fired on modules as well as content items since Joomla 1.0.10 (It was considered a bug that they did not fire on modules before this version so the developers "fixed" the bug and introduced this annoying "feature")


That's how soon one can forget about changes ;)
Phil, you are absolutely right

_________________
We may not be able to control the wind, but we can always adjust our sails


Top
   
 
Posted: Wed Aug 16, 2006 2:36 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sun Sep 04, 2005 3:59 pm
Posts: 522
Location: Hong Kong
$option = mosGetParam($_REQUEST, 'option');

global $option;

What are the differences between the above two lines?


Top
   
 
Posted: Wed Aug 16, 2006 2:47 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Aug 20, 2005 12:32 pm
Posts: 990
Location: Tewkesbury, UK
kai920 wrote:
$option = mosGetParam($_REQUEST, 'option');


This will read what the option equals in the URL

Quote:
global $option;




This will read what the option equals in the global scope

(Note: the following are generic notes and not just about $option, they apply to all varibles passed by url and required in a script)

The url value and the global scope are probably going to be the same (as Joomla sets $option in the global scope), however if you are relying on getting the right value from the URL you should use the first one and not the second one.  It is also more secure as mosGetParam cleans the value,

_________________
Phil Taylor - Full Time Expert Joomla-Only Developer
Blue Flame IT Ltd.
-- http://www.phil-taylor.com/
SPEED UP Joomla 1.5.x Admin Console with this: http://extensions.joomla.org/extensions ... 53/details


Top
   
 
Posted: Fri Aug 18, 2006 8:48 pm 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Mon Aug 15, 2005 4:36 pm
Posts: 2399
Location: Marikina, Metro Manila, Philippines
In 1.0.11 SVN there is now a new param for custom modules that will allow you to disable or enable mambots to act upon these content modules.
When creating new modules the default setting is to 'enable' mambot firing.

For existing custom mambots, the defailt is to 'disable' mambot firing.



Please note this issue should only affect 'custom/new' modules and not 3PD modules.

_________________
God grant me the Serenity to Accept the things I cannot change, the Courage to change the things I can and the Wisdom to know the Difference.


Top
  E-mail  
 
Posted: Fri Oct 27, 2006 7:21 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Nov 03, 2005 4:46 pm
Posts: 44
friesengeist wrote:
$_MAMBOTS->registerFunction( 'onAfterStart', 'botSomething' );
function botSomething() {
    [INSERT HERE]
    [OLD MAMBOT CODE HERE]
}


this simply isn't working for me.  i'm having this issue with the ijoomla magazine component mambot: mos_magazine.php

its replacing text inside newsflash modules.  i followed your directions and inserted "if (@$row->content){ return;}" at the beginning of the function that is called out in registerFunction as well as tried it in other functions inside the bot, but with absolutely no effect whatsoever.

here's the beginning of the bot:

"$_MAMBOTS->registerFunction( 'onPrepareContent', 'botMagQuotes' );"

and here's the function being called out with Phil's conditional statement inserted:

"function botMagQuotes( $published, &$row, &$params, $page=0 ) {

if (@$row->content){
  return;
}

    global $_MAMBOTS, $my, $mosConfig_absolute_path,$mainframe,$database,$mosConfig_lang, $mosConfig_live_site;
    global $css_article_quote1,$css_article_quote2,$css_article_quote3,$Itemid,$_CONFIG;"


i should mention that i'm using Joomla 1.0.11.  i don't see any parameter options in the newsflash module to disable bots....i see the option for custom modules, but isn't newsflash a core module?  shouldn't it be set to disable bots by default??

anyone have any other ideas?  can i hack the newsflash module to ignore this specific bot?


Last edited by averan on Fri Oct 27, 2006 7:24 pm, edited 1 time in total.

Top
   
 
Posted: Sun Jan 07, 2007 6:13 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Sun Jan 07, 2007 6:06 am
Posts: 1
Works fine for me after some tweaking

_________________
DM Web Directory


Top
  E-mail  
 
Posted: Sun Jul 01, 2007 2:31 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Sat Aug 20, 2005 4:12 pm
Posts: 100
Location: Arouca - Portugal
sorry to come to this post again but i am having some hard times with the google adsense mambot.

I is something i realy need to one site, its a simple way to get some revenue, but unfortunately the bot is fired in some components that break with the google ad code inside.

Is there anyone willing to help on this?

_________________
twitter.com/ruigato


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group