Firefox PHP

Module: Post Previews

Posted by Joe Curia 
Re: Module: Post Previews
November 06, 2008 09:30PM
It looks like one other change is needed in the same ./include/api/json.php file.

Add global $PHORUM around line 61 as shown here:
Language: PHP
// {{{ Function phorum_api_json_decode() function phorum_api_json_decode($var) { global $PHORUM; if (empty($PHORUM[';API';][';PEARJSON';])) { return json_decode($var, TRUE); } else { return $PHORUM[';API';][';PEARJSON';]->decode($var); } } // }}}


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Post Previews
November 06, 2008 10:54PM
Yes, you are right. Committed the required change to changeset 3649.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Post Previews
November 07, 2008 12:52AM
I've definitely made the change, confirmed via SSH.

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Module: Post Previews
November 07, 2008 01:00AM
you haven't seen the messages after mine, eh? ;)


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: Module: Post Previews
November 07, 2008 01:40AM
Quote
Thomas Seifert
you haven't seen the messages after mine, eh? ;)

Oops! Sorry, didn't realise there was another page of responses :blush:

I have now made the second change, which didn't fix the issue, but the popup error has now changed to:

Error: The Ajax Phorum API call failed

I also cleared the cache again, just in case that could have helped.
I can PM you a URL to access phpinfo() on my server if that is any use?

If I can't get the module working it's no disaster - it would be interesting to find the cause though.

/\dam

--
My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Module: Post Previews
November 07, 2008 01:48PM
The ajax code also has an demo page built in and that demo page on your site is showing the same errors. You can see it by opening the page phorum/ajax.php?examples on your site. It looks like you have been randomly selected to help develop the json/ajax api ;-)

As to the error, it looks like the ajax variables are not being properly encoded/transferred as the error "Illegal Ajax request" is generated when either the ajax variables as a whole or the call variable specifically are not present.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Post Previews
November 07, 2008 01:53PM
That might indicate that the json fallback code is not working like expected. In that case the json code would not get decoded correctly, causing the ajax script to not see the variables that were put inside the json data.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Post Previews
November 11, 2008 06:46PM
Do i need to do something to my templates to get the (disable previews) to show up? It doesn't seem to be working for my templates. I updated some of the templates but, its still now showing.
Re: Module: Post Previews
November 11, 2008 07:12PM
The error is actually with the Birthdays module which is not passing on the required profile data for my module (or any other) to work with the control center pages.

I have uploaded v1.0.5 of that module on its thread. Please reinstall that module and let me know if you have any other issues.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: Module: Post Previews
November 19, 2008 02:13PM
Problem with error "Illegal Ajax request" is only when using pearjson.

Change in /api/json.php :

Language: PHP
if (!function_exists(';json_encode';)) {   require_once(';./include/api/json-pear.php';); $GLOBALS[';PHORUM';][';API';][';PEARJSON';] = new Services_JSON(); }


to:

Language: PHP
if ( !function_exists(';json_decode';) ){ function json_decode($content, $assoc=false){ require_once(';./include/api/json-pear.php';); if ( $assoc ){ $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); } else { $json = new Services_JSON; } return $json->decode($content); } }   if ( !function_exists(';json_encode';) ){ function json_encode($content){ require_once(';./include/api/json-pear.php';); $json = new Services_JSON;   return $json->encode($content); } }

and now should be workin great.



Edited 2 time(s). Last edit at 11/19/2008 02:53PM by rasta.
Sorry, only registered users may post in this forum.

Click here to login