New problem with PHP plugin
- Arnaud
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
16 years 7 months ago #2491
by Arnaud
Hi Emir !
I have a problem with a PHP Plugin i'm trying to develop (latest news). I can't find what's wrong with my code, so your help would be very appreciate !
I pass a variable in my url to filter on my news categories. Here is my URL with my variable 'cat' :
Now, here is my PHP code to extract my variable content :
And now my SQL code :
When i execute my module, i have no result (Loading...). If i set the debug mode on, i can see my variable is passed :
But, if i manually set "$cat = 13" in my php code, i have my module result !
I don't know why it's not working... Is there a problem with my PHP code or with the API ?
Thank you for your help, Emir !
Arnaud
I have a problem with a PHP Plugin i'm trying to develop (latest news). I can't find what's wrong with my code, so your help would be very appreciate !
I pass a variable in my url to filter on my news categories. Here is my URL with my variable 'cat' :
index.php?option=com_content&task=section&id=1&Itemid=2&cat=13
Now, here is my PHP code to extract my variable content :
$url = $_SERVER['QUERY_STRING'];
parse_str($url, $output);
$cat = $output['cat'];
And now my SQL code :
$query = "SELECT count(id) FROM #__content WHERE sectionid = '1' AND catid = $cat AND state = '1'";
When i execute my module, i have no result (Loading...). If i set the debug mode on, i can see my variable is passed :
SELECT count(id) FROM jos_content WHERE sectionid = '1' AND catid = 13 AND state = '1'
But, if i manually set "$cat = 13" in my php code, i have my module result !
I don't know why it's not working... Is there a problem with my PHP code or with the API ?
Thank you for your help, Emir !
Arnaud
Please Log in or Create an account to join the conversation.
- Arnaud
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
16 years 7 months ago #2492
by Arnaud
I've activated debug mode in the plugin and I can see the content.
So the problem come from the API !
Emir ! Help, please !
So the problem come from the API !
Emir ! Help, please !
Please Log in or Create an account to join the conversation.
- Saka
- Offline
- Administrator
16 years 7 months ago #2499
by Saka
Emir Sakic
www.sakic.net
Please attach the plugin so I can test.
Emir Sakic
www.sakic.net
Please Log in or Create an account to join the conversation.
- Arnaud
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
16 years 7 months ago #2500
by Arnaud
Check MP, Emir
Please Log in or Create an account to join the conversation.
- Arnaud
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
16 years 7 months ago #2504
by Arnaud
Hi Emir !
Do you have information about my plugin issue ?
Arnaud
Do you have information about my plugin issue ?
Arnaud
Please Log in or Create an account to join the conversation.
- Saka
- Offline
- Administrator
16 years 7 months ago #2505
by Saka
Emir Sakic
www.sakic.net
Not yet, I've been busy. Will check that soon.
Emir Sakic
www.sakic.net
Please Log in or Create an account to join the conversation.