Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Hide Module

Hide Module

Hi
Problem -1
I have use MetaMod Free versions.
I want to Hide Module for articles content wise.
Usually I use php condition:
And Find Articles content length and Hide Module.
For use Code Here

Code:


if($intro_text1 >= 8000){
echo  $intro_text1."Yes<br/>";
           return xxx;
}else
{
    echo "No<br/>";
           if ($content_genius->check("article_id != $id") ) 
           return xxx;
}

But Not Hide for Module.

Problem - 2
It is Possible for Hide Plugin ?

Please Me.
Joomla version 3.5.1
Metamod version 3-27

renishguru99
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Hide Module

Hi,

I see that you are using the variable $intro_text1
But where are you calculating that value? Is there more to the PHP code that you didn't put in the IM? MetaModPro won't calculate that for you, so unless you are using some code to calculate it, it is probably treated as "0".

Could you please send the complete PHP code you are using?

Thanks,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: Hide Module

Hi

Check The Complete PHP Code and it's working for find content length

Code:


$link= "SELECT * FROM `as23dc_content`where id='".$id."'";
$link_result = mysqli_query($conn, $link);

while($row_link= mysqli_fetch_assoc($link_result)) {

    $title = $row_link["title"];
   
    echo $title."<br/>";
   
    $inrto_text = $row_link["introtext"];
   
    $intro_text1 = strlen($inrto_text);
   
    echo $intro_text1."<br/>";
   
    if($intro_text1 >= 8000)
    {
        echo  $intro_text1."Yes<br/>";
                return 185;
    }
    else
    {
        echo "No<br/>";
               if ($content_genius->check("article_id != $id") )  return 185;
               
             

    }
}

Check My site Url is Display for content length

http://www.test2.guru99.com/introductio … enium.html

renishguru99
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Hide Module

Hi,

ok, so it's calculating the intro length correctly - that's good.
So I am just wondering what is the purpose of this part:

    else
    {
        echo "No";
               if ($content_genius->check("article_id != $id") )  return 185;
        }

I can't see why you would need to check if the article id is the same as the $id variable. Technically, $id is gained from the URL, so can be a valid value in components other than com_content. e.g. it could be "27" but from com_xyz with some sort of content id 27.
So if you are checking to see if article_id = $id you are checking to see if the person is viewing an article page in com_content. There are easier ways to do that, so I am not sure that's what you were trying to do.

The way it is set up at present, means:
1 - if MetaMod can find an article with id equal to $id (will usually be on an article page), then do the rest of the rules
2 - if not, then display nothing
3 - continue:
- if intro text > 8000 then display the module
4 - else, if article_id = id (which is most likely to be the case due to [1]) then display the module.

My guess is that you don't need the "else" section at all. If the length is not > 8000 then simply don't display a module (return a module id).

I see from your web page however that it is displaying the module twice. I expect this is because the target module (185) has been assigned onto the page in the normal way. MetaMod can't stop that from appearing, it can only "add" a module to the page on certain conditions. To prevent it from appearing twice like this, I would suggest that you assign module 185 to a fake module position e.g. "right-metamod". This ensures that it does not appear in the normal way, but doesn't stop the MetaMod from including it. Of course the MetaMod needs to be assigned to a legal module position.

Make sense?

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: Hide Module

Re hiding plugins:

You can't do this with MetaMod. But you can with Chameleon. It's very powerful.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: Hide Module

Hi

it"s try base Chameleon Plugin for Free Download  or Demo?

renishguru99
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Hide Module

Hi,

unfortunately there's not a demo version online, because it's so powerful that people could use it to destroy the demo site quite easily... but there is a 30 day money back guarantee (for any reason) so if it doesn't suit your needs I'll give you your money back.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1689
Total Polls:
6
Total Posts:
5941
Posts this week:
1
User Info:
 
Total Users:
5349
Newest User:
tony55549
Members Online:
0
Guests Online:
109

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked