Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
config.php error
elixir



Joined: 28 Jun 2008
Posts: 599

Posted: 06/10/11 21:18 
I finally decide to create a jamroom module. so far everything was going great except i hit a road block..

I create a new folder in jamroom modules folder called "facebookApp"

i created the include.php inside this folder

Code
<?php 
/**
 * Jamroom facebookApp Module includer
 * @copyright 2011 by future, LLC
 * @author
 */ 
 
defined('IN_JAMROOM') or exit(); 
 
// Define module name as a variable 
$facebookApp = "Facebook App"; 
 
// Our version 
$config['facebookApp_version']     = '0.0.1'; 
$config['facebookApp_developer']   = 'Future, LLC., ©'. strftime('%Y'); 
$config['facebookApp_description'] = 'This module enables you to create a facebook app of your Jamroom site.'; 

?> 


then i created config.php



Code
<?php
/**
 * Jamroom facebookApp master settings config
 * @copyright 2009 by Talldude Networks LLC.
 * @author Brian Johnson - bigguy@jamroom.net
 * $Id: config.php,v 1.4 2010/07/21 17:21:56 bigguy Exp $
 */
defined('IN_JAMROOM') or exit();
/**
 * Creates the Jamroom Config form for the module
 * @param array Master Jamroom settings
 * @return bool Returns true
 */
function facebookApp_config($config)
{
    jmSpanCell('Jamroom Facebook App Settings','Config Settings for the facebookApp Module');
    jmInput('Facebook API Key','facebookApp_api_key','description',$config['facebookApp_api_key'],"Enter your valid Facebook API Key. This key is generated once you have created an app on facebook developers site. Check documentation for more information.");
    jmInput('Facebook Secret','facebookApp_secret','description',$config['facebookApp_secret'],"Enter your valid Facebook Secret. This key is generated once you have created an app on facebook developers site. Check documentation for more information.");
   jmInput('Facebook Canvas URL','facebookApp_canvasUrl','description',$config['facebookApp_canvasUrl'],"Enter your valid canvas URL. This URL is vital for this app to work. Please make sure you are able access this page by directly entering the URL in browser. The url is generated once you have created an app on facebook developers site. Check documentation for more information.");   
    return true;
}
/**
 * The _verify function validates our $_post
 * @param array Posted form results
 * @return mixed returns bool true on success, array on failure
 */
function facebookApp_verify($_args)
{
    global $_post;
    if (!isset($_post['facebookApp_api_key']) || strlen($_post['facebookApp_api_key']) === 0) {
        $_tmp['error_text']  = 'Please enter a valid Facebook API Key';
        $_tmp['error_field'] = 'facebookApp_api_key';
        return $_tmp;
    }
    if (!isset($_post['facebookApp_secret']) || strlen($_post['facebookApp_secret']) === 0) {
        $_tmp['error_text']  = 'Please enter a valid Facebook Secret';
        $_tmp['error_field'] = 'facebookApp_secret';
        return $_tmp;
    }
   if (!checkType($_post['facebookApp_canvasUrl'],'url')) {
        $_tmp['error_text']  = 'Please enter a valid canvas url';
        $_tmp['error_field'] = 'facebookApp_canvasUrl';
        return $_tmp;
    }
    return (true);
}
?>


i logged in the main site as admin and then i see the new module "facebookApp". I clicked on settings and try to add my necessary parameters. I click on "update settings" and the page goes blank. I think i should be able to update settings by now and save it. Does it require any more files created before i can do this. I checked my php error log and no error has been reported.

Any help would be greatly appreciated.

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 06/11/11 07:48 
Look in your PHP error log (jamroom/logs/jr_php_error_log) - you likely have a syntax error in one of your files.

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
elixir



Joined: 28 Jun 2008
Posts: 599

Posted: 06/11/11 16:24 

bigguy:
Look in your PHP error log (jamroom/logs/jr_php_error_log) - you likely have a syntax error in one of your files.

Hope this helps!

- Brian


thats the first place i checked for errors. unfortunately there isn't any error logged. i also copied the server to another jamroom install and the screen went blank too

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 06/12/11 14:42 
If you rename config.php to something else (i.e. config.php.off), do you still get a blank page?

Kyle


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
elixir



Joined: 28 Jun 2008
Posts: 599

Posted: 06/14/11 16:51 

smith.kyle:
If you rename config.php to something else (i.e. config.php.off), do you still get a blank page?

Kyle



if i do that, then i don't have any option to change the settings for the app.

here is the download link if somebody wants to try out

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 06/14/11 16:56 
You likely have a trailing space/newline after the closing PHP tag in your file - there can be no spaces or newlines after the final:


Code

?>


Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
elixir



Joined: 28 Jun 2008
Posts: 599

Posted: 06/14/11 17:26 
thank you very much for your help, Brian.

couldn't believe that blank space after finish line was giving me blank page. This did solve the problem. But new problem arise. When i save the settings, it returns "The settings have been successfully updated" but actually it doesn't save anything.

I check the debug output. The variables i defined in include.php are saved but not the variables i have defined in config.php.

Back to top
elixir



Joined: 28 Jun 2008
Posts: 599

Posted: 06/14/11 20:15 
got it. I need to create schema.php

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.