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.

 

myBlog Php does not work?

myBlog Php does not work?

Hello,

I would like to show a slideshow only on the myBlog homepage.

I have this PHP code from Metamode Docs:

Code:

if ( $option == "com_myblog" and JRequest::getVar('task') == '' ) return 37;

but with this PHP code, the slideshow will not display.

Code:

Debug:


if (
$option == 'com_content'
and $Itemid == '316'
and JRequest::getVar('task') == 'view' /*!*/
) return XXX;

$option: com_content
$view:
$id:
$Itemid: 316
$timezone: default
$language: de-de
$language_code: de
$language_region: de
Eingebundene Module:

The php code on debug works, but the module is also displayed in the articel full view.

Metamod  2.3

Regards,
Martin

Edited By: MartinXE
26-Jul-10 22:06:37

MartinXE
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: myBlog Php does not work?

Hi Martin,

I just re-installed my copy of MyBlog to try to replicate your setup. So far I haven't managed to replicate it.

On the MyBlog front page (i.e. when I make a menu item to MyBlog), I get a URL like this:  index.php?option=com_myblog&Itemid=153

... and the MetaMod Advanced Debug gives me:

if (
  $option == 'com_myblog'
  and $Itemid == '153'
) return XXX; /* replace XXX with the module ID or position to display */
MetaMod debug info:
$option: com_myblog
$view:
$id:
$Itemid: 153

Can you confirm that the advanced debug output that you gave was actually from the front page of the blog? i.e. a menu item pointing to MyBlog?

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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: myBlog Php does not work?

Hi,

On myBlog component I get the output com_content, also on "index.php?option=com_myblog&Itemid=316".
I have also tried reinstalling myBlog.

I have sent a PM with the link, if you want to see.
Thanks for the help.

Regards,
Martin

MartinXE
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: myBlog Php does not work?

Hi Martin,

it looks like your installation of MyBlog works *very* differently to mine! (thanks for the login - but it only confirmed what you said already).

Can you tell me what version of MyBlog you have installed?

I just installed 3.0.332 on a fresh joomla installation and I can't get it to show $option as com_content, only as com_myblog.

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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: myBlog Php does not work?

Hi

I have the same version 3.0.332 of myblog, and Joomla 1.5.20.

Regards,
Martin

MartinXE
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: myBlog Php does not work?

hmmmm. Do you have any interesting/different system plugins installed? If you want to PM me your admin login details I could check through the rest of the setup.

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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: myBlog Php does not work?

Hi,

I have found the bug, when I activate a plugin in "MyBlog Plugins" my_blog changes in com_content.

Is there a way to display with com_content, modules only on the frontpage?

Regards,
Martin

MartinXE
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: myBlog Php does not work?

oooooh, interesting!!! Can you tell me what plugin it is? Or is it any of them?

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
3313 Posts
User info in posts
Administrator has disabled public posting

Re: myBlog Php does not work?

It is with all plugins, if I activate a plugin myBlog changes in com_content

MartinXE
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: myBlog Php does not work?

Just looking at the code for myblog. In libraries/plugins.php I see the following code:

JRequest::setVar( 'task' , 'view' , 'GET' );
JRequest::setVar( 'option' , 'com_content' , 'GET' );

This is a bit nasty really. This overrides the URL parameters that you'd normally get with JRequest::getVar("option") etc. and makes it very hard to detect whether or not you're actually on a myBlog page rather than a normal content page.

However, the "show" parameter is still in there, which it's not on normal content pages, so we can use that to toggle with when you are viewing individual blog entries. The main blog front page however doesn't have the "show" parameter so it's no good there.

When you're viewing a blog category page, the parameter "category" is used, which again is not found in com_content pages, so that could be used as a toggle.

The "tags" page keeps $option as com_myblog.

The "blogger" pages have a parameter "blogger" on them.

Back to your original request: to target the front page of the blog, when it's set as default on the site:

I think you could probably go for this:

if ($option == "com_content"
  and JRequest::getVar("category") == ""
  and JRequest::getVar("show") == ""
  and JRequest::getVar("blogger") == ""
  and JRequest::getVar("task") == "view"
) return 37;

Hope that works this time! Thanks for finding the plugin thing, that helped a lot!

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
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10796
Newest User:
mokao3
Members Online:
0
Guests Online:
119

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