the only other thing i notice and i'm not sure why but none of the links in my admin profile are directing anywhere.... if u click on them nothing moves, so i can't add characters and ect. i'm not sure if this is related to this mod or not..
Edit:
also another question i have, for the vbskin bridge, say you have 3 skins for vb, orange, blue white. say for example that your vb uses orange and you want your efiction to use the blue vb theme. is there a way to work around to be able to do this?
After having to deal with some web host issues I was forced to migrate my site to php5, and ran into some issues with the bridge. None of the admin links would work, and no story information would show up when viewing a story.
I have resolved this with a new get_session_variables.php that I will quote here. I am still working on other parts so I do not want to release the new version in a package yet.
Also, in this file you will see the commented out sections of the new bitfield permission sets. When done you will be able to give eFiction permissions with vBulletin groups. So far my site is setting admin and validated status rights using bitfields.
<?php
// Get session variables from cookie data if not logged in.
// To bridge to another program replace (or add to) this information with the bridge to your other script. See examples in the includes/bridges/ folder.
if(!defined("_CHARSET")) exit( );
if (!empty($_COOKIE[$sitekey."_useruid"]) && !isset($_SESSION[$sitekey."_useruid"])) {
$userdata = dbassoc(dbquery("SELECT "._UIDFIELD." as uid, "._PENNAMEFIELD." as penname, "._EMAILFIELD." as email, "._PASSWORDFIELD." as password, ap.* FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '".$_COOKIE[$sitekey."_useruid"]."'"));
if($userdata && $userdata['level'] != -1 && $_COOKIE[$sitekey.'_pwd'] == md5($userdata['email']+$userdata['password'])) {
define("USERUID", $userdata['uid']);
define("USERPENNAME", $userdata['penname']);
if(!isset($_SESSION[$sitekey."_skin"]) && !empty($userdata['userskin'])) $siteskin = $userdata['userskin'];
else if(isset($_SESSION[$sitekey."_skin"])) $siteskin = $_SESSION[$sitekey."_skin"];
else $siteskin = $defaultskin;
define("uLEVEL", $userdata['level']);
define("isADMIN", uLEVEL > 0 ? true : false);
define("isMEMBER", true);
if(!isset($_SESSION[$sitekey."_agecontsent"])) $ageconsent = $userdata['ageconsent'];
else $ageconsent = $_SESSION[$sitekey."_agecontsent"];
}
}
$user_info = array( );
$_SERVER['HTTPS'] = '0';
$_SERVER['HTTP_REFERER'] = $site_url;
chdir($path_to_vb);
require_once("global.php");
chdir($path_to_efic);
//-INT bitfields for new permission checks.
//$te1 = (int)$permissions['efictionpermissions'];
//$te2 = (int)$vbulletin->bf_ugp['efictionpermissions']['can_admin_efiction'];
//$te3 = (int)$vbulletin->bf_ugp['efictionpermissions']['is_validated_efiction'];
// Bitfield check for author validation
//if ($te1 & $te3)
//{
//$autovalidate = 1;
//}
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];
if($vbulletin->userinfo['userid']) {
$userid = $vbulletin->userinfo['userid'];
$eficdata = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorprefs as ap RIGHT JOIN "._AUTHORTABLE." ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '$userid'");
if(dbnumrows($eficdata)) {
$userdata = dbassoc($eficdata);
if($userdata['level'] != "-1") {
define("USERUID", $userid);
define("USERPENNAME", $vbulletin->userinfo['username']);
if(!isset($_SESSION[$sitekey."_skin"]) && !empty($userdata['userskin'])) $siteskin = $userdata['userskin'];
else if(isset($_SESSION[$sitekey."_skin"])) $siteskin = $_SESSION[$sitekey."_skin"];
else $siteskin = $defaultskin;
define("uLEVEL", $userdata['level']);
define("isADMIN", uLEVEL > 0 OR ? true : false);
//if ($vbulletin->userinfo['usergroupid'] == "6") {
//if ($te1 & $te2){
//define("isADMIN",true);
//define("uLEVEL", 1);
//}
define("isMEMBER", true);
if(!isset($_SESSION[$sitekey."_agecontsent"])) $ageconsent = $userdata['ageconsent'];
else $ageconsent = $_SESSION[$sitekey."_agecontsent"];
}
}
}
if(!defined("USERUID")) define("USERUID", false);
if(!defined("USERPENNAME")) define("USERPENNAME", false);
if(!defined("uLEVEL")) define("uLEVEL", 0);
if(!defined("isMEMBER")) define("isMEMBER", false);
if(!defined("isADMIN")) define("isADMIN", false);
if(empty($siteskin)) $siteskin = $defaultskin;
// Copied from header.php. the include of global.php seems to wipe the variables set previously, so we have to set them again. To prevent a file edit we are duplicating the effort here.
if(isset($_GET['offset'])) $offset = $_GET['offset'];
if(!isset($offset) || !isNumber($offset)) $offset = 0;
if(isset($_REQUEST["sid"])) $sid = $_REQUEST["sid"];
if(isset($sid) && !isNumber($sid)) unset($sid);
if(isset($_REQUEST['seriesid'])) $seriesid = $_REQUEST["seriesid"];
if(isset($seriesid) && !isNumber($seriesid)) unset($seriesid);
if(isset($_REQUEST['uid'])) $uid = $_REQUEST["uid"];
if(isset($uid) && !isNumber($uid)) unset($uid);
if(isset($_REQUEST['chapid'])) $chapid = $_REQUEST["chapid"];
if(isset($chapid) && !isNumber($chapid)) unset($chapid);
$let = false;
if(isset($_GET['let'])) $let = $_GET['let'];
if(isset($let) && !in_array($let, $alphabet)) $let = false;
$output = "";
if(isset($_GET['action'])) $action = strip_tags($_GET['action']);
else $action = false;
?>
Hi Calash,
I am new with efiction and vbulletin. I have tried your bridge and get as far as login to vbulletin and authenticate with efiction. However, I am unable to use any links of efiction such as add new stories, add new series, etc. I have no idea what I did wrong. My vbulletin is 3.7.4 & efiction 3.5 & php 5.2.6. I did not tried the skin integration yet. The way I set up my test environment is as follows:
http://www.localhost.com/vb/ -------------> this is for Vbulletin
http://www.localhost.com/stories/ -------------> this is for efiction
Does this matter with the cookies authentication between them? Please advice. Thank you very much and hope someone else can also help me too if you encounter the same problems which I describe.
Thanks,
Did you try the replacment code that I posted a few posts up? On my setup it corrected the problems that you are seeing.
Just paste everything in the code block into your get_session_varaibles.php file, overwriting everything. This should clear up the problem, let me know if it does not.
I will get the download updated this weekend as well.
Thank you calash, for the quick response. I did replace the content of get_session_vars.php with your new codes; However, this time I just got a blank page when going to efiction link. I just set up this on my local computer with no network. Otherwise, I can post a link for your reference. Thank you very much for your support.
Hmm....very odd. I am going to check my code again and post a new version on the bridge. Give me a day to get things together and we can try again.
I am sorry about the problems...
Thanks calash, I am looking forward to trying it again.
I have a new version of the bridge uploaded based on the files that I run on my site. Upload them and see if they help at all.
get_session_vatiables.php contains my bitfield code for vB permissions, however it is commented out until I can make an installer for the vB side. I have 7 plugins that pull data from eFiction over to vB, as well as the bitfield that can manage permissions based on groups.
Thank you calash. I have downloaded the new bridge and installed it as your instruction. I had very high hope for this change; however, the result is still the same. I got the same blank page as I described in the previous post. My VB forum path to save cookies setting is /forurm/ . I tried your previous vbridge. It did work to certain point such as login automatically after the forum login. Efiction display all the links for both either user or admin. Everything is displayed as normal. However, I could not use any of the links. When you click on the links, it just did not go anywhere, no action. If you can think of any other possible causes please advice. Hope someone else encounter the same problem which I had. Please contribute your solution. Thank you very much. Calash, you have tried your best. I really appreciate your effort.
That is odd....it sounds like there are some issues with get_session_variables.php
You said you test system was offline? If so, try this and see what happons.
in get_session_variables.php remove the following line
if(!defined("_CHARSET")) exit( );
See if it helps at all.
Thanks, I did try it, but it did not solve the problem I had. Thank you for your help.
Hi Calash,
I have solved my blank page problem. I looked in my webserver error and found out that there was a PHP parse error at line 57 in your get_session_vars.php . I have removed the code as follows:
define("isADMIN", uLEVEL > 0 OR ? true : false); ( original )
define("isADMIN", uLEVEL > 0); ( new change)
Now, it worked for me. I am not sure it is the right way to do it or not. Please check if it is actually the error on the code. Anyway, thank you very much for your bridge.
I will have to double check the default code, but that explains why I did not see it on my setup. I am using the bitfield code that is commented out, so that line on my setup is deleted.
Does your admin account have the correct rights?
Thank you so much for hunting down that problem. I will get a new version uploaded in the next couple of days.
Yes, I have the full admin right as well as the regular user. I will try the skin integration soon and let you know. Thank you for your hard work.
Hi Calash,
Sorry to bother you again. Look like I have too many problems. I tried the vbskin integration and I had this error of the header at the begin of the front page.I have modified the extra_header.php file to match with my test environment. If you notice what the cause of this problem, please advice.
'src=""/forum/clientscript/'," 'a href=""'" => 'a href=""/forum/'," 'action="' => 'action="/forum/', //'/forum//forum' => '/forum', '/forum//forum' => '/forum', 'base href="" http://www.localhost.com/forum/"' ;" => '', '< />' => '', //'/forum//stories' => '/stories', '/forum//stories' => '/stories', '/forum/viewstory.php?' => '/stories/viewstory.php?', 'href=""/forum/javascript:'" => 'href=""javascript:'," ); foreach ($vb_fix_path as $old_path => $new_path) { $headinclude = str_replace($old_path, $new_path, $headinclude); $navbar = str_replace($old_path, $new_path, $navbar); $header = str_replace($old_path, $new_path, $header); $footer = str_replace($old_path, $new_path, $footer); } chdir ($path_to_efic); echo $headinclude; ?>
