Integration with another PHP script

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
jonbolton
Posts: 1
Joined: Mon Aug 01, 2005 1:59 pm
Location: Scotland, UK
Contact:

Integration with another PHP script

Post by jonbolton »

Thanks for this excellent script. I am also using another PHP product which collects username and email address when the user logs in. I would like to pull this information through to the phpMyFAQ script.

In the ask.tpl file, I want to change the name and email fields to read the username and email address from the other program.

I'm guessing I need something like

require_once('./learningcentre/config.php');
global $CFG, $USER;

and then change the ask.tpl file with something like

<div class="row"><span class="label">{msgNewContentMail}</span>
<input type="hidden" name="email" value="<?php echo $USER->email;?>" />
<?php echo $USER->email; ?></div>

but I'm not sure where to put it :oops:

I've tried adding
require_once('./learningcentre/config.php');
global $CFG, $USER;

to the ask.php file, but it just says

Warning: main(./learningcentre/config.php): failed to open stream: No such file or directory in /home/baillie/public_html/myfaq/ask.php on line 3

Fatal error: main(): Failed opening required './learningcentre/config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/cpanel/3rdparty/lib/php') in /home/baillie/public_html/myfaq/ask.php on line 3

Any advice would be very much appreciated.

Thanks
Thorsten
Posts: 15759
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

you should use phpMyFAQ 1.5 because there's a similar function like you want: the LDAP support. If LDAP is enabled we take the username and the e-mail adress from the LDAP user and insert this information in the input forms in the publich frontend.

I think with a little hack this should be made in an hour.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply