Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sat, Feb 1, 8:48 PM

in-portal

Index: trunk/admin/import/import.php
===================================================================
--- trunk/admin/import/import.php (revision 324)
+++ trunk/admin/import/import.php (nonexistent)
@@ -1,941 +0,0 @@
-<?php
-#import script
-#taking care of actual importing from in-link db to in-portal db
-
-
-if(!strlen($pathtoroot))
-{
- $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
- if(strlen($path))
- {
- /* determine the OS type for path parsing */
- $pos = strpos($path,":");
- if ($pos === false)
- {
- $gOS_TYPE="unix";
- $pathchar = "/";
- }
- else
- {
- $gOS_TYPE="win";
- $pathchar="\\";
- }
- $p = $path.$pathchar;
- /*Start looking for the root flag file */
- while(!strlen($pathtoroot) && strlen($p))
- {
- $sub = substr($p,strlen($pathchar)*-1);
- if($sub==$pathchar)
- {
- $filename = $p."root.flg";
- }
- else
- $filename = $p.$pathchar."root.flg";
- if(file_exists($filename))
- {
- $pathtoroot = $p;
- }
- else
- {
- $parent = realpath($p.$pathchar."..".$pathchar);
- if($parent!=$p)
- {
- $p = $parent;
- }
- else
- $p = "";
- }
- }
- if(!strlen($pathtoroot))
- $pathtoroot = ".".$pathchar;
- }
- else
- {
- $pathtoroot = ".".$pathchar;
- }
-}
-
-$sub = substr($pathtoroot,strlen($pathchar)*-1);
-if($sub!=$pathchar)
-{
- $pathtoroot = $pathtoroot.$pathchar;
-}
-
-require_once($pathtoroot."kernel/startup.php");
-
-$admin = $objConfig->Get("AdminDirectory");
-if(!strlen($admin))
- $admin = "admin";
-
-if ($_POST["Action"]=="Import")
-{
- $objSession->SetVariable("import_user_admin",$_POST["user_admin"]);
- $objSession->SetVariable("import_user_regular",$_POST["user_regular"]);
- $objSession->SetVariable("import_init_cat",$_POST["init_cat"]);
- $objSession->SetVariable("image_name",$_POST["image_name"]);
-
- $objSession->SetVariable("importtodo","initialize");
- $objSession->SetVariable("importstart",0);
- $objSession->SetVariable("importtotal",0);
-
- if((int)$_POST["init_cat"]>0)
- {
- $c = $objCatList->GetItemByField("ResourceId",(int)$_POST["init_cat"]);
- $c->UpdateACL();
- $c->UpdateCachedPath();
- }
-
-
-}
- $allgroups = $objGroups->GetAllGroupList();
-
- $inlink_sql_type=$objSession->GetVariable("import_inlink_sql_type");
- $inlink_server=$objSession->GetVariable("import_inlink_server");
- $inlink_db=$objSession->GetVariable("import_inlink_db");
- $inlink_user=$objSession->GetVariable("import_inlink_user");
- $inlink_pass=$objSession->GetVariable("import_inlink_pass");
-
- $user_admin=$objSession->GetVariable("import_user_admin");
- $user_regular=$objSession->GetVariable("import_user_regular");
- if(!is_object($c))
- $c = $objCatList->GetItemByField("ResourceId",$objSession->GetVariable("import_init_cat"));
- $init_cat= $c->Get("CategoryId");
- $image_name=$objSession->GetVariable("image_name");
- $start = $objSession->GetVariable("importstart");
- $acl = explode(",",$c->GetACL("CATEGORY.VIEW"));
-
-//IN-LINK connection
-$linkconn=&ADONewConnection($inlink_sql_type);
-$linkconn->PConnect($inlink_server, $inlink_user, $inlink_pass, $inlink_db);
-
-if(!$linkconn)
-{ echo "Database connection failed. DB Type: $sql_type, DB Server: $inlink_server, DB User: $inlink_user, DB Name: $inlink_db"; //fatal;
- echo $linkconn->ErrorMsg();
- die();
-}
-if($pconnect)
-{
- $linkconn->Close();
- $linkconn = ADONewConnection($inlink_sql_type);
- $linkconn->PConnect($inlink_server, $inlink_user, $inlink_pass, $inlink_db);
-}
-
-//admin only util
-$pathtolocal = $pathtoroot."kernel/";
-require_once ($pathtoroot."admin/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot."admin/toolbar.php");
-//Set Section
-$section = "in-portal:inlink_inport";
-//Set Environment Variable
-$envar = "env=" . BuildEnv();
-
-$sec = $objSections->GetSection($section);
-$objCatToolBar = new clsToolBar();
-
-$title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 4";
-
-//In-Portal
-$portalconn = GetAdodbConnection();
-
-$TablePrefix = "ses_".$objSession->GetSessionKey()."_".GetTablePrefix();
-
-$olddbname=$inlink_db;
-//$newdbname="inportal";
-$newdbname=$g_DBName;
-##############creating a temproary table have to be here
-if ($_POST["Action"]=="Import")
-{
- $portalconn->Execute("DROP TABLE IF EXISTS ".$TablePrefix."import");
- $portalconn->Execute("DROP TABLE IF EXISTS ".$TablePrefix."importcat");
- $temptable = "CREATE TABLE ".$TablePrefix."import (otname varchar(40), oid int(11), ocustomid int(11), oparentid int(11), ntname varchar(40), nid int(11), nrid int(11), npid int(11)) ";
-
- $portalconn->Execute($temptable);
- $cattable ="CREATE TABLE ".$TablePrefix."importcat (op int(11), np int(11), flag int(11)) ";
- $portalconn->Execute($cattable);
- $newcat = 1;
-}
-
-global $admin, $pathtoroot;
-
-require_once ($pathtoroot.$admin."/import/status.php"); #for status bar and all visual effects
-
-
-$todo= $objSession->GetVariable("importtodo");
-
-$total = $objSession->GetVariable("importtotal");
-switch ($todo)
-{
- case "users":
- status($start, $total, "users");
- usersimport();
-
- //setstart(0,"cats"); #for debugging
- break;
- case "cats":
- status($start, $total, "cats");
- catmanager();
- #setstart(0,"links"); #for debugging
- break;
- case "links":
- status($start, $total, "links");
- linksimport();
- #setstart(0,"custom");#For debugging only
- break;
- case "custom":
- status($start, $total, "custom");
- customimport();
- #setstart(0,"relcat");#for debuggin only
- break;
- case "relcat":
- status($start, $total, "relcat");
- relcatimport();
- #setstart(0,"terminate"); #for debuggin only
- break;
- case "terminate":
- terminator();
- status(1,1,"terminate");
- break;
- default:
- status(0,0,"initializing");
- setstart(0,"users"); #to start importing from users first
- break;
-}
-
- function terminator()
- {
- global $portalconn, $TablePrefix;
- $query="DROP TABLE IF EXISTS ".$TablePrefix."import, ".$TablePrefix."importcat";
- $portalconn->Execute($query);
- }
-
- function reload()
- {
- global $newurl;
- print '<script language="javascript">' ;
- print " setTimeout('location.href=location.href',40);";
- print ' </script>';
- }
- function setstart($mystart, $part)
- {
- global $objSession;
-
- $objSession->SetVariable("importstart",$mystart);
- $objSession->SetVariable("importtodo",$part);
- reload();
- }
- function settotal($total)
- {
- global $objSession;
- $objSession->SetVariable("importtotal",$total);
- }
-
-//users import from inlink to inportal
- function usersimport()
- {
- global $objUsers, $objSession, $linkconn, $portalconn, $olddbname,
- $user_admin,$objGroups, $user_regular, $start, $TablePrefix;
-
- $counter = 0;
- $limit = 350;
- $oldtablename = "inl_users";
- $newtablename = $objUsers->SourceTable;
- if ($start == 0)
- {
- $query="select count(*) as NumUsers from inl_users";
- $row =$linkconn->Execute($query);
- if ($row && !$row->EOF)
- {
- settotal($row->fields["NumUsers"]);
-
- }
- }
- $query="select * from inl_users LIMIT $start, $limit";
- $row =$linkconn->Execute($query);
- while($row && !$row->EOF)
- {
- $counter++; #needed to know when close to time out
-
- if ($row->fields['user_name'] != "root") {
- $olduserid=$row->fields["user_id"];
- //$Login, $Password, $Email, $CreatedOn, $FirstName="", $LastName="", $Status=2,
- // $Phone="", $Street="", $City="", $State="", $Zip="", $Country=""
-
- if($row->fields["user_status"]==1)
- {
- $Status=1;
- }
- else
- {
- if($row->fields["user_pend"]==0)
- {
- $Status=2;
- }
- else
- $Status=0;
- }
- $u = $objUsers->Add_User( $row->fields["user_name"], $row->fields["user_pass"], $row->fields["email"],
- $row->fields["user_date"], $row->fields["first"], $row->fields["last"],
- $Status);
- $oldid=$row->fields["user_id"];
- $oldcustom=$row->fields["user_cust"];
- $newid=$u->Get("PortalUserId");
- $resid=$u->Get("ResourceId");
- #adding user to usergroup
-
- $userpermission = $row->fields["user_perm"];
- if ($userpermission==2 || $userpermission==1)
- {
- $glist = explode(",",$user_admin);
- $Primary=1;
- for($i=0;$i<count($glist);$i++)
- {
- $group=$objGroups->GetItem($glist[$i]);
- $group->AddUser($newid,$Primary);
- $Primary = 0;
- }
- }
- else
- {
- $glist = explode(",",$user_regular);
- $Primary=1;
- for($i=0;$i<count($glist);$i++)
- {
- $group=$objGroups->GetItem($glist[$i]);
- $group->AddUser($newid,$Primary);
- $Primary = 0;
- }
- }
- //$group=$objGroups->GetItem($g);
- //$group->AddUser($newid,1);
-
- #inserting values to the temproary table
- $totemp = "INSERT INTO ".$TablePrefix."import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) ";
- $tovalues= " VALUES ('$oldtablename',$olduserid,$oldcustom,0,'$newtablename', $newid, $resid, 0 )";
- $totemp=$totemp.$tovalues;
- $portalconn->Execute($totemp);
- }
- $row->moveNext();
- }
- if ($counter == $limit)
- {
- setstart($start+$limit, "users");
- }
- else
- setstart(0,"cats");
-
- }
- //END OF USERS IMPORT ^^^^^^^^^^^^^^^^^^^^^
-
-//Categories Import
- function catmanager()
- {
- global $portalconn, $init_cat,$start,$TablePrefix;
- if ($start == 0)
- {
- $counter = catimport(0,$init_cat);
- setstart($counter,"cats");
- $portalconn->Execute("UPDATE ".$TablePrefix."importcat SET flag=1 WHERE np=$init_cat");
- }
- else
- {
-
- $query="select * from ".$TablePrefix."importcat WHERE flag=0 LIMIT 0,1";
- $row =$portalconn->Execute($query);
- if($row && !$row->EOF)
- {
- $oldid= $row->fields["op"];
- $newid = $row->fields["np"];
- $counter= catimport($oldid,$newid);
- $query2="UPDATE ".$TablePrefix."importcat SET flag=1 WHERE op=$oldid and np=$newid";
- $portalconn->Execute($query2);
- setstart($counter+$start-1,"cats");
- $x=5;
- }
- else
- {
- setstart(0,"links");
- }
- }
- }
- #pushes into the quque
- function pushid($op,$np)
- {
- global $linkconn, $portalconn, $TablePrefix;
- $addnew = "INSERT INTO ".$TablePrefix."importcat (op,np,flag) VALUES ($op,$np,0)";
- $portalconn->Execute($addnew);
-
- }
- function checkifexist($id)
- {
- global $linkconn;
- $addnew = "select * from inl_cats where cat_sub=$id";
- $row =$linkconn->Execute($addnew);
- if ($row && !$row->EOF)
- {
-
- if ($row->fields["cat_id"] !=0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- return false;
- }
- }
- #import itself
- function catimport($oldparentid, $parentid)
- {
- global $objCatList, $linkconn, $objUsers, $linkconn, $portalconn,
- $olddbname, $user_admin,$objGroups, $user_regular, $acl,$allgroups,
- $c, $start, $TablePrefix;
- $counter=0;
-
- $objCacheCount = new clsCacheCountList();
- if ($start == 0)
- {
- $query="select count(*) as CatCount from inl_cats";
- $row =$linkconn->Execute($query);
- if ($row && !$row->EOF)
- {
- settotal($row->fields["CatCount"]);
- $catcount = $row->fields["CatCount"];
- $catcount += (int)$c->Get("CachedDescendantCatsQty");
- $c->Set("CachedDescendantCatsQty",$catcount);
- $c->Update();
-
- }
- }
-
- $query="select * from inl_cats WHERE cat_sub=$oldparentid";
- $oldtablename = "inl_cats";
- $newtablename = "Category";
- $row =$linkconn->Execute($query);
- if($row && !$row->EOF)
- {
- $RowCount = $row->NumRows();
- $ResInc = $RowCount;
- $ResourceId = GetNextResourceId($ResInc);
- }
- if($parentid>0)
- {
- $ParentCat = new clsCategory($parentid);
- $Path = $ParentCat->Get("ParentPath");
- }
- while($row && !$row->EOF)
- {
- $counter++;
-
- $cat = new clsCategory();
- if($row->fields["cat_pend"]==0)
- {
- $Status=1;
- }
- else
- {
- if($row->fields["cat_vis"]==0)
- {
- $Status=2;
- }
- else
- $Status=0;
- }
- $CreatedById = getnewid($row->fields["cat_id"]);
- $cat->Set(array("ParentId", "Name", "Description", "CreatedOn", "EditorsPick", "Status", "HotItem",
- "NewItem","PopItem", "Priority", "MetaKeywords", "MetaDescription", "CreatedById",
- "CachedDescendantCatsQty"),
- array($parentid, $row->fields["cat_name"], $row->fields["cat_desc"],
- $row->fields["cat_date"], (int)$row->fields["cat_pick"], $Status, 2, 2, 2, 0,
- $row->fields["meta_keywords"],$row->fields["meta_desc"],
- (int)$CreatedById,(int)$row->fields["cat_cats"]));
- $cat->Set("ResourceId",$ResourceId);
- $ResourceId++;
- $cat->Create();
-
- $FullPath = $Path.$cat->Get("CategoryId")."|";
- $cat->Set("ParentPath",$FullPath);
- $cat->SetViewPerms("CATEGORY.VIEW",$acl,$allgroups);
- $cat->SetViewPerms("LINK.VIEW",$acl,$allgroups);
- $cat->Update();
- $cat->UpdateCachedPath();
-
- $objCacheCount->CategoryId= $cat->Get("CategoryId");
- $objCacheCount->SetValue(0,0,0,0,0);
-
- $newid = $cat->Get("CategoryId");
- $resid = $cat->Get("ResourceId");
- $oldid = $row->fields["cat_id"];
- $oldcustom = $row->fields["cat_cust"];
- $oldpid = $row->fields["cat_sub"];
-
- #inserting values to the temproary table
- $totemp = "INSERT INTO ".$TablePrefix."import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) ";
- $tovalues= " VALUES ('$oldtablename',$oldid,$oldcustom,$oldpid,'$newtablename', $newid, $resid, $parentid )";
- $totemp=$totemp.$tovalues;
- $portalconn->Execute($totemp);
-
- #pushes into the queue
- if(checkifexist($oldid))
- {
- pushid($oldid,$newid);
- }
- $row->moveNext();
- }
- // disable lost+found category (if found one)
- $tmp_cat = $objCatList->GetItemByField('Name','Lost+Found');
- if( is_object($tmp_cat) )
- {
- $tmp_cat->Set('Status',0);
- $tmp_cat->Update();
- }
- return $counter;
- }
-
-//Links Import
- function linksimport()
- {
- global $objLinkList, $init_cat, $linkconn, $portalconn, $olddbname,
- $user_admin,$objGroups, $user_regular, $start, $TablePrefix;
- $limit = 750; #need to change to a higher number like 100, forty is only for debugging
- $counter = 0;
- set_time_limit(0);
- if ($start == 0)
- {
- $query="select count(*) as LinkCount from inl_lc";
- $row =$linkconn->Execute($query);
- if ($row && !$row->EOF)
- {
- settotal($row->fields["LinkCount"]);
-
- }
- }
-
- $query="select * from inl_lc INNER JOIN inl_links ON (inl_lc.link_id=inl_links.link_id) limit $start,$limit";
- $oldtablename="inl_links";
- $newtablename="link";
- $row =$linkconn->Execute($query);
- if($row && !$row->EOF)
- {
- $RowCount = $row->NumRows();
- $ResInc = $RowCount;
- $ResourceId = GetNextResourceId($ResInc);
- }
- while($row && !$row->EOF)
- {
- $counter++;
- $oldid=$row->fields["link_id"];
- $flag=1;
-
- $oldcatid = $row->fields["cat_id"];
- $pending = $row->fields["link_pend"];
- #getting a new category id
-
- $rs = $portalconn->Execute("SELECT nid FROM ".$TablePrefix."import WHERE ntname='Category' and oid=$oldcatid");
- if ($rs && ! $rs->EOF)
- {
- $categoryid=$rs->fields["nid"];
- }
- else
- {
- $categoryid = $init_cat;
- }
-
- $rs = $portalconn->Execute("SELECT * FROM ".$TablePrefix."import WHERE otname='inl_link' AND oid='$oldid'");
- if($rs && ! $rs->EOF)
- {
- $NewLinkId = $rs->fields["nid"];
- }
- else
- $NewLinkId=0;
- if ($NewLinkId==0)
- {
- #gets the new user id of the user who created a link
- $newuserid=getnewid($row->fields["link_user"]);
- #adds link to the IN-PORTAL
- $link = new clsLink();
- if($Pending==0)
- {
- $Status=1;
- }
- else
- $Status=2;
- $link->Set(array("Name", "Description", "Url", "CreatedOn", "Status", "EditorsPick",
- "NewItem","PopItem","HotItem", "CreatedById", "CachedRating",
- "CachedVotesQty","Hits", "Priority"),
- array($row->fields["link_name"], $row->fields["link_desc"], $row->fields["link_url"], $row->fields["link_date"], $Status,
- $row->fields["link_pick"], 2, 2, 2, $newuserid, (int)$row->fields["link_rating"],
- (int)$row->fields["link_votes"],(int)$row->fields["link_hits"], 0));
- $link->Set("ResourceId",$ResourceId);
- $ResourceId++;
- $link->Create();
- $link->AddToCategory($categoryid,"",1);
-
- $newid = $link->Get("LinkId");
- $resid = $link->Get("ResourceId");
- $oldcustom=$row->fields["link_cust"];
- $linkimage =$row->fields["link_image"];
-
- if ($linkimage)
- {
- addimage($resid,$linkimage);
- }
-
- #calls to import reviews
- reviewimport($link,$oldid,$resid);
- $parentid = 0;
- $totemp = "INSERT INTO ".$TablePrefix."import (odb,otname,oid,ocustomid,oparentid,ndb,ntname,nid,nrid,npid) ";
- $tovalues= " VALUES ('$olddbname','$oldtablename',$oldid,$oldcustom,$oldcatid,'inportal','$newtablename', $newid, $resid, $parentid )";
- $totemp = $totemp.$tovalues;
- //$portalconn->Execute($totemp);
-
- }
- else #if link is related to more than one category
- {
- $link = new clsLink($NewLinkId);
- $link->AddtoCategory($categoryid,"",0);
- }
- #prelast while
- $row->moveNext();
- }
-
- if ($counter == $limit)
- {
- setstart($start+$limit, "links");
- }
- else
- {
- setstart(0,"custom");
- }
-
- }
-
- #importing image from the in-link
- function addimage($resourceid, $imageurl)
- {
- global $objImageList, $image_name;
- #echo "<br />IMAGE RESOURCEID: $resourceid IMAGE URL: $imageurl <br />";
- if(!is_object($objImageList))
- $objImageList = new clsImageList();
-
- $LocalImage = 0;
- $LocalThumb = 0;
- if(!strlen($image_name))
- $image_name="inlink_image";
-
- $img = $objImageList->Add($image_name,"",$resourceid, 0, 0,"", $imageurl, 1,0, 1, 0,1);
- }
- #Reviews Import for links
- function reviewimport($myclass,$oldid,$rid)
- {
- global $objCustomFieldList, $linkconn, $portalconn;
- #ITEM AddReview($createdBy,$reviewText,0)
-
- $query="select * from inl_reviews where rev_link= $oldid";
- $row =$linkconn->Execute($query);
- while($row && !$row->EOF)
- {
- $oldreviewuser= $row->fields["rev_user"];
- if($oldreviewuser !=0) #meaning was not created by guest
- {
- $newrid=getnewid($oldreviewuser);
- if ($newrid)
- {
- $temp=$myclass->AddReview($newrid,$row->fields["rev_text"],0,"127.0.0.1",1, "In-Link");
-
- }
- else
- {
- $temp=$myclass->AddReview(0,$row->fields["rev_text"],0,"127.0.0.1",1, "In-Link");
-
- }
- }
- else #meaning was created by guest
- {
- $temp=$myclass->AddReview(0,$row->fields["rev_text"],0,"127.0.0.1",1, "In-Link");
-
- }
- $row->moveNext();
- }
- }
- #HELPER FUNCTION THAT GETS THE NEW ID of the USER
- function getnewid($oldid)
- {
- global $portalconn, $TablePrefix;
-
- $query2="select * from ".$TablePrefix."import where otname='inl_users' and oid=".$oldid;
- $row2=$portalconn->Execute($query2);
- if ($row2->fields["nid"])
- {
- return $row2->fields["nid"];
- }
- else
- {
- return 0;
- }
- }
-
-
-
- //^^^^^^^^^^^^^^^^^^^^^^ABOVE IS LINKS IMPORT
-
-
-#########################################Custom Fields Import
-#create a new CustomField first and then
-#by selecting all and receiving from one record of inl_config the values of cc1,cc2,cc3,cc4,cc5,cc6,uc1,uc2,uc3,uc4,uc5,uc6,lc1,lc2,lc3,lc4,lc5,lc6
-#go through all import table and if ocustomid occures get the row from inl_custom and
-#create CustomMetaData field
-#---------------------
-#Regarding CustomField:
-#FieldName= cc1,cc2 .... from inl_config
-#FieldLabel= value of cc1, cc2 ....
-#Type=4 for links 6 for users 0 category
-#------------
-#Regarding CustomMetaData
-#ResourceId <= link id
-#CustomFieldId <= id from the top
-#Value = Value from the table custom
-
- //VVVVV BELOW ARE CUSTOM FIELD IMPORT REQUIRES TO HAVE A TEMPROARY TABLE IMPORT
- function customimport()
- {
- global $linkconn, $portalconn, $start, $TablePrefix;
- $limit = 40; #just for debugging purposes, in real life set it to higher number
- $counter=0;
- if ($start == 0)
- {
- $r=buildfields();
- $query="SELECT count(*) as cc from ".$TablePrefix."import WHERE NOT ocustomid=0";
- $row =$portalconn->Execute($query);
- if ($row && !$row->EOF)
- {
- settotal($row->fields["cc"]);
-
- }
- }
- else
- {
- $r=getfields();
- }
-
- $query="SELECT * from ".$TablePrefix."import WHERE ocustomid!=0 limit $start,$limit";
- $row =$portalconn->Execute($query);
- while($row && !$row->EOF)
- {
- $counter++;
- if ($row->fields["ocustomid"]!=0)
- {
- loadcustom($row->fields["ocustomid"],$row->fields["nrid"],$row->fields["otname"],$r);
- }
- $row->moveNext();
- }
- if ($counter == $limit)
- {
- setstart($start+$limit, "custom");
- }
- else
- {
- setstart(0,"relcat");
- }
- }
- function loadcustom($customid,$rid,$tablename,$r)
- {
- global $linkconn, $objCustomDataList, $objSession;
-
- $objCustomDataList->Clear();
- if ($tablename =="inl_cats")
- {
- //$myfieldname="cc";
- $fields = explode(",",$objSession->GetVariable("custom_category"));
- }
- else if($tablename =="inl_users")
- {
- //$myfieldname="uc";
- $fields = explode(",",$objSession->GetVariable("custom_user"));
- }
- else if($tablename =="inl_links")
- {
- //$myfieldname="lc";
- $fields = explode(",",$objSession->GetVariable("custom_links"));
- }
-
- $oldtablename="inl_links";
- $newtablename="link";
- $query="select * from inl_custom Where cust_id=$customid";
- $row =$linkconn->Execute($query);
- if ($row)
- {
- for ($x=0; $x<count($fields);$x++)
- {
- $cust=$row->fields["cust".$x];
- if ($cust!="")
- {
- $fieldid =$r[$fields[$x]];
- $objCustomDataList->SetFieldValue($fieldid,$rid,$cust);
- }
- }
- $objCustomDataList->SaveData();
- }
- }
-
- function buildfields() #building and populating an array
- {
- global $objCustomFieldList, $objSession,$linkconn;
-
- $lc="lc";
- $uc="uc";
- $cc="cc";
- $query = "SELECT * FROM inl_config WHERE name LIKE 'uc%'";
- $row =$linkconn->Execute($query);
- $names = array();
- while($row && !$row->EOF)
- {
- $data = $row->fields;
- $fieldlabel=$data["name"];
- if(strlen($data["value"]))
- {
- $fieldlabel = $data["value"];
- }
- $f=$objCustomFieldList->AddField(6,$data["name"],$fieldlabel);
- $r["'".$data["name"]."'"]=$f->Get("CustomFieldId");
- $objSession->SetVariable("custom_".$data["name"],$f->Get("CustomFieldId"));
- $names[] = $data["name"];
- $row->MoveNext();
- }
- $objSession->SetVariable("custom_user",implode(",",$names));
- unset($names);
-
- $names = array();
- $query = "SELECT * FROM inl_config WHERE name LIKE 'cc%'";
- $row =$linkconn->Execute($query);
- while($row && !$row->EOF)
- {
- $data = $row->fields;
- $fieldlabel=$data["name"];
- if(strlen($data["value"]))
- {
- $fieldlabel = $data["value"];
- }
- $f=$objCustomFieldList->AddField(1,$data["name"],$fieldlabel);
- $r["'".$data["name"]."'"]=$f->Get("CustomFieldId");
- $objSession->SetVariable("custom_".$data["name"],$f->Get("CustomFieldId"));
- $names[] = $data["name"];
- $row->MoveNext();
- }
- $objSession->SetVariable("custom_category",implode(",",$names));
- unset($names);
-
- $names = array();
- $query = "SELECT * FROM inl_config WHERE name LIKE 'lc%'";
- $row =$linkconn->Execute($query);
- while($row && !$row->EOF)
- {
- $data = $row->fields;
- $fieldlabel=$data["name"];
- if(strlen($data["value"]))
- {
- $fieldlabel = $data["value"];
- }
- $f=$objCustomFieldList->AddField(4,$data["name"],$fieldlabel);
- $r["'".$data["name"]."'"]=$f->Get("CustomFieldId");
- $objSession->SetVariable("custom_".$data["name"],$f->Get("CustomFieldId"));
- $names[] = $data["name"];
- $row->MoveNext();
- }
- $objSession->SetVariable("custom_links",implode(",",$names));
-
- return $r;
- }
-
- function getfields() #building and populating an array
- {
- global $objSession;
-
- $lc="lc";
- $uc="uc";
- $cc="cc";
- $userfields = explode(",",$objSession->GetVariable("custom_user"));
- for ($x=0;$x<=count($userfields);$x++)
- {
- $r[$userfields[$x]]=$objSession->GetVariable("custom_".$userfields[$x]);
- }
- $catfields = explode(",",$objSession->GetVariable("custom_category"));
- for ($x=0;$x<=count($catfields);$x++)
- {
- $r[$catfields[$x]]=$objSession->GetVariable("custom_".$catfields[$x]);
- }
- $linkfields = explode(",",$objSession->GetVariable("custom_links"));
- for ($x=0;$x<=count($linkfields);$x++)
- {
- $r[$linkfields[$x]]=$objSession->GetVariable("custom_".$linkfields[$x]);
- }
-
- return $r;
- }
-
-
-################################################Relationships Import
-
- function relcatimport()
- {
- global $linkconn,$objSession, $start;
- $limit = 100;
- $counter =0;
- if ($start == 0)
- {
- $query="SELECT count(*) from inl_rel_cats";
- $row =$linkconn->Execute($query);
- if ($row && !$row->EOF)
- {
- settotal($row->fields[0]);
-
- }
- }
-
- $objRelList = new clsRelationshipList();
- $query="select * from inl_rel_cats LIMIT $start, $limit";
- $row =$linkconn->Execute($query);
- while($row && !$row->EOF)
- {
- $counter++;
- $sourceid = newcatrid($row->fields["cat_id"]);
- $targetid = newcatrid($row->fields["rel_id"]);
- if ($sourceid !="" && $targetid !="")
- {
- $r = $objRelList->Add($sourceid, 1,$targetid, 1);
- $r->Create();
- }
- $row->moveNext();
- }
-
- if ($counter == $limit)
- {
- setstart($start+$limit, "relcat");
- }
- else
- {
- setstart(0,"terminate");
- }
-
- }
- function newcatrid($oid)
- {
- global $portalconn, $TablePrefix;
- $query2="select * from ".$TablePrefix."import where otname='inl_cats' and oid=$oid";
- $row =$portalconn->Execute($query2);
- if ($row->fields["nrid"])
- {
- return $row->fields["nrid"];
- }
- else
- {
- return "";
- }
- }
- // END OF RELATIONSHIP IMPORT
-?>
\ No newline at end of file
Property changes on: trunk/admin/import/import.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.10
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/import/inlinkimport1.php
===================================================================
--- trunk/admin/import/inlinkimport1.php (revision 324)
+++ trunk/admin/import/inlinkimport1.php (nonexistent)
@@ -1,175 +0,0 @@
-<?php
-
-if(!strlen($pathtoroot))
-{
- $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
- if(strlen($path))
- {
- /* determine the OS type for path parsing */
- $pos = strpos($path,":");
- if ($pos === false)
- {
- $gOS_TYPE="unix";
- $pathchar = "/";
- }
- else
- {
- $gOS_TYPE="win";
- $pathchar="\\";
- }
- $p = $path.$pathchar;
- /*Start looking for the root flag file */
- while(!strlen($pathtoroot) && strlen($p))
- {
- $sub = substr($p,strlen($pathchar)*-1);
- if($sub==$pathchar)
- {
- $filename = $p."root.flg";
- }
- else
- $filename = $p.$pathchar."root.flg";
- if(file_exists($filename))
- {
- $pathtoroot = $p;
- }
- else
- {
- $parent = realpath($p.$pathchar."..".$pathchar);
- if($parent!=$p)
- {
- $p = $parent;
- }
- else
- $p = "";
- }
- }
- if(!strlen($pathtoroot))
- $pathtoroot = ".".$pathchar;
- }
- else
- {
- $pathtoroot = ".".$pathchar;
- }
-}
-
-$sub = substr($pathtoroot,strlen($pathchar)*-1);
-if($sub!=$pathchar)
-{
- $pathtoroot = $pathtoroot.$pathchar;
-}
-//echo $pathtoroot;
-//echo $pathtoroot;
-require_once($pathtoroot."kernel/startup.php");
-$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
-$admin = $objConfig->Get("AdminDirectory");
-if(!strlen($admin))
- $admin = "admin";
-$localURL=$rootURL."kernel/";
-$adminURL = $rootURL.$admin;
-$imagesURL = $adminURL."/images";
-//admin only util
-$pathtolocal = $pathtoroot."kernel/";
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
-//Set Section
-$section = "in-portal:inlink_inport";
-//Set Environment Variable
-$envar = "env=" . BuildEnv();
-
-$formaction = $adminURL."/import/import.php?".$envar;
- $sec = $objSections->GetSection($section);
- $objCatToolBar = new clsToolBar();
-
-//inlink import variables clean up
-$objSession->SetVariable("import_inlink_sql_type","");
-$objSession->SetVariable("import_inlink_server","");
-$objSession->SetVariable("import_inlink_db","");
-$objSession->SetVariable("import_inlink_user","");
-$objSession->SetVariable("import_inlink_pass","");
-$objSession->SetVariable("error_importing","");
-
-//importal import variables clean up.
-$objSession->SetVariable("user_admin_names","");
-$objSession->SetVariable("user_regular_names","");
-$objSession->SetVariable("user_admin_values","");
-$objSession->SetVariable("user_regular_values","");
-$objSession->SetVariable("catnavbar","");
-$objSession->SetVariable("init_cat","");
-$objSession->SetVariable("user_input1","");
-$objSession->SetVariable("user_input2","");
-$objSession->SetVariable("importtodo","");
-
-if (true)
-{
-
- if($en_prev>-1)
- {
- $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');";
- $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');";
- $onClick= $sec->Get("onclick");
- $var="?env=".BuildEnv()."&en=$en_prev";
- $link=$_SERVER["PHP_SELF"].$var;
- $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif");
- }
- else
- {
- $MouseOver="";
- $MouseOut="";
- $onClick="";
- $link="#";
- $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),"#","","","","tool_prev_f3.gif");
-
- }
- if(true)
- {
- $MouseOver="if (document.inlinkimport1.agree.checked == true) swap('moveright','toolbar/tool_next_f2.gif');";
- $MouseOut="if (document.inlinkimport1.agree.checked == true) swap('moveright', 'toolbar/tool_next.gif');";
-
- $var="?env=".BuildEnv()."&en=$en_next";
- $link2=$adminURL."/import/inlinkimport2.php".$var;
- $onClick="if (document.inlinkimport1.agree.checked == true) document.location= '$link2';";
-
- $link="#";
- $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,$onClick,"tool_next_f3.gif");
- }
-
- $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 1";
-
- int_header($objCatToolBar,NULL,$title);
-}
-?>
-
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
-<form name="inlinkimport1" METHOD="POST" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>">
-<?php int_subsection_title(admin_language("la_Prompt_Warning")); ?>
- <TR <?php echo int_table_color(); ?>>
- <TD COLSPAN="2"><span class=\"text\">This utility allows you to import data from other databases and applications, including third party products and earlier versions of this software.
- </span>
- </TD>
- </TR>
- <tr <?php echo int_table_color(); ?>>
- <TD>
- <?php
- //$text = 'Running this utility will affect your database. '.
- // 'Please be advised that you can use this utility '.
- // 'at your own risk. Intechnic Corporation can not '.
- // 'be held liable for any corrupt data or data loss. '.
- // 'Please make sure to back up your database(s) before '.
- // 'running this utility.';
- echo int_hint(prompt_language("la_text_disclaimer_part1")." ".prompt_language("la_text_disclaimer_part2"));
- ?>
- </td>
- </tr>
- <tr>
- <td COLSPAN="2">
-
- <input type="checkbox" value="0" id="agree" name="agree" onclick="if (document.inlinkimport1.agree.checked == true) swap('moveright', 'toolbar/tool_next.gif'); else swap('moveright', 'toolbar/tool_next_f3.gif'); "><label for="agree"><?php echo admin_language("la_Text_IAgree"); ?></label>
- </td>
- </tr>
-</FORM>
-</TABLE>
-<?php
-int_footer();
-?>
\ No newline at end of file
Property changes on: trunk/admin/import/inlinkimport1.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/import/inlinkimport2.php
===================================================================
--- trunk/admin/import/inlinkimport2.php (revision 324)
+++ trunk/admin/import/inlinkimport2.php (nonexistent)
@@ -1,135 +0,0 @@
-<?php
-
-if(!strlen($pathtoroot))
-{
- $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
- if(strlen($path))
- {
- /* determine the OS type for path parsing */
- $pos = strpos($path,":");
- if ($pos === false)
- {
- $gOS_TYPE="unix";
- $pathchar = "/";
- }
- else
- {
- $gOS_TYPE="win";
- $pathchar="\\";
- }
- $p = $path.$pathchar;
- /*Start looking for the root flag file */
- while(!strlen($pathtoroot) && strlen($p))
- {
- $sub = substr($p,strlen($pathchar)*-1);
- if($sub==$pathchar)
- {
- $filename = $p."root.flg";
- }
- else
- $filename = $p.$pathchar."root.flg";
- if(file_exists($filename))
- {
- $pathtoroot = $p;
- }
- else
- {
- $parent = realpath($p.$pathchar."..".$pathchar);
- if($parent!=$p)
- {
- $p = $parent;
- }
- else
- $p = "";
- }
- }
- if(!strlen($pathtoroot))
- $pathtoroot = ".".$pathchar;
- }
- else
- {
- $pathtoroot = ".".$pathchar;
- }
-}
-
-$sub = substr($pathtoroot,strlen($pathchar)*-1);
-if($sub!=$pathchar)
-{
- $pathtoroot = $pathtoroot.$pathchar;
-}
-//echo $pathtoroot;
-//echo $pathtoroot;
-require_once($pathtoroot."kernel/startup.php");
-$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
-
-$admin = $objConfig->Get("AdminDirectory");
-if(!strlen($admin))
- $admin = "admin";
-
-$localURL=$rootURL."kernel/";
-$adminURL=$rootURL.$admin;
-$imagesURL = $adminURL."/images";
-//admin only util
-$pathtolocal = $pathtoroot."kernel/";
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
- //Set Section
- $section = "in-portal:inlink_inport";
-
- //Set Environment Variable
- $envar = "env=" . BuildEnv();
- $var = '?env='.BuildEnv();
-
- $sec = $objSections->GetSection($section);
- $objCatToolBar = new clsToolBar();
-
- // Previous Button
- $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');";
- $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');";
- $link = $adminURL.'/import/inlinkimport1.php'.$var;
- $objCatToolBar->Add('moveleft','la_ToolTip_PreviousStep', $link, $MouseOver, $MouseOut,'','tool_prev.gif');
-
- // Next Button
- $MouseOver = "if( ChoiseMade('import_form','choose') !== false ) swap('moveright','toolbar/tool_next_f2.gif');";
- $MouseOut = "if( ChoiseMade('import_form','choose') !== false ) swap('moveright', 'toolbar/tool_next.gif');";
-
- if($ro_perm)
- {
- $click_url = $adminURL."/import/inlinkimport1.php".$var;
- $onClick = "if( ChoiseMade('import_form','choose') ) document.location= '$click_url'; ";
- }
- else
- {
- $click_url = $adminURL."/import/inlinkimport3.php".$var;
- $onClick = "ImportRedirect('import_form', ChoiseMade('import_form','choose'), '$click_url');";
- }
- $objCatToolBar->Add("moveright",'la_ToolTip_NextStep','#',$MouseOver,$MouseOut,$onClick,"tool_next_f3.gif");
-
- // header
- $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 2";
- int_header($objCatToolBar,NULL,$title);
-
-?>
-<form name="import_form" id="import_form" method="post" action="<?php echo $click_url; ?>">
- <input type="hidden" name="import_id" id="import_id" value="">
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
-
- <?php int_subsection_title("Import Source"); ?>
- <tr <?php echo int_table_color(); ?>>
- <td><span class="text">Select the program you are importing the data from:</span></td>
- </tr>
- <tr <?php echo int_table_color(); ?>>
- <td>
- <?php
- foreach($import_scripts as $id => $iscript)
- echo '<input type="radio" name="choose" id="ch'.$id.'" value="'.$id.'" onclick="swap(\'moveright\', \'toolbar/tool_next.gif\')"'.(!$iscript['enabled'] ? ' disabled="true"' : '').'><span class="text"><label for="ch'.$id.'">'.$iscript['label'].'</label></span><br />'."\n";
- ?>
- </td>
- </tr>
-</table>
-</form>
-<?php
-int_footer();
-?>
\ No newline at end of file
Property changes on: trunk/admin/import/inlinkimport2.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/import/inlinkimport3.php
===================================================================
--- trunk/admin/import/inlinkimport3.php (revision 324)
+++ trunk/admin/import/inlinkimport3.php (nonexistent)
@@ -1,155 +0,0 @@
-<?php
-
-if(!strlen($pathtoroot))
-{
- $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
- if(strlen($path))
- {
- /* determine the OS type for path parsing */
- $pos = strpos($path,":");
- if ($pos === false)
- {
- $gOS_TYPE="unix";
- $pathchar = "/";
- }
- else
- {
- $gOS_TYPE="win";
- $pathchar="\\";
- }
- $p = $path.$pathchar;
- /*Start looking for the root flag file */
- while(!strlen($pathtoroot) && strlen($p))
- {
- $sub = substr($p,strlen($pathchar)*-1);
- if($sub==$pathchar)
- {
- $filename = $p."root.flg";
- }
- else
- $filename = $p.$pathchar."root.flg";
- if(file_exists($filename))
- {
- $pathtoroot = $p;
- }
- else
- {
- $parent = realpath($p.$pathchar."..".$pathchar);
- if($parent!=$p)
- {
- $p = $parent;
- }
- else
- $p = "";
- }
- }
- if(!strlen($pathtoroot))
- $pathtoroot = ".".$pathchar;
- }
- else
- {
- $pathtoroot = ".".$pathchar;
- }
-}
-
-$sub = substr($pathtoroot,strlen($pathchar)*-1);
-if($sub!=$pathchar)
-{
- $pathtoroot = $pathtoroot.$pathchar;
-}
-//echo $pathtoroot;
-//echo $pathtoroot;
-require_once($pathtoroot."kernel/startup.php");
-$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
-
-$admin = $objConfig->Get("AdminDirectory");
-if(!strlen($admin))
- $admin = "admin";
-
-$localURL=$rootURL."kernel/";
-$adminURL=$rootURL.$admin;
-$imagesURL = $adminURL."/images";
-
-//admin only util
-$pathtolocal = $pathtoroot."kernel/";
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
- //Set Section
- $section = "in-portal:inlink_inport";
-
- //Set Environment Variable
- $envar = "env=" . BuildEnv();
- $var = "?env=".BuildEnv();
-
-
- if( isset($_POST['import_id']) ) $objSession->SetVariable('ImportScriptID', $_POST['import_id']);
- $import_script = GetImportScript( $objSession->GetVariable('ImportScriptID') );
-
-
- $sec = $objSections->GetSection($section);
- $objCatToolBar = new clsToolBar();
-
- // Previous Button
- $MouseOver = "swap('moveleft','toolbar/tool_prev_f2.gif');";
- $MouseOut = "swap('moveleft', 'toolbar/tool_prev.gif');";
- $link = $adminURL."/import/inlinkimport2.php".$var;
- $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif");
-
- // Next Button
- $MouseOver = "swap('moveright','toolbar/tool_next_f2.gif');";
- $MouseOut = "swap('moveright', 'toolbar/tool_next.gif');";
- $link2 = $adminURL."/import/inlinkimport4.php".$var;
- $onClick = "document.import_form.submit();";
- $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),'#',$MouseOver,$MouseOut,$onClick,"tool_next.gif");
-
- // Header
- $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 3";
- int_header($objCatToolBar,NULL,$title);
-?>
-
-<form name="import_form" METHOD="POST" action='<?php echo $adminURL."/import/inlinkimport4.php".$var ; ?>' >
-<input type="hidden" name="Action" value="checkconn">
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <?php int_subsection_title(admin_language("la_Text_DatabaseSettings").' - '.$import_script['label']); ?>
- <tr <?php echo int_table_color(); ?>>
- <td width="60%" valign="top"><span class="text"><?php echo $import_script['field_prefix'].' '.admin_language("la_prompt_InlinkSqlType"); ?></span></td>
- <td>
- <select name="inlink_sql_type" style="width: 197px;">
- <option value="mysql" selected>MySQL</option>
- </select>
- </td>
- </tr>
- <tr <?php echo int_table_color(); ?>>
- <td width="60%" valign="top"><span class="text"><?php echo $import_script['field_prefix'].' '.admin_language("la_prompt_InlinkServer"); ?></span></td>
- <td>
- <input type="text" name="inlink_server" class="text" size="30" value="<?php echo $objSession->GetVariable("import_inlink_server"); ?>">
- </td>
- </tr>
- <tr <?php echo int_table_color(); ?>>
- <td width="60%" valign="top"><span class="text"><?php echo $import_script['field_prefix'].' '.admin_language("la_prompt_InlinkDbName"); ?></span></td>
- <td>
- <input type="text" name="inlink_db" class="text" size="30" value="<?php echo $objSession->GetVariable("import_inlink_db"); ?>">
- </td>
- </tr>
- <tr <?php echo int_table_color(); ?>>
- <td width="60%" valign="top"><span class="text"><?php echo $import_script['field_prefix'].' '.admin_language("la_prompt_InlinkDbUsername"); ?></span></td>
- <td>
- <input type="text" name="inlink_user" class="text" size="30" value="<?php echo $objSession->GetVariable("import_inlink_user"); ?>">
- </td>
- </tr>
- <tr <?php echo int_table_color(); ?>>
- <td width="60%" valign="top"><span class="text"><?php echo $import_script['field_prefix'].' '.admin_language("la_prompt_InlinkDbPass"); ?></span></td>
- <td>
- <input type="password" name="inlink_pass" class="text" size="30" value="<?php echo $objSession->GetVariable("import_inlink_pass"); ?>">
- </td>
- </tr>
- <tr>
- <td colspan="2"><span class="error"><?php echo $objSession->GetVariable("error_importing"); ?></span></td>
- </tr>
-</table>
-</form>
-<?php
-int_footer();
-?>
\ No newline at end of file
Property changes on: trunk/admin/import/inlinkimport3.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.2
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/import/inlinkimport4.php
===================================================================
--- trunk/admin/import/inlinkimport4.php (revision 324)
+++ trunk/admin/import/inlinkimport4.php (nonexistent)
@@ -1,203 +0,0 @@
-<?php
-
-if(!strlen($pathtoroot))
-{
- $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
- if(strlen($path))
- {
- /* determine the OS type for path parsing */
- $pos = strpos($path,":");
- if ($pos === false)
- {
- $gOS_TYPE="unix";
- $pathchar = "/";
- }
- else
- {
- $gOS_TYPE="win";
- $pathchar="\\";
- }
- $p = $path.$pathchar;
- /*Start looking for the root flag file */
- while(!strlen($pathtoroot) && strlen($p))
- {
- $sub = substr($p,strlen($pathchar)*-1);
- if($sub==$pathchar)
- {
- $filename = $p."root.flg";
- }
- else
- $filename = $p.$pathchar."root.flg";
- if(file_exists($filename))
- {
- $pathtoroot = $p;
- }
- else
- {
- $parent = realpath($p.$pathchar."..".$pathchar);
- if($parent!=$p)
- {
- $p = $parent;
- }
- else
- $p = "";
- }
- }
- if(!strlen($pathtoroot))
- $pathtoroot = ".".$pathchar;
- }
- else
- {
- $pathtoroot = ".".$pathchar;
- }
-}
-
-$sub = substr($pathtoroot,strlen($pathchar)*-1);
-if($sub!=$pathchar)
-{
- $pathtoroot = $pathtoroot.$pathchar;
-}
-//echo $pathtoroot;
-//echo $pathtoroot;
-require_once($pathtoroot."kernel/startup.php");
-$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
-
-$admin = $objConfig->Get("AdminDirectory");
-if(!strlen($admin))
- $admin = "admin";
-
-$localURL=$rootURL."kernel/";
-$adminURL = $rootURL.$admin;
-$imagesURL = $adminURL."/images";
-//admin only util
-$pathtolocal = $pathtoroot."kernel/";
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
-
- //Set Section
- $section = "in-portal:inlink_inport";
-
- //Set Environment Variable
- $envar = "env=" . BuildEnv();
-
- $sec = $objSections->GetSection($section);
- $objCatToolBar = new clsToolBar();
-
- //check if the previous input is correct
- if( $_POST["Action"] == 'checkconn')
- {
- // save supplied connection info
- $objSession->SetVariable("import_inlink_sql_type", $_POST["inlink_sql_type"]);
- $objSession->SetVariable("import_inlink_server", $_POST["inlink_server"]);
- $objSession->SetVariable("import_inlink_db", $_POST["inlink_db"]);
- $objSession->SetVariable("import_inlink_user", $_POST["inlink_user"]);
- $objSession->SetVariable("import_inlink_pass", $_POST["inlink_pass"]);
- $objSession->SetVariable("error_importing", '');
-
-
- $inlink_sql_type = $objSession->GetVariable("import_inlink_sql_type");
- $inlink_server = $objSession->GetVariable("import_inlink_server");
- $inlink_db = $objSession->GetVariable("import_inlink_db");
- $inlink_user = $objSession->GetVariable("import_inlink_user");
- $inlink_pass = $objSession->GetVariable("import_inlink_pass");
-
- // check supplied connection
- $linkconn = ADONewConnection($inlink_sql_type);
- if(!$linkconn->PConnect($inlink_server, $inlink_user, $inlink_pass, $inlink_db) || $inlink_server =="" || $inlink_db=="")
- {
- $objSession->SetVariable("error_importing","Error: The connection to the DB failed please check your settings");
- header("Location:inlinkimport3.php?".$envar);
- }
- unset($linkconn);
- }
-
-
- $import_script = GetImportScript( $objSession->GetVariable('ImportScriptID') );
-
- $var = "?env=".BuildEnv();
-
- // Previous Button
- $MouseOver = "swap('moveleft','toolbar/tool_prev_f2.gif');";
- $MouseOut = "swap('moveleft', 'toolbar/tool_prev.gif');";
- $link = $adminURL."/import/inlinkimport3.php".$var;
- $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif");
-
- // Next Button
- $MouseOver = "swap('moveright','toolbar/tool_next_f2.gif');";
- $MouseOut = "swap('moveright', 'toolbar/tool_next.gif');";
- $formaction = $adminURL.'/import/'.$import_script['url'].'.php?'.$envar;
- $link = $adminURL."/import/inlinkimport4.php".$var;
- $onClick = "if( !CheckFinalForm('import_form') ) alert('Please fill in all of the fields'); else import_submit('import_form','$formaction',''); ";
- $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),'#',$MouseOver,$MouseOut,$onClick,"tool_next.gif");
-
- // Header
- $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 4";
- int_header($objCatToolBar,NULL,$title);
-
-?>
-
-<form id="import_form" name="import_form" method="post" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>">
- <input type="hidden" name="Action" value="m_save_import_config">
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <?php int_subsection_title("Matching Fields - Intechnic In-Portal "); ?>
-<!-- script common fields: begin -->
- <tr <?php echo int_table_color(); ?>>
- <td width="60%" valign="top"><span class="text"><?php echo admin_language("la_prompt_AdminId"); ?></span></td>
- <td>
- <b><?php echo $objSession->GetVariable("user_admin_names"); ?></b>
- <input type="hidden" name="user_admin" size="15" class="text" value="<?php echo $objSession->GetVariable("user_admin_values"); ?>">
- <input type="hidden" name="grouplist1" value="<?php echo $objSession->GetVariable('grouplist1'); ?>">
- <a href="#"><img src="../images/icon_users_sm.gif" style="cursor:hand;" border="0" onclick="OpenGroupSelector('<?php echo $envar; ?>&en=0&destform=import_form&destfield=grouplist1&Selector=radio');"></a>
- </td>
- </tr>
- <tr <?php echo int_table_color(); ?>>
- <td width="60%" valign="top"><span class="text"><?php echo admin_language("la_prompt_RegUserId"); ?></span></td>
- <td>
- <b><?php echo $objSession->GetVariable("user_regular_names"); ?></b>
- <input type="hidden" name="user_regular" size="15" class="text" value="<?php echo $objSession->GetVariable("user_regular_values"); ?>">
- <input type="hidden" name="grouplist2" value="<?php echo $objSession->GetVariable('grouplist2'); ?>">
- <a href="#"><img src="../images/icon_users_sm.gif" style="cursor:hand;" border="0" onclick="OpenGroupSelector('<?php echo $envar; ?>&en=0&destform=import_form&destfield=grouplist2&Selector=radio');"></a>
- </td>
- </tr>
- <tr <?php echo int_table_color(); ?>>
- <td width="60%" valign="top"><span class="text"><?php
- echo admin_language("la_prompt_InitImportCat");
- $catid = $objSession->GetVariable('categoryid');
- $path = prompt_language($objConfig->Get("Root_Name"));
- if($catid > 0)
- {
- $c = $objCatList->GetItemByField('ResourceId', $catid);
- $path .= "&gt;".$c->GetCachedNavBar();
- }
- ?>
- </td>
- <td>
- <b><?php echo $path; ?></b>
- <input type="hidden" name="init_cat" size="15" class="text" value="<?php echo $objSession->GetVariable("categoryid"); ?>">
- <a href="#"><img src="<?php echo $imagesURL; ?>/folder.gif" style="cursor:hand;" border="0" ONCLICK="OpenCatSelector('<?php echo $envar; ?>&source=inlinkimport4&continue_sess=1&destform=import_form&destfield=categorylist&Selector=radio');"></a>
- <input type="hidden" name="categorylist" value="<?php echo $objSession->GetVariable('categorylist'); ?>">
- </td>
- </tr>
-<!-- script common fields: end -->
-<!-- script spefific fields: begin -->
-<?php
- if( $import_script['id'] == 'in-link' )
- {
-?>
- <tr <?php echo int_table_color(); ?>>
- <td width="60%" valign="top"><span class="text"><?php echo admin_language("la_prompt_Import_ImageName"); ?></span></td>
- <td>
- <input type="text" name="link_image" class="text" size="30" value="<?php echo $objSession->GetVariable("link_image"); ?>">
- </td>
- </tr>
-<?php
- }
-?>
-<!-- script spefific fields: end -->
-</table>
-</form>
-<?php
-int_footer();
-?>
Property changes on: trunk/admin/import/inlinkimport4.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.3
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/import/status.php
===================================================================
--- trunk/admin/import/status.php (revision 324)
+++ trunk/admin/import/status.php (nonexistent)
@@ -1,201 +0,0 @@
-<?php #status display
-#require_once ($pathtoroot."admin/include/elements.php");
-
-global $objCatToolBar, $title;
-
- function status($start,$total,$section)
- {
- global $objSession;
-
- if ($start != 0 && $total>0)
- $percent=round(($start/$total)*100);
- else
- $percent=0;
- switch ($section)
- {
- case "users":
- $section = "Users";
- $uservalue=$percent;
- $catvalue=0;
- $linksvalue=0;
- $customvalue=0;
- $relcatvalue=0;
- break;
- case "cats":
- $section = "Categories";
- $uservalue=100;
- $catvalue=$percent;
- $linksvalue=0;
- $customvalue=0;
- $relcatvalue=0;
- break;
- case "links":
- $section = "Links";
- $uservalue=100;
- $catvalue=100;
- $linksvalue=$percent;
- $customvalue=0;
- $relcatvalue=0;
- break;
- case "custom":
- $section = "Custom Fields";
- $uservalue=100;
- $catvalue=100;
- $linksvalue=100;
- $customvalue=$percent;
- $relcatvalue=0;
- break;
- case "relcat":
- $section = "Relative Categories";
- $uservalue=100;
- $catvalue=100;
- $linksvalue=100;
- $customvalue=100;
- $relcatvalue=$percent;
- break;
- case "terminate":
- $section = "Complete";
- $uservalue=100;
- $catvalue=100;
- $linksvalue=100;
- $customvalue=100;
- $relcatvalue=100;
- #callexit();
- break;
- default:
- $section = "Initializing";
- $uservalue=0;
- $catvalue=0;
- $linksvalue=0;
- $customvalue=0;
- $relcatvalue=0;
- break;
- }
- displayheader();
- displaytablestart();
- displayrow1("<b>Importing In-Link to In-Portal:</b>"," ");
- displayrow2("Users:",$uservalue."%");
- displayrow1("Categories:",$catvalue."%");
- displayrow2("Links (Including Reviews and Images):",$linksvalue."%");
- displayrow1("Custom Fields:",$customvalue."%");
- displayrow2("Category Relations:",$relcatvalue."%");
- displayrow1("Importing:",$section);
- displaytableover();
- displaytablestart();
- displaybar($percent);
- displaytableover();
- displayfooter();
-
- if ($section == "Complete") {
- $ado = GetADODBConnection();
- $TablePrefix = "ses_".$objSession->GetSessionKey()."_".GetTablePrefix();
-
- $query="DROP TABLE IF EXISTS ".$TablePrefix."import, ".$TablePrefix."importcat";
- $ado->Execute($query);
- }
- }
- function callexit() #In case importing is over
- {
- /* global $pathtoroot;
- require_once ($pathtoroot."admin/import/exit.php");
- displaytablestart();
- displayrow1("<b>Importing In-Link to In-Portal:</b>"," ");
- displayrow2("Users:",$uservalue."%");
- displayrow1("Categories:",$catvalue."%");
- displayrow2("Links (Including Reviews and Images):",$linksvalue."%");
- displayrow1("Custom Fields:",$customvalue."%");
- displayrow2("Category Relations:",$relcatvalue."%");
- displayrow1("Importing:",$section);
- displaytableover();
- displaytablestart();
- displaybar($percent);
- displaytableover();
- displayfooter();
-*/
- }
- function displayheader()
- {
- global $title;
-
- int_header($objCatToolBar,NULL,$title);
- //echo '<HTML>';
- //echo '<HEAD>';
- //echo '<title>Importing In-Link to In-Portal </title>';
- //echo '<link rel="stylesheet" type="text/css" href="../include/style.css">';
- //echo '</HEAD>';
- //echo '<body topmargin="8" leftmargin="8" marginheight="8" marginwidth="8" bgcolor="#FFFFFF">';
- }
- function displaytablestart()
- {
- echo '<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder_full">';
-
- }
- function displaytableover()
- {
- echo "</TABLE>";
- }
- function displayfooter()
- {
- echo "</BODY>";
- echo "</HTML>";
- }
- function displayrow1($name,$value)
- {
- echo '<TR class="table_color1"><TD width="70%" valign=\"top\"><span class=\"text\">';
- echo $name;
- echo '</span></td><TD width="30%" valign="top">';
- echo $value;
- echo '</td></tr>';
- }
- function displayrow2($name,$value)
- {
- echo '<TR class="table_color2"><TD width="70%" valign=\"top\"><span class=\"text\">';
- echo $name;
- echo '</span></td><TD width="30%" valign="top">';
- echo $value;
- echo '</td></tr>';
- }
-
- function displaybar($percent)
- {
- global $rootURL, $title;
-
- $o .="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\" class=\"tableborder\">";
-
- echo "\n";
- $o .= int_subsection_title_ret(admin_language("la_performing_import")." - ".$percent."%");
- $o .= "<TR><TD align=\"middle\"><br />";
- $o .= " <TABLE CLASS=\"tableborder_full\" width=\"75%\">";
- $o .=" <TR border=1><TD width=\"".$percent."%\" STYLE=\"background:url('".$rootURL."admin/images/progress_bar_segment.gif');\">&nbsp;</TD>";
- $comp_pct = 100-$percent;
- $o .= " <TD bgcolor=#FFFFFF width=\"".$comp_pct."%\"></TD></TR>";
- $o .= " </TABLE>";
- //$o .= " <BR /><input type=button VALUE=\"".admin_language("la_Cancel")."\" CLASS=\"button\" ONCLICK=\"document.location='".$CancelURL."';\">";
- echo $o."\n";
- echo "</TD></TR></TABLE>";
-
-/* if ($percent == 0)
- {
- echo "<TR>";
- echo "<TD BGCOLOR=\"#FFFFFF\" width=\"100%\" >$percent";
- echo "%</td></TR>";
- }
- else if ($percent < 60)
- {
- echo "<TR><TD BGCOLOR=\"#4682B2\" width=\"".$percent."%\" >";
- $row2 = 100-$percent;
- echo "</td> <TD BGCOLOR=\"#FFFFFF\" width=\"".$row2."%\" > $percent";
- echo "%</td></TR>";
- }
- else if ($percent == 100)
- {
- echo "<TR><TD BGCOLOR=\"#4682B2\" align=\"right\" width=\"100%\" ><FONT COLOR=\"#FFFFFF\">$percent%</FONT></td>";
- }
- else
- {
- echo "<TR><TD BGCOLOR=\"#4682B2\" align=\"right\" width=\"".$percent."%\" ><FONT COLOR=\"#FFFFFF\">$percent%</FONT>";
- $row2 = 100-$percent;
- echo "</td> <TD BGCOLOR=\"#FFFFFF\" width=\"".$row2."%\" ></td></TR>";
- }*/
- }
-?>
\ No newline at end of file
Property changes on: trunk/admin/import/status.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/import/phpbb_import.php
===================================================================
--- trunk/admin/import/phpbb_import.php (revision 324)
+++ trunk/admin/import/phpbb_import.php (nonexistent)
@@ -1,427 +0,0 @@
-<?php
-if(!strlen($pathtoroot))
-{
- $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
- if(strlen($path))
- {
- /* determine the OS type for path parsing */
- $pos = strpos($path,":");
- if ($pos === false)
- {
- $gOS_TYPE="unix";
- $pathchar = "/";
- }
- else
- {
- $gOS_TYPE="win";
- $pathchar="\\";
- }
- $p = $path.$pathchar;
- /*Start looking for the root flag file */
- while(!strlen($pathtoroot) && strlen($p))
- {
- $sub = substr($p,strlen($pathchar)*-1);
- if($sub==$pathchar)
- {
- $filename = $p."root.flg";
- }
- else
- $filename = $p.$pathchar."root.flg";
- if(file_exists($filename))
- {
- $pathtoroot = $p;
- }
- else
- {
- $parent = realpath($p.$pathchar."..".$pathchar);
- if($parent!=$p)
- {
- $p = $parent;
- }
- else
- $p = "";
- }
- }
- if(!strlen($pathtoroot))
- $pathtoroot = ".".$pathchar;
- }
- else
- {
- $pathtoroot = ".".$pathchar;
- }
-}
-
-$sub = substr($pathtoroot,strlen($pathchar)*-1);
-if($sub!=$pathchar)
-{
- $pathtoroot = $pathtoroot.$pathchar;
-}
-//echo $pathtoroot;
-//echo $pathtoroot;
-require_once($pathtoroot."kernel/startup.php");
-$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
-
-$admin = $objConfig->Get("AdminDirectory");
-if(!strlen($admin))
- $admin = "admin";
-
-$localURL=$rootURL."kernel/";
-$imagesURL = $rootURL."admin/images";
-$adminURL = $rootURL.$admin;
-
-//admin only util
-$pathtolocal = $pathtoroot."kernel/";
-require_once ($pathtoroot."admin/include/elements.php");
-require_once ($pathtoroot."kernel/admin/include/navmenu.php");
-require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot."admin/toolbar.php");
-//Set Section
-$section = "in-portal:inlink_inport";
-//Set Environment Variable
-$envar = "env=" . BuildEnv();
-
-$sec = $objSections->GetSection($section);
-$title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 4";
-int_header(null,NULL,$title);
-
-
-$import_steps = Array();
-$import_steps[] = Array('id' => 'users', 'caption' => 'Users, avatars'); // users + avatars
-$import_steps[] = Array('id' => 'user_banlist', 'caption' => 'Users Banrules'); // banned users
-$import_steps[] = Array('id' => 'cats', 'caption' => 'Categories');
-$import_steps[] = Array('id' => 'forums', 'caption' => 'Forums');
-$import_steps[] = Array('id' => 'topics', 'caption' => 'Topics');
-$import_steps[] = Array('id' => 'posts', 'caption' => 'Posts');
-$import_steps[] = Array('id' => 'smiles', 'caption' => 'Smiles');
-
-error_reporting(E_ALL);
-ini_set('display_errors',1);
-ini_set('max_execution_time', 0);
-ini_set('memory_limit', '250M');
-
-function PrintStep($step_rec)
-{
- echo '
- <tr '.int_table_color(0, true).'>
- <td width="30%">&nbsp;</td>
- <td width="35%" valign="top"><span class="text">'.$step_rec['caption'].'</span></td>
- <td width="5%">
- <span id="'.$step_rec['id'].'" class="text">0</span>%&nbsp;(<span id="'.$step_rec['id'].'_additional" class="text"></span>)
- </td>
- <td width="30%">&nbsp;</td>
- </tr>';
-
-}
-
-function echof($s) // not in use
-{
- echo $s;
- flush();
-}
-
-?>
-
-<form id="import_form" action="" method="post">
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <?php
- foreach($import_steps as $import_step) PrintStep($import_step);
- int_subsection_title( admin_language("la_performing_import").' - 965 %' );
- ?>
- <tr <?php echo int_table_color(); ?>>
- <td colspan="4">Script Running: <span id="total_time">0</span> s</td>
- </tr>
-
-
- </table>
-</form>
-<?php
- int_footer(); echo "\n";
-
- define('DT_USER', 6); // user data type
- $bb_prefix = $objSession->GetVariable('bb_prefix'); // may be phpBB uses prefix
- $sql_type = $objSession->GetVariable("import_inlink_sql_type");
- $db_server = $objSession->GetVariable("import_inlink_server");
- $db_name = $objSession->GetVariable("import_inlink_db");
- $db_user = $objSession->GetVariable("import_inlink_user");
- $db_pass = $objSession->GetVariable("import_inlink_pass");
- $import_category_id = $objSession->GetVariable('import_category_id');
-
- $user_admin = $objSession->GetVariable("user_admin_values");
- $user_regular = $objSession->GetVariable("user_regular_values");
-
- //$admin_group =& new clsPortalGroup($user_admin);
- $user_group =& new clsPortalGroup($user_regular);
-
-
-
-
- // made connection to source database
- $db =& ADONewConnection($sql_type);
- $db->PConnect($db_server, $db_user, $db_pass, $db_name);
-
- // get connection to destination database
- $dst_db =& GetADODBConnection();
-
- // if connection error occured, then say this
- if(!$db)
- {
- echo "Database connection failed. DB Type: $sql_type, DB Server: $inlink_server, DB User: $inlink_user, DB Name: $inlink_db"; //fatal;
- echo $db->ErrorMsg();
- exit;
- }
-
- $begin_time = microtime();
- // connection made, so begin import
-
- // create custom fields for in-bulletin users (and show them on general tab)
- $user_fields = new clsCustomFieldList(DT_USER);
- $user_fields_created = $user_fields->GetFieldNames();
- $uf_defs = Array( 'user_msn' => 'user_msnm', 'user_icq' => 'user_icq', 'user_aim' => 'user_aim',
- 'user_yahoo' => 'user_yim', 'user_website' => 'user_website',
- 'user_occupation' => 'user_occ', 'user_interests' => 'user_interests');
-
- $pesistant_vars = Array('my_signature' => 'user_sig', 'bb_posts' => 'user_posts',
- 'smileys' => 'user_allowsmile', 'bbcode' => 'user_allowbbcode',
- 'bb_signatures' => 'user_attachsig');
-
- foreach($uf_defs as $pending_uf => $no_in_use)
- if( !in_array($pending_uf, $user_fields_created) ) // don't create one customfield twice :)
- $user_fields->AddField(DT_USER, $pending_uf, '', 1, 'la_bb', 'la_'.$pending_uf, 'text', '');
-
- // get users
- $cache['users'] = Array();
- $sql = 'SELECT * FROM '.$bb_prefix.'users ORDER BY user_id';
- $rs = $db->Execute($sql);
- InitCounter('users', $rs->RecordCount() );
-
- // Create Anonymous User
- $user =& $objUsers->Add_User('Guest', '', 'anonymous@user.com', time(), '', '', 1, '', '', '', '', '', '');
- $cache['users'][ -1 ] = $user->UniqueId();
- $cache['users'][ 0 ] = $user->UniqueId();
- unset($user);
-
- while(!$rs->EOF)
- {
- $rec =& $rs->fields;
- $address = explode(',', $rec['user_from']); // state, country
- foreach($address as $id => $addr_part) $address[$id] = trim($addr_part);
- $user_state = isset( $address[0] ) ? $address[0] : '';
- $user_country = isset( $address[1] ) ? $address[1] : '';
-
- $user =& $objUsers->Add_User($rec['username'], $rec['user_password'], $rec['user_email'], $rec['user_regdate'],
- '', '', $rec['user_active'], '', '', '', $user_state, '', $user_country);
-
- $user_id = $user->UniqueId();
-
- // set user pesistant variables (why not custom fields)
- foreach($pesistant_vars as $dst_field => $src_field)
- SetPersistantVariable($user_id, $dst_field, $rec[$src_field]);
-
- // set user custom fields
- foreach($uf_defs as $dst_field => $src_field)
- $user->SetCustomField($dst_field, $rec[$src_field]);
- $user->SaveCustomFields();
-
- // add user to user_group specified (in import step 3)
- $user_group->AddUser($user_id, 1);
-
- // add created user to cache
- $cache['users'][ $rec['user_id'] ] = Array('new_id' => $user_id, 'username' => $rec['username']);
- $processed['users']++;
- unset($user);
- SetStepPercent('users');
- $rs->MoveNext();
- }
- //unset($objUsers);
-
- // get ban rules
- $sql = 'SELECT * FROM '.$bb_prefix.'banlist ORDER BY ban_id';
- $rs = $db->Execute($sql);
- $banrule_priority = 1;
- InitCounter('user_banlist', $rs->RecordCount() );
- while(!$rs->EOF)
- {
- $rec =& $rs->fields;
- if( $rec['ban_userid'] )
- {
- $tmp =& $objBanList->AddRule(DT_USER, 0, 'Login',1, $cache['users'][ $rec['ban_userid'] ]['username'], $banrule_priority, 1);
- unset($tmp);
- $banrule_priority++;
- }
-
- if( $rec['ban_ip'] )
- {
- $tmp =& $objBanList->AddRule(DT_USER, 0, 'ip',1, DecodeIP( $rec['ban_ip'] ), $banrule_priority, 1);
- unset($tmp);
- $banrule_priority++;
- }
-
- if( $rec['ban_email'] )
- {
- $tmp =& $objBanList->AddRule(DT_USER, 0, 'Email',1, $rec['ban_email'], $banrule_priority, 1);
- unset($tmp);
- $banrule_priority++;
- }
- $processed['user_banlist']++;
- SetStepPercent('user_banlist');
- $rs->MoveNext();
- }
- unset($objBanList);
-
- // get categories
- $cache['cats'] = Array();
- $sql = 'SELECT * FROM '.$bb_prefix.'categories ORDER BY cat_order';
- $rs = $db->Execute($sql);
- InitCounter('cats', $rs->RecordCount() );
- while(!$rs->EOF)
- {
- $rec =& $rs->fields;
- $category =& $objCatList->Add( $import_category_id, $rec['cat_title'], $rec['cat_title'], time(),
- 0, 1, 2, 2, 2, $rec['cat_order'] / 10, '', '');
- $cache['cats'][ $rec['cat_id'] ] = Array( 'new_id' => $category->UniqueId() );
- $processed['cats']++;
- SetStepPercent('cats');
- unset($category);
- $rs->MoveNext();
- }
-
- // get forums
- $cache['forums'] = Array();
- $sql = 'SELECT * FROM '.$bb_prefix.'forums ORDER BY cat_id';
- $rs = $db->Execute($sql);
- InitCounter('forums', $rs->RecordCount() );
- while(!$rs->EOF)
- {
- $rec =& $rs->fields;
- $category =& $objCatList->Add( $cache['cats'][ $rec['cat_id'] ]['new_id'], $rec['forum_name'],
- $rec['forum_desc'], time(), 0, 1, 2, 2, 2, $rec['forum_order'], '', '');
- $cache['forums'][ $rec['forum_id'] ] = Array( 'new_id' => $category->UniqueId() );
- $processed['forums']++;
- SetStepPercent('forums');
- unset($category);
- $rs->MoveNext();
- }
- //unset($objCatList);
-
- // get topics
- $cache['topics'] = Array();
- $sql = 'SELECT * FROM '.$bb_prefix.'topics ORDER BY forum_id';
- $rs = $db->Execute($sql);
- InitCounter('topics', $rs->RecordCount() );
- while(!$rs->EOF)
- {
- $rec =& $rs->fields;
- $rec['topic_replies'] = $rec['topic_replies'] > 0 ? $rec['topic_replies'] : 0;
- $topic =& $objTopicList->Add_Topic( $rec['topic_title'], $cache['forums'][ $rec['forum_id'] ]['new_id'],
- 1, 0, 0, $rec['topic_time'], GetUserID( $rec['topic_poster'] ),
- Array('Posts' => $rec['topic_replies'], 'Views' => $rec['topic_views']) );
-
- $cache['topics'][ $rec['topic_id'] ] = Array( 'new_id' => $topic->UniqueId() );
- $processed['topics']++;
- SetStepPercent('topics');
- unset($topic);
- $rs->MoveNext();
- }
- unset($objTopicList);
-
- // get posts
- $cache['posts'] = Array();
- $sql = 'SELECT * FROM '.$bb_prefix.'posts p LEFT JOIN '.$bb_prefix.'posts_text pt ON pt.post_id = p.post_id ORDER BY topic_id';
- $rs = $db->Execute($sql);
- InitCounter('posts', $rs->RecordCount() + $total['topics'] ); // update each topic info too
- while(!$rs->EOF)
- {
- $rec =& $rs->fields;
- $post =& new clsPosting();
- $post->Set( Array('IPAddress', 'PosterAlias', 'Subject', 'PostingText', 'CreatedOn', 'CreatedById', 'TopicId' ),
- Array(
- DecodeIP( $rec['poster_ip'] ),
- GetUserName( $rec['poster_id'] ),
- $rec['post_subject'],
- $rec['post_text'],
- $rec['post_time'],
- GetUserID( $rec['poster_id'] ),
- $cache['topics'][ $rec['topic_id'] ]['new_id'] )
- );
- $post->Create();
- $cache['posts'][ $rec['post_id'] ] = Array( 'new_id' => $post->UniqueId() );
- $processed['posts']++;
- SetStepPercent('posts');
- unset($post);
- $rs->MoveNext();
- }
-
- // set lastpostid for each topic
- $sql = 'SELECT topic_id, MAX(post_time) AS pt, post_id FROM '.$bb_prefix.' posts GROUP BY topic_id ORDER BY post_time DESC';
- $rs = $db->Execute($sql);
- $update_sql = 'UPDATE '.GetTablePrefix().'Topic SET LastPostId = %s, LastPostDate = %s';
- while(!$rs->EOF)
- {
- $rec =& $rs->fields;
- $tmp = sprintf($update_sql, $cache['posts'][ $rec['post_id'] ]['new_id'], $rec['pt']);
- $db->Execute($tmp);
- $processed['posts']++;
- SetStepPercent('posts');
- $rs->MoveNext();
- }
-
-
-// functions used
-
-function SetPersistantVariable($user_id, $var_name, $var_value)
-{
- global $dst_db;
- $sql_template = "REPLACE INTO ".GetTablePrefix()."PersistantSessionData (PortalUserId, VariableName, VariableValue) VALUES (%s,'%s','%s')";
- $dst_db->Execute( sprintf($sql_template, $user_id, $var_name, $var_value) );
-}
-
-function SetStepPercent($step_id, $new_percent = false)
-{
- if($new_percent === false)
- {
- global $total, $processed, $progress_display;
- $new_percent = ($processed[$step_id] / $total[$step_id]) * 100;
- $new_percent = round($new_percent, 1);
- if( $processed[$step_id] % $progress_display[$step_id] != 0 ) return false;
- }
- $time_runs = microtime() - $GLOBALS['begin_time'];
- echo '<script language="javascript">SetPercent(\''.$step_id.'\', '.$new_percent.',\''.($processed[$step_id].'_of_'.$total[$step_id]).'\',\''.$time_runs.'\');</script>';
- flush();
-}
-
-function DecodeIP($ip)
-{
- $i = 0;
- $ip_len = strlen($ip);
- $ip_parts = Array();
- while($i < $ip_len)
- {
- $ip_parts[] = hexdec( substr($ip, $i, 2) );
- $i += 2;
- }
- return implode('.', $ip_parts);
-}
-
-function GetUserID($old_user_id)
-{
- global $cache;
- return $cache['users'][ $old_user_id ]['new_id'];
-}
-
-function GetUserName($old_user_id)
-{
- global $cache;
- return $cache['users'][ $old_user_id ]['username'];
-}
-
-function InitCounter($step_id, $total_count)
-{
- global $processed, $total, $progress_display;
- $processed[$step_id] = 0;
- $total[$step_id] = $total_count;
- $progress_display[$step_id] = ceil($total[$step_id] / 10); // display progress in 1 of 10 times requested
-
-
-}
-
-?>
\ No newline at end of file
Property changes on: trunk/admin/import/phpbb_import.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/import/inlinkimport.php
===================================================================
--- trunk/admin/import/inlinkimport.php (revision 324)
+++ trunk/admin/import/inlinkimport.php (nonexistent)
@@ -1,218 +0,0 @@
-<?php
-if(!strlen($pathtoroot))
-{
- $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
- if(strlen($path))
- {
- /* determine the OS type for path parsing */
- $pos = strpos($path,":");
- if ($pos === false)
- {
- $gOS_TYPE="unix";
- $pathchar = "/";
- }
- else
- {
- $gOS_TYPE="win";
- $pathchar="\\";
- }
- $p = $path.$pathchar;
- /*Start looking for the root flag file */
- while(!strlen($pathtoroot) && strlen($p))
- {
- $sub = substr($p,strlen($pathchar)*-1);
- if($sub==$pathchar)
- {
- $filename = $p."root.flg";
- }
- else
- $filename = $p.$pathchar."root.flg";
- if(file_exists($filename))
- {
- $pathtoroot = $p;
- }
- else
- {
- $parent = realpath($p.$pathchar."..".$pathchar);
- if($parent!=$p)
- {
- $p = $parent;
- }
- else
- $p = "";
- }
- }
- if(!strlen($pathtoroot))
- $pathtoroot = ".".$pathchar;
- }
- else
- {
- $pathtoroot = ".".$pathchar;
- }
-}
-
-$sub = substr($pathtoroot,strlen($pathchar)*-1);
-if($sub!=$pathchar)
-{
- $pathtoroot = $pathtoroot.$pathchar;
-}
-require_once($pathtoroot."kernel/startup.php");
-$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
-
-$admin = $objConfig->Get("AdminDirectory");
-if(!strlen($admin))
- $admin = "admin";
-
-$localURL=$rootURL."kernel/";
-$adminURL = $rootURL.$admin;
-$imagesURL = $adminURL."/images";
-//admin only util
-$pathtolocal = $pathtoroot."kernel/";
-require_once ($pathtoroot.$admin."/include/elements.php");
-require_once ($pathtolocal."admin/include/navmenu.php");
-require_once($pathtoroot.$admin."/toolbar.php");
-//Set Section
-$section = "in-portal:inlink_inport";
-//Set Environment Variable
-$envar = "env=" . BuildEnv();
-
-//Making default settings
-if ($_POST["inlink_sql_type"]!="")
-{
- echo "SQL TYPE IS: ".$_POST["inlink_sql_type"];
-}
-if ($objSession->GetVariable("inlink_sql_type")=="")
-{
- $objSession->SetVariable("inlink_sql_type","mysql");
-}
-if ($objSession->GetVariable("inlink_server")=="")
-{
- $objSession->SetVariable("inlink_server","localhost");
-}
-if ($objSession->GetVariable("inlink_db")=="")
-{
- $objSession->SetVariable("inlink_db","in-link");
-}
-
-if ($objSession->GetVariable("user_admin_values")=="")
-{
- $objSession->SetVariable("user_admin_names","Admin");
- $objSession->SetVariable("user_admin_values","11");
-}
-if ($objSession->GetVariable("user_regular_values")=="")
-{
- $objSession->SetVariable("user_regular_names","Root");
- $objSession->SetVariable("user_regular_values","2");
-}
-if ($objSession->GetVariable("categoryid")=="")
-{
- $objSession->SetVariable("catnavbar","Top");
- $objSession->SetVariable("categoryid","0");
-}
-if ($objSession->GetVariable("user_input1")=="")
-{
- $objSession->SetVariable("user_input1","2");
-}
-if($objSession->GetVariable("user_input2")=="")
-{
- $objSession->SetVariable("user_input2","1");
-}
-$formaction = $adminURL."/import/import.php?".$envar;
-
-$title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 5";
-
-int_header(NULL, NULL, $title);
-?>
-
-<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
- <form name="inlinkimport" METHOD="POST" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>">
- <?php int_subsection_title($h); ?>
-
- <TR <?php echo int_table_color(); ?>>
- <td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo admin_language("la_prompt_AdminId"); ?> ( <b><?php echo $objSession->GetVariable("user_admin_names"); ?></b> )</span></td>
- <TD>
-
- <INPUT TYPE="text" NAME="user_admin" size="15" class="text" value='<?php echo $objSession->GetVariable("user_admin_values"); ?>'>
- <INPUT TYPE="button" name="adminselector" value="Admin User" class="button" onclick="OpenGroupSelector('<?php echo $envar; ?>&en=0&destform=inlinkimport&destfield=grouplist1');">
- <INPUT TYPE="hidden" NAME="grouplist1">
-
- </TD>
- </TR>
- <TR <?php echo int_table_color(); ?>>
- <td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo admin_language("la_prompt_RegUserId"); ?> ( <b><?php echo $objSession->GetVariable("user_regular_names"); ?></b> )</span></td>
- <TD>
- <INPUT TYPE="text" NAME="user_regular" size="15" class="text" value='<?php echo $objSession->GetVariable("user_regular_values"); ?>'>
- <INPUT TYPE="button" name="regularselector" value="Regular User" class="button" onclick="OpenGroupSelector('<?php echo $envar; ?>&en=0&destform=inlinkimport&destfield=grouplist2');">
- <INPUT TYPE="hidden" NAME="grouplist2">
- </TD>
- </TR>
- <TR <?php echo int_table_color(); ?>>
- <td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo admin_language("la_prompt_InitImportCat"); ?> ( <b><?php echo $objSession->GetVariable("catnavbar"); ?></b> )</span></td>
- <TD >
- <INPUT TYPE="text" NAME="init_cat" size="15" class="text" value='<?php echo $objSession->GetVariable("categoryid"); ?>'>
- <INPUT TYPE="button" name="catselector" value="Category" class="button" onclick="OpenCatSelector('<?php echo $envar; ?>&source=inlinkimport&destform=inlinkimport&destfield=categorylist&Selector=radio');">
- <INPUT TYPE="hidden" NAME="categorylist">
-
- </TD>
- </TR>
- <TR <?php echo int_table_color(); ?>>
- <td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo admin_language("la_prompt_RegUsers"); ?></span></td>
- <TD >
- <INPUT type="text" name="user_input1" class="text" size="30" value='<?php echo $objSession->GetVariable("user_input1"); ?>'>
- </TD>
- </TR>
- <TR <?php echo int_table_color(); ?>>
- <td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo admin_language("la_prompt_NotRegUsers"); ?></span></td>
- <TD >
- <INPUT type="text" name="user_input2" class="text" size="30" value='<?php echo $objSession->GetVariable("user_input2"); ?>'>
- </TD>
- </TR>
- <TR <?php echo int_table_color(); ?>>
- <td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo admin_language("la_prompt_InlinkSqlType"); ?></span></td>
- </TD>
-
- <TD>
- <INPUT type="text" name="inlink_sql_type" class="text" size="30" value='<?php echo $objSession->GetVariable("inlink_sql_type"); ?>'>
- </TD>
- </TR>
- <TR <?php echo int_table_color(); ?>>
- <td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo admin_language("la_prompt_InlinkServer"); ?></span></td>
- </TD>
-
- <TD>
- <INPUT type="text" name="inlink_server" class="text" size="30" value='<?php echo $objSession->GetVariable("inlink_server"); ?>'>
- </TD>
- </TR>
- <TR <?php echo int_table_color(); ?>>
- <td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo admin_language("la_prompt_InlinkDbName"); ?></span></td>
- </TD>
-
- <TD>
- <INPUT type="text" name="inlink_db" class="text" size="30" value='<?php echo $objSession->GetVariable("inlink_db"); ?>'>
- </TD>
- </TR>
- <TR <?php echo int_table_color(); ?>>
- <td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo admin_language("la_prompt_InlinkDbUsername"); ?></span></td>
- <TD>
- <INPUT type="text" name="inlink_user" class="text" size="30" value='<?php echo $objSession->GetVariable("inlink_user"); ?>'>
- </TD>
-
- </TR>
- <TR <?php echo int_table_color(); ?>>
- <td width=\"60%\" valign=\"top\"><span class=\"text\"><?php echo admin_language("la_prompt_InlinkDbPass"); ?></span></td>
- <TD >
- <INPUT type="password" name="inlink_pass" class="text" size="30" value='<?php echo $objSession->GetVariable("inlink_pass"); ?>'>
- </TD>
- </TR>
- <input TYPE="hidden" NAME="Action" VALUE="l_import_config">
-
-<tr <?php int_table_color(); ?>>
- <td colspan="4">
-
- <input type="button" name="submit1" value="Import" class="button" ONCLICK="import_submit('inlinkimport','<?php echo $formaction; ?>');">
- </td>
- </tr>
-</FORM></TABLE>
-<?php
-int_footer();
-?>
\ No newline at end of file
Property changes on: trunk/admin/import/inlinkimport.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/admin/install/upgrades/inportal_upgrade_v1.0.7.sql
===================================================================
--- trunk/admin/install/upgrades/inportal_upgrade_v1.0.7.sql (revision 324)
+++ trunk/admin/install/upgrades/inportal_upgrade_v1.0.7.sql (revision 325)
@@ -1,25 +1,26 @@
CREATE TABLE EmailLog (
EmailLogId int(11) NOT NULL auto_increment,
fromuser varchar(200) default NULL,
addressto varchar(255) default NULL,
subject varchar(255) default NULL,
timestamp bigint(20) default '0',
event varchar(100) default NULL,
PRIMARY KEY (EmailLogId)
)
CREATE TABLE ImportScripts (
is_id smallint(5) unsigned NOT NULL auto_increment,
+ is_Module varchar(50) NOT NULL default '',
is_string_id varchar(10) NOT NULL default '',
is_script varchar(100) NOT NULL default '',
is_label varchar(255) NOT NULL default '',
is_field_prefix varchar(50) NOT NULL default '',
is_requred_fields varchar(255) NOT NULL default '',
is_enabled tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (is_id)
)
INSERT INTO ConfigurationValues VALUES ('EmailsL_SortField', 'timestamp', 'In-Portal', '');
INSERT INTO ConfigurationValues VALUES ('Perpage_EmailsL', '20', 'In-Portal', '');
UPDATE Modules SET Version = '1.0.7' WHERE Name = 'In-Portal';
\ No newline at end of file
Property changes on: trunk/admin/install/upgrades/inportal_upgrade_v1.0.7.sql
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/admin/install/sel_license.php
===================================================================
--- trunk/admin/install/sel_license.php (revision 324)
+++ trunk/admin/install/sel_license.php (revision 325)
@@ -1,50 +1,52 @@
<td>
<img src="images/icon_install.gif" width="46" height="46" alt="" align="absmiddle">&nbsp;<span class="admintitle">Select License</span><br><br>
<?php section_header('Step '.$tmp_step.' - Select License'); ?>
<table border=0 cellpadding=0 cellspacing=0 width="100%" class="toolbar">
<?php include("install/toolbar.php"); ?>
</table>
<!-- toolbar button \\-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr valign="top">
<td width="60%" bgcolor="#F0F0F0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr class="table_color2">
<td ALIGN="left" WIDTH="100%" class="txt"><INPUT TYPE="RADIO" NAME="lic_opt" id="lic_opt_1" VALUE="1"><label for="lic_opt_1">Download from Intechnic</label></td>
</tr>
<tr class="table_color2">
<td ALIGN="left" WIDTH="100%" class="txt"><INPUT TYPE=RADIO value="2" id="lic_opt_2" name="lic_opt"><label for="lic_opt_2">Upload License File:</label>
<INPUT TYPE="FILE" CLASS="button" NAME="licfile" onclick="document.getElementById('lic_opt_2').checked = true;">
</td>
</tr>
<tr class="table_color2">
<?php
$enabled = '';
if(!isset($g_License) || !$g_License )
{
- $enabled="disabled='true'";
+ $enabled="disabled='true'";
}
+ else
+
?>
- <td ALIGN="left" WIDTH="100%" class="txt" <?php echo $enabled; ?>><INPUT TYPE=RADIO value="3" id="lic_opt_3" name="lic_opt"><label for="lic_opt_3">Use Existing License</label></td>
+ <td ALIGN="left" WIDTH="100%" class="txt" <?php echo $enabled; ?>><INPUT TYPE=RADIO value="3" id="lic_opt_3" name="lic_opt" <?php if(!$enabled) echo 'checked'; ?>><label for="lic_opt_3">Use Existing License</label></td>
</tr>
<tr class="table_color2">
<td ALIGN="left" WIDTH="100%" class="txt"><INPUT TYPE=RADIO value="4" id="lic_opt_4" name="lic_opt"><label for="lic_opt_4">Skip License (Local Domain Installation)</label></td>
</tr>
<tr class="table_color2">
<td colspan="2"><p class="error"><?php if( isset($license_error) ) echo $license_error; ?></p><br/></td>
</tr>
<td>
<br>
<input TYPE="hidden" NAME ="state" VALUE="license_process">
<input type="submit" name="submit_form" value="Continue" class="button">
<input type="reset" name="Cancel" value="Cancel" class="button" ONCLICK = "history.go(-1);">
<input type="hidden" name="UserPass" VALUE="<?php echo $UserPass; ?>">
<input type="hidden" name="UserName" VALUE="<?php echo $UserName; ?>">
<input type="hidden" name="next_step" value="<?php echo $next_step;?>">
<input type="hidden" name="install_type" value="<?php echo $install_type;?>">
</td>
</tr>
</table>
</td>
\ No newline at end of file
Property changes on: trunk/admin/install/sel_license.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Index: trunk/admin/install/inportal_remove.sql
===================================================================
--- trunk/admin/install/inportal_remove.sql (revision 324)
+++ trunk/admin/install/inportal_remove.sql (revision 325)
@@ -1,99 +1,104 @@
DROP TABLE BanRules
# --------------------------------------------------------
DROP TABLE Category
# --------------------------------------------------------
DROP TABLE CategoryItems
# --------------------------------------------------------
DROP TABLE Censorship
# --------------------------------------------------------
DROP TABLE ConfigurationAdmin
# --------------------------------------------------------
DROP TABLE ConfigurationValues
# --------------------------------------------------------
DROP TABLE CountCache
# --------------------------------------------------------
DROP TABLE CustomField
# --------------------------------------------------------
DROP TABLE CustomMetaData
# --------------------------------------------------------
DROP TABLE EmailMessage
# --------------------------------------------------------
DROP TABLE EmailQueue
# --------------------------------------------------------
DROP TABLE EmailSubscribers
# --------------------------------------------------------
DROP TABLE Emoticon
# --------------------------------------------------------
DROP TABLE Events
# --------------------------------------------------------
DROP TABLE Favorites
# --------------------------------------------------------
DROP TABLE IdGenerator
# --------------------------------------------------------
DROP TABLE IgnoreKeywords
# --------------------------------------------------------
DROP TABLE Images
# --------------------------------------------------------
DROP TABLE ItemRating
# --------------------------------------------------------
DROP TABLE ItemReview
# --------------------------------------------------------
DROP TABLE ItemTypes
# --------------------------------------------------------
DROP TABLE Language
# --------------------------------------------------------
DROP TABLE Link
# --------------------------------------------------------
DROP TABLE Modules
# --------------------------------------------------------
DROP TABLE News
# --------------------------------------------------------
DROP TABLE PermCache
# --------------------------------------------------------
DROP TABLE PermissionConfig
# --------------------------------------------------------
DROP TABLE Permissions
# --------------------------------------------------------
DROP TABLE PersistantSessionData
# --------------------------------------------------------
DROP TABLE Phrase
# --------------------------------------------------------
DROP TABLE PhraseCache
# --------------------------------------------------------
DROP TABLE PortalGroup
# --------------------------------------------------------
DROP TABLE PortalUser
# --------------------------------------------------------
DROP TABLE Posting
# --------------------------------------------------------
DROP TABLE Relationship
# --------------------------------------------------------
DROP TABLE SearchConfig
# --------------------------------------------------------
DROP TABLE SearchLog
# --------------------------------------------------------
DROP TABLE SessionData
# --------------------------------------------------------
DROP TABLE SpamControl
# --------------------------------------------------------
DROP TABLE StatItem
# --------------------------------------------------------
DROP TABLE Theme
# --------------------------------------------------------
DROP TABLE ThemeFiles
# --------------------------------------------------------
DROP TABLE Topic
# --------------------------------------------------------
DROP TABLE UserGroup
# --------------------------------------------------------
DROP TABLE UserSession
# --------------------------------------------------------
DROP TABLE SuggestMail
# --------------------------------------------------------
DROP TABLE SysCache
# --------------------------------------------------------
DROP TABLE TagLibrary
# --------------------------------------------------------
DROP TABLE TagAttributes
# --------------------------------------------------------
-DROP TABLE LinkValidation
\ No newline at end of file
+DROP TABLE LinkValidation
+# --------------------------------------------------------
+DROP TABLE ImportScripts
+# --------------------------------------------------------
+DROP TABLE EmailLog
+#
\ No newline at end of file
Property changes on: trunk/admin/install/inportal_remove.sql
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/admin/install/inportal_schema.sql
===================================================================
--- trunk/admin/install/inportal_schema.sql (revision 324)
+++ trunk/admin/install/inportal_schema.sql (revision 325)
@@ -1,521 +1,522 @@
CREATE TABLE BanRules (
RuleId int(11) NOT NULL auto_increment,
RuleType tinyint(4) NOT NULL default '0',
ItemField varchar(255) default NULL,
ItemVerb tinyint(4) NOT NULL default '0',
ItemValue varchar(255) NOT NULL default '',
ItemType int(11) NOT NULL default '0',
Priority int(11) NOT NULL default '0',
Status tinyint(4) NOT NULL default '1',
ErrorTag varchar(255) default NULL,
PRIMARY KEY (RuleId)
)
# --------------------------------------------------------
CREATE TABLE Category (
CategoryId int(11) NOT NULL auto_increment,
Type int(11) NOT NULL default '0',
ParentId int(11) NOT NULL default '0',
Name varchar(255) NOT NULL default '',
Description text NOT NULL,
CreatedOn double NOT NULL default '0',
EditorsPick tinyint(4) default NULL,
Status tinyint(4) NOT NULL default '0',
Pop tinyint(4) default NULL,
Priority int(11) default NULL,
MetaKeywords varchar(255) default NULL,
CachedDescendantCatsQty int(11) default NULL,
CachedNavbar text NOT NULL,
CreatedById int(11) NOT NULL default '0',
ResourceId int(11) default NULL,
ParentPath text NOT NULL,
MetaDescription varchar(255) default NULL,
HotItem int(11) NOT NULL default '2',
NewItem int(11) NOT NULL default '2',
PopItem int(11) NOT NULL default '2',
Modified double NOT NULL default '0',
ModifiedById int(11) NOT NULL default '0',
PRIMARY KEY (CategoryId),
KEY ParentId (ParentId),
KEY ResourceId (ResourceId),
KEY Modified (Modified),
KEY Priority (Priority),
KEY sorting (Name,Priority)
)
# --------------------------------------------------------
CREATE TABLE CategoryItems (
CategoryId int(11) NOT NULL default '0',
ItemResourceId int(11) NOT NULL default '0',
PrimaryCat tinyint(4) NOT NULL default '0',
PRIMARY KEY (CategoryId,ItemResourceId),
KEY ItemResourceId (ItemResourceId),
KEY PrimaryCat (PrimaryCat)
)
# --------------------------------------------------------
CREATE TABLE ConfigurationAdmin (
VariableName varchar(80) NOT NULL default '',
heading varchar(255) default NULL,
prompt varchar(255) default NULL,
element_type varchar(20) NOT NULL default '',
validation varchar(255) default NULL,
ValueList varchar(255) default NULL,
DisplayOrder int(11) NOT NULL default '0',
Install int(11) NOT NULL default '1',
PRIMARY KEY (VariableName)
)
# --------------------------------------------------------
CREATE TABLE ConfigurationValues (
VariableName varchar(255) NOT NULL default '',
VariableValue varchar(255) default NULL,
ModuleOwner varchar(20) default 'In-Portal',
Section varchar(255) NOT NULL default '',
PRIMARY KEY (VariableName)
)
# --------------------------------------------------------
CREATE TABLE CountCache (
ListType int(11) NOT NULL default '0',
ItemType int(11) NOT NULL default '-1',
Value int(11) NOT NULL default '0',
CountCacheId int(11) NOT NULL auto_increment,
LastUpdate int(11) NOT NULL default '0',
ExtraId varchar(50) default NULL,
TodayOnly tinyint(4) NOT NULL default '0',
PRIMARY KEY (CountCacheId)
)
# --------------------------------------------------------
CREATE TABLE CustomField (
CustomFieldId int(11) NOT NULL auto_increment,
Type int(11) NOT NULL default '0',
FieldName varchar(255) NOT NULL default '',
FieldLabel varchar(40) default NULL,
Heading varchar(60) default NULL,
Prompt varchar(60) default NULL,
ElementType varchar(50) NOT NULL default '',
ValueList varchar(255) default NULL,
DisplayOrder int(11) NOT NULL default '0',
OnGeneralTab tinyint(4) NOT NULL default '0',
PRIMARY KEY (CustomFieldId),
KEY Type (Type)
)
# --------------------------------------------------------
CREATE TABLE CustomMetaData (
CustomDataId int(11) NOT NULL auto_increment,
ResourceId int(11) NOT NULL default '0',
CustomFieldId int(11) NOT NULL default '0',
Value text NOT NULL,
PRIMARY KEY (CustomDataId)
)
# --------------------------------------------------------
CREATE TABLE EmailMessage (
EmailMessageId int(10) NOT NULL auto_increment,
Template longtext,
MessageType enum('html','text') NOT NULL default 'text',
LanguageId int(11) NOT NULL default '0',
EventId int(11) NOT NULL default '0',
PRIMARY KEY (EmailMessageId)
)
# --------------------------------------------------------
CREATE TABLE EmailQueue (
Subject text NOT NULL,
toaddr text NOT NULL,
fromaddr text NOT NULL,
message blob,
headers blob,
queued timestamp NOT NULL
)
# --------------------------------------------------------
CREATE TABLE EmailSubscribers (
EmailMessageId int(11) NOT NULL default '0',
PortalUserId int(11) NOT NULL default '0'
)
# --------------------------------------------------------
CREATE TABLE Events (
EventId int(11) NOT NULL auto_increment,
Event varchar(40) NOT NULL default '',
Enabled int(11) NOT NULL default '1',
FromUserId int(11) NOT NULL default '0',
Module varchar(40) NOT NULL default '',
Description varchar(255) NOT NULL default '',
Type int(11) NOT NULL default '0',
PRIMARY KEY (EventId)
)
# --------------------------------------------------------
CREATE TABLE Favorites (
FavoriteId int(11) NOT NULL auto_increment,
PortalUserId int(11) NOT NULL default '0',
ResourceId int(11) NOT NULL default '0',
ItemTypeId int(11) NOT NULL default '0',
Modified int(11) NOT NULL default '0',
PRIMARY KEY (FavoriteId),
UNIQUE KEY main (PortalUserId,ResourceId)
)
# --------------------------------------------------------
CREATE TABLE IdGenerator (
lastid int(11) default NULL
)
# --------------------------------------------------------
CREATE TABLE Images (
ImageId int(11) NOT NULL auto_increment,
ResourceId int(11) NOT NULL default '0',
Url varchar(255) NOT NULL default '',
Name varchar(255) NOT NULL default '',
AltName varchar(255) default NULL,
ImageIndex int(11) NOT NULL default '0',
LocalImage tinyint(4) NOT NULL default '1',
LocalPath varchar(240) NOT NULL default '',
Enabled int(11) NOT NULL default '1',
DefaultImg int(11) NOT NULL default '0',
ThumbUrl varchar(255) default NULL,
Priority int(11) NOT NULL default '0',
ThumbPath varchar(255) default NULL,
LocalThumb tinyint(4) NOT NULL default '0',
SameImages tinyint(4) NOT NULL default '0',
PRIMARY KEY (ImageId),
KEY ResourceId (ResourceId)
)
# --------------------------------------------------------
CREATE TABLE ItemRating (
RatingId int(11) NOT NULL auto_increment,
IPAddress varchar(255) NOT NULL default '',
CreatedOn double NOT NULL default '0',
RatingValue int(11) NOT NULL default '0',
ItemId int(11) NOT NULL default '0',
PRIMARY KEY (RatingId)
)
# --------------------------------------------------------
CREATE TABLE ItemReview (
ReviewId int(11) NOT NULL auto_increment,
CreatedOn double NOT NULL default '0',
ReviewText longtext NOT NULL,
IPAddress varchar(255) NOT NULL default '',
ItemId int(11) NOT NULL default '0',
CreatedById int(11) NOT NULL default '0',
ItemType tinyint(4) NOT NULL default '0',
Priority int(11) NOT NULL default '0',
Status tinyint(4) NOT NULL default '0',
TextFormat int(11) NOT NULL default '0',
Module varchar(255) NOT NULL default '',
PRIMARY KEY (ReviewId)
)
# --------------------------------------------------------
CREATE TABLE ItemTypes (
ItemType int(11) NOT NULL default '0',
Module varchar(50) NOT NULL default '',
SourceTable varchar(100) NOT NULL default '',
TitleField varchar(50) default NULL,
CreatorField varchar(255) NOT NULL default '',
PopField varchar(255) default NULL,
RateField varchar(255) default NULL,
LangVar varchar(255) NOT NULL default '',
PrimaryItem int(11) NOT NULL default '0',
EditUrl varchar(255) NOT NULL default '',
ClassName varchar(40) NOT NULL default '',
ItemName varchar(50) NOT NULL default '',
PRIMARY KEY (ItemType),
KEY Module (Module)
)
# --------------------------------------------------------
CREATE TABLE Language (
LanguageId int(11) NOT NULL auto_increment,
PackName varchar(40) NOT NULL default '',
LocalName varchar(40) NOT NULL default '',
Enabled int(11) NOT NULL default '0',
PrimaryLang int(11) NOT NULL default '0',
IconURL varchar(255) default NULL,
DateFormat varchar(50) NOT NULL default '',
TimeFormat varchar(50) NOT NULL default '',
DecimalPoint char(2) NOT NULL default '.',
ThousandSep char(1) NOT NULL default ',',
PRIMARY KEY (LanguageId)
)
# --------------------------------------------------------
CREATE TABLE Modules (
Name varchar(255) NOT NULL default '',
Path varchar(255) NOT NULL default '',
Var varchar(10) NOT NULL default '',
Version varchar(10) NOT NULL default '',
Loaded tinyint(4) NOT NULL default '1',
LoadOrder tinyint(4) NOT NULL default '0',
TemplatePath varchar(255) NOT NULL default '',
RootCat int(11) NOT NULL default '0',
BuildDate double NOT NULL default '0',
PRIMARY KEY (Name)
)
# --------------------------------------------------------
CREATE TABLE PermCache (
PermCacheId int(11) NOT NULL auto_increment,
CategoryId int(11) NOT NULL default '0',
PermId int(11) NOT NULL default '0',
ACL varchar(255) NOT NULL default '',
DACL varchar(255) NOT NULL default '',
PRIMARY KEY (PermCacheId),
KEY CategoryId (CategoryId),
KEY PermId (PermId)
)
# --------------------------------------------------------
CREATE TABLE PermissionConfig (
PermissionConfigId int(11) NOT NULL auto_increment,
PermissionName varchar(30) NOT NULL default '',
Description varchar(255) NOT NULL default '',
ErrorMessage varchar(255) NOT NULL default '',
ModuleId varchar(20) NOT NULL default '0',
PRIMARY KEY (PermissionConfigId),
KEY PermissionName (PermissionName)
)
# --------------------------------------------------------
CREATE TABLE Permissions (
PermissionId int(11) NOT NULL auto_increment,
Permission varchar(30) NOT NULL default '',
GroupId int(11) default '0',
PermissionValue int(11) NOT NULL default '0',
Type tinyint(4) NOT NULL default '0',
CatId int(11) NOT NULL default '0',
PRIMARY KEY (PermissionId)
)
# --------------------------------------------------------
CREATE TABLE PersistantSessionData (
PortalUserId int(11) NOT NULL default '0',
VariableName varchar(255) NOT NULL default '',
VariableValue text NOT NULL,
KEY UserId (PortalUserId),
KEY VariableName (VariableName)
)
# --------------------------------------------------------
CREATE TABLE Phrase (
Phrase varchar(255) NOT NULL default '',
Translation varchar(255) NOT NULL default '',
PhraseType int(11) NOT NULL default '0',
PhraseId int(11) NOT NULL auto_increment,
LanguageId int(11) NOT NULL default '0',
PRIMARY KEY (PhraseId),
INDEX Phrase_Index (Phrase)
)
# --------------------------------------------------------
CREATE TABLE PhraseCache (
Template varchar(40) NOT NULL default '',
PhraseList text NOT NULL,
CacheDate int(11) NOT NULL default '0',
ThemeId int(11) NOT NULL default '0',
PRIMARY KEY (Template)
)
# --------------------------------------------------------
CREATE TABLE PortalGroup (
GroupId int(11) NOT NULL auto_increment,
Name varchar(255) NOT NULL default '',
Description varchar(255) default NULL,
CreatedOn double NOT NULL default '0',
System tinyint(4) NOT NULL default '0',
Personal tinyint(4) NOT NULL default '0',
Enabled tinyint(4) NOT NULL default '1',
ResourceId int(11) NOT NULL default '0',
PRIMARY KEY (GroupId),
UNIQUE KEY Name (Name),
KEY ResourceId (ResourceId),
KEY Personal (Personal),
KEY Enabled (Enabled)
)
# --------------------------------------------------------
CREATE TABLE PortalUser (
PortalUserId int(11) NOT NULL auto_increment,
Login varchar(255) default NULL,
Password varchar(255) default NULL,
FirstName varchar(255) default NULL,
LastName varchar(255) default NULL,
Email varchar(255) NOT NULL default '',
CreatedOn double NOT NULL default '0',
Phone varchar(20) default NULL,
Street varchar(255) default NULL,
City varchar(20) default NULL,
State varchar(20) default NULL,
Zip varchar(20) default NULL,
Country varchar(20) NOT NULL default '',
ResourceId int(11) NOT NULL default '0',
Status tinyint(4) NOT NULL default '2',
Modified int(11) NOT NULL default '0',
dob double NOT NULL default '0',
tz int(11) default NULL,
ip varchar(20) default NULL,
IsBanned tinyint(1) NOT NULL default '0',
PRIMARY KEY (PortalUserId),
UNIQUE KEY Login (Login),
KEY ResourceId (ResourceId),
KEY CreatedOn (CreatedOn)
)
# --------------------------------------------------------
CREATE TABLE Relationship (
RelationshipId int(11) NOT NULL auto_increment,
SourceId int(11) default NULL,
TargetId int(11) default NULL,
SourceType tinyint(4) NOT NULL default '0',
TargetType tinyint(4) NOT NULL default '0',
Type int(11) NOT NULL default '0',
Enabled int(11) NOT NULL default '1',
Priority int(11) NOT NULL default '0',
PRIMARY KEY (RelationshipId),
KEY RelSource (SourceId),
KEY RelTarget (TargetId)
)
# --------------------------------------------------------
CREATE TABLE SearchConfig (
TableName varchar(40) NOT NULL default '',
FieldName varchar(40) NOT NULL default '',
SimpleSearch tinyint(4) NOT NULL default '0',
AdvancedSearch tinyint(4) NOT NULL default '0',
Description varchar(255) default NULL,
DisplayName varchar(80) default NULL,
ModuleName varchar(20) default NULL,
ConfigHeader varchar(255) default NULL,
DisplayOrder int(11) NOT NULL default '0',
SearchConfigId int(11) NOT NULL auto_increment,
Priority int(11) NOT NULL default '0',
FieldType varchar(20) NOT NULL default 'text',
ForeignField varchar(255) default NULL,
JoinClause varchar(255) default NULL,
IsWhere text,
IsNotWhere text,
ContainsWhere text,
NotContainsWhere text,
CustomFieldId int(11) NOT NULL default '0',
PRIMARY KEY (SearchConfigId)
)
# --------------------------------------------------------
CREATE TABLE SearchLog (
SearchLogId int(11) NOT NULL auto_increment,
Keyword varchar(255) NOT NULL default '',
Indices bigint(20) NOT NULL default '0',
SearchType int(11) NOT NULL default '0',
PRIMARY KEY (SearchLogId)
)
# --------------------------------------------------------
CREATE TABLE SessionData (
SessionKey varchar(50) NOT NULL default '',
VariableName varchar(255) NOT NULL default '',
VariableValue text NOT NULL,
KEY SessionKey (SessionKey),
KEY VariableName (VariableName)
)
# --------------------------------------------------------
CREATE TABLE SpamControl (
ItemResourceId int(11) NOT NULL default '0',
IPaddress varchar(20) NOT NULL default '',
Expire double NOT NULL default '0',
PortalUserId int(11) NOT NULL default '0',
DataType varchar(20) default NULL
)
# --------------------------------------------------------
CREATE TABLE StatItem (
StatItemId int(11) NOT NULL auto_increment,
Module varchar(20) NOT NULL default '',
ValueSQL varchar(255) default NULL,
ResetSQL varchar(255) default NULL,
ListLabel varchar(255) NOT NULL default '',
Priority int(11) NOT NULL default '0',
AdminSummary int(11) NOT NULL default '0',
PRIMARY KEY (StatItemId)
)
# --------------------------------------------------------
CREATE TABLE Theme (
ThemeId int(11) NOT NULL auto_increment,
Name varchar(40) NOT NULL default '',
Enabled int(11) NOT NULL default '1',
Description varchar(255) default NULL,
PrimaryTheme int(11) NOT NULL default '0',
CacheTimeout int(11) NOT NULL default '0',
PRIMARY KEY (ThemeId)
)
# --------------------------------------------------------
CREATE TABLE ThemeFiles (
FileId int(11) NOT NULL auto_increment,
ThemeId int(11) NOT NULL default '0',
FileName varchar(255) NOT NULL default '',
FilePath varchar(255) NOT NULL default '',
Description varchar(255) default NULL,
FileType int(11) NOT NULL default '0',
PRIMARY KEY (FileId)
)
# --------------------------------------------------------
CREATE TABLE UserGroup (
PortalUserId int(11) NOT NULL default '0',
GroupId int(11) NOT NULL default '0',
PrimaryGroup tinyint(4) NOT NULL default '1',
PRIMARY KEY (PortalUserId,GroupId),
KEY GroupId (GroupId),
KEY PrimaryGroup (PrimaryGroup)
)
# --------------------------------------------------------
CREATE TABLE UserSession (
SessionKey varchar(50) NOT NULL default '',
CurrentTempKey varchar(50) default NULL,
PrevTempKey varchar(50) default NULL,
LastAccessed double NOT NULL default '0',
PortalUserId varchar(255) NOT NULL default '',
Language varchar(255) NOT NULL default '',
Theme varchar(255) NOT NULL default '',
GroupId int(11) NOT NULL default '0',
IpAddress varchar(20) NOT NULL default '0.0.0.0',
Status int(11) NOT NULL default '1',
GroupList varchar(255) default NULL,
tz int(11) default NULL,
PRIMARY KEY (SessionKey),
KEY UserId (PortalUserId),
KEY LastAccessed (LastAccessed)
)
# --------------------------------------------------------
CREATE TABLE SuggestMail (
email varchar(255) NOT NULL default '',
sent double,
PRIMARY KEY (email)
)
# --------------------------------------------------------
CREATE TABLE SysCache (
SysCacheId int(11) NOT NULL auto_increment,
Name varchar(255) NOT NULL default '',
Value mediumtext,
Expire double NOT NULL default '0',
Module varchar(20) default NULL,
Context varchar(255) default NULL,
GroupList varchar(255) NOT NULL default '',
PRIMARY KEY (SysCacheId),
KEY Name (Name)
)
# --------------------------------------------------------
CREATE TABLE TagLibrary (
TagId int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL default '',
description text,
example text,
scope varchar(20) NOT NULL default 'global',
PRIMARY KEY (TagId)
)
# --------------------------------------------------------
CREATE TABLE TagAttributes (
AttrId int(11) NOT NULL auto_increment,
TagId int(11) NOT NULL default '0',
Name varchar(255) NOT NULL default '',
AttrType varchar(20) default NULL,
DefValue varchar(255) default NULL,
Description TEXT,
Required int(11) NOT NULL default '0',
PRIMARY KEY (AttrId)
)
# --------------------------------------------------------
CREATE TABLE EmailLog (
EmailLogId int(11) NOT NULL auto_increment,
fromuser varchar(200) default NULL,
addressto varchar(255) default NULL,
subject varchar(255) default NULL,
timestamp bigint(20) default '0',
event varchar(100) default NULL,
PRIMARY KEY (EmailLogId)
)
# --------------------------------------------------------
CREATE TABLE ImportScripts (
is_id smallint(5) unsigned NOT NULL auto_increment,
+ is_Module varchar(50) NOT NULL default '',
is_string_id varchar(10) NOT NULL default '',
is_script varchar(100) NOT NULL default '',
is_label varchar(255) NOT NULL default '',
is_field_prefix varchar(50) NOT NULL default '',
is_requred_fields varchar(255) NOT NULL default '',
is_enabled tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (is_id)
)
\ No newline at end of file
Property changes on: trunk/admin/install/inportal_schema.sql
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property

Event Timeline