<?php
/**
* ****************************************************************************
* Module généré par TDMCreate de la TDM "http://www.tdmxoops.net"
* ****************************************************************************
* fbconnect - MODULE FOR XOOPS AND IMPRESS CMS
* Copyright (c) waqar (http://www.fluidfusion.net)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright waqar (http://www.fluidfusion.net)
* @license GPL
* @package fbconnect
* @author waqar (http://www.fluidfusion.net)
*
* Version : 1.00:
* ****************************************************************************
*/
if (isset($_POST)) {
foreach ( $_POST as $k => $v ) {
${$k} = $v;
}
}
if (isset($_GET['op'])) {
$op = trim($_GET['op']);
if (isset($_GET['uid'])) {
$uid = intval($_GET['uid']);
}
}
include "../../mainfile.php";
include_once XOOPS_ROOT_PATH."/header.php";
include_once 'lib/config.php';
$user = User::fbc_getLoggedIn();
($user) ? $fb_active_session = $user->fbc_is_session_active() : $fb_active_session = FALSE;
global $xoopsConfig, $xoopsDB;
if (!$user) {
include_once XOOPS_ROOT_PATH."/header.php";
// DISPLAY PAGE WHEN USER IS NOT LOGGED IN TO FB CONNECT
echo render_header($user);
echo render_logged_out_index();
echo render_footer();
include_once XOOPS_ROOT_PATH."/footer.php";
exit;
}
// USER CONNECTED TO APPLICATION
if ($user->fbc_is_facebook_user()) {
echo "<br>uid " . $user->fbc_uid;
echo "<br>User " . $user->fbc_name ;
echo "<br>Name " . $user->fbc_first_name ;
echo "<br>Surname " . $user->fbc_last_name ;
$uid = $user->fbc_uid;
$username = $user->fbc_name;
$name = $user->fbc_name;
$password = "aitor";
$pass2 = "aitor";
$email = "usuario@mail.com";
$url = "http://www.getxo2.es";
if (!$username || !$email || !$password) {
$adduser_errormsg = _AM_YMCACF;
} else {
$member_handler =& xoops_gethandler('member');
// make sure the username doesnt exist yet
if ($member_handler->getUserCount(new Criteria('uname', $uid)) > 0) {
$adduser_errormsg = 'User name '.$uid.' already exists';
} else {
$newuser =& $member_handler->createUser();
if (isset($user_viewemail)) {
$newuser->setVar("user_viewemail",$user_viewemail);
}
if (isset($attachsig)) {
$newuser->setVar("attachsig",$attachsig);
}
$newuser->setVar("name", $username);
$newuser->setVar("uname", $uid);
$newuser->setVar("email", $email);
$newuser->setVar("url", formatURL($url));
$newuser->setVar("user_avatar",'blank.gif');
$newuser->setVar('user_regdate', time());
$newuser->setVar("user_icq", "");
$newuser->setVar("user_from", "");
$newuser->setVar("user_sig", "");
$newuser->setVar("user_aim", "");
$newuser->setVar("user_yim", "");
$newuser->setVar("user_msnm", "");
if ($pass2 != "") {
if ( $password != $pass2 ) {
xoops_cp_header();
echo "<strong>" . _AM_STNPDNM . "</strong>";
xoops_cp_footer();
exit();
}
$newuser->setVar("pass", md5($password));
}
$newuser->setVar("timezone_offset", $xoopsConfig['default_TZ']);
$newuser->setVar("uorder", $xoopsConfig['com_order']);
$newuser->setVar("umode",$xoopsConfig['com_mode']);
// RMV-NOTIFY
$newuser->setVar("notify_method", 1);
$newuser->setVar("notify_mode", 1);
$newuser->setVar("bio", "");
$newuser->setVar("rank", 1);
$newuser->setVar("level", 1);
$newuser->setVar("user_occ", "");
$newuser->setVar("user_intrest", "");
$newuser->setVar('user_mailok', true);
if (!$member_handler->insertUser($newuser, 1)) {
echo _AM_CNRNU;
}
$sql = "INSERT INTO " . $xoopsDB->prefix('groups_users_link') . " (groupid, uid) VALUES (2, " . $newuser->getVar('uid') . ")";
$result = $xoopsDB->queryF($sql);
}
}
if ($_POST["comment"] != "") {
// PUBLISH STORY TO PROFILE FEED
$template_data = array(
'post-title'=>idx($GLOBALS, 'sample_post_title'),
'post-url'=>idx($GLOBALS, 'sample_post_url'),
'post'=>$_POST["comment"]);
$target_ids = array();
$body_general = '';
$publish_success = $user->fbc_publishFeedStory(idx($GLOBALS, 'feed_bundle_id'), $template_data);
if ($publish_success) { $publish_result = "Published story via PHP to your profile feed!"; } else { $publish_result = "Error publishing story!"; }
}
if ($_POST["status"] != "") {
// PUBLISH STORY TO PROFILE FEED
$status_success = $user->fbc_setStatus($_POST["status"]);
if ($status_success) { $status_result = "Updated your status via PHP!"; } else { $status_result = "Error updating your status!"; }
}
echo render_header($user);
// SHOW FACEBOOK STATUS
echo render_status($user, $status_result);
// POST FEED TO PROFILE
echo render_feed_form($user, $publish_result);
// SHOW ALL FRIENDS
$friends = $user->fbc_get_all_friends(TRUE);
echo render_friends_table_html($friends, 0, 10, "fbconnect_friend", "All Friends");
// SHOW ALL CONNECTED FRIENDS TO APPLICATION
$friends = $user->fbc_get_connected_friends(FALSE);
echo render_friends_table_html($friends, 0, 10, "fbconnect_friend", "Connected Friends");
// SHOW ALL UNCONNECTED FRIENDS TO APPLICATION
$friends = $user->fbc_get_unconnected_friends_xfbml(TRUE);
echo render_friends_table_xfbml($friends, 3, 5, "fbconnect_friend", "Unconnected Friends");
echo render_footer();
} else {
echo render_header($user);
echo render_footer();
}
include_once XOOPS_ROOT_PATH."/footer.php";
?>
ALTER TABLE `x602_myquiz_data` CHANGE `optionText` `optionText` TEXT CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT ''
echo "<tr><td>"._MYQUIZ_ANSWER." $i :</td><td><input type="text" name="optionText[$i]" size="50" maxlength="300" value="".$myts->MakeTboxData4Edit($Text).""></td>n";
echo "<tr><td>"._MYQUIZ_ANSWER." $i :</td><td><TEXTAREA wrap="virtual" cols="50" rows="4" name="optionText[$i]">".$myts->MakeTboxData4Edit($Text)."</textarea></td>n";
echo "<tr><td>"._MYQUIZ_ANSWER." $i :</td><td><input type="text" name="optionText[$i]" size="50" maxlength="300" value="".$myts->MakeTboxData4Edit($Text).""></td>n";
echo "<tr><td>"._MYQUIZ_ANSWER." $i :</td><td><TEXTAREA wrap="virtual" cols="50" rows="4" name="optionText[$i]">".$myts->MakeTboxData4Edit($Text). "</textarea></td>n";