function moveAttachment($row, $db, $from_prefix, $attachmentUploadDir) { static $smf_folders = null; if ($smf_folders === null) { $request = $db->query("\n\t\t\tSELECT value\n\t\t\tFROM {$from_prefix}settings\n\t\t\tWHERE variable='attachmentUploadDir';"); list($smf_attachments_dir) = $db->fetch_row($request); $smf_folders = @unserialize($smf_attachments_dir); if (!is_array($smf_folders)) { $smf_folders = array(1 => $smf_attachments_dir); } } $smf_attachments_dir = $smf_folders[$row['id_folder']]; if (empty($row['file_hash'])) { $row['file_hash'] = createAttachmentFileHash($row['filename']); $source_file = $row['filename']; } else { $source_file = $row['id_attach'] . '_' . $row['file_hash']; } copy_file($smf_attachments_dir . '/' . $source_file, $attachmentUploadDir . '/' . $row['id_attach'] . '_' . $row['file_hash'] . '.elk'); }
} # create default 404.xml page $init = GSDATAOTHERPATH . GSHTTPPREFIX . '404.xml'; $temp = GSADMININCPATH . 'tmp/tmp-404.xml'; if (!file_exists($init)) { if (copy_file($temp, $init)) { $message .= msgOK(sprintf(i18n_r('COPY_SUCCESS'), 'tmp/404.xml')); } else { $message .= msgError(sprintf(i18n_r('COPY_FAILURE'), 'tmp/404.xml')); } } # create default 403.xml page $init = GSDATAOTHERPATH . GSHTTPPREFIX . '403.xml'; $temp = GSADMININCPATH . 'tmp/tmp-403.xml'; if (!file_exists($init)) { if (copy_file($temp, $init)) { $message .= msgOK(sprintf(i18n_r('COPY_SUCCESS'), 'tmp/403.xml')); } else { $message .= msgError(sprintf(i18n_r('COPY_FAILURE'), 'tmp/403.xml')); } } /* create new folders */ foreach ($create_dirs as $dir) { if (!file_exists($dir)) { if (getDef('GSCHMOD')) { $chmod_value = GSCHMOD; } else { $chmod_value = 0755; } $status = create_dir($dir, $chmod_value); if ($status) {
/** * Rename a file (overwrites existing) * renames a file, moving between dirs if necessary * * @since 3.4 * * @param str $src filepath to rename * @param str $dest filepath destination * @param str $filename optional filename will be appended to src and destf * @return bool success */ function rename_file($src, $dest, $filename = null) { if (isset($filename)) { $src .= DIRECTORY_SEPARATOR . $filename; $dest .= DIRECTORY_SEPARATOR . $filename; } if (!($status = rename($src, $dest))) { // php rename fileLog(__FUNCTION__, false, 'calling copy_file & delete_file'); $status = copy_file($src, $dest) && delete_file($src); return $status; } return fileLog(__FUNCTION__, $status, $src, $dest); }
/** * Import user's avatar * * @param integer User ID (from b2evo) * @param string Path avatars * @param string File name of user's avatar */ function phpbb_import_avatar($user_ID, $path_avatars, $user_avatar) { global $DB, $tableprefix; if (!empty($user_avatar) && file_exists($path_avatars . $user_avatar)) { // Import user's avatar $FileRootCache =& get_FileRootCache(); $root_ID = FileRoot::gen_ID('user', $user_ID); $imported_file_ID = copy_file($path_avatars . $user_avatar, $root_ID, 'profile_pictures', false); if (!empty($imported_file_ID)) { // Update user's avatar mysql_query('UPDATE ' . $tableprefix . 'users SET user_avatar_file_ID = ' . $DB->quote($imported_file_ID) . ' WHERE user_ID = ' . $DB->quote($user_ID) . ' AND user_avatar_file_ID IS NULL', $DB->dbhandle); } } }
$init = GSDATAOTHERPATH . '404.xml'; $temp = GSADMININCPATH . 'tmp/tmp-404.xml'; if (!file_exists($init)) { copy($temp, $init); } # create default 404.xml page $init = GSDATAOTHERPATH . '403.xml'; $temp = GSADMININCPATH . 'tmp/tmp-403.xml'; if (!file_exists($init)) { copy($temp, $init); } # create default components.xml page if not exist $init = GSDATAOTHERPATH . 'components.xml'; $temp = GSADMININCPATH . 'tmp/tmp-components.xml'; if (!file_exists($init)) { copy_file($temp, $init); } # create root .htaccess file if it does not exist # remove temp, verify and throw errors $temp = GSROOTPATH . 'temp.htaccess'; $init = GSROOTPATH . '.htaccess'; if (file_exists($temp) && !file_exists($init)) { // open temp htaccess and replace the root holder and save as new file $temp_data = read_file(GSROOTPATH . 'temp.htaccess'); $temp_data = str_replace('**REPLACE**', tsl($path_parts), $temp_data); save_file($init, $temp_data); if (!file_exists($init)) { $err .= sprintf(i18n_r('ROOT_HTACCESS_ERROR'), 'temp.htaccess', '**REPLACE**', tsl($path_parts)) . '<br />'; } else { if (file_exists($temp)) { delete_file($temp);
function main_upgrade($oldversion = 0) { global $CFG, $db; $result = true; if ($oldversion < 0) { modify_database('', "CREATE TABLE {$CFG->prefix}datalists (\r\n ident SERIAL PRIMARY KEY,\r\n name varchar(32) NOT NULL default '',\r\n value text NOT NULL\r\n );"); modify_database('', "CREATE INDEX {$CFG->prefix}datalists_name_idx ON {$CFG->prefix}datalists (name);"); } if ($oldversion < 2006010600) { execute_sql("\r\n CREATE TABLE {$CFG->prefix}weblog_watchlist (\r\n ident SERIAL PRIMARY KEY,\r\n owner integer NOT NULL default '0',\r\n weblog_post integer NOT NULL default '0'\r\n ) ;\r\n\r\n CREATE INDEX {$CFG->prefix}weblog_watchlist_owner_idx ON {$CFG->prefix}weblog_watchlist (owner,weblog_post);"); execute_sql("DROP INDEX {$CFG->prefix}friends_owner_idx ;"); execute_sql("CREATE INDEX {$CFG->prefix}friends_owner_idx ON {$CFG->prefix}friends (owner) ;"); execute_sql("CREATE INDEX {$CFG->prefix}friends_friend_idx ON {$CFG->prefix}friends (friend) ;"); table_column('friends', '', 'status', 'varchar', '4', '', 'perm'); execute_sql("CREATE INDEX {$CFG->prefix}friends_status_idx ON {$CFG->prefix}friends (status);"); table_column('users', '', 'moderation', 'varchar', '4', '', 'no'); execute_sql("CREATE INDEX {$CFG->prefix}users_moderation_idx ON {$CFG->prefix}users (moderation);"); } if ($oldversion < 2006010601) { execute_sql("DROP INDEX {$CFG->prefix}file_folders_owner_idx ;"); execute_sql("CREATE INDEX {$CFG->prefix}file_folders_files_owner_idx ON {$CFG->prefix}file_folders (files_owner);"); execute_sql("CREATE INDEX {$CFG->prefix}file_folders_owner_idx ON {$CFG->prefix}file_folders (owner);"); execute_sql("CREATE INDEX {$CFG->prefix}file_folders_access_idx ON {$CFG->prefix}file_folders (access);"); execute_sql("CREATE INDEX {$CFG->prefix}file_folders_name_idx ON {$CFG->prefix}file_folders (name);"); execute_sql("DROP INDEX {$CFG->prefix}icons_owner_idx ;"); execute_sql("CREATE INDEX {$CFG->prefix}icons_owner_idx ON {$CFG->prefix}icons (owner) ;"); execute_sql("DROP INDEX {$CFG->prefix}invitations_name_idx ;"); execute_sql("CREATE INDEX {$CFG->prefix}invitations_code_idx ON {$CFG->prefix}invitations (code);"); execute_sql("CREATE INDEX {$CFG->prefix}invitations_email_idx ON {$CFG->prefix}invitations (email);"); execute_sql("CREATE INDEX {$CFG->prefix}invitations_added_idx ON {$CFG->prefix}invitations (added);"); execute_sql("DROP INDEX {$CFG->prefix}tags_tag_idx ;"); execute_sql("DROP INDEX {$CFG->prefix}tags_tag_2_idx ;"); execute_sql("CREATE INDEX {$CFG->prefix}tags_tagtype_ref_idx ON {$CFG->prefix}tags (tagtype,ref);"); execute_sql("CREATE INDEX {$CFG->prefix}tags_tag_idx ON {$CFG->prefix}tags (tag);"); } if ($oldversion < 2006012600) { modify_database('', "CREATE TABLE {$CFG->prefix}users_alias (\r\n ident SERIAL PRIMARY KEY,\r\n installid varchar(32) NOT NULL default '',\r\n username varchar(32) NOT NULL default '',\r\n firstname varchar(64) NOT NULL default '',\r\n lastname varchar(64) NOT NULL default '',\r\n email varchar(128) NOT NULL default '',\r\n user_id integer NOT NULL default 0\r\n );"); modify_database('', "CREATE INDEX {$CFG->prefix}users_alias_username_idx ON {$CFG->prefix}users_alias (username);"); modify_database('', "CREATE INDEX {$CFG->prefix}users_alias_installid_idx ON {$CFG->prefix}users_alias (installid);"); modify_database('', "CREATE INDEX {$CFG->prefix}users_alias_user_id_idx ON {$CFG->prefix}users_alias (user_id);"); } if ($oldversion < 2006021400) { modify_database('', "CREATE TABLE {$CFG->prefix}files_incoming (\r\n ident SERIAL PRIMARY KEY,\r\n installid varchar(32) NOT NULL default '',\r\n intentiondate integer NOT NULL default 0,\r\n size bigint NOT NULL default 0,\r\n foldername varchar(128) NOT NULL default '',\r\n user_id integer NOT NULL default 0\r\n );"); modify_database('', "CREATE INDEX {$CFG->prefix}files_incoming_user_id_idx ON {$CFG->prefix}files_incoming (user_id);"); } if ($oldversion < 2006022000) { modify_database('', "CREATE TABLE {$CFG->prefix}feed_posts (\r\n ident SERIAL PRIMARY KEY,\r\n posted varchar(64) NOT NULL default '',\r\n added integer NOT NULL default 0,\r\n feed integer NOT NULL default 0,\r\n title text NOT NULL,\r\n body text NOT NULL,\r\n url varchar(128) NOT NULL default ''\r\n );"); modify_database('', "CREATE INDEX {$CFG->prefix}feed_posts_url_idx ON {$CFG->prefix}feed_posts (url);"); modify_database('', "CREATE INDEX {$CFG->prefix}feed_posts_feed_idx ON {$CFG->prefix}feed_posts (feed);"); modify_database('', "CREATE INDEX {$CFG->prefix}feed_posts_posted_idx ON {$CFG->prefix}feed_posts (posted,added);"); modify_database('', "CREATE TABLE {$CFG->prefix}feed_subscriptions (\r\n ident SERIAL PRIMARY KEY,\r\n user_id integer NOT NULL default 0,\r\n feed_id integer NOT NULL default 0,\r\n autopost varchar(3) NOT NULL default 'no' check (autopost in ('yes', 'no')),\r\n autopost_tag varchar(128) NOT NULL default ''\r\n );"); modify_database('', "CREATE INDEX {$CFG->prefix}feed_subscriptions_feed_idx ON {$CFG->prefix}feed_subscriptions (feed_id);"); modify_database('', "CREATE INDEX {$CFG->prefix}feed_subscriptions_user_idx ON {$CFG->prefix}feed_subscriptions (user_id);"); modify_database('', "CREATE INDEX {$CFG->prefix}feed_subscriptions_autopost_idx ON {$CFG->prefix}feed_subscriptions (autopost);"); modify_database('', "CREATE TABLE {$CFG->prefix}feeds (\r\n ident SERIAL PRIMARY KEY,\r\n url varchar(128) NOT NULL default '',\r\n feedtype varchar(16) NOT NULL default '',\r\n name text NOT NULL,\r\n tagline varchar(128) NOT NULL default '',\r\n siteurl varchar(128) NOT NULL default '',\r\n last_updated integer NOT NULL default 0\r\n );"); modify_database('', "CREATE INDEX {$CFG->prefix}feeds_url_idx ON {$CFG->prefix}feeds (url,feedtype);"); modify_database('', "CREATE INDEX {$CFG->prefix}feeds_last_updated_idx ON {$CFG->prefix}feeds (last_updated);"); modify_database('', "CREATE INDEX {$CFG->prefix}feeds_siteurl_idx ON {$CFG->prefix}feeds (siteurl);"); modify_database('', "CREATE INDEX {$CFG->prefix}feeds_tagline_idx ON {$CFG->prefix}feeds (tagline);"); } if ($oldversion < 2006022100) { modify_database('', "CREATE TABLE {$CFG->prefix}friends_requests (\r\n ident SERIAL PRIMARY KEY,\r\n owner integer NOT NULL default 0,\r\n friend integer NOT NULL default 0\r\n ) ;"); modify_database('', "CREATE INDEX {$CFG->prefix}friends_requests_owner_idx ON {$CFG->prefix}friends_requests (owner);"); } if ($oldversion < 2006022200) { modify_database('', "INSERT INTO {$CFG->prefix}template_elements (name,content,template_id) VALUES ('pageshell', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>{{title}}</title>\r\n{{metatags}}\r\n</head>\r\n<body>\r\n<!-- elgg banner and logo -->\r\n<div id=\"container\"><!-- start container -->\r\n <div id=\"statusbar\"><!-- start statusbar -->\r\n <div id=\"welcome\"><!-- start welcome -->\r\n <p>Welcome {{userfullname}}</p>\r\n </div><!-- end welcome -->\r\n {{topmenu}}\r\n </div><!-- end statusbar -->\r\n <div id=\"header\"><!-- start header -->\r\n <h1>Elgg</h1>\r\n <h2>Community learning space</h2>\r\n <ul id=\"navigation\">\r\n {{menu}}\r\n </ul>\r\n </div><!-- end header -->\r\n <div id=\"content_holder\"><!-- start contentholder -->\r\n <div id=\"maincontent_container\"><!-- start main content -->\r\n {{messageshell}}\r\n {{mainbody}}\r\n </div><!-- end main content -->\r\n <div id=\"sidebar_container\">\r\n <div id=\"sidebar\"><!-- start sidebar -->\r\n <ul><!-- open sidebar lists -->\r\n {{sidebar}}\r\n </ul>\r\n </div><!-- end sidebar -->\r\n </div><!-- end sidebar_container -->\r\n </div><!-- end contentholder -->\r\n <div class=\"clearall\" />\r\n <div id=\"footer\"><!-- start footer -->\r\n Using the <a href=\"http://www.ifelse.co.uk/gentle-calm\">Gentle Calm theme</a> designed by <a href=\"http://www.ifelse.co.uk\">Phu Ly</a>.<br />\r\n <a href=\"http://elgg.net\"><img src=\"http://development.apcala.com/_templates/elgg_powered.png\" alt=\"Powered by Elgg\" title=\"Powered by Elgg\" border=\"0\" /></a>\r\n </div><!-- end footer -->\r\n</div><!-- end container -->\r\n</body>\r\n</html>', 5);"); modify_database('', "INSERT INTO {$CFG->prefix}template_elements (name,content,template_id) VALUES ( 'css', '/* \r\nTheme Name: Connections\r\nTheme URI: http://wpthemes.info\r\nVersion: 1.0\r\nDescription: A Theme from wpthemes.Info\r\nAuthor: Patricia Muller\r\nAuthor URI: http://www.vanillamist.com/blog/\r\n*/\r\nbody {\r\n margin:0;\r\n padding:0;\r\n font-family: ''Trebuchet MS'',Georgia, Times, Times New Roman, sans-serif;\r\n font-size: 80%;\r\n text-align:center;\r\n color:#29303B;\r\n line-height:1.3em;\r\n background: #F3F6ED;\r\n}\r\na {\r\n color: #909D73; \r\n text-decoration:none;\r\n font-size:100%;\r\n}\r\na:visited {\r\n color: #8a3207;\r\n}\r\na:hover {\r\n color: #753206;\r\n text-decoration:underline;\r\n}\r\n\r\nh1 {\r\n margin:0px 0px 15px 0px;\r\n padding:0px;\r\n font-size:120%;\r\n font-weight:900;\r\n}\r\n\r\n\r\nh2, h3, h4, h5 {\r\n margin:0px 0px 5px 0px;\r\n padding:0px;\r\n font-size:100%\r\n}\r\n\r\nblockquote {\r\n /*margin: 15px 30px 0 45px;*/\r\n padding: 0 0 0 45px;\r\n background: url(''/_templates/connections/blockquote.gif'') no-repeat left top;\r\n font-style:italic;\r\n}\r\n\r\n\r\nh3 {\r\n margin: 0;\r\n padding: 0;\r\n font-size:1.3em;\r\n}\r\np {\r\n margin: 0 0 1em;\r\n padding: 0;\r\n line-height: 1.5em;\r\n}\r\nh1, h2, h3, h4 {\r\n font-family: Georgia, \"Lucida Sans Unicode\", lucida, Verdana, sans-serif;\r\n font-weight: normal;\r\n letter-spacing: 1px;\r\n}\r\n\r\ninput, textarea \r\n{\r\n background: #F3F6ED;\r\n border: #E1D6C6 1px solid;\r\n}\r\n\r\n#container \r\n{\r\n background:#fff url(''/_templates/connections/rap.jpg'') center repeat-y;\r\n width:760px;\r\n margin:0 auto;\r\n padding:0px 8px;\r\n text-align:left;\r\n font-family: Trebuchet MS,Georgia, Arial, serif;\r\n}\r\n\r\n/*-----------------------------------------\r\nTOP STATUS BAR \r\n-------------------------------------------*/\r\n#header {\r\n background:#fff url(''/_templates/connections/top.jpg'') no-repeat bottom; \r\n height: 183px;\r\n margin: 0 auto;\r\n width:760px;\r\n padding:0;\r\n border:#fc9 0px solid;\r\n}\r\n\r\n#welcome {\r\n float: left;\r\n}\r\n\r\n#welcome p{\r\n font-weight:bold;\r\n font-size:110%;\r\n padding:0 0 0 4px;\r\n margin:0px;\r\n}\r\n\r\n#global_menuoptions {\r\n text-align: right;\r\n padding:0 5px 0 0;\r\n margin:0px;\r\n float:right;\r\n}\r\n\r\n#global_menuoptions ul {\r\n margin: 0; \r\n padding: 0;\r\n}\r\n\r\n#global_menuoptions li {\r\n margin: 0; \r\n padding: 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n\r\n#global_menuoptions a {\r\n text-decoration: none;\r\n font-size:80%;\r\n}\r\n\r\n#global_menuoptions a:hover{\r\n text-decoration:underline;\r\n}\r\n\r\n \r\n/*-------------------------------------------------\r\nnavigation\r\n-------------------------------------------------*/\r\n\r\n#navigation {\r\n height: 21px;\r\n margin: 0;\r\n padding-left: 20px;\r\n text-align:left;\r\n padding-top:155px;\r\n}\r\n\r\n#navigation li {\r\n margin: 0; \r\n padding: 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n \r\n#navigation a:link, #navigation a:visited {\r\n\r\n background: #524B21; /*#9BBB38;*/\r\n font-size:85%;\r\n font-weight: normal;\r\n padding: 4px 6px;\r\n margin: 0 2px 0 0;\r\n border: 0px solid #036;\r\n border-bottom: #9BBB38;\r\n text-decoration: none;\r\n color: #fff;\r\n}\r\n\r\n#navigation a:link.current, #navigation a:visited.current {\r\n border-bottom: 0px solid #9BBB38;\r\n background: #F5F5E7;\r\n color: #9BBB38;\r\n font-weight: bold;\r\n}\r\n\r\n#navigation a:hover {\r\n color: #fff;\r\n background: #000;\r\n}\r\n#navigation li a:hover{\r\n background:#000;\r\n }\r\n\r\n#content_holder \r\n{\r\n margin:0 auto;\r\n padding:0;\r\n background:#000 url(''/_templates/connections/content_bg.gif'') repeat;\r\n width:740px;\r\n}\r\n#maincontent_container {\r\n width:510px;\r\n float:left;\r\n padding:5px;\r\n margin:0;\r\n overflow:hidden;\r\n display:inline;\r\n}\r\n\r\n/*-----------------------------------------------------------------------\r\nDIV''s to help control look and feel - infoholder holds all the profile data\r\nand is always located in within ''maincontentdisplay''\r\n\r\n-------------------------------------------------------------------------*/\r\n\r\n/*------ holds profile data -------*/\r\n.infoholder {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.infoholder p {\r\n padding:0 0 0 5px;\r\n}\r\n\r\n.infoholder .fieldname h2 {\r\n border:0;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n padding:5px;\r\n color:#666;\r\n background:#fff;\r\n} \r\n\r\n.infoholder_twocolumn {\r\n padding:4px;\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 10px 0;\r\n }\r\n\r\n.infoholder_twocolumn .fieldname h3{\r\n color:#666;\r\n background:#fff;\r\n border:0px;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n}\r\n\r\n/*----------- holds administration data---------*/\r\n\r\n.admin_datatable {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.admin_datatable p {\r\n padding:0px;\r\n margin:0px;\r\n}\r\n\r\n.admin_datatable a {\r\n \r\n}\r\n\r\n\r\n.admin_datatable td {\r\n text-align:left;\r\n}\r\n\r\n.admin_datatable h3{\r\n color:#666;\r\n background:#fff;\r\n font-size:85%;\r\n}\r\n\r\n.admin_datatable h5 {\r\n padding:0px;\r\n margin:0px;\r\n}\r\n\r\n/*---- header plus one row of content ------*/\r\n\r\n.databox_vertical {\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n padding:5px;\r\n }\r\n\r\n .databox_vertical p{\r\n padding:0px;\r\n margin:0px;\r\n }\r\n\r\n.databox_vertical .fieldname h3 {\r\n padding:0px;\r\n margin:0px;\r\n font-size:90%;\r\n}\r\n\r\n/*------- holds file content ----*/\r\n\r\n.filetable {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n width:100%;\r\n }\r\n\r\n .filetable p{\r\n padding:0px;\r\n margin:0px;\r\n color:#000; /*#1181AA;*/\r\n background:#fff;\r\n }\r\n\r\n.filetable a{\r\n \r\n }\r\n\r\n\r\n.filetable table {\r\n text-align:left;\r\n}\r\n\r\n#edit_files h4 {\r\n \r\n}\r\n \r\n\r\n/*------- holds fodler content ------*/\r\n\r\n.foldertable {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n width:100%;\r\n }\r\n\r\n.foldertable a{\r\n \r\n }\r\n\r\n .foldertable p{\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n }\r\n\r\n.foldertable table {\r\n text-align:left;\r\n}\r\n\r\n/*------- holds network data ------*/\r\n\r\n.networktable {\r\n \r\n}\r\n\r\n#sidebar {\r\n width:186px;\r\n float:right;\r\n padding:0px 8px 10px 8px;\r\n margin:0;\r\n font-size:1em;\r\n color:#333;\r\n display:inline;\r\n}\r\n\r\n\r\n#header h1 \r\n{\r\n margin: 0; \r\n font-size: 1.6em; \r\n padding:10px 20px 0 0;\r\n text-align:right; \r\n}\r\n#header h1 a \r\n{\r\n color:#B5C09D;\r\n text-decoration:none;\r\n}\r\n#header h1 a:hover \r\n{\r\n color:#F7F3ED;\r\n}\r\n\r\n#sidebar h2 {\r\n margin: 10px 0 0 0;\r\n padding:2px;\r\n font-size: 90%;\r\n color: #676E04;\r\n text-align:center;\r\n background:url(''/_templates/connections/sidenav_top.jpg'') no-repeat center;\r\n border:#ccc 0px solid;\r\n height:22px;\r\n font-weight:bold;\r\n}\r\n#sidebar ul {\r\n list-style-type: none;\r\n padding: 0px;\r\n margin: 0;\r\n}\r\n\r\n#sidebar ul li ul{\r\n list-style-type: none;\r\n padding: 0;\r\n margin: 0;\r\n font-size: 0.9em; \r\n padding-bottom:3em;\r\n background:#F3F6ED url(''/_templates/connections/sidenav_bottom.jpg'') no-repeat bottom;\r\n border:#E1D6c6 1px solid;\r\n border-top:#f3f6ed 1px solid;\r\n}\r\n\r\n#sidebar ul li ul li{\r\n margin: 0.1em 0 0 0;\r\n padding: 2px; \r\n}\r\n#sidebar li a {\r\n text-decoration: none;\r\n border:none;\r\n}\r\n#sidebar li a:link {\r\n color: #909D73; \r\n}\r\n#sidebar li a:visited {\r\n color: #999999; \r\n}\r\n#sidebar li a:hover, #sidebar li a:active {\r\n color: #990000;\r\n}\r\n\r\n/*-------------------------------------------\r\nSIDEBAR DISPLAY COMPONENTS \r\n----------------------------------------------*/\r\n\r\n#sidebar_user {\r\n}\r\n\r\n#recent_activity {\r\n}\r\n\r\n#community_owned {\r\n}\r\n\r\n#community_membership {\r\n}\r\n\r\n#sidebar_friends {\r\n}\r\n\r\n#search {\r\n}\r\n\r\n/*--- extra div''s when looking at someone else''s page ---*/\r\n\r\n#sidebar_weblog {\r\n}\r\n\r\n#sidebar_files {\r\n}\r\n\r\n#me {\r\n padding: 0 3px 3px 3px;\r\n min-height: 71px;\r\n font-size: 0.9em; \r\n padding-bottom:3em;\r\n background:#F3F6ED url(''/_templates/connections/sidenav_bottom.jpg'') no-repeat bottom;\r\n border:#E1D6c6 1px solid;\r\n border-top:#f3f6ed 1px solid;\r\n}\r\n\r\n#me a {\r\n \r\n }\r\n\r\n#me #icon {\r\n margin:3px 0 0 0;\r\n float: left; \r\n width: 70px;\r\n}\r\n\r\n#me #contents {\r\n margin: 0 0 0 75px;\r\n text-align: left;\r\n}\r\n\r\n#searchform {\r\n font-size: 0.9em; \r\n padding-bottom:1em;\r\n background:#F3F6ED;\r\n border:#E1D6c6 1px solid;\r\n border-top:#f3f6ed 1px solid;\r\n text-align:center;\r\n}\r\n\r\n#maincontent_holder ul {\r\n margin-left: 0;\r\n padding-left: 45px;\r\n list-style-type: none;\r\n}\r\n\r\n#maincontent_holder ul li {\r\n background: url(''img/bullet.gif'') no-repeat 0 7px;\r\n padding-left: 1.5em;\r\n}\r\n\r\n/*-------------------------------------------\r\n INDIVIDUAL BLOG POSTS \r\n -------------------------------------------*/\r\n\r\n\r\n.weblog_posts {\r\n}\r\n\r\n.user {\r\n float: left;\r\n margin: 4px;\r\n padding:0 0 5px 0;\r\n width: 105px;\r\n text-align: left;\r\n}\r\n\r\n.entry \r\n{\r\n font-size:0.85em;\r\n font-family: Verdana, Arial, Sans-Serif;\r\n margin:0 0 30px 0;\r\n padding:0;\r\n color:#333;\r\n}\r\n.entry a\r\n{\r\n color:#990000;\r\n}\r\n.entry a:hover \r\n{\r\n color:#000;\r\n}\r\n\r\n.weblog_title h3 {\r\n font-family:Georgia, Arial, Serif;\r\n font-size:1.3em;\r\n margin:0;\r\n font-weight:bold;\r\n text-decoration:none;\r\n color:#676E04;\r\n border:0px\r\n font-size:80%;\r\n margin: 3px 10px 5px 0;\r\n padding: 8px 3px;\r\n}\r\n\r\n/* .entry h3 {\r\n color:#676E04;\r\n font-family: Georgia,''Lucida sans ms'', Verdana, Arial, Helvetica, sans-serif;\r\n text-align: center;\r\n font-size:80%;\r\n font-weight: bold;\r\n margin: 3px 10px 5px 0;\r\n padding: 8px 3px;\r\n /*background: #E7EBDE;*/\r\n line-height:1em;\r\n border:0px;\r\n text-decoration:none;\r\n} */\r\n\r\n.post {\r\n padding:10px 0;\r\n margin:3px 0;\r\n border-top:#BBC4A3 1px solid; \r\n font-family: Georgia, Verdana, Arial, serif;\r\n font-size:100%;\r\n}\r\n\r\n.info\r\n{\r\n padding-top:20px;\r\n background:url(''/_templates/connections/divider.gif'') no-repeat center;\r\n}\r\n\r\n.weblog_dateheader {\r\n padding: 0px;\r\n margin: 0px;\r\n color: #333;\r\n background:#fff;\r\n font-weight: normal;\r\n font-size:90%;\r\n font-style: italic;\r\n line-height: 12px;\r\n border:0px;\r\n border-bottom: 1px solid #ccc;\r\n}\r\n\r\n#footer {\r\n margin:0 auto;\r\n padding: 7px 0;\r\n border-top:#BBC4A3 1px solid;\r\n clear: both;\r\n font-size: 0.8em;\r\n color: #999;\r\n text-align:center;\r\n width:740px;\r\n}\r\n#footer a {\r\nborder:none;\r\ncolor:#7A7636;\r\n}\r\n\r\n.comments {\r\n font-size:1em;\r\n font-weight:normal; \r\n}\r\n#comments\r\n{\r\n margin:0 0 0 40px;\r\n}\r\n#comments textarea {\r\n width: 80%;\r\n}\r\n#comments p {\r\n margin: 0 0 1em;\r\n}\r\n#comments,#respond {\r\n text-transform: uppercase;\r\n margin: 3em 0 1em 40px;\r\n color: #676E04;\r\n font: 0.9em verdana, helvetica, sans-serif;\r\n}\r\n#comments li \r\n{\r\n margin:5px 0;\r\n padding:10px 10px 20px 10px;\r\n background:#F3F6ED url(_template/connections/comments_bottom.jpg) repeat-x bottom;\r\n border:#E1D6C6 1px solid;\r\n}\r\n#comments .alt \r\n{\r\n\r\n}\r\n\r\n#global_menuoptions \r\n{\r\n list-style:none;\r\n font-size:0.9em;\r\n margin:0 auto; \r\n padding:12px 20px 0 0;\r\n text-align:right; \r\n font-family:Verdana, Arial, Sans-Serif;\r\n}\r\n#global_menuoptions li \r\n{\r\n list-style:none;\r\n display:inline;\r\n padding:0;\r\n margin:0;\r\n font-weight:bold;\r\n}\r\n\r\n#global_menuoptions li a:link, #global_menuoptions li a:visited\r\n{\r\n text-decoration:none; \r\n color:#BBC4A3;\r\n}\r\n#global_menuoptions li a:hover, #global_menuoptions li a:active\r\n{\r\n color:#F7F3ED; \r\n}\r\n\r\n/*-------------------------------------\r\n Input forms\r\n--------------------------------------*/\r\n\r\n.textarea{\r\n border: 1px solid #7F9DB9;\r\n color:#71717B;\r\n width: 95%;\r\n height:200px;\r\n padding:3px;\r\n -moz-border-radius: 3px;\r\n}\r\n\r\n.medium_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n.small_textarea {\r\n width:95%;\r\n}\r\n\r\n.keywords_textarea {\r\n width:95%;\r\n height:100px;\r\n}', 4);"); modify_database('', "INSERT INTO {$CFG->prefix}template_elements (name,content,template_id) VALUES ( 'css', '/*\r\n Theme Name: Gentle Calm\r\n Theme URI: http://ifelse.co.uk/gentlecalm\r\n Description: Liquid Serenity\r\n Version: 1.0\r\n Author: Phu Ly\r\n Author URI: http://ifelse.co.uk/\r\n*/\r\n\r\n/************************************************\r\n * Main structure *\r\n ************************************************/\r\nbody {\r\n margin:0px;\r\n padding:0px;\r\n text-align:center;\r\n font:11px \"Lucida Grande\", \"Lucida Sans Unicode\", Verdana, Helvetica, Arial, sans-serif;\r\n color: #474E44;\r\n background:#F3F4EC;\r\n}\r\n\r\n/*-------------------------------------------------\r\nSTATUS BAR\r\n-------------------------------------------------*/\r\n\r\n#statusbar {\r\n padding: 3px 10px 2px 0;\r\n margin: 0px;\r\n text-align: bottom;\r\n height:15px;\r\n}\r\n\r\n\r\n#welcome {\r\n float: left;\r\n}\r\n\r\n#welcome p{\r\n font-weight:bold;\r\n font-size:110%;\r\n padding:0 0 0 4px;\r\n margin:0px;\r\n}\r\n\r\n#global_menuoptions {\r\n text-align: right;\r\n padding:0 5px 0 0;\r\n margin:0px;\r\n float:right;\r\n}\r\n\r\n#global_menuoptions a:hover{\r\n text-decoration:underline;\r\n}\r\n\r\n#global_menuoptions ul {\r\n margin: 0; \r\n padding: 0;\r\n}\r\n\r\n#global_menuoptions li {\r\n margin: 0; \r\n padding: 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n\r\n#global_menuoptions a {\r\n text-decoration: none;\r\n}\r\n\r\n#global_menuoptions a:hover{\r\n text-decoration:underline;\r\n}\r\n\r\n#maincontent_container {\r\n width:72%;\r\n float:left;\r\n}\r\n#maincontent_container .col {\r\n padding-bottom: 0.5em;\r\n padding-left:2.5em;\r\n padding-right:8.5em;\r\n line-height:1.6em;\r\n}\r\n#sidebar {\r\n padding:0.5em;\r\n padding-top: 2em;\r\n clear:right;\r\n width:25%;\r\n right:0px;\r\n float:right;\r\n font-size:1em; \r\n}\r\n#content_holder { \r\n width:80%;\r\n text-align:left;\r\n margin-left: auto;\r\n display:block;\r\n margin-right: auto;\r\n padding-bottom:0;\r\n}\r\n\r\n#content_holder:after {\r\n content: \".\"; \r\n display: block; \r\n height: 0; \r\n clear: both; \r\n visibility: hidden;\r\n}\r\n#footer{\r\n border-top:1px solid #324031;\r\n border-bottom:1px solid #324031;\r\n color: #eee;\r\n background: #87a284;\r\n clear:both;\r\n padding: 0.8em;\r\n text-align:center;\r\n margin-left: auto;\r\n display:block;\r\n margin-right: auto;\r\n font-size: 0.9em;\r\n margin-top:5em;\r\n}\r\n#footer a{\r\n color: #fff;\r\n font-weight:bold;\r\n}\r\na{\r\n color: #3C657B;\r\n text-decoration: none;\r\n}\r\na:hover {\r\n text-decoration:underline;\r\n}\r\n/************************************************\r\n * Header *\r\n ************************************************/\r\n#header {\r\n padding: 0px; \r\n margin-top: 0.3em;\r\n padding-top:1em; \r\n padding-bottom:1em;\r\n margin-bottom:0px;\r\n border-bottom: 1px solid #bab1b1;\r\n background: #CCCFBC;\r\n text-align:right;\r\n padding-right:2em;\r\n padding-left:-.5em;\r\n}\r\n\r\n#header h1{\r\n padding:0px;\r\n margin: 0px;\r\n font-size: 1.6em;\r\n letter-spacing:0.2em;\r\n}\r\n#header h1 {\r\n color:#5B7B57;\r\n}\r\n#header h1 a:hover {\r\n text-decoration:none;\r\n color: #bb4444;\r\n \r\n}\r\n#header img {\r\n border:none;\r\n}\r\n#header h2 {\r\n margin-bottom:0.3em;\r\n font-size: 0.8em;\r\n text-transform:uppercase;\r\n color:#A37B45;\r\n}\r\n\r\n/*-------------------------------------------------\r\nnavigation\r\n-------------------------------------------------*/\r\n\r\n#navigation {\r\n height: 21px;\r\n margin: 0;\r\n padding: 0 0 0 20px;\r\n text-align:left;\r\n}\r\n\r\n#navigation li {\r\n margin: 0; \r\n padding: 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n \r\n#navigation a:link, #navigation a:visited {\r\n\r\n background: #524B21; /*#9BBB38;*/\r\n font-size:85%;\r\n font-weight: normal;\r\n padding: 4px 6px;\r\n margin: 0 2px 0 0;\r\n border: 0px solid #036;\r\n border-bottom: #9BBB38;\r\n text-decoration: none;\r\n color: #fff;\r\n}\r\n\r\n#navigation a:link.current, #navigation a:visited.current {\r\n border-bottom: 0px solid #9BBB38;\r\n background: #F5F5E7;\r\n color: #9BBB38;\r\n font-weight: bold;\r\n}\r\n\r\n#navigation a:hover {\r\n color: #fff;\r\n background: #000;\r\n}\r\n#navigation li a:hover{\r\n background:#000;\r\n }\r\n\r\n/************************************************\r\n * Content *\r\n ************************************************/\r\nh1, h2, h3, h4 {\r\n font-family:\"Century Gothic\", \"Lucida Grande\", \"Lucida Sans Unicode\", Verdana, Helvetica, Arial, sans-serif;\r\n}\r\nh1 {\r\n font-size:130%;\r\n padding:10px 0 0 0;\r\n }\r\nh3 {\r\n font-size:100%;\r\n }\r\n\r\nh4 {\r\n font-size:100%;\r\n }\r\n\r\nh2 {\r\n font-size: 1.2em;\r\n margin-bottom:0.5em;\r\n}\r\nh2.entrydate{\r\n margin-bottom:0.3em;\r\n font-size: 1.8em;\r\n font-weight:normal;\r\n color:#86942A;\r\n text-transform:uppercase;\r\n}\r\n.entrymeta{\r\n font-weight:bold;\r\n color:#99A879;\r\n}\r\nh3.entrytitle a{\r\n color: #507642;\r\n}\r\nh3.weblog_title{\r\n margin-top:0px;\r\n margin-bottom:0.1em;\r\n font-size: 1.8em;\r\n}\r\n\r\n.user {\r\n float: left;\r\n margin: 4px;\r\n padding:0 0 5px 0;\r\n width: 105px;\r\n text-align: left;\r\n}\r\n\r\n.post p {\r\n margin-top:0.8em;\r\n margin-bottom:1.6em;\r\n}\r\n.weblog_posts{\r\n padding-bottom: 2em;\r\n font-family:\"Trebuchet MS\",\"Lucida Grande\", \"Lucida Sans Unicode\", Verdana, Helvetica, Arial, sans-serif;\r\n}\r\n/************************************************\r\n * Navigation Sidebar *\r\n ************************************************/\r\nul {\r\n margin:0 0 1em 0;\r\n padding-left:0px;\r\n list-style-type:none;\r\n}\r\n/************************************************\r\n * Comments *\r\n ************************************************/\r\nh2#comments{\r\n text-align:center;\r\n border-top:1px solid #9ba1aa;\r\n background:#E2ECD5;\r\n padding:0.7em;\r\n border-bottom:1px solid #9ba1aa;\r\n margin-bottom:1em;\r\n margin-top:8em;\r\n}\r\nol#commentlist {\r\n margin-top:0px;\r\n padding: 0.5em;\r\n margin-left: 0px;\r\n color: #9b9b9b;\r\n list-style-type: none;\r\n font-size:0.9em;\r\n}\r\n#comments li p{\r\n padding: 0px;\r\n margin: 0px;\r\n}\r\n.commentname {\r\n float: left;\r\n margin: 0;\r\n padding: 0 0 0.2em 0;\r\n}\r\n.commentinfo{\r\n width: 20em;\r\n float: right;\r\n text-align: right;\r\n}\r\n.commenttext {\r\n clear: both;\r\n padding-top: 0px;\r\n margin-top: 0px;\r\n margin-bottom: 3em;\r\n border-top: 1px solid #ebebeb;\r\n line-height:1.2em;\r\n color: #5b5b5b;\r\n}\r\n#commentsformheader{\r\n padding-left:1.5em;\r\n font-size: 1.4em;\r\n}\r\n#commentsform{\r\n margin-top:none;\r\n text-align:center;\r\n border:1px solid #ddd;\r\n background:#ecefdf;\r\n padding:0em 1em;\r\n}\r\n#commentsform form{\r\n text-align:left;\r\n margin:0px;\r\n}\r\n#commentsform p{\r\n margin:0.5em;\r\n}\r\n#commentsform form textarea{\r\n width:100%;\r\n}\r\n/************************************************\r\n * Extra *\r\n ************************************************/\r\ncode{\r\n font-family: ''lucida console'', ''Courier New'', monospace;\r\n font-size: 0.8em;\r\n display:block;\r\n padding:0.5em;\r\n background-color: #E5EaE4;\r\n border: 1px solid #d2d8d1;\r\n}\r\ninput[type=\"text\"], textarea {\r\n padding:0.3em;\r\n border: 1px solid #CCCFBC;\r\n color: #656F5C;\r\n -moz-border-radius: 0.5em;\r\n}\r\ninput[type=\"submit\"]{\r\n padding:0.2em;\r\n font-size: 1.25em;\r\n border: 1px solid #CCCFBC;\r\n color: #353F2f;\r\n background: #fefff8;\r\n -moz-border-radius: 0.5em;\r\n}\r\nblockquote {\r\n border-left: 3px solid #686868;\r\n color: #888;\r\n padding-left: 0.8em;\r\n margin-left: 2.5em;\r\n}\r\na img {\r\n border:none;\r\n}\r\n.imgborder img{\r\n border: 1px solid #87a284;\r\n background:#CCCFBC;\r\n padding:0.3em;\r\n}\r\n.imgborder{\r\n text-align: center;\r\n}\r\n\r\n#system_message{ \r\n border:1px solid #5B7B57;\r\n background:#CCCFBC;\r\n margin:20px 0 0 0;\r\n}\r\n\r\n#system_message p{\r\n padding:0px;\r\n margin:2px;\r\n }\r\n\r\n /*-------------------------------------\r\n Input forms\r\n--------------------------------------*/\r\n\r\n.textarea{\r\n border: 1px solid #7F9DB9;\r\n color:#71717B;\r\n width: 95%;\r\n height:200px;\r\n padding:3px;\r\n -moz-border-radius: 3px;\r\n}\r\n\r\n.medium_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n.small_textarea {\r\n width:95%;\r\n}\r\n\r\n.keywords_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n/*-----------------------------------------------------------------------\r\nDIV''s to help control look and feel - infoholder holds all the profile data\r\nand is always located in within ''maincontentdisplay''\r\n\r\n-------------------------------------------------------------------------*/\r\n\r\n/*------ holds profile data -------*/\r\n.infoholder {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.infoholder p {\r\n padding:0 0 0 5px;\r\n}\r\n\r\n.infoholder .fieldname h2 {\r\n border:0;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n padding:5px;\r\n} \r\n\r\n.infoholder_twocolumn {\r\n padding:4px;\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 10px 0;\r\n }\r\n\r\n.infoholder_twocolumn .fieldname h3{\r\n border:0px;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n}', 5);"); modify_database('', "INSERT INTO {$CFG->prefix}template_elements (name,content,template_id) VALUES ( 'pageshell', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>{{title}}</title>\r\n{{metatags}}\r\n</head>\r\n<body>\r\n <!-- elgg banner and logo -->\r\n<div id=\"container\"><!-- start container -->\r\n<div id=\"header\"><!-- start header -->\r\n {{topmenu}}\r\n <ul id=\"navigation\">\r\n {{menu}}\r\n </ul>\r\n</div><!-- end header -->\r\n<div id=\"content_holder\"><!-- start contentholder -->\r\n<div id=\"maincontent_container\"><!-- start main content -->\r\n {{messageshell}}\r\n {{mainbody}}\r\n</div><!-- end main content -->\r\n<div id=\"sidebar_container\">\r\n<div id=\"sidebar\"><!-- start sidebar -->\r\n <ul><!-- open sidebar lists -->\r\n {{sidebar}}\r\n </ul>\r\n</div><!-- end sidebar -->\r\n</div>\r\n</div><!-- end contentholder -->\r\n<div class=\"clearall\" />\r\n <div id=\"footer\"><!-- start footer -->\r\n <a href=\"http://elgg.net\"><img src=\"/_templates/elgg_powered.png\" border=\"0\"></a>\r\n </div><!-- end footer -->\r\n</div><!-- end container -->\r\n </body>\r\n </html>', 4);"); modify_database('', "INSERT INTO {$CFG->prefix}template_elements (name,content,template_id) VALUES ( 'css', '/*\r\nTheme Name: Northern-Web-Coders\r\nTheme URI: http://www.northern-web-coders.de/\r\nDescription: Northern-Web-Coders Theme\r\nVersion: 1.0\r\n\r\nAuthor: Kai Ackermann\r\n*/\r\n\r\nbody\r\n{\r\nbackground: #d8d8d3;\r\nfont-family: Lucida Grande, Verdana, sans-serif;\r\nmargin: 0;\r\npadding: 0;\r\nfont-size:80%;\r\ntext-align: center;\r\n}\r\n\r\na\r\n{\r\nfont-size:100%;\r\ncolor: #495865;\r\n}\r\n\r\na:hover\r\n{\r\ncolor: #6F6F6F;\r\n}\r\n\r\nh2, h3, h4, h5 {\r\n margin:0px 0px 5px 0px;\r\n padding:0px;\r\n font-size:100%\r\n}\r\n\r\n#container\r\n{\r\nbackground: #FFFFFF;\r\nmargin: 0 auto 0 auto;\r\nwidth: 769px;\r\ntext-align: left;\r\nborder: 2px solid #5F707A;\r\n}\r\n\r\n/*-----------------------------------------\r\nSTATUS BAR \r\n-------------------------------------------*/\r\n\r\n#statusbar {\r\n padding: 3px 5px 0 0;\r\n margin: 0px;\r\n height:16px;\r\n background:#eee;\r\n color: #333;\r\n font-size:80%;\r\n}\r\n\r\n#statusbar a {\r\n color: #666;\r\n background:#eee;\r\n}\r\n\r\n#welcome {\r\n float: left;\r\n}\r\n\r\n#welcome p{\r\n font-weight:bold;\r\n padding:0 0 0 4px;\r\n margin:0px;\r\n}\r\n\r\n#global_menuoptions {\r\n text-align: right;\r\n padding:0px;\r\n margin:0px;\r\n float:right;\r\n}\r\n\r\n#global_menuoptions ul {\r\n margin: 0; \r\n padding: 0;\r\n}\r\n\r\n#global_menuoptions li {\r\n margin: 0; \r\n padding: 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n\r\n#global_menuoptions a {\r\n text-decoration: none;\r\n}\r\n\r\n#global_menuoptions a:hover{\r\n text-decoration:underline;\r\n}\r\n\r\n/*--------------------------------------------\r\n Header\r\n -------------------------------------------*/\r\n\r\n#header\r\n{\r\nbackground: url(/_templates/northern/totems_2.jpg);\r\nwidth: 769px;\r\nheight: 200px;\r\nmargin: 0;\r\npadding: 0;\r\ntext-align: right;\r\n}\r\n\r\n#header h1 {\r\n padding:0 5px 0 5px;\r\n margin:0px;\r\n color:#fff;\r\n }\r\n\r\n#header h2 {\r\n padding:0 5px 0 5px;\r\n margin:0px;\r\n color:#fff;\r\n }\r\n\r\n/*--------------------------------------------\r\nNAVIGATION \r\n----------------------------------------------*/\r\n\r\n#navigation ul\r\n{\r\npadding: 0;\r\nmargin: 0;\r\nbackground: #5F707A;\r\nborder-top: 1px solid #DFDFDF;\r\nborder-bottom: 0px solid #DFDFDF;\r\nfloat: left;\r\nwidth: 769px;\r\nfont-family: arial, helvetica, sans-serif;\r\n}\r\n\r\n\r\n\r\n#navigation ul li { display: inline; }\r\n\r\n#navigation ul li a\r\n{\r\npadding: 10px 14px 11px 14px;\r\nbackground: #9C9D95;\r\ncolor: #ffffff;\r\ntext-decoration: none;\r\nfont-weight: bold;\r\nfloat: left;\r\nfont-size:85%;\r\nborder-right: 1px solid #FFFFFF;\r\n}\r\n\r\n#navigation ul li a:hover\r\n{\r\ncolor: #990000;\r\nbackground: #C9C0B0;\r\n}\r\n\r\n#navigation a:link.current, #navigation a:visited.current\r\n{\r\npadding: 10px 14px 11px 14px;\r\nbackground: #C9C0B0;\r\ncolor: #990000;\r\ntext-decoration: none;\r\nfont-weight: bold;\r\nfloat: left;\r\nborder-right: 1px solid #DFDFDF;\r\n}\r\n\r\n#navigation a:link.current, #navigation a:visited.current a:hover\r\n{\r\nbackground: #6F6F6F;\r\n}\r\n\r\n\r\n/*-------------------------------------------------\r\nHOLDS THE MAIN CONTENT E.G. BLOG, PROFILE ETC \r\n----------------------------------------------------*/\r\n\r\n#maincontent_container\r\n{\r\nposition: relative;\r\nleft: 20px;\r\nfloat: left;\r\npadding: 0;\r\nwidth: 68%;\r\ncolor: #495865;\r\nfont-size:85%;\r\n}\r\n\r\n/*#maincontent_container h2\r\n{\r\nborder-bottom: 1px solid #6F6F6F;\r\ncolor: #5F707A;\r\nmargin: 20px 0 5px 0;\r\npadding: 0 0 3px 3px;\r\ntext-align: right;\r\n}*/\r\n\r\n/*-------------------------------------------------------------\r\nTHIS DISPLAYS THE ACTUAL CONTENT WITHIN maincontent_container\r\n--------------------------------------------------------------*/\r\n\r\n#maincontent_display h1 {\r\n padding-bottom: 2px;\r\n border-bottom: 1px solid #666;\r\n margin: 10px 0 0 0;\r\n font-size:120%;\r\n color: #666;\r\n}\r\n\r\n#maincontent_display #sub_menu {\r\n font-family: verdana;\r\n padding: 2px 0 0 0;\r\n margin: 0 0 15px 0;\r\n font-weight: normal;\r\n color: #990000;\r\n}\r\n\r\n#maincontent_display #sub_menu a {\r\n font-weight:bold;\r\n margin:0px;\r\n padding:0px;\r\n color: #990000;\r\n}\r\n\r\n#maincontent_display #sub_menu a:hover {\r\n text-decoration: underline;\r\n}\r\n\r\n#maincontent_display #sub_menu p {\r\n margin:0px;\r\n padding:0px;\r\n}\r\n\r\n/*-----------------------------------------\r\n SIDEBAR\r\n ----------------------------------------*/\r\n\r\n#sidebar\r\n{\r\nclear: right;\r\nfloat: left;\r\nposition: relative;\r\ntop: 10px;\r\nleft: 50px;\r\nmargin: 0 0 10px 0;\r\nwidth: 30%;\r\nfont-size:90%;\r\n}\r\n\r\n#sidebar ul\r\n{\r\nlist-style-type: none;\r\nmargin: 10px 0;\r\npadding: 0;\r\n}\r\n\r\n#sidebar ul li\r\n{\r\ncolor: #5F5F5F;\r\nmargin: 0;\r\npadding: 0;\r\n}\r\n\r\n#sidebar ul li p\r\n{\r\nwidth: 190px;\r\nfont-weight: bold;\r\n}\r\n\r\n#sidebar ul li h2\r\n{\r\nborder-bottom: 1px solid;\r\nwidth: 190px;\r\nfont-weight: bold;\r\nmargin: 0;\r\npadding: 0;\r\n}\r\n\r\n#sidebar ul li ul\r\n{\r\n/*margin: 5px 0 15px 10px;*/\r\n}\r\n\r\n#sidebar ul li ul li\r\n{\r\nfont-weight: normal;\r\nmargin: 0 0 3px 0;\r\npadding: 0;\r\nline-height: 12px\r\n}\r\n\r\n#sidebar ul li#winamp ul li\r\n{\r\nwidth: 190px\r\n}\r\n\r\n#sidebar ul li ul li a\r\n{\r\ncolor: #5F5F5F;\r\ntext-decoration: none;\r\n}\r\n\r\n#sidebar ul li ul li a:hover\r\n{\r\nfont-weight: bold;\r\ntext-decoration: none\r\n}\r\n\r\n/*-------------------------------------------\r\nSIDEBAR DISPLAY COMPONENTS \r\n----------------------------------------------*/\r\n\r\n#sidebar_user {\r\n}\r\n\r\n#recent_activity {\r\n}\r\n\r\n#community_owned {\r\n}\r\n\r\n#community_membership {\r\n}\r\n\r\n#sidebar_friends {\r\n}\r\n\r\n#search {\r\n}\r\n\r\n#me {\r\n padding: 3px;\r\n margin:0;\r\n}\r\n\r\n#me p{\r\n font-weight:normal;\r\n font-weight: normal;\r\n margin:0;\r\n }\r\n\r\n#sidebar #sidebar_user p {\r\n padding:4px 0 0 0;\r\n font-weight: normal;\r\n }\r\n\r\n\r\n/*--- extra div''s when looking at someone else''s page ---*/\r\n\r\n#sidebar_weblog {\r\n}\r\n\r\n#sidebar_files {\r\n}\r\n\r\n#searchform\r\n{\r\nmargin: 2px 0 15px 0;\r\n}\r\n\r\n#searchform input\r\n{\r\nbackground: #FFFFFF;\r\nborder: 1px solid #6F6F6F;\r\nfont-size: 11px;\r\nmargin-top: 3px;\r\npadding: 2px;\r\n}\r\n\r\n/*--------------------------------------\r\n FOOTER\r\n --------------------------------------*/\r\n\r\n#footer\r\n{\r\ncolor: #FFFFFF;\r\nbackground: #5F707A;\r\nborder-top: 1px solid #DFDFDF;\r\nclear: both;\r\nmargin: 0 auto 0 auto;\r\npadding: 16px 0 17px 0;\r\ntext-align: center;\r\nwidth: 769px;\r\n}\r\n\r\n#footer a\r\n{\r\ncolor: #ffffff\r\n}\r\n\r\n/*-------------------------------------\r\n Blog classes\r\n ------------------------------------*/\r\n\r\n.weblog_posts {\r\n margin:0 0 30px 0;\r\n}\r\n\r\n.weblog_posts .entry h3 {\r\n color:#1181AA;\r\n background:#fff;\r\n padding: 0 0 10px 110px;\r\n}\r\n\r\n.user {\r\n float: left;\r\n margin: 0px;\r\n /* padding: 0.3em 2em 2em 0; */\r\n width: 105px;\r\n text-align: left;\r\n}\r\n\r\n.post {\r\n margin: 0 0 0 77px;\r\n padding:0 0 0 40px;\r\n font-family: arial;\r\n}\r\n\r\n.post p {\r\n padding: 0;\r\n margin: 3px 0 10px 0;\r\n line-height: 16px;\r\n}\r\n\r\n.post ol, .post ul {\r\n margin: 3px 0 10px 0;\r\n padding: 0;\r\n}\r\n\r\n.post li {\r\n margin: 0 0 0 30px;\r\n line-height: 16px;\r\n}\r\n\r\n.post ul li {\r\n list-style-type: square;\r\n}\r\n\r\n.post .blog_edit_functions p {\r\n \r\n}\r\n\r\n.post .blog_edit_functions a {\r\n \r\n}\r\n\r\n.post .weblog_keywords p {\r\n \r\n}\r\n\r\n.post .weblog_keywords a {\r\n \r\n}\r\n\r\n.info p {\r\n padding: 0px;\r\n margin: 0 0 5px 0;\r\n color: #666;\r\n background:#fff;\r\n font-family: verdana;\r\n font-weight: normal;\r\n line-height: 14px;\r\n text-align: left;\r\n}\r\n\r\n.info p a {\r\n color: #666;\r\n background:#fff;\r\n text-decoration: none;\r\n border-bottom: 1px dotted #666;\r\n padding-bottom: 0;\r\n}\r\n\r\n#comments ol, #comments ul {\r\n margin: 3px 0 10px 0;\r\n padding: 0;\r\n}\r\n\r\n#comments li {\r\n margin: 0 0 0 30px;\r\n line-height: 16px;\r\n}\r\n\r\n#comments ul li {\r\n list-style-type: square;\r\n}\r\n\r\n#comments h4 {\r\n color:#1181AA;\r\n}\r\n\r\n.weblog_dateheader {\r\n padding: 0px;\r\n margin: 0 0 5px 0;\r\n color: #333;\r\n background:#fff;\r\n font-weight: normal;\r\n font-style: italic;\r\n line-height: 12px;\r\n border:0px;\r\n border-bottom: 1px solid #ccc;\r\n}\r\n\r\n.clearing{clear:both;}\r\n\r\n.post p, post li\r\n{\r\nfont-family: Lucida Grande, Verdana, sans-serif;\r\nline-height: 130%;\r\n}\r\n\r\n.post blockquote\r\n{\r\nbackground: #fef7e9;\r\nborder: 1px solid #e6ddcb;\r\nborder-left: 2px solid #6F6F6F;\r\nfont-family: Georgia, Times New Roman, serif;\r\npadding: 4px 4px 4px 7px;\r\n}\r\n\r\n/*-------------------------------------\r\n Input forms\r\n--------------------------------------*/\r\n\r\n.textarea {\r\n border: 1px solid #7F9DB9;\r\n color:#71717B;\r\n width: 95%;\r\n height:200px;\r\n padding:3px;\r\n}\r\n\r\n.medium_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n.small_textarea {\r\n width:95%;\r\n}\r\n\r\n.keywords_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n/*----- System Messages ------*/\r\n\r\n#system_message { \r\n border:1px solid #D3322A;\r\n background:#F7DAD8;\r\n padding:3px 50px;\r\n margin:5px 0 0 0; \r\n}\r\n\r\n#system_message p{\r\n padding:0px;\r\n margin:2px;\r\n }\r\n\r\n/*-----------------------------------------------------------------------\r\nDIV''s to help control look and feel - infoholder holds all the profile data\r\nand is always located in within ''maincontentdisplay''\r\n\r\n-------------------------------------------------------------------------*/\r\n\r\n/*------ holds profile data -------*/\r\n.infoholder {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.infoholder p {\r\n padding:0 0 0 5px;\r\n}\r\n\r\n.infoholder .fieldname {\r\n /* border:0;\r\n margin:0;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n padding:5px;\r\n color:#666;\r\n background:#fff; */\r\ncolor: #5F707A;\r\nmargin: 0px 0 5px 0;\r\npadding: 0 0 0px 3px;\r\ntext-align: left;\r\nborder:0px;\r\n} \r\n\r\n.infoholder_twocolumn {\r\n padding:4px;\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 10px 0;\r\n }\r\n\r\n.infoholder_twocolumn .fieldname h3{\r\n color:#666;\r\n background:#fff;\r\n border:0px;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n}\r\n\r\n/*----------- holds administration data---------*/\r\n\r\n.admin_datatable {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.admin_datatable p {\r\n padding:0px;\r\n margin:0px;\r\n}\r\n\r\n.admin_datatable a {\r\n \r\n}\r\n\r\n\r\n.admin_datatable td {\r\n text-align:left;\r\n}\r\n\r\n.admin_datatable h3{\r\n color:#666;\r\n background:#fff;\r\n}\r\n\r\n.admin_datatable h4 {\r\n}\r\n\r\n/*---- header plus one row of content ------*/\r\n\r\n.databox_vertical {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n padding:5px;\r\n }\r\n\r\n .databox_vertical p{\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n }\r\n\r\n.databox_vertical .fieldname h3 {\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n}\r\n\r\n/*------- holds file content ----*/\r\n\r\n.filetable {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n width:100%;\r\n }\r\n\r\n .filetable p{\r\n padding:0px;\r\n margin:0px;\r\n color:#000; /*#1181AA;*/\r\n background:#fff;\r\n }\r\n\r\n.filetable a{\r\n \r\n }\r\n\r\n\r\n.filetable table {\r\n text-align:left;\r\n}\r\n\r\n#edit_files h4 {\r\n \r\n}\r\n \r\n\r\n/*------- holds fodler content ------*/\r\n\r\n.foldertable {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n width:100%;\r\n }\r\n\r\n.foldertable a{\r\n \r\n }\r\n\r\n .foldertable p{\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n }\r\n\r\n.foldertable table {\r\n text-align:left;\r\n}\r\n\r\n/*------- holds network data ------*/\r\n\r\n.networktable {\r\n \r\n}\r\n\r\n/*---------------------------------------------\r\n Your Resources\r\n-----------------------------------------------*/\r\n\r\n.feeds {\r\n border-bottom: 1px dotted #aaaaaa;\r\n background: transparent url(\"//_templates/sunflower.jpg\") bottom right no-repeat;\r\n}\r\n\r\n.feed_content a {\r\n color:black;\r\n border:0px;\r\n}\r\n\r\n.feed_content a:hover{\r\n background:#fff;\r\n }\r\n\r\n.feed_content img {\r\n border: 1px solid #666666;\r\n padding:5px;\r\n}\r\n\r\n.feed_content h3 {\r\n padding:0 0 4px 0;\r\n margin:0px;\r\n}\r\n\r\n.feed_content h3 a{\r\n color:black;\r\n border:0px;\r\n border-bottom:1px;\r\n border-style:dotted;\r\n border-color:grey;\r\n}\r\n\r\n.feed_content h3 a:hover{\r\n background:#FCD63F;\r\n color:#000;\r\n }\r\n\r\n.feed_date {\r\n line-height: 21px;\r\n font-weight: bold;\r\n padding: 5px 10px 4px 5px;\r\n margin:0 0 10px 0;\r\n background-color: #D0DEDF;\r\n color:#000;\r\n text-decoration:none;\r\n}\r\n\r\n.via a {\r\n color:#1181AA;\r\n background:#fff;\r\n border:0px;\r\n}\r\n\r\n.via a:hover {\r\n background:#ffc;\r\n color:#1181AA;\r\n}', 3);"); modify_database('', "INSERT INTO {$CFG->prefix}template_elements (name,content,template_id) VALUES ( 'pageshell', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>{{title}}</title>\r\n{{metatags}}\r\n</head>\r\n<body>\r\n <!-- elgg banner and logo -->\r\n<div id=\"container\"><!-- start container -->\r\n<div id=\"statusbar\"><!-- start statusbar -->\r\n <div id=\"welcome\"><!-- start welcome -->\r\n <p>Welcome {{userfullname}}</p>\r\n </div><!-- end welcome -->\r\n {{topmenu}}\r\n</div><!-- end statusbar -->\r\n<div id=\"header\"><!-- start header -->\r\n <h1>Elgg</h1>\r\n <h2>Community learning space</h2>\r\n</div><!-- end header -->\r\n<div id=\"navigation\">\r\n <ul>\r\n {{menu}}\r\n </ul>\r\n</div>\r\n<div id=\"content_holder\"><!-- start contentholder -->\r\n<div id=\"maincontent_container\"><!-- start main content -->\r\n {{messageshell}}\r\n {{mainbody}}\r\n</div><!-- end main content -->\r\n<div id=\"sidebar_container\">\r\n<div id=\"sidebar\"><!-- start sidebar -->\r\n <ul><!-- open sidebar lists -->\r\n {{sidebar}}\r\n </ul>\r\n</div><!-- end sidebar -->\r\n</div>\r\n</div><!-- end contentholder -->\r\n<div class=\"clearall\" />\r\n <div id=\"footer\"><!-- start footer -->\r\n <a href=\"http://elgg.net\"><img src=\"/_templates/elgg_powered.png\" border=\"0\"></a>\r\n </div><!-- end footer -->\r\n</div><!-- end container -->\r\n </body>\r\n </html>', 3);"); modify_database('', "INSERT INTO {$CFG->prefix}templates VALUES (4, 'Connections', 1, 'yes');"); modify_database('', "INSERT INTO {$CFG->prefix}templates VALUES (3, 'Northern', 1, 'yes');"); modify_database('', "INSERT INTO {$CFG->prefix}templates VALUES (5, 'Gentle Calm', 1, 'yes');"); // because this is postgres, we need to reset the sequence since we're hard coding the ids // that were used in the template_elements table. yuk. modify_database('', "SELECT setval('{$CFG->prefix}templates_ident_seq', (select max(ident) from {$CFG->prefix}templates))"); } if ($oldversion < 2006022300) { // Display errors error_reporting(E_ERROR | E_WARNING | E_PARSE); // Set time limit to 60 minutes @set_time_limit(3600); if ($users = get_records('users')) { foreach ($users as $user) { $ident = $user->ident; echo "<p>" . sprintf(gettext("Publishing RSS for user %d"), $ident) . "</p>"; $rssresult = run("weblogs:rss:publish", array($ident, false)); $rssresult = run("files:rss:publish", array($ident, false)); $rssresult = run("profile:rss:publish", array($ident, false)); } } } if ($oldversion < 2006022301) { // This handles upgrades from _files/data to $CFG->dataroot too... // Alter file repository to remove path information echo "<h2>" . gettext("Adjusting file repository information") . "</h2>"; // Get all files with path in the location $tostrip = $CFG->dirroot . '_files/data/'; if ($files = get_records_select('files', 'location LIKE ?', array($tostrip . '%'))) { foreach ($files as $file) { $ident = $file->ident; $filename = str_replace($tostrip, "files/", $file->location); set_field('files', 'location', $filename, 'ident', $ident); echo "<p>" . sprintf(gettext("Updating file %d: %s"), $ident, $filename) . "</p>"; } } // Get all files that start with _files $tostrip = '_files/data/'; if ($files = get_records_select('files', 'location LIKE ?', array($tostrip . '%'))) { foreach ($files as $file) { $ident = $file->ident; $filename = str_replace($tostrip, "files/", $file->location); set_field('files', 'location', $filename, 'ident', $ident); echo "<p>" . sprintf(gettext("Updating file %d: %s"), $ident, $filename) . "</p>"; } } // copy the files across. if ($dir = opendir($CFG->dirroot . '_files/data/')) { while ($file = readdir($dir)) { if ($file == "." || $file == ".." || $file == '.htaccess') { continue; } copy_file($CFG->dirroot . "_files/data/{$file}", $CFG->dataroot . "files/{$file}"); } } // now the profile images.. this is harder. if ($icons = get_records_sql("SELECT i.*,u.username FROM {$CFG->prefix}icons i JOIN {$CFG->prefix}users u ON i.owner = u.ident")) { foreach ($icons as $icon) { $upload_folder = $textlib->substr($icon->username, 0, 1); $fromfile = $CFG->dirroot . '_icons/data/' . $icon->filename; $tofile = $CFG->dataroot . 'icons/' . $upload_folder . '/' . $icon->username . '/' . $icon->filename; copy_file($fromfile, $tofile); } } } if ($oldversion < 2006052100) { // add some missing indexes modify_database('', 'CREATE INDEX {$CFG->prefix}tags_access_idx ON {$CFG->prefix}tags (access)'); } if ($oldversion < 2006052200) { // homogenise access field, shortest one was vc16, longest vc255 table_column('file_folders', 'access', 'access', 'varchar', 20, '', 'PUBLIC'); table_column('files', 'access', 'access', 'varchar', 20, '', 'PUBLIC'); table_column('groups', 'access', 'access', 'varchar', 20, '', 'PUBLIC'); table_column('profile_data', 'access', 'access', 'varchar', 20, '', 'PUBLIC'); table_column('tags', 'access', 'access', 'varchar', 20, '', 'PUBLIC'); table_column('weblog_posts', 'access', 'access', 'varchar', 20, '', 'PUBLIC'); } if ($oldversion < 2006052300) { // shorten another keyword field table_column('tags', 'tagtype', 'tagtype', 'varchar', 20); } if ($oldversion < 2006052400) { // purge owner=0 watchlist entries from watchlist-on-comment bug delete_records('weblog_watchlist', 'owner', 0); } if ($oldversion < 2006060600) { modify_database('', 'CREATE INDEX {$CFG->prefix}feed_posts_added_idx ON {$CFG->prefix}feed_posts (added)'); } if ($oldversion < 2006061600) { modify_database('', 'DROP INDEX {$CFG->prefix}feed_posts_url_idx'); table_column('feed_posts', 'url', 'url', 'varchar', 255, '', ''); } if ($oldversion < 2006061700) { modify_database('', 'DROP INDEX {$CFG->prefix}weblog_watchlist_owner_idx'); modify_database('', 'CREATE INDEX {$CFG->prefix}weblog_watchlist_owner_idx ON {$CFG->prefix}weblog_watchlist (owner)'); modify_database('', 'CREATE INDEX {$CFG->prefix}weblog_watchlist_weblog_post_idx ON {$CFG->prefix}weblog_watchlist (weblog_post)'); } if ($oldversion < 2006081000) { // Add old Elgg default template as Classic Elgg $template = new StdClass(); $template->name = "Classic Elgg"; $template->owner = 1; $template->public = "yes"; $template_id = insert_record('templates', $template); execute_sql("INSERT INTO `{$CFG->prefix}template_elements` (`name`,`content`,`template_id`) VALUES ('pageshell', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>{{title}}</title>\r\n{{metatags}}\r\n</head>\r\n<body>\r\n<!-- elgg banner and logo -->\r\n<div id=\"container\"><!-- start container -->\r\n <div id=\"statusbar\"><!-- start statusbar -->\r\n <div id=\"welcome\"><!-- start welcome -->\r\n <p>Welcome {{userfullname}}</p>\r\n </div><!-- end welcome -->\r\n {{topmenu}}\r\n </div><!-- end statusbar -->\r\n <div id=\"header\"><!-- start header -->\r\n <h1>{{sitename}}</h1>\r\n <h2>Personal Learning Landscape</h2>\r\n <ul id=\"navigation\">\r\n {{menu}}\r\n </ul>\r\n </div><!-- end header -->\r\n <div id=\"content_holder\"><!-- start contentholder -->\r\n <div id=\"maincontent_container\"><!-- start main content -->\r\n {{messageshell}}\r\n {{mainbody}}\r\n </div><!-- end main content -->\r\n <div id=\"sidebar_container\">\r\n <div id=\"sidebar\"><!-- start sidebar -->\r\n <ul><!-- open sidebar lists -->\r\n {{sidebar}}\r\n </ul>\r\n </div><!-- end sidebar -->\r\n </div><!-- end sidebar_container -->\r\n </div><!-- end contentholder -->\r\n <div class=\"clearall\" />\r\n <div id=\"footer\"><!-- start footer -->\r\n <a href=\"http://elgg.net/\"><img src=\"{{url}}_templates/elgg_powered.png\" alt=\"Powered by Elgg\" title=\"Powered by Elgg\" border=\"0\" /></a>\r\n </div><!-- end footer -->\r\n</div><!-- end container -->\r\n</body>\r\n</html>', {$template_id})"); execute_sql("INSERT INTO `{$CFG->prefix}template_elements` (`name`,`content`,`template_id`) VALUES ('css', '/*\r\n CSS for Elgg Classic default\r\n*/\r\n\r\nbody{\r\n padding: 0;\r\n font-family: arial, verdana, helvetica, sans-serif;\r\n color: #333;\r\n background: #eee;\r\n width:97%;\r\n margin:auto;\r\n font-size:80%;\r\n }\r\n\r\na {\r\n text-decoration: none;\r\n color: #7289AF;\r\n background: #fff;\r\n font-family:verdana, arial, helvetica, sans-serif;\r\n font-size:100%;\r\n\r\n }\r\n\r\np {\r\n font-size: 100%; \r\n}\r\n\r\nh1 {\r\n margin:0px 0px 15px 0px;\r\n padding:0px;\r\n font-size:120%;\r\n font-weight:900;\r\n}\r\n\r\n\r\nh2 {\r\n margin:0px 0px 5px 0px;\r\n padding:0px;\r\n font-size:100%\r\n}\r\n\r\n\r\nh3 {\r\n margin:0px 0px 5px 0px;\r\n padding:0px;\r\n font-size:100%\r\n}\r\n\r\nh4 {\r\n margin:0px 0px 5px 0px;\r\n padding:0px;\r\n font-size:100%\r\n}\r\n\r\nh5 {\r\n margin:0px 0px 5px 0px;\r\n padding:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n font-size:100%\r\n}\r\n\r\nblockquote {\r\n padding: 0 1pc 1pc 1pc;\r\n border: 1px solid #ddd;\r\n background-color: #F0F0F0;\r\n color:#000;\r\n background-image: url(\"{{url}}_templates/double-quotes.png\");\r\n background-repeat: no-repeat;\r\n background-position: -10px -7px;\r\n}\r\n\r\n/*---------------------------------------\r\nWraps the entire page \r\n-----------------------------------------*/\r\n\r\n#container {\r\n margin: 0 auto;\r\n text-align: center;\r\n width: 100%;\r\n min-width: 750px;\r\n }\r\n\r\n\r\n/*-----------------------------------------\r\nTOP STATUS BAR \r\n-------------------------------------------*/\r\n\r\n#statusbar {\r\n padding: 3px 0px 2px 0;\r\n margin: 0px;\r\n height:19px;\r\n background:#eee;\r\n color: #333;\r\n font-size:85%;\r\n}\r\n\r\n#statusbar a {\r\n color: #666;\r\n background:#eee;\r\n}\r\n\r\n#welcome {\r\n float: left;\r\n}\r\n\r\n#welcome p{\r\n font-weight:bold;\r\n font-size:110%;\r\n padding:0 0 0 4px;\r\n margin:0px;\r\n}\r\n\r\n#global_menuoptions {\r\n text-align: right;\r\n padding:0px;\r\n margin:0px;\r\n float:right;\r\n}\r\n\r\n#global_menuoptions ul {\r\n margin: 0; \r\n padding: 0;\r\n}\r\n\r\n#global_menuoptions li {\r\n margin: 0; \r\n padding: 0 8px 0 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n\r\n#global_menuoptions a {\r\n text-decoration: none;\r\n}\r\n\r\n#global_menuoptions a:hover{\r\n text-decoration:underline;\r\n}\r\n\r\n\r\n/*---------------------------------------------\r\nHEADER \r\n------------------------------------------------*/\r\n\r\n#header {\r\n width: 100%;\r\n background: #1181AA;\r\n color:#fff;\r\n border: 1px solid #ccc;\r\n border-bottom: none;\r\n padding: 0px;\r\n margin: 0px;\r\n text-align: left;\r\n }\r\n\r\n#header h1 {\r\n padding: 0 0 4px 0;\r\n margin: 7px 0 0 20px;\r\n color: #FAC83D;\r\n background: #1181AA;\r\n text-align: left;\r\n font-size:140%;\r\n font-weight:normal;\r\n } \r\n\r\n#header h2 {\r\n padding: 0 0 7px 0;\r\n margin: 0 0 0 20px;\r\n font-weight: normal;\r\n color: #fff;\r\n background: #1181AA;\r\n border: none;\r\n font-family: \"Lucida Grande\", arial, sans-serif;\r\n font-size:120%;\r\n } \r\n\r\n/*--------------------------------------------\r\nNAVIGATION \r\n----------------------------------------------*/\r\n\r\n#navigation {\r\n height: 19px;\r\n margin: 0;\r\n padding-left: 20px;\r\n text-align:left;\r\n}\r\n\r\n#navigation li {\r\n margin: 0; \r\n padding: 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n\r\n#navigation a:link, #navigation a:visited {\r\n\r\n background: #eaeac7;\r\n font-weight: normal;\r\n padding: 5px;\r\n margin: 0 2px 0 0;\r\n border: 0px solid #036;\r\n text-decoration: none;\r\n color: #333;\r\n font-size:85%;\r\n}\r\n\r\n#navigation a:link.selected, #navigation a:visited.selected {\r\n border-bottom: 1px solid #fff;\r\n background: #fff;\r\n color: #393;\r\n font-weight: bold;\r\n}\r\n\r\n#navigation a:hover {\r\n color: #000;\r\n background: #ffc;\r\n}\r\n\r\n#navigation li a:hover{\r\n background:#FCD63F;\r\n color: #000;\r\n }\r\n\r\n\r\n/*-----------------------------------------------\r\nSITE CONTENT WRAPPER \r\n-------------------------------------------------*/\r\n\r\n#content_holder {\r\n margin: 0;\r\n padding: 20px 0;\r\n width: 100%;\r\n text-align: left;\r\n float: left;\r\n border: 1px solid #ccc;\r\n border-top: none;\r\n background-color: #fff;\r\n color:#000;\r\n}\r\n\r\n/*-------------------------------------------------\r\nHOLDS THE MAIN CONTENT E.G. BLOG, PROFILE ETC \r\n----------------------------------------------------*/\r\n\r\n#maincontent_container {\r\n margin: 0;\r\n padding: 5px;\r\n text-align: left;\r\n width: 65%;\r\n float: left;\r\n }\r\n\r\n#maincontent_container h2 {\r\n padding-bottom: 5px;\r\n padding-top: 5px;\r\n margin: 0;\r\n /*color: #666;\r\n background-color:#fff;*/\r\n}\r\n\r\n#maincontent_container h1 {\r\n padding-bottom: 5px;\r\n padding-top: 5px;\r\n margin: 0;\r\n color: #666;\r\n background-color:#fff;\r\n}\r\n\r\n#maincontent_container h3 {\r\n padding-bottom: 5px;\r\n padding-top: 5px;\r\n margin: 0;\r\n /*color: #666;\r\n background-color:#fff;*/\r\n}\r\n\r\n#Footer .performanceinfo {\r\n color: #000;\r\n}\r\n\r\n/*-------------------------------------------------------------\r\nTHIS DISPLAYS THE ACTUAL CONTENT WITHIN maincontent_container\r\n--------------------------------------------------------------*/\r\n\r\n#maincontent_display {\r\n margin: 0;\r\n padding: 0 0 20px 20px;\r\n width: 100%;\r\n text-align: left;\r\n float: left;\r\n background-color: #fff;\r\n color:#000;\r\n}\r\n\r\n#maincontent_display h1 {\r\n padding-bottom: 2px;\r\n border-bottom: 1px solid #666;\r\n margin: 0;\r\n font-size:130%;\r\n color: #666;\r\n background-color: #fff;\r\n}\r\n\r\n/*---- Sub Menu attributes ----*/\r\n\r\n#maincontent_display #sub_menu {\r\n font-family: verdana;\r\n padding: 0px;\r\n margin: 5px 0 20px 0;\r\n color: #000;\r\n background-color:#fff;\r\n}\r\n\r\n#maincontent_display #sub_menu a {\r\n font-weight:bold;\r\n margin:0px;\r\n padding:0px;\r\n}\r\n\r\n#maincontent_display #sub_menu a:hover {\r\n text-decoration: underline;\r\n}\r\n\r\n#maincontent_display #sub_menu p {\r\n margin:0px;\r\n padding:0px;\r\n}\r\n\r\n/*-----------------------------------------------------------------------\r\nDIV''s to help control look and feel - infoholder holds all the profile data\r\nand is always located in within ''maincontentdisplay''\r\n\r\n-------------------------------------------------------------------------*/\r\n\r\n/*------ holds profile data -------*/\r\n.infoholder {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.infoholder p {\r\n padding:0 0 0 5px;\r\n}\r\n\r\n.infoholder .fieldname h2 {\r\n border:0;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n padding:5px;\r\n color:#666;\r\n background:#fff;\r\n} \r\n\r\n.infoholder_twocolumn {\r\n padding:4px;\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 10px 0;\r\n }\r\n\r\n.infoholder_twocolumn .fieldname h3{\r\n color:#666;\r\n background:#fff;\r\n border:0px;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n}\r\n\r\n/*----------- holds administration data---------*/\r\n\r\n.admin_datatable {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.admin_datatable p {\r\n padding:0px;\r\n margin:0px;\r\n}\r\n\r\n.admin_datatable a {\r\n \r\n}\r\n\r\n\r\n.admin_datatable td {\r\n text-align:left;\r\n}\r\n\r\n.admin_datatable h3{\r\n color:#666;\r\n background:#fff;\r\n}\r\n\r\n.admin_datatable h4 {\r\n}\r\n\r\n/*---- header plus one row of content ------*/\r\n\r\n.databox_vertical {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n padding:5px;\r\n }\r\n\r\n .databox_vertical p{\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n }\r\n\r\n.databox_vertical .fieldname h3 {\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n}\r\n\r\n/*------- holds file content ----*/\r\n\r\n.filetable {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n width:100%;\r\n }\r\n\r\n .filetable p{\r\n padding:0px;\r\n margin:0px;\r\n color:#000; /*#1181AA;*/\r\n background:#fff;\r\n }\r\n\r\n.filetable a{\r\n \r\n }\r\n\r\n\r\n.filetable table {\r\n text-align:left;\r\n}\r\n\r\n#edit_files h4 {\r\n \r\n}\r\n \r\n\r\n/*------- holds fodler content ------*/\r\n\r\n.foldertable {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n width:100%;\r\n }\r\n\r\n.foldertable a{\r\n \r\n }\r\n\r\n .foldertable p{\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n }\r\n\r\n.foldertable table {\r\n text-align:left;\r\n}\r\n\r\n/*------- holds network data ------*/\r\n\r\n.networktable {\r\n \r\n}\r\n\r\n\r\n/*-------------------------------------------\r\nSIDEBAR CONTAINER \r\n---------------------------------------------*/\r\n\r\n#sidebar_container {\r\n margin: 0px;\r\n text-align: left;\r\n float: right;\r\n width: 26%;\r\n min-width: 100px;\r\n border-left: 1px dotted #dcdcdc;\r\n padding: 0 10px;\r\n /*width:220px;*/\r\n /*overflow: hidden;*/\r\n }\r\n\r\n/*-----------------------------------------\r\nACTUAL SIDEBAR CONTENT\r\n-------------------------------------------*/\r\n\r\n#sidebar {\r\nmin-width: 100px;\r\n padding: 0 10px;\r\n }\r\n\r\n#sidebar ul {\r\n margin: 0;\r\n padding: 0;\r\n list-style: none;\r\n}\r\n\r\n#sidebar ul li ul {\r\n \r\n}\r\n\r\n#sidebar ul li {\r\n margin: 10px 0;\r\n padding-left: 5px;\r\n}\r\n\r\n\r\n#sidebar h2 {\r\n font-family: \"Lucida Grande\", arial, sans-serif;\r\n font-weight: bold;\r\n color: #333;\r\n background:#fff;\r\n margin: 20px 0 3px 0;\r\n padding: 0;\r\n border: none;\r\n}\r\n\r\n#sidebar h2 {\r\n border-bottom: 1px solid #666; \r\n}\r\n\r\n/*-------------------------------------------\r\nSIDEBAR DISPLAY COMPONENTS \r\n----------------------------------------------*/\r\n\r\n#sidebar_user {\r\n}\r\n\r\n#recent_activity {\r\n}\r\n\r\n#community_owned {\r\n}\r\n\r\n#community_membership {\r\n}\r\n\r\n#sidebar_friends {\r\n}\r\n\r\n#search {\r\n}\r\n\r\n#me {\r\n padding: 0 3px 3px 3px;\r\n background-color:#FAC83D;\r\n min-height: 71px;\r\n}\r\n\r\n#me a {\r\n background-color:#FAC83D;\r\n color: #7289AF;\r\n }\r\n\r\n#me #icon {\r\n margin:3px 0 0 0;\r\n float: left; \r\n width: 70px;\r\n}\r\n\r\n#me #contents {\r\n margin: 0 0 0 75px;\r\n text-align: left;\r\n}\r\n\r\n\r\n/*--- extra div''s when looking at someone else''s page ---*/\r\n\r\n#sidebar_weblog {\r\n}\r\n\r\n#sidebar_files {\r\n}\r\n\r\n\r\n\r\n/*------------------------------------------\r\n FOOTER \r\n ------------------------------------------*/\r\n\r\n#footer {\r\n margin: 10px 0 20px 20px;\r\n text-align: center;\r\n padding:5px;\r\n}\r\n\r\n#footer a:link, #footer a:visited {\r\n text-align:right;\r\n}\r\n\r\n\r\n/*-------------------------------------------\r\n INDIVIDUAL BLOG POSTS \r\n -------------------------------------------*/\r\n\r\n\r\n/*------ wraps all blog components ------*/\r\n\r\n.weblog_posts {\r\n}\r\n\r\n.weblog_posts .entry h3 {\r\n color:#1181AA;\r\n background:#fff;\r\n padding: 0 0 10px 110px;\r\n}\r\n\r\n.user {\r\n float: left;\r\n margin: 0px;\r\n padding:0 0 5px 0;\r\n width: 105px;\r\n text-align: left;\r\n}\r\n\r\n.user a {\r\n \r\n}\r\n\r\n.post {\r\n margin: 0 0 10px 0;\r\n padding: 0 0 20px 110px;\r\n font-family: arial;\r\n}\r\n\r\n.post p {\r\n padding: 0;\r\n margin: 3px 0 10px 0;\r\n line-height: 16px;\r\n}\r\n\r\n.post ol, .post ul {\r\n margin: 3px 0 10px 0;\r\n padding: 0;\r\n}\r\n\r\n.post li {\r\n margin: 0 0 0 30px;\r\n line-height: 16px;\r\n}\r\n\r\n.post ul li {\r\n list-style-type: square;\r\n}\r\n\r\n.post .blog_edit_functions p {\r\n \r\n}\r\n\r\n.post .blog_edit_functions a {\r\n \r\n}\r\n\r\n.post .weblog_keywords p {\r\n \r\n}\r\n\r\n.post .weblog_keywords a {\r\n \r\n}\r\n\r\n.info p {\r\n padding: 0px;\r\n margin: 0 0 5px 0;\r\n color: #666;\r\n background:#fff;\r\n font-family: verdana;\r\n font-weight: normal;\r\n line-height: 14px;\r\n text-align: left;\r\n}\r\n\r\n.info p a {\r\n color: #666;\r\n background:#fff;\r\n text-decoration: none;\r\n border-bottom: 1px dotted #666;\r\n padding-bottom: 0;\r\n}\r\n\r\n#comments ol, #comments ul {\r\n margin: 3px 0 10px 0;\r\n padding: 0;\r\n}\r\n\r\n#comments li {\r\n margin: 10px 0 10px 30px;\r\n line-height: 16px;\r\n}\r\n\r\n#comments ul li {\r\n list-style-type: square;\r\n}\r\n\r\n#comments h4 {\r\n color:#1181AA;\r\n}\r\n\r\n.comment_owner {\r\n border:1px solid #eee;\r\n\tbackground:#f2f7fb;\r\n\tpadding:5px;\r\n\theight:50px;\r\n}\r\n\r\n.comment_owner img {\r\n margin:0px 5px 0px 0px;\r\n}\r\n\r\n.comment_owner a {\r\n background:#f2f7fb;\r\n}\r\n\r\n.comment_owner p {\r\n padding:0;\r\n margin:0 0 10px 0;\r\n}\r\n\r\n.weblog_dateheader {\r\n padding: 0px;\r\n margin: 0 0 5px 0;\r\n color: #333;\r\n background:#fff;\r\n font-weight: normal;\r\n font-style: italic;\r\n line-height: 12px;\r\n border:0px;\r\n border-bottom: 1px solid #ccc;\r\n}\r\n\r\n.clearing{clear:both;}\r\n\r\n/*---------------------------------------------\r\n Your Resources\r\n-----------------------------------------------*/\r\n\r\n.feeds {\r\n border-bottom: 1px dotted #aaaaaa;\r\n background: transparent url(\"{{url}}_templates/sunflower.jpg\") bottom right no-repeat;\r\n}\r\n\r\n.feed_content a {\r\n color:black;\r\n border:0px;\r\n border-bottom:1px;\r\n border-style:dotted;\r\n border-color:#eee;\r\n}\r\n\r\n.feed_content a:hover{\r\n background:#fff;\r\n }\r\n\r\n.feed_content img {\r\n border: 1px solid #666666;\r\n padding:5px;\r\n}\r\n\r\n.feed_content h3 {\r\n padding:0 0 4px 0;\r\n margin:0px;\r\n}\r\n\r\n.feed_content h3 a{\r\n color:black;\r\n border:0px;\r\n border-bottom:1px;\r\n border-style:dotted;\r\n border-color:#eee;\r\n}\r\n\r\n.feed_content h3 a:hover{\r\n background:#FCD63F;\r\n color:#000;\r\n }\r\n\r\n.feed_date h2 {\r\n font-size:13px;\r\n line-height: 21px;\r\n font-weight: bold;\r\n padding: 5px 10px 5px 5px;\r\n background: #D0DEDF;\r\n color:#000;\r\n text-decoration:none;\r\n}\r\n\r\n.via a {\r\n font-size:80%;\r\n color:#1181AA;\r\n background:#fff;\r\n border:0px;\r\n border-bottom:1px;\r\n border-style:dashed;\r\n border-color:#ebebeb;\r\n}\r\n\r\n.via a:hover {\r\n background:#ffc;\r\n color:#1181AA;\r\n}\r\n\r\n\r\n/*---------------------------------------\r\n SYSTEM MESSAGES \r\n ---------------------------------------*/\r\n\r\n#system_message{ \r\n border:1px solid #D3322A;\r\n background:#F7DAD8;\r\n color:#000;\r\n padding:3px 50px;\r\n margin:0 0 0 20px;\r\n}\r\n\r\n#system_message p{\r\n padding:0px;\r\n margin:2px;\r\n }\r\n\r\n\r\n/* ------------- help files -------------*/\r\n\r\n.helpfiles ul {\r\n font-family: arial, helvetica, Tahoma;\r\n color: #000000;\r\n background:#fff;\r\n}\r\n\r\n.helpfiles h4 {\r\n \r\n}\r\n\r\n/*------ site news for home.php ---------*/\r\n\r\n.sitenews {\r\n background:#ebebeb;\r\n color:#000;\r\n}\r\n\r\n.sitenews h2 {\r\n background:#1181AA;\r\n color:#FAC83D;\r\n padding:0 0 5px 0;\r\n}\r\n\r\n/*-------------------------------------\r\n Input forms\r\n--------------------------------------*/\r\n\r\n.textarea {\r\n border: 1px solid #7F9DB9;\r\n color:#71717B;\r\n width: 95%;\r\n height:200px;\r\n padding:3px;\r\n}\r\n\r\n.medium_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n.small_textarea {\r\n width:95%;\r\n}\r\n\r\n.keywords_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n\r\n/*--------------------------------------\r\n MISC \r\n--------------------------------------*/\r\n\r\n.clearall {\r\n padding: 0px;\r\n clear: both;\r\n font-size: 0px;\r\n }\r\n\r\n.flagcontent {\r\n background:#eee;\r\n color:#000;\r\n border:1px;\r\n border-color:#000;\r\n border-style:solid;\r\n padding:3px;\r\n}\r\n\r\n.flagcontent h5 {\r\n background:#eee;\r\n color:#1181AA;\r\n}', {$template_id})"); // Clean up slashes execute_sql("update {$CFG->prefix}weblog_posts set title = replace(title,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}weblog_posts set title = replace(title,'\\\"','\"')"); execute_sql("update {$CFG->prefix}weblog_posts set body = replace(body,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}weblog_posts set body = replace(body,'\\\"','\"')"); execute_sql("update {$CFG->prefix}weblog_comments set body = replace(body,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}weblog_comments set body = replace(body,'\\\"','\"')"); execute_sql("update {$CFG->prefix}weblog_comments set postedname = replace(postedname,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}weblog_comments set postedname = replace(postedname,'\\\"','\"')"); execute_sql("update {$CFG->prefix}tags set tag = replace(tag,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}tags set tag = replace(tag,'\\\"','\"')"); execute_sql("update {$CFG->prefix}files set title = replace(title,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}files set title = replace(title,'\\\"','\"')"); execute_sql("update {$CFG->prefix}files set description = replace(description,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}files set description = replace(description,'\\\"','\"')"); execute_sql("update {$CFG->prefix}file_folders set name = replace(name,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}file_folders set name = replace(name,'\\\"','\"')"); execute_sql("update {$CFG->prefix}profile_data set value = replace(value,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}profile_data set value = replace(value,'\\\"','\"')"); execute_sql("update {$CFG->prefix}users set name = replace(name,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}users set name = replace(name,'\\\"','\"')"); execute_sql("update {$CFG->prefix}groups set name = replace(name,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}groups set name = replace(name,'\\\"','\"')"); } return $result; }
/** * MYSQL update and save forum */ private function set_forumDB() { global $aidlink; // Save_permission if (isset($_POST['save_permission'])) { $this->data['forum_id'] = form_sanitizer($_POST['forum_id'], '', 'forum_id'); $this->data = self::get_forum($this->data['forum_id']); if (!empty($this->data)) { $this->data['forum_access'] = form_sanitizer($_POST['forum_access'], USER_LEVEL_PUBLIC, 'forum_access'); $this->data['forum_post'] = form_sanitizer($_POST['forum_post'], USER_LEVEL_MEMBER, 'forum_post'); $this->data['forum_reply'] = form_sanitizer($_POST['forum_reply'], USER_LEVEL_MEMBER, 'forum_reply'); $this->data['forum_post_ratings'] = form_sanitizer($_POST['forum_post_ratings'], USER_LEVEL_MEMBER, 'forum_post_ratings'); $this->data['forum_poll'] = form_sanitizer($_POST['forum_poll'], USER_LEVEL_MEMBER, 'forum_poll'); $this->data['forum_vote'] = form_sanitizer($_POST['forum_vote'], USER_LEVEL_MEMBER, 'forum_vote'); $this->data['forum_answer_threshold'] = form_sanitizer($_POST['forum_answer_threshold'], 0, 'forum_answer_threshold'); $this->data['forum_attach'] = form_sanitizer($_POST['forum_attach'], USER_LEVEL_MEMBER, 'forum_attach'); $this->data['forum_attach_download'] = form_sanitizer($_POST['forum_attach_download'], USER_LEVEL_PUBLIC, 'forum_attach_download'); $this->data['forum_mods'] = isset($_POST['forum_mods']) ? form_sanitizer($_POST['forum_mods'], '', 'forum_mods') : ""; dbquery_insert(DB_FORUMS, $this->data, 'update'); addnotice('success', self::$locale['forum_notice_10']); if (\defender::safe()) { redirect(FUSION_SELF . $aidlink . $this->ext); } } } if (isset($_POST['save_forum'])) { $this->data = array('forum_id' => form_sanitizer($_POST['forum_id'], 0, 'forum_id'), 'forum_name' => form_sanitizer($_POST['forum_name'], '', 'forum_name'), 'forum_description' => form_sanitizer($_POST['forum_description'], '', 'forum_description'), 'forum_cat' => form_sanitizer($_POST['forum_cat'], 0, 'forum_cat'), 'forum_type' => form_sanitizer($_POST['forum_type'], '', 'forum_type'), 'forum_language' => form_sanitizer($_POST['forum_language'], '', 'forum_language'), 'forum_alias' => form_sanitizer($_POST['forum_alias'], '', 'forum_alias'), 'forum_meta' => form_sanitizer($_POST['forum_meta'], '', 'forum_meta'), 'forum_rules' => form_sanitizer($_POST['forum_rules'], '', 'forum_rules'), 'forum_image_enable' => isset($_POST['forum_image_enable']) ? 1 : 0, 'forum_merge' => isset($_POST['forum_merge']) ? 1 : 0, 'forum_allow_attach' => isset($_POST['forum_allow_attach']) ? 1 : 0, 'forum_quick_edit' => isset($_POST['forum_quick_edit']) ? 1 : 0, 'forum_allow_poll' => isset($_POST['forum_allow_poll']) ? 1 : 0, 'forum_poll' => USER_LEVEL_MEMBER, 'forum_users' => isset($_POST['forum_users']) ? 1 : 0, 'forum_lock' => isset($_POST['forum_lock']) ? 1 : 0, 'forum_permissions' => isset($_POST['forum_permissions']) ? form_sanitizer($_POST['forum_permissions'], 0, 'forum_permissions') : 0, 'forum_order' => isset($_POST['forum_order']) ? form_sanitizer($_POST['forum_order']) : '', 'forum_branch' => get_hkey(DB_FORUMS, 'forum_id', 'forum_cat', $this->data['forum_cat']), 'forum_image' => '', 'forum_mods' => ""); $this->data['forum_alias'] = $this->data['forum_alias'] ? str_replace(' ', '-', $this->data['forum_alias']) : ''; // Checks for unique forum alias if ($this->data['forum_alias']) { if ($this->data['forum_id']) { $alias_check = dbcount("('alias_id')", DB_PERMALINK_ALIAS, "alias_url='" . $this->data['forum_alias'] . "' AND alias_item_id !='" . $this->data['forum_id'] . "'"); } else { $alias_check = dbcount("('alias_id')", DB_PERMALINK_ALIAS, "alias_url='" . $this->data['forum_alias'] . "'"); } if ($alias_check) { \defender::stop(); addNotice('warning', self::$locale['forum_error_6']); } } // check forum name unique $this->data['forum_name'] = $this->check_validForumName($this->data['forum_name'], $this->data['forum_id']); // Uploads or copy forum image or use back the forum image existing if (!empty($_FILES) && is_uploaded_file($_FILES['forum_image']['tmp_name'])) { $upload = form_sanitizer($_FILES['forum_image'], '', 'forum_image'); if ($upload['error'] == 0) { if (!empty($upload['thumb1_name'])) { $this->data['forum_image'] = $upload['thumb1_name']; } else { $this->data['forum_image'] = $upload['image_name']; } } } elseif (isset($_POST['forum_image_url']) && $_POST['forum_image_url'] != "") { require_once INCLUDES . "photo_functions_include.php"; // if forum_image_header is not empty $type_opts = array('0' => BASEDIR, '1' => ''); // the url $this->data['forum_image'] = $type_opts[intval($_POST['forum_image_header'])] . form_sanitizer($_POST['forum_image_url'], '', 'forum_image_url'); $upload = copy_file($this->data['forum_image'], FORUM . "images/"); if ($upload['error'] == TRUE) { \defender::stop(); addNotice('danger', self::$locale['forum_error_9']); } else { $this->data['forum_image'] = $upload['name']; } } else { $this->data['forum_image'] = isset($_POST['forum_image']) ? form_sanitizer($_POST['forum_image'], '', 'forum_image') : ""; } if (!$this->data['forum_id']) { $this->data += array('forum_access' => USER_LEVEL_PUBLIC, 'forum_post' => USER_LEVEL_MEMBER, 'forum_reply' => USER_LEVEL_MEMBER, 'forum_post_ratings' => USER_LEVEL_MEMBER, 'forum_poll' => USER_LEVEL_MEMBER, 'forum_vote' => USER_LEVEL_MEMBER, 'forum_mods' => ""); } // Set last order if (!$this->data['forum_order']) { $this->data['forum_order'] = dbresult(dbquery("SELECT MAX(forum_order) FROM " . DB_FORUMS . " " . (multilang_table("FO") ? "WHERE forum_language='" . LANGUAGE . "' AND" : "WHERE") . " forum_cat='" . $this->data['forum_cat'] . "'"), 0) + 1; } if (\defender::safe()) { if ($this->verify_forum($this->data['forum_id'])) { $result = dbquery_order(DB_FORUMS, $this->data['forum_order'], 'forum_order', $this->data['forum_id'], 'forum_id', $this->data['forum_cat'], 'forum_cat', 1, 'forum_language', 'update'); if ($result) { dbquery_insert(DB_FORUMS, $this->data, 'update'); } addNotice('success', self::$locale['forum_notice_9']); redirect(FUSION_SELF . $aidlink . $this->ext); } else { $new_forum_id = 0; $result = dbquery_order(DB_FORUMS, $this->data['forum_order'], 'forum_order', FALSE, FALSE, $this->data['forum_cat'], 'forum_cat', 1, 'forum_language', 'save'); if ($result) { dbquery_insert(DB_FORUMS, $this->data, 'save'); $new_forum_id = dblastid(); } if ($this->data['forum_cat'] == 0) { redirect(FUSION_SELF . $aidlink . "&action=p_edit&forum_id=" . $new_forum_id . "&parent_id=0"); } else { switch ($this->data['forum_type']) { case '1': addNotice('success', self::$locale['forum_notice_1']); break; case '2': addNotice('success', self::$locale['forum_notice_2']); break; case '3': addNotice('success', self::$locale['forum_notice_3']); break; case '4': addNotice('success', self::$locale['forum_notice_4']); break; } redirect(FUSION_SELF . $aidlink . $this->ext); } } } } }
function copy_dir($from_file, $to_file) { global $CFG; if (!is_dir($to_file)) { umask(00); $status = mkdir($to_file, $CFG->directorypermissions); } $dir = opendir($from_file); while ($file = readdir($dir)) { if ($file == "." || $file == "..") { continue; } $status = copy_file("{$from_file}/{$file}", "{$to_file}/{$file}"); } closedir($dir); return $status; }
echo "Scuessfully created file(s)!"; } exit; } if (isset($_GET['edit'])) { echo "<center><table border=\"1\" width=600 rules=\"groups\">\n <thead>\n <tr><td>"; if (@file_exists($filename)) { echo "<form action=" . $surl . "?&" . $word . "&save method=post><textarea rows=15 cols=90 name=text>"; read_file($filename); echo "</textarea><br><br><input type=hidden name=file value=" . urlencode($_GET['file']) . "><input type=submit name=sub value=Save>"; } exit; } if (isset($_GET['copy_start'])) { echo "<center><table border=\"1\" width=600 rules=\"groups\">\n <thead>\n <tr><td>"; copy_file($_POST['from'], $_POST['to']); exit; } if (isset($_GET['copy_file'])) { echo "<center><table border=\"1\" width=600 rules=\"groups\">\n\n <thead>\n <tr><td>"; ?> <form action=<?php echo $surl; ?> ?&<?php echo $word; ?> ©_start method="post"> New:<br><textarea rows=4 cols=70 name="to"><?php echo realpath($filename); ?>
function ccXML() { $inxUploaded = 0; //$connect = pDataConnect(); // no longer used? --atf 5/24/07 // cache filenames $remote_inx = remote_inx(); $remote_oux = remote_oux(); $local_inx = local_inx(); // check if PCCharge has both #.inx and #.pro (for any #, not just CashierNo) -- stuck queue, alert FEC --atf 5/24/07 // also note a new return value for ccXML(): -1 means stuck-queue, 0 means some other file copy error $testcmd = "for %f in (\\" . $_SESSION["ccServer"] . "\\" . $_SESSION["ccShare"] . "\\temp\\*.pro) do @if exist \"\\" . $_SESSION["ccServer"] . "\\" . $_SESSION["ccShare"] . "\\temp\\%%~nf.inx\" echo 1"; $teststuck = shell_exec($testcmd); if ($teststuck != "") { return -1; } // end stuck-queue-check $input = $_SESSION["ccSwipe"]; $transno = ccTicket(); $amountIn = $_SESSION["ccAmt"]; $aCCInput = explode("=", $input); // ***** CvR 09/22/05 test for forced transactions ***** END // $input comes from SESSION[ccSwipe] which has track2 data: these characters could not be there, and all digits up to '=' are the card num --atf 5/24/07 $CC = $aCCInput[0]; /* if(substr($input,0,1) == 'F' || substr($input,0,1) == 'f'){ $CC = substr($aCCInput[0], -17); }else{ $CC = substr($aCCInput[0], -16); } */ $expYear = substr($aCCInput[1], 0, 2); $expMonth = substr($aCCInput[1], 2, 2); //-----added 03/31/05 CvR if ($amountIn > 0) { $command = "1"; //action code for transaction sale = 1 } else { $command = "2"; //action code for return = 2 } //----- // in the PCCharge DevKit manual, 'MANUAL_FLAG' is defined as '0=manual, 1=swiped' --atf 5/18/07 $manual = 1; if ($_SESSION["ccManual"] != 0) { $manual = 0; $_SESSION["ccManual"] = 0; } $expDate = $expMonth . $expYear; //set expDate $present = 1; //card present $proc = 'BPAS'; //processor (will be set to CCRD when done testing) $TID = merchantNum(); //merchant ID for processor $user = $_SESSION["CashierNo"]; $trackII = $_SESSION["ccSwipe"]; $amount = truncate2(abs($amountIn)); // $string_out creates the string that will be saved to the *.inx file // of the XML format that PC Charge expects // Note: ref to x-schema requires specific order sequence // could not resolve 'Incomplete Trans' errors; last resort, just turn off XML validation --atf 5/18/07 //'<XML_FILE xmlns="x-schema:.\dtd\stnd.xdr"> $string_out = '<XML_FILE> <XML_REQUEST> <USER_ID>' . $user . '</USER_ID> <COMMAND>' . $command . '</COMMAND> <PROCESSOR_ID>' . $proc . '</PROCESSOR_ID> <MERCH_NUM>' . $TID . '</MERCH_NUM> <ACCT_NUM>' . $CC . '</ACCT_NUM> <EXP_DATE>' . $expDate . '</EXP_DATE> <MANUAL_FLAG>' . $manual . '</MANUAL_FLAG> <TRANS_AMOUNT>' . $amount . '</TRANS_AMOUNT>'; if ($manual == 1) { // counter-intuitive: manual==1 means swiped, not manual, so pass the track data --atf 5/24/07 $string_out .= ' <TRACK_DATA>' . $trackII . '</TRACK_DATA>'; } $string_out .= ' <TICKET_NUM>' . $transno . '</TICKET_NUM> <PRESENT_FLAG>1</PRESENT_FLAG> </XML_REQUEST> </XML_FILE> '; //------added 04/01/05 Tak & CvR-----provide for voiding CC entry on receipt if (substr($input, 0, 1) == 'V' || substr($input, 0, 1) == 'v') { $troutd = $getCCOutW[2]; $command = 3; $string_out = '<XML_FILE xmlns="x-schema:.\\dtd\\stnd.xdr"> <XML_REQUEST> <USER_ID>' . $user . '</USER_ID> <COMMAND>' . $command . '</COMMAND> <TROUTD>' . $troutd . '</TROUTD> </XML_REQUEST> </XML_FILE> '; // echo $string_out; } //---- //below added to log .inx info. To be tested on lane9, etc //added 07/07/05 CvR $trans_id = $_SESSION["LastID"] + 1; $lane = $_SESSION["laneno"]; $trans_no = $_SESSION["transno"]; $now = date('Y-m-d H:i:s'); $dbinx = tDataconnect(); $inxQ = "INSERT INTO INX\r\n VALUES('{$user}','{$command}','{$proc}','{$TID}','{$CC}','{$expDate}','{$manual}','{$trackII}','{$transno}',1,{$amount},'','{$now}','{$trans_id}','{$trans_no}','{$lane}')"; if (sql_query($inxQ, $dbinx)) { //--------- // changed all filename functions (remote_oux(), local_inx(), etc) to variables, cached up top --atf 5/24/07 delete_file($local_inx); // ***** changed local_inx function to variable abpw 3/05/07 ***** $fp = fopen($local_inx, 'w'); // open the file with write permissions -- ***** changed local_inx function to variable abpw 3/05/07 ***** fwrite($fp, $string_out); // write $string_out to the *.inx file fclose($fp); // close the file delete_file($remote_inx); delete_file($remote_oux); $inxUploaded = copy_file($local_inx, $remote_inx); //***** changed local_inx function to variable abpw 3/05/07 ***** } return $inxUploaded; }
<?php foreach ($files as $fl) { $fl_nm = explode("_", $fl); $fl_timest = explode(".", $fl_nm[2]); if (count($fl_timest[0]) != 12) { if (substr($fl_timest[0], 2) != 10) { $new_fl_nm = substr_replace($fl_nm[2], "0" . substr($fl_timest[0], 2, 2), 2, count($fl_nm)); $new_fl_nm = $fl_nm[0] . "_" . $fl_nm[1] . "_" . $new_fl_nm; //echo $new_fl_nm;die; if (copy_file($fl, $dir, $files_to_rename)) { // copy file to be rename if (renameFile($fl, $new_fl_nm, $dir, $dir)) { // rename file echo "file '{$fl}' renamed to '{$new_fl_nm}'."; } else { echo "file '{$fl}' not renamed."; } } } } }
/** * Copy a directory with all its contents * * When a file whose filename ends '.log' is created, its permissions * are set to be world writable. * @param string $src_path Path to source directory * @param string $dst_path Path to destination directory * @return boolean true=>success, false=>failure. */ function copy_dir($src_path, $dst_path) { global $quiet; // Make sure we have directories as arguments if (!is_dir($src_path)) { echo $src_path . " is not a directory\n"; return false; } if (!is_dir($dst_path)) { echo $dst_path . " is not a directory\n"; return false; } // Open the source directory $src_handle = opendir($src_path); if (!$src_handle) { echo "unable to open {$src_path}\n"; return false; } // Copy contents of source directory while (false !== ($src_file = readdir($src_handle))) { if (!is_dir($src_path . $src_file)) { // If this file exists only to make the directory // non-empty so that PackageFileManager will add it to // the installable package, don't bother to copy it. if ($src_file == '.delete_this_file') { continue; } // This is a regular file, need to copy it if (file_exists($dst_path . $src_file)) { // A destination file or directory with this name exists if (is_file($dst_path . $src_file)) { // A regular destination file with this name exists. // Check whether it's different from source. $src_content = file_get_contents($src_path . $src_file); $dst_content = file_get_contents($dst_path . $src_file); if ($src_content == $dst_content) { // Source and destination are identical if (!$quiet) { echo "\texists {$dst_path}{$src_file}\n"; } continue; } } // New and old files differ. Save the old file. $stat = stat($dst_path . $src_file); $new_name = $dst_path . $src_file . '.' . $stat[9]; if (!rename($dst_path . $src_file, $new_name)) { echo "unable to rename {$dst_path}{$src_file} to {$new_name}\n"; return false; } if (!$quiet) { echo "\trenamed {$src_file} to " . ($src_file . '.' . $stat[9]) . "\n"; } } // Destination file does not exist. Create it if (!copy_file($src_path . $src_file, $dst_path . $src_file)) { return false; } // Log files need to be world writeable if (substr($src_file, -4, 4) == '.log') { chmod($dst_path . $src_file, 0666); } // Generator & Console needs to be executable if ($src_file == 'generate.php' || $src_file == 'console.php') { chmod($dst_path . $src_file, 0754); } if (!$quiet) { echo "\tcreate {$dst_path}{$src_file}\n"; } } else { // This is a directory. Ignore '.' and '..' if ($src_file == '.' || $src_file == '..') { continue; } // This directory needs to be copied. if (!create_dir($dst_path . $src_file)) { return false; } // Recursive call to copy directory if (!copy_dir($src_path . $src_file . DIRECTORY_SEPARATOR, $dst_path . $src_file . DIRECTORY_SEPARATOR)) { return false; } } } closedir($src_handle); return true; }
create_dir(path($app_path, 'static'), 0777, TRUE); create_dir(path($app_path, 'static', 'font'), 0777); create_dir(path($app_path, 'static', 'css'), 0777); create_dir(path($app_path, 'static', 'img'), 0777); create_dir(path($app_path, 'static', 'js'), 0777); create_dir(path($app_path, 'tasks'), 0777); create_dir(path($app_path, 'app', 'assets')); create_dir(path($app_path, 'app', 'assets', 'img')); create_dir(path($app_path, 'app', 'assets', 'font')); copy_file(path($app_path, 'app', 'assets', 'css'), path($skel_dir, 'config', 'app.css')); copy_file(path($app_path, 'app', 'assets', 'css', 'app'), path($skel_dir, 'styles', 'styles.css.less')); copy_file(path($app_path, 'app', 'assets', 'css'), path($skel_dir, 'styles', 'sauce.less')); copy_file(path($app_path, 'app', 'assets', 'css'), path($skel_dir, 'styles', 'media.less')); copy_file(path($app_path, 'app', 'assets', 'js'), path($skel_dir, 'config', 'app.js')); copy_file(path($app_path, 'app', 'assets', 'js', 'app'), path($skel_dir, 'scripts', 'script.js.coffee')); create_dir(path($app_path, 'app', 'assets', 'js', 'lib'), 0777, TRUE); create_dir(path($app_path, 'app', 'views')); copy_file(path($app_path, 'app', 'views', 'layouts'), path($skel_dir, 'views', 'raising.php.neddle')); copy_file(path($app_path, 'app', 'views', 'layouts'), path($skel_dir, 'views', 'default.php.neddle')); copy_file(path($app_path, 'app', 'views', 'home'), path($skel_dir, 'views', 'index.php.neddle')); create_file(path($app_path, 'bower.json'), template(path($skel_dir, 'bower.json'), $vars)); create_file(path($app_path, '.gitignore'), read(path($skel_dir, 'gitignore.txt')), 0777); copy_file($app_path, path($skel_dir, '.bowerrc')); copy_file($app_path, path($skel_dir, '.htaccess')); copy_file($app_path, path($skel_dir, 'composer.json')); copy_file($app_path, path($skel_dir, 'exclude.txt')); copy_file($app_path, path($skel_dir, 'deploy.sh')); copy_file($app_path, path($skel_dir, 'favicon.ico')); copy_file($app_path, path($skel_dir, 'config.php')); copy_file($app_path, path($skel_dir, 'index.php'));
function run_new_project($task, $args) { global $pathHome; global $projectName; //the class filename in the first argument $projectName = $args[0]; if (trim($projectName) == '') { printf("Error: %s\n", pakeColor::colorize("you must specify a valid name for the project", 'ERROR')); exit(0); } $createProject = strtolower(prompt("Do you want to create the project '{$projectName}' ? [Y/n]")); if ($createProject == 'n') { die; } G::LoadSystem('templatePower'); define('PATH_SHARED', PATH_SEP . 'shared' . PATH_SEP . $projectName . '_data' . PATH_SEP); $pathHome = PATH_TRUNK . $projectName; printf("creating project %s in %s\n", pakeColor::colorize($projectName, 'INFO'), pakeColor::colorize($pathHome, 'INFO')); define('G_ENVIRONMENT', G_DEV_ENV); require_once "propel/Propel.php"; //create project.conf for httpd conf //$dbFile = PATH_TRUNK . $projectName . PATH_SEP . 'shared' . PATH_SEP . 'sites'. PATH_SEP . 'dev'. PATH_SEP . 'db.php'; $dbFile = PATH_SEP . PATH_SHARED . 'sites' . PATH_SEP . $projectName . PATH_SEP . 'db.php'; $dbn = "db_" . $projectName; $dbrn = "rb_" . $projectName; $dbnpass = substr(G::GenerateUniqueId(), 0, 8); if (1 || !file_exists($dbFile)) { if (!defined('HASH_INSTALLATION')) { printf("%s\n", pakeColor::colorize('HASH INSTALLATION is invalid or does not exist. Please check the paths_installed.php file', 'ERROR')); exit(0); } $dbOpt = @explode(SYSTEM_HASH, G::decrypt(HASH_INSTALLATION, SYSTEM_HASH)); $connectionDatabase = mysql_connect($dbOpt[0], $dbOpt[1], $dbOpt[2]); if (!$connectionDatabase) { printf("%s\n", pakeColor::colorize('HASH INSTALLATION has invalid credentials. Please check the paths_installed.php file', 'ERROR')); exit(0); } printf("creating database %s \n", pakeColor::colorize($dbn, 'INFO')); $q = "CREATE DATABASE IF NOT EXISTS {$dbn} DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci"; $ac = @mysql_query($q, $connectionDatabase); if (!$ac) { printf("%s\n", pakeColor::colorize(mysql_error(), 'ERROR')); exit(0); } printf("creating database %s \n", pakeColor::colorize($dbrn, 'INFO')); $q = "CREATE DATABASE IF NOT EXISTS {$dbrn} DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci"; $ac = @mysql_query($q, $connectionDatabase); if (!$ac) { printf("%s\n", pakeColor::colorize(mysql_error(), 'ERROR')); exit(0); } $q = "GRANT ALL PRIVILEGES ON `{$dbn}`.* TO {$dbn}@'localhost' IDENTIFIED BY '{$dbnpass}' WITH GRANT OPTION"; $ac = @mysql_query($q, $connectionDatabase); if (!$ac) { printf("%s\n", pakeColor::colorize(mysql_error(), 'ERROR')); exit(0); } $q = "GRANT ALL PRIVILEGES ON `{$dbrn}`.* TO {$dbn}@'localhost' IDENTIFIED BY '{$dbnpass}' WITH GRANT OPTION"; $ac = @mysql_query($q, $connectionDatabase); if (!$ac) { printf("%s\n", pakeColor::colorize(mysql_error(), 'ERROR')); exit(0); } $rbSql = PATH_RBAC_MYSQL_DATA . 'schema.sql'; printf("executing %s \n", pakeColor::colorize($rbSql, 'INFO')); mysql_select_db($dbrn, $connectionDatabase); $qrs = query_sql_file($rbSql, $connectionDatabase); $q = "INSERT INTO `USERS` VALUES ('00000000000000000000000000000001','admin',md5('admin'),'Administrator','','*****@*****.**','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1);"; $ac = @mysql_query($q, $connectionDatabase); $q = "INSERT INTO `USERS` VALUES ('00000000000000000000000000000002','operator',md5('operator'),'Operator','','*****@*****.**','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1);"; $ac = @mysql_query($q, $connectionDatabase); //database wf_ db_ $dbInsertSql = PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'tasks' . PATH_SEP . 'templates' . PATH_SEP . 'db_insert.sql'; printf("executing %s \n", pakeColor::colorize($dbInsertSql, 'INFO')); mysql_select_db($dbn, $connectionDatabase); $qrs = query_sql_file($dbInsertSql, $connectionDatabase); G::mk_dir(PATH_SHARED . 'sites' . PATH_SEP); G::mk_dir(PATH_SHARED . 'sites' . PATH_SEP . $projectName); $dbFields['rootUser'] = $dbn; $dbFields['rootPass'] = $dbnpass; create_file_from_tpl('db.php', $dbFile, $dbFields); } global $G_ENVIRONMENTS; $G_ENVIRONMENTS['DEVELOPMENT']['dbfile'] = $dbFile; //print_r ( $G_ENVIRONMENTS ); Propel::init(PATH_CORE . "config/databases.php"); $configuration = Propel::getConfiguration(); $connectionDSN = $configuration['datasources']['workflow']['connection']; printf("using DSN Connection %s \n", pakeColor::colorize($connectionDSN, 'INFO')); $rbacProjectName = strtoupper($projectName); G::LoadSystem('rbac'); $RBAC = RBAC::getSingleton(); $RBAC->sSystem = $rbacProjectName; $RBAC->initRBAC(); $RBAC->createSystem($rbacProjectName); $RBAC->createPermision(substr($rbacProjectName, 0, 3) . '_LOGIN'); $RBAC->createPermision(substr($rbacProjectName, 0, 3) . '_ADMIN'); $RBAC->createPermision(substr($rbacProjectName, 0, 3) . '_OPERATOR'); $systemData = $RBAC->systemObj->LoadByCode($rbacProjectName); $roleData['ROL_UID'] = G::GenerateUniqueId(); $roleData['ROL_PARENT'] = ''; $roleData['ROL_SYSTEM'] = $systemData['SYS_UID']; $roleData['ROL_CODE'] = substr($rbacProjectName, 0, 3) . '_ADMIN'; $roleData['ROL_CREATE_DATE'] = date('Y-m-d H:i:s'); $roleData['ROL_UPDATE_DATE'] = date('Y-m-d H:i:s'); $roleData['ROL_STATUS'] = '1'; $RBAC->createRole($roleData); $roleData['ROL_UID'] = G::GenerateUniqueId(); $roleData['ROL_PARENT'] = ''; $roleData['ROL_SYSTEM'] = $systemData['SYS_UID']; $roleData['ROL_CODE'] = substr($rbacProjectName, 0, 3) . '_OPERATOR'; $roleData['ROL_CREATE_DATE'] = date('Y-m-d H:i:s'); $roleData['ROL_UPDATE_DATE'] = date('Y-m-d H:i:s'); $roleData['ROL_STATUS'] = '1'; $RBAC->createRole($roleData); $roleData = $RBAC->rolesObj->LoadByCode(substr($rbacProjectName, 0, 3) . '_ADMIN'); //Assign permissions to ADMIN $roleData = $RBAC->rolesObj->LoadByCode(substr($rbacProjectName, 0, 3) . '_ADMIN'); $permData = $RBAC->permissionsObj->LoadByCode(substr($rbacProjectName, 0, 3) . '_LOGIN'); $RBAC->assignPermissionToRole($roleData['ROL_UID'], $permData['PER_UID']); $permData = $RBAC->permissionsObj->LoadByCode(substr($rbacProjectName, 0, 3) . '_ADMIN'); $RBAC->assignPermissionToRole($roleData['ROL_UID'], $permData['PER_UID']); $userRoleData['ROL_UID'] = $roleData['ROL_UID']; $userRoleData['USR_UID'] = '00000000000000000000000000000001'; $RBAC->assignUserToRole($userRoleData); //Assign permissions to OPERATOR $roleData = $RBAC->rolesObj->LoadByCode(substr($rbacProjectName, 0, 3) . '_OPERATOR'); $permData = $RBAC->permissionsObj->LoadByCode(substr($rbacProjectName, 0, 3) . '_LOGIN'); $RBAC->assignPermissionToRole($roleData['ROL_UID'], $permData['PER_UID']); $permData = $RBAC->permissionsObj->LoadByCode(substr($rbacProjectName, 0, 3) . '_OPERATOR'); $RBAC->assignPermissionToRole($roleData['ROL_UID'], $permData['PER_UID']); $userRoleData['ROL_UID'] = $roleData['ROL_UID']; $userRoleData['USR_UID'] = '00000000000000000000000000000002'; $RBAC->assignUserToRole($userRoleData); //create folder and structure G::mk_dir($pathHome); G::mk_dir($pathHome . PATH_SEP . 'public_html'); G::mk_dir($pathHome . PATH_SEP . 'public_html' . PATH_SEP . 'images'); G::mk_dir($pathHome . PATH_SEP . 'public_html' . PATH_SEP . 'skins'); G::mk_dir($pathHome . PATH_SEP . 'public_html' . PATH_SEP . 'skins' . PATH_SEP . 'green'); G::mk_dir($pathHome . PATH_SEP . 'public_html' . PATH_SEP . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images'); G::mk_dir($pathHome . PATH_SEP . 'engine'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'classes'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'model'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'map'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'om'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'config'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'content'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'content' . PATH_SEP . 'languages'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'content' . PATH_SEP . 'translations'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'data'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'data' . PATH_SEP . 'mysql'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'js'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'js' . PATH_SEP . 'labels'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'menus'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'methods'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'methods' . PATH_SEP . 'login'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'methods' . PATH_SEP . 'users'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'skins'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'templates'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'test'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'test' . PATH_SEP . 'bootstrap'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'test' . PATH_SEP . 'fixtures'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'test' . PATH_SEP . 'unit'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'xmlform'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'login'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'gulliver'); G::mk_dir($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'users'); //create project.conf for httpd conf create_file_from_tpl('httpd.conf', $projectName . '.conf'); create_file_from_tpl('sysGeneric.php', 'public_html' . PATH_SEP . 'sysGeneric.php'); copy_file_from_tpl('bm.jpg', 'public_html' . PATH_SEP . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images' . PATH_SEP . 'bm.jpg'); copy_file_from_tpl('bsm.jpg', 'public_html' . PATH_SEP . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images' . PATH_SEP . 'bsm.jpg'); create_file_from_tpl('index.html', 'public_html' . PATH_SEP . 'index.html'); create_file_from_tpl('paths.php', 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php'); create_file_from_tpl('defines.php', 'engine' . PATH_SEP . 'config' . PATH_SEP . 'defines.php'); create_file_from_tpl('databases.php', 'engine' . PATH_SEP . 'config' . PATH_SEP . 'databases.php'); $fields['dbName'] = 'mysql'; create_file_from_tpl('propel.ini', 'engine' . PATH_SEP . 'config' . PATH_SEP . 'propel.ini', $fields); create_file_from_tpl('propel.ini', 'engine' . PATH_SEP . 'config' . PATH_SEP . 'propel.mysql.ini', $fields); if (file_exists($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'schema.xml')) { $createSchema = strtolower(prompt("schema.xml exists!. Do you want to overwrite the schema.xml file? [y/N]")); if ($createSchema == 'y') { create_file_from_tpl('schema.xml', 'engine' . PATH_SEP . 'config' . PATH_SEP . 'schema.xml'); } } else { create_file_from_tpl('schema.xml', 'engine' . PATH_SEP . 'config' . PATH_SEP . 'schema.xml'); } create_file_from_tpl('sysLogin.php', 'engine' . PATH_SEP . 'methods' . PATH_SEP . 'login' . PATH_SEP . 'sysLogin.php'); create_file_from_tpl('login.php', 'engine' . PATH_SEP . 'methods' . PATH_SEP . 'login' . PATH_SEP . 'login.php'); create_file_from_tpl('authentication.php', 'engine' . PATH_SEP . 'methods' . PATH_SEP . 'login' . PATH_SEP . 'authentication.php'); create_file_from_tpl('welcome.php', 'engine' . PATH_SEP . 'methods' . PATH_SEP . 'login' . PATH_SEP . 'welcome.php'); create_file_from_tpl('dbInfo.php', 'engine' . PATH_SEP . 'methods' . PATH_SEP . 'login' . PATH_SEP . 'dbInfo.php'); create_file_from_tpl('usersList.php', 'engine' . PATH_SEP . 'methods' . PATH_SEP . 'users' . PATH_SEP . 'usersList.php'); create_file_from_tpl('rolesList.php', 'engine' . PATH_SEP . 'methods' . PATH_SEP . 'users' . PATH_SEP . 'rolesList.php'); create_file_from_tpl('permissionsList.php', 'engine' . PATH_SEP . 'methods' . PATH_SEP . 'users' . PATH_SEP . 'permissionsList.php'); create_file_from_tpl('sysLogin.xml', 'engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'login' . PATH_SEP . 'sysLogin.xml'); create_file_from_tpl('login.xml', 'engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'login' . PATH_SEP . 'login.xml'); create_file_from_tpl('showMessage.xml', 'engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'login' . PATH_SEP . 'showMessage.xml'); create_file_from_tpl('welcome.xml', 'engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'login' . PATH_SEP . 'welcome.xml'); copy_file_from_tpl('xmlform.html', 'engine' . PATH_SEP . 'templates' . PATH_SEP . 'xmlform.html'); copy_file_from_tpl('publish.php', 'engine' . PATH_SEP . 'templates' . PATH_SEP . 'publish.php'); copy_file_from_tpl('publish-treeview.php', 'engine' . PATH_SEP . 'templates' . PATH_SEP . 'publish-treeview.php'); create_file_from_tpl('dbInfo.xml', 'engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'login' . PATH_SEP . 'dbInfo.xml'); create_file_from_tpl('usersList.xml', 'engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'users' . PATH_SEP . 'usersList.xml'); create_file_from_tpl('rolesList.xml', 'engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'users' . PATH_SEP . 'rolesList.xml'); create_file_from_tpl('permissionsList.xml', 'engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'users' . PATH_SEP . 'permissionsList.xml'); create_file_from_tpl('mainmenu.php', 'engine' . PATH_SEP . 'menus' . PATH_SEP . $projectName . '.php'); create_file_from_tpl('users.menu.php', 'engine' . PATH_SEP . 'menus' . PATH_SEP . 'users.php'); copy_file('public_html' . PATH_SEP . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'style.css'); copy_file('public_html' . PATH_SEP . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images' . PATH_SEP . 'bsms.jpg'); copy_file('public_html' . PATH_SEP . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images' . PATH_SEP . 'ftl.png'); copy_file('public_html' . PATH_SEP . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images' . PATH_SEP . 'ftr.png'); copy_file('public_html' . PATH_SEP . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images' . PATH_SEP . 'fbl.png'); copy_file('public_html' . PATH_SEP . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images' . PATH_SEP . 'fbr.png'); copy_file('public_html' . PATH_SEP . 'skins' . PATH_SEP . 'green' . PATH_SEP . 'images' . PATH_SEP . 'fbc.png'); copy_file('public_html' . PATH_SEP . 'images' . PATH_SEP . 'favicon.ico'); copy_file('public_html' . PATH_SEP . 'images' . PATH_SEP . 'bulletButton.gif'); copy_file('public_html' . PATH_SEP . 'images' . PATH_SEP . 'bulletSubMenu.jpg'); copy_file('public_html' . PATH_SEP . 'images' . PATH_SEP . 'users.png'); copy_file('public_html' . PATH_SEP . 'images' . PATH_SEP . 'trigger.gif'); copy_file('engine' . PATH_SEP . 'skins' . PATH_SEP . 'green.html'); copy_file('engine' . PATH_SEP . 'skins' . PATH_SEP . 'green.php'); copy_file('engine' . PATH_SEP . 'skins' . PATH_SEP . 'blank.html'); copy_file('engine' . PATH_SEP . 'skins' . PATH_SEP . 'blank.php'); copy_file('engine' . PATH_SEP . 'skins' . PATH_SEP . 'raw.html'); copy_file('engine' . PATH_SEP . 'skins' . PATH_SEP . 'raw.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.ArrayPeer.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.BasePeer.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.configuration.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.plugin.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.pluginRegistry.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.popupMenu.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.propelTable.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'Application.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'ApplicationPeer.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'Content.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'ContentPeer.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'Configuration.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'ConfigurationPeer.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'om' . PATH_SEP . 'BaseApplication.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'om' . PATH_SEP . 'BaseApplicationPeer.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'om' . PATH_SEP . 'BaseContent.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'om' . PATH_SEP . 'BaseContentPeer.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'om' . PATH_SEP . 'BaseConfiguration.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'om' . PATH_SEP . 'BaseConfigurationPeer.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'map' . PATH_SEP . 'ApplicationMapBuilder.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'map' . PATH_SEP . 'ContentMapBuilder.php'); copy_file('engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'map' . PATH_SEP . 'ConfigurationMapBuilder.php'); copy_file('engine' . PATH_SEP . 'config' . PATH_SEP . 'environments.php'); copy_file('engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'login' . PATH_SEP . 'login.xml'); copy_file('engine' . PATH_SEP . 'xmlform' . PATH_SEP . 'gulliver' . PATH_SEP . 'pagedTable_PopupMenu.xml'); copy_file('engine' . PATH_SEP . 'templates' . PATH_SEP . 'popupMenu.html'); copy_file('engine' . PATH_SEP . 'templates' . PATH_SEP . 'paged-table.html'); copy_file('engine' . PATH_SEP . 'templates' . PATH_SEP . 'xmlmenu.html'); copy_file('engine' . PATH_SEP . 'templates' . PATH_SEP . 'filterform.html'); copy_file('engine' . PATH_SEP . 'templates' . PATH_SEP . 'tree.html'); copy_file('engine' . PATH_SEP . 'templates' . PATH_SEP . 'dummyTemplate.html'); $filePng = $pathHome . PATH_SEP . 'public_html' . PATH_SEP . 'images' . PATH_SEP . 'processmaker.logo.jpg'; createPngLogo($filePng, $projectName); if (!PHP_OS == "WINNT") { printf("creating symlinks %s \n", pakeColor::colorize($pathHome . PATH_SEP . 'engine' . PATH_SEP . 'gulliver', 'INFO')); symlink(PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'gulliver', $pathHome . PATH_SEP . 'engine' . PATH_SEP . 'gulliver'); } //create schema.xml with empty databases exit(0); }
function main_upgrade($oldversion = 0) { global $CFG, $db; $tables = $db->Metatables(); $textlib = textlib_get_instance(); $result = true; if ($oldversion < 0) { modify_database('', "CREATE TABLE `{$CFG->prefix}datalists` (\r\n `ident` int(10) unsigned NOT NULL auto_increment,\r\n `name` varchar(32) NOT NULL default '',\r\n `value` text NOT NULL,\r\n PRIMARY KEY (`ident`),\r\n KEY `name` (`name`)\r\n ) TYPE=MyISAM;"); } if ($oldversion < 2008032844) { // added folio (wiki) functions /* --------------------------------------------------------------- Page Currently not using formatpage_ident column. Built in now to support templating. --------------------------------------------------------------- */ execute_sql("CREATE TABLE `{$CFG->prefix}folio_page` (\n\t\t\t\t\t `page_ident` int(11) NOT NULL default '0',\n\t\t\t\t\t `user_ident` int(11) NOT NULL default '0',\n\t\t\t\t\t `created` int(11) NOT NULL default '0',\n\t\t\t\t\t `creator_ident` int(11) default NULL,\n\t\t\t\t\t `title` varchar(255) NOT NULL default '',\n\t\t\t\t\t `newest` tinyint(1) NOT NULL default '0',\n\t\t\t\t\t `parentpage_ident` int(11) NOT NULL default '-1',\n\t\t\t\t\t `format_ident` int(11) NOT NULL default '0',\n\t\t\t\t\t `body` text NOT NULL,\n\t\t\t\t\t `security_ident` int(11) NOT NULL default '-1',\n\t\t\t\t\t PRIMARY KEY (`page_ident`,`created`),\n\t\t\t\t\t KEY `Index_user` (`user_ident`),\n\t\t\t\t\t KEY `Index_title` (`title`),\n\t\t\t\t\t KEY `Index_newest` (`newest`),\n\t\t\t\t\t KEY `Index_parent` (`parentpage_ident`)\n\t\t\t\t\t);"); /* --------------------------------------------------------------- Page Security There can be multiple security records for a single page. They differ only in that they have multiple user_ids. They should all have the same security levels. This lets us keep track of the different involved users. Currently 3 levels are implemented, public, moderated, and private. Public is wide open, everyone can read/write. Moderated is public readable, but only setable by owners. Private is readable and setable only by owners. Owners are defined as people who have a security record with their id. The interface doesn't currently handle inheriting. Will re-implement again at a later date. --------------------------------------------------------------- */ execute_sql("CREATE TABLE `{$CFG->prefix}folio_page_security` (\n\t\t\t\t\t `security_ident` int(11) NOT NULL default '0',\n\t\t\t\t\t `user_ident` int(11) NOT NULL default '0',\n\t\t\t\t\t `accesslevel` varchar(100) NOT NULL default 'member',\n\t\t\t\t\t PRIMARY KEY (`user_ident`,`security_ident`,`accesslevel`),\n\t\t\t\t\t KEY `Index_security` (`security_ident`)\n\t\t\t\t\t);"); /* --------------------------------------------------------------- Tree This contains nodes for navigating between objects. Probably needs some more indexes (along with the rest of the folio tables). Not currently being used. Will implement for the presentation module, and possibly the ability to import/link to other people's pages. --------------------------------------------------------------- */ execute_sql("CREATE TABLE `{$CFG->prefix}folio_tree` (\n\t\t\t\t\t `node_ident` int(10) unsigned NOT NULL auto_increment,\n\t\t\t\t\t `alink_type` varchar(45) NOT NULL default '',\n\t\t\t\t\t `alink_ident` int(10) unsigned NOT NULL default '0',\n\t\t\t\t\t `blink_type` varchar(45) NOT NULL default '',\n\t\t\t\t\t `blink_ident` int(10) unsigned NOT NULL default '0',\n\t\t\t\t\t `blink_caption` varchar(45) NOT NULL default '',\n\t\t\t\t\t PRIMARY KEY (`node_ident`),\n\t\t\t\t\t KEY `a_link` (`alink_ident`),\n\t\t\t\t\t KEY `b_link` (`blink_ident`)\n\t\t\t\t\t);"); /* --------------------------------------------------------------- Folio Comments. Comments on different items inside of the add-in. --------------------------------------------------------------- */ execute_sql("CREATE TABLE `{$CFG->prefix}folio_comment` (\n\t\t\t\t\t `activity_ident` int(11) NOT NULL auto_increment,\n\t\t\t\t\t `item_type` varchar(100) NOT NULL default '',\n\t\t\t\t\t `item_ident` int(11) NOT NULL default '0',\n\t\t\t\t\t `item_title` varchar(254) NOT NULL default '',\n\t\t\t\t\t `item_owner_username` varchar(254) NOT NULL default '',\n\t\t\t\t\t `item_owner_name` varchar(254) NOT NULL default '',\n\t\t\t\t\t `creator_username` varchar(254) NOT NULL default '',\n\t\t\t\t\t `creator_ident` int(11) NOT NULL default '0',\n\t\t\t\t\t `creator_name` varchar(254) NOT NULL default '',\n\t\t\t\t\t `body` text NOT NULL,\n\t\t\t\t\t `access` varchar(100) NOT NULL default '',\n\t\t\t\t\t `posted` int(11) NOT NULL default '0',\n\t\t\t\t\t `item_owner_ident` int(10) unsigned NOT NULL default '0',\n\t\t\t\t\t PRIMARY KEY (`activity_ident`),\n\t\t\t\t\t KEY `Index_type` (`item_type`),\n\t\t\t\t\t KEY `Index_ident` (`item_type`)\n\t\t\t\t\t);"); /* --------------------------------------------------------------- Folio RSS. Stores RSS feeds --------------------------------------------------------------- */ execute_sql("CREATE TABLE `{$CFG->prefix}folio_rss` (\n\t\t\t\t\t `type_ident` int(10) unsigned NOT NULL default '0',\n\t\t\t\t\t `type` varchar(45) NOT NULL default '',\n\t\t\t\t\t `user_ident` int(10) unsigned NOT NULL default '0',\n\t\t\t\t\t `user_username` varchar(45) NOT NULL default '',\n\t\t\t\t\t `user_name` varchar(255) NOT NULL default '',\n\t\t\t\t\t `owner_ident` int(10) unsigned NOT NULL default '0',\n\t\t\t\t\t `title` text NOT NULL,\n\t\t\t\t\t `body` text NOT NULL,\n\t\t\t\t\t `link` varchar(255) NOT NULL default '',\n\t\t\t\t\t `created` int(10) unsigned NOT NULL default '0',\n\t\t\t\t\t `owner_username` varchar(255) NOT NULL default '',\n\t\t\t\t\t `access` varchar(255) NOT NULL default 'PUBLIC',\n\t\t\t\t\t PRIMARY KEY (`type_ident`,`type`,`created`),\n\t\t\t\t\t KEY `Index_user` (`user_ident`),\n\t\t\t\t\t KEY `Index_owner` (`owner_ident`)\n\t\t\t\t\t);"); /* --------------------------------------------------------------- Tracks what version of the db we're working with. --------------------------------------------------------------- */ execute_sql("CREATE TABLE `{$CFG->prefix}folio_version` (\n\t\t\t\t\t `version` int(10) unsigned NOT NULL auto_increment,\n\t\t\t\t\t PRIMARY KEY (`version`)\n\t\t\t\t\t);"); // Update version to schema 5 $version = new StdClass(); $version->version = 5; insert_record("folio_version", $version); } if ($oldversion < 2006081003) { table_column('weblog_comments', '', 'access', 'varchar', '20', '', 'PUBLIC', 'NOT NULL', 'posted'); } if ($oldversion < 2006010600) { execute_sql("\r\n CREATE TABLE `{$CFG->prefix}weblog_watchlist` (\r\n `ident` int(11) NOT NULL auto_increment,\r\n `owner` int(11) NOT NULL default '0',\r\n `weblog_post` int(11) NOT NULL default '0',\r\n PRIMARY KEY (`ident`),\r\n KEY `owner` (`owner`,`weblog_post`)\r\n ) TYPE=MyISAM;", false); execute_sql("ALTER TABLE `{$CFG->prefix}friends` DROP INDEX `owner` ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}friends` ADD INDEX `owner` (`owner`) ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}friends` ADD INDEX `friend` (`friend`) ;", false); table_column('friends', '', 'status', 'varchar', '4', '', 'perm'); execute_sql("ALTER TABLE `{$CFG->prefix}friends` ADD INDEX `status` (`status`) ;", false); table_column('users', '', 'moderation', 'varchar', '4', '', 'no', 'NOT NULL', 'user_type'); execute_sql("ALTER TABLE `{$CFG->prefix}users` ADD INDEX `moderation` (`moderation`) ;", false); } if ($oldversion < 2006010601) { execute_sql("ALTER TABLE `{$CFG->prefix}file_folders` DROP INDEX `owner` ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}file_folders` ADD INDEX `files_owner` (`files_owner`) ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}file_folders` ADD INDEX `owner` (`owner`) ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}file_folders` ADD INDEX `access` (`access`) ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}file_folders` ADD INDEX `name` (`name`) ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}icons` DROP INDEX `owner` ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}icons` ADD INDEX `owner` (`owner`) ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}invitations` DROP INDEX `name` ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}invitations` ADD INDEX `code` (`code`) ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}invitations` ADD INDEX `email` (`email`) ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}invitations` ADD INDEX `added` (`added`) ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}tags` DROP INDEX `tag` ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}tags` DROP INDEX `tag_2` ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}tags` ADD INDEX `tagtype_ref` (`tagtype`,`ref`) ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}tags` ADD FULLTEXT INDEX `tag` (`tag`) ;", false); } if ($oldversion < 2006012600) { modify_database('', "CREATE TABLE `{$CFG->prefix}users_alias` (\r\n `ident` int(10) unsigned NOT NULL auto_increment,\r\n `installid` varchar(32) NOT NULL default '',\r\n `username` varchar(32) NOT NULL default '',\r\n `firstname` varchar(64) NOT NULL default '',\r\n `lastname` varchar(64) NOT NULL default '',\r\n `email` varchar(128) NOT NULL default '',\r\n `user_id` int(10) unsigned NOT NULL default 0,\r\n PRIMARY KEY (`ident`),\r\n KEY `username` (`username`),\r\n KEY `installid` (`installid`),\r\n KEY `user_id` (`user_id`)\r\n ) TYPE=MyISAM;"); } if ($oldversion < 2006021400) { modify_database('', "CREATE TABLE `{$CFG->prefix}files_incoming` (\r\n `ident` int(10) unsigned NOT NULL auto_increment,\r\n `installid` varchar(32) NOT NULL default '',\r\n `intentiondate` int(11) unsigned NOT NULL default 0,\r\n `size` bigint unsigned NOT NULL default 0,\r\n `foldername` varchar(128) NOT NULL default '',\r\n `user_id` int(10) unsigned NOT NULL default 0,\r\n PRIMARY KEY (`ident`),\r\n KEY `user_id` (`user_id`)\r\n ) TYPE=MyISAM;"); } if ($oldversion < 2006022000) { if (!in_array($CFG->prefix . 'feed_posts', $tables)) { modify_database('', "CREATE TABLE {$CFG->prefix}feed_posts (\r\n ident int(11) NOT NULL auto_increment,\r\n posted varchar(64) NOT NULL default '0',\r\n added int(11) NOT NULL default '0',\r\n feed int(11) NOT NULL default '0',\r\n title text NOT NULL,\r\n body text NOT NULL,\r\n url varchar(128) NOT NULL default '',\r\n PRIMARY KEY (ident),\r\n KEY url (url),\r\n KEY feed (feed),\r\n KEY posted (posted,added)\r\n ) ;"); } if (!in_array($CFG->prefix . 'feed_subscriptions', $tables)) { modify_database('', "CREATE TABLE {$CFG->prefix}feed_subscriptions (\r\n ident int(10) unsigned NOT NULL auto_increment,\r\n user_id int(10) unsigned NOT NULL default '0',\r\n feed_id int(10) unsigned NOT NULL default '0',\r\n autopost enum('yes','no') NOT NULL default 'no',\r\n autopost_tag varchar(128) NOT NULL default '',\r\n PRIMARY KEY (ident),\r\n KEY feed_id (feed_id),\r\n KEY user_id (user_id),\r\n KEY autopost (autopost)\r\n ) ;"); } if (!in_array($CFG->prefix . 'feeds', $tables)) { modify_database('', "CREATE TABLE {$CFG->prefix}feeds (\r\n ident int(10) unsigned NOT NULL auto_increment,\r\n url varchar(128) NOT NULL default '',\r\n feedtype varchar(16) NOT NULL default '',\r\n `name` text NOT NULL,\r\n tagline varchar(128) NOT NULL default '',\r\n siteurl varchar(128) NOT NULL default '',\r\n last_updated int(11) NOT NULL default '0',\r\n PRIMARY KEY (ident),\r\n KEY url (url,feedtype),\r\n KEY last_updates (last_updated),\r\n KEY siteurl (siteurl),\r\n KEY tagline (tagline)\r\n ) ;"); } } if ($oldversion < 2006022100) { if (!in_array($CFG->prefix . 'friends_requests', $tables)) { modify_database('', "CREATE TABLE `{$CFG->prefix}friends_requests` (\r\n `ident` INT UNSIGNED NOT NULL AUTO_INCREMENT ,\r\n `owner` INT NOT NULL ,\r\n `friend` INT NOT NULL ,\r\n PRIMARY KEY ( `ident` ) ,\r\n INDEX ( `owner` )\r\n ) ;"); } } if ($oldversion < 2006022200) { if (!($connections = get_record('templates', 'name', 'Connections'))) { $connections = new StdClass(); $connections->name = 'Connections'; $connections->owner = 1; $connections->public = 'yes'; $connections->ident = insert_record('templates', $connections); } if (!($northern = get_record('templates', 'name', 'Northern'))) { $northern = new StdClass(); $northern->name = 'Northern'; $northern->owner = 1; $northern->public = 'yes'; $northern->ident = insert_record('templates', $northern); } if (!($gc = get_record('templates', 'name', 'Gentle Calm'))) { $gc = new StdClass(); $gc->name = 'Northern'; $gc->owner = 1; $gc->public = 'yes'; $gc->ident = insert_record('templates', $gc); } if (!record_exists('template_elements', 'name', 'pageshell', 'template_id', $gc->ident)) { modify_database('', "INSERT INTO `{$CFG->prefix}template_elements` (name,content,template_id) VALUES ('pageshell', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>{{title}}</title>\r\n{{metatags}}\r\n</head>\r\n<body>\r\n<!-- elgg banner and logo -->\r\n<div id=\"container\"><!-- start container -->\r\n <div id=\"statusbar\"><!-- start statusbar -->\r\n <div id=\"welcome\"><!-- start welcome -->\r\n <p>Welcome {{userfullname}}</p>\r\n </div><!-- end welcome -->\r\n {{topmenu}}\r\n </div><!-- end statusbar -->\r\n <div id=\"header\"><!-- start header -->\r\n <h1>Elgg</h1>\r\n <h2>Community learning space</h2>\r\n <ul id=\"navigation\">\r\n {{menu}}\r\n </ul>\r\n </div><!-- end header -->\r\n <div id=\"content_holder\"><!-- start contentholder -->\r\n <div id=\"maincontent_container\"><!-- start main content -->\r\n {{messageshell}}\r\n {{mainbody}}\r\n </div><!-- end main content -->\r\n <div id=\"sidebar_container\">\r\n <div id=\"sidebar\"><!-- start sidebar -->\r\n <ul><!-- open sidebar lists -->\r\n {{sidebar}}\r\n </ul>\r\n </div><!-- end sidebar -->\r\n </div><!-- end sidebar_container -->\r\n </div><!-- end contentholder -->\r\n <div class=\"clearall\" />\r\n <div id=\"footer\"><!-- start footer -->\r\n Using the <a href=\"http://www.ifelse.co.uk/gentle-calm\">Gentle Calm theme</a> designed by <a href=\"http://www.ifelse.co.uk\">Phu Ly</a>.<br />\r\n <a href=\"http://elgg.net\"><img src=\"http://development.apcala.com/_templates/elgg_powered.png\" alt=\"Powered by Elgg\" title=\"Powered by Elgg\" border=\"0\" /></a>\r\n </div><!-- end footer -->\r\n</div><!-- end container -->\r\n</body>\r\n</html>', {$gc->ident});"); } if (!record_exists('template_elements', 'name', 'css', 'template_id', $connections->ident)) { modify_database('', "INSERT INTO `{$CFG->prefix}template_elements` (name,content,template_id) VALUES ( 'css', '/* \r\nTheme Name: Connections\r\nTheme URI: http://wpthemes.info\r\nVersion: 1.0\r\nDescription: A Theme from wpthemes.Info\r\nAuthor: Patricia Muller\r\nAuthor URI: http://www.vanillamist.com/blog/\r\n*/\r\nbody {\r\n margin:0;\r\n padding:0;\r\n font-family: ''Trebuchet MS'',Georgia, Times, Times New Roman, sans-serif;\r\n font-size: 80%;\r\n text-align:center;\r\n color:#29303B;\r\n line-height:1.3em;\r\n background: #F3F6ED;\r\n}\r\na {\r\n color: #909D73; \r\n text-decoration:none;\r\n font-size:100%;\r\n}\r\na:visited {\r\n color: #8a3207;\r\n}\r\na:hover {\r\n color: #753206;\r\n text-decoration:underline;\r\n}\r\n\r\nh1 {\r\n margin:0px 0px 15px 0px;\r\n padding:0px;\r\n font-size:120%;\r\n font-weight:900;\r\n}\r\n\r\n\r\nh2, h3, h4, h5 {\r\n margin:0px 0px 5px 0px;\r\n padding:0px;\r\n font-size:100%\r\n}\r\n\r\nblockquote {\r\n /*margin: 15px 30px 0 45px;*/\r\n padding: 0 0 0 45px;\r\n background: url(''/_templates/connections/blockquote.gif'') no-repeat left top;\r\n font-style:italic;\r\n}\r\n\r\n\r\nh3 {\r\n margin: 0;\r\n padding: 0;\r\n font-size:1.3em;\r\n}\r\np {\r\n margin: 0 0 1em;\r\n padding: 0;\r\n line-height: 1.5em;\r\n}\r\nh1, h2, h3, h4 {\r\n font-family: Georgia, \"Lucida Sans Unicode\", lucida, Verdana, sans-serif;\r\n font-weight: normal;\r\n letter-spacing: 1px;\r\n}\r\n\r\ninput, textarea \r\n{\r\n background: #F3F6ED;\r\n border: #E1D6C6 1px solid;\r\n}\r\n\r\n#container \r\n{\r\n background:#fff url(''/_templates/connections/rap.jpg'') center repeat-y;\r\n width:760px;\r\n margin:0 auto;\r\n padding:0px 8px;\r\n text-align:left;\r\n font-family: Trebuchet MS,Georgia, Arial, serif;\r\n}\r\n\r\n/*-----------------------------------------\r\nTOP STATUS BAR \r\n-------------------------------------------*/\r\n#header {\r\n background:#fff url(''/_templates/connections/top.jpg'') no-repeat bottom; \r\n height: 183px;\r\n margin: 0 auto;\r\n width:760px;\r\n padding:0;\r\n border:#fc9 0px solid;\r\n}\r\n\r\n#welcome {\r\n float: left;\r\n}\r\n\r\n#welcome p{\r\n font-weight:bold;\r\n font-size:110%;\r\n padding:0 0 0 4px;\r\n margin:0px;\r\n}\r\n\r\n#global_menuoptions {\r\n text-align: right;\r\n padding:0 5px 0 0;\r\n margin:0px;\r\n float:right;\r\n}\r\n\r\n#global_menuoptions ul {\r\n margin: 0; \r\n padding: 0;\r\n}\r\n\r\n#global_menuoptions li {\r\n margin: 0; \r\n padding: 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n\r\n#global_menuoptions a {\r\n text-decoration: none;\r\n font-size:80%;\r\n}\r\n\r\n#global_menuoptions a:hover{\r\n text-decoration:underline;\r\n}\r\n\r\n \r\n/*-------------------------------------------------\r\nnavigation\r\n-------------------------------------------------*/\r\n\r\n#navigation {\r\n height: 21px;\r\n margin: 0;\r\n padding-left: 20px;\r\n text-align:left;\r\n padding-top:155px;\r\n}\r\n\r\n#navigation li {\r\n margin: 0; \r\n padding: 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n \r\n#navigation a:link, #navigation a:visited {\r\n\r\n background: #524B21; /*#9BBB38;*/\r\n font-size:85%;\r\n font-weight: normal;\r\n padding: 4px 6px;\r\n margin: 0 2px 0 0;\r\n border: 0px solid #036;\r\n border-bottom: #9BBB38;\r\n text-decoration: none;\r\n color: #fff;\r\n}\r\n\r\n#navigation a:link.current, #navigation a:visited.current {\r\n border-bottom: 0px solid #9BBB38;\r\n background: #F5F5E7;\r\n color: #9BBB38;\r\n font-weight: bold;\r\n}\r\n\r\n#navigation a:hover {\r\n color: #fff;\r\n background: #000;\r\n}\r\n#navigation li a:hover{\r\n background:#000;\r\n }\r\n\r\n#content_holder \r\n{\r\n margin:0 auto;\r\n padding:0;\r\n background:#000 url(''/_templates/connections/content_bg.gif'') repeat;\r\n width:740px;\r\n}\r\n#maincontent_container {\r\n width:510px;\r\n float:left;\r\n padding:5px;\r\n margin:0;\r\n overflow:hidden;\r\n display:inline;\r\n}\r\n\r\n/*-----------------------------------------------------------------------\r\nDIV''s to help control look and feel - infoholder holds all the profile data\r\nand is always located in within ''maincontentdisplay''\r\n\r\n-------------------------------------------------------------------------*/\r\n\r\n/*------ holds profile data -------*/\r\n.infoholder {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.infoholder p {\r\n padding:0 0 0 5px;\r\n}\r\n\r\n.infoholder .fieldname h2 {\r\n border:0;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n padding:5px;\r\n color:#666;\r\n background:#fff;\r\n} \r\n\r\n.infoholder_twocolumn {\r\n padding:4px;\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 10px 0;\r\n }\r\n\r\n.infoholder_twocolumn .fieldname h3{\r\n color:#666;\r\n background:#fff;\r\n border:0px;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n}\r\n\r\n/*----------- holds administration data---------*/\r\n\r\n.admin_datatable {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.admin_datatable p {\r\n padding:0px;\r\n margin:0px;\r\n}\r\n\r\n.admin_datatable a {\r\n \r\n}\r\n\r\n\r\n.admin_datatable td {\r\n text-align:left;\r\n}\r\n\r\n.admin_datatable h3{\r\n color:#666;\r\n background:#fff;\r\n font-size:85%;\r\n}\r\n\r\n.admin_datatable h5 {\r\n padding:0px;\r\n margin:0px;\r\n}\r\n\r\n/*---- header plus one row of content ------*/\r\n\r\n.databox_vertical {\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n padding:5px;\r\n }\r\n\r\n .databox_vertical p{\r\n padding:0px;\r\n margin:0px;\r\n }\r\n\r\n.databox_vertical .fieldname h3 {\r\n padding:0px;\r\n margin:0px;\r\n font-size:90%;\r\n}\r\n\r\n/*------- holds file content ----*/\r\n\r\n.filetable {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n width:100%;\r\n }\r\n\r\n .filetable p{\r\n padding:0px;\r\n margin:0px;\r\n color:#000; /*#1181AA;*/\r\n background:#fff;\r\n }\r\n\r\n.filetable a{\r\n \r\n }\r\n\r\n\r\n.filetable table {\r\n text-align:left;\r\n}\r\n\r\n#edit_files h4 {\r\n \r\n}\r\n \r\n\r\n/*------- holds fodler content ------*/\r\n\r\n.foldertable {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n width:100%;\r\n }\r\n\r\n.foldertable a{\r\n \r\n }\r\n\r\n .foldertable p{\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n }\r\n\r\n.foldertable table {\r\n text-align:left;\r\n}\r\n\r\n/*------- holds network data ------*/\r\n\r\n.networktable {\r\n \r\n}\r\n\r\n#sidebar {\r\n width:186px;\r\n float:right;\r\n padding:0px 8px 10px 8px;\r\n margin:0;\r\n font-size:1em;\r\n color:#333;\r\n display:inline;\r\n}\r\n\r\n\r\n#header h1 \r\n{\r\n margin: 0; \r\n font-size: 1.6em; \r\n padding:10px 20px 0 0;\r\n text-align:right; \r\n}\r\n#header h1 a \r\n{\r\n color:#B5C09D;\r\n text-decoration:none;\r\n}\r\n#header h1 a:hover \r\n{\r\n color:#F7F3ED;\r\n}\r\n\r\n#sidebar h2 {\r\n margin: 10px 0 0 0;\r\n padding:2px;\r\n font-size: 90%;\r\n color: #676E04;\r\n text-align:center;\r\n background:url(''/_templates/connections/sidenav_top.jpg'') no-repeat center;\r\n border:#ccc 0px solid;\r\n height:22px;\r\n font-weight:bold;\r\n}\r\n#sidebar ul {\r\n list-style-type: none;\r\n padding: 0px;\r\n margin: 0;\r\n}\r\n\r\n#sidebar ul li ul{\r\n list-style-type: none;\r\n padding: 0;\r\n margin: 0;\r\n font-size: 0.9em; \r\n padding-bottom:3em;\r\n background:#F3F6ED url(''/_templates/connections/sidenav_bottom.jpg'') no-repeat bottom;\r\n border:#E1D6c6 1px solid;\r\n border-top:#f3f6ed 1px solid;\r\n}\r\n\r\n#sidebar ul li ul li{\r\n margin: 0.1em 0 0 0;\r\n padding: 2px; \r\n}\r\n#sidebar li a {\r\n text-decoration: none;\r\n border:none;\r\n}\r\n#sidebar li a:link {\r\n color: #909D73; \r\n}\r\n#sidebar li a:visited {\r\n color: #999999; \r\n}\r\n#sidebar li a:hover, #sidebar li a:active {\r\n color: #990000;\r\n}\r\n\r\n/*-------------------------------------------\r\nSIDEBAR DISPLAY COMPONENTS \r\n----------------------------------------------*/\r\n\r\n#sidebar_user {\r\n}\r\n\r\n#recent_activity {\r\n}\r\n\r\n#community_owned {\r\n}\r\n\r\n#community_membership {\r\n}\r\n\r\n#sidebar_friends {\r\n}\r\n\r\n#search {\r\n}\r\n\r\n/*--- extra div''s when looking at someone else''s page ---*/\r\n\r\n#sidebar_weblog {\r\n}\r\n\r\n#sidebar_files {\r\n}\r\n\r\n#me {\r\n padding: 0 3px 3px 3px;\r\n min-height: 71px;\r\n font-size: 0.9em; \r\n padding-bottom:3em;\r\n background:#F3F6ED url(''/_templates/connections/sidenav_bottom.jpg'') no-repeat bottom;\r\n border:#E1D6c6 1px solid;\r\n border-top:#f3f6ed 1px solid;\r\n}\r\n\r\n#me a {\r\n \r\n }\r\n\r\n#me #icon {\r\n margin:3px 0 0 0;\r\n float: left; \r\n width: 70px;\r\n}\r\n\r\n#me #contents {\r\n margin: 0 0 0 75px;\r\n text-align: left;\r\n}\r\n\r\n#searchform {\r\n font-size: 0.9em; \r\n padding-bottom:1em;\r\n background:#F3F6ED;\r\n border:#E1D6c6 1px solid;\r\n border-top:#f3f6ed 1px solid;\r\n text-align:center;\r\n}\r\n\r\n#maincontent_holder ul {\r\n margin-left: 0;\r\n padding-left: 45px;\r\n list-style-type: none;\r\n}\r\n\r\n#maincontent_holder ul li {\r\n background: url(''img/bullet.gif'') no-repeat 0 7px;\r\n padding-left: 1.5em;\r\n}\r\n\r\n/*-------------------------------------------\r\n INDIVIDUAL BLOG POSTS \r\n -------------------------------------------*/\r\n\r\n\r\n.weblog_posts {\r\n}\r\n\r\n.user {\r\n float: left;\r\n margin: 4px;\r\n padding:0 0 5px 0;\r\n width: 105px;\r\n text-align: left;\r\n}\r\n\r\n.entry \r\n{\r\n font-size:0.85em;\r\n font-family: Verdana, Arial, Sans-Serif;\r\n margin:0 0 30px 0;\r\n padding:0;\r\n color:#333;\r\n}\r\n.entry a\r\n{\r\n color:#990000;\r\n}\r\n.entry a:hover \r\n{\r\n color:#000;\r\n}\r\n\r\n.weblog_title h3 {\r\n font-family:Georgia, Arial, Serif;\r\n font-size:1.3em;\r\n margin:0;\r\n font-weight:bold;\r\n text-decoration:none;\r\n color:#676E04;\r\n border:0px\r\n font-size:80%;\r\n margin: 3px 10px 5px 0;\r\n padding: 8px 3px;\r\n}\r\n\r\n/* .entry h3 {\r\n color:#676E04;\r\n font-family: Georgia,''Lucida sans ms'', Verdana, Arial, Helvetica, sans-serif;\r\n text-align: center;\r\n font-size:80%;\r\n font-weight: bold;\r\n margin: 3px 10px 5px 0;\r\n padding: 8px 3px;\r\n /*background: #E7EBDE;*/\r\n line-height:1em;\r\n border:0px;\r\n text-decoration:none;\r\n} */\r\n\r\n.post {\r\n padding:10px 0;\r\n margin:3px 0;\r\n border-top:#BBC4A3 1px solid; \r\n font-family: Georgia, Verdana, Arial, serif;\r\n font-size:100%;\r\n}\r\n\r\n.info\r\n{\r\n padding-top:20px;\r\n background:url(''/_templates/connections/divider.gif'') no-repeat center;\r\n}\r\n\r\n.weblog_dateheader {\r\n padding: 0px;\r\n margin: 0px;\r\n color: #333;\r\n background:#fff;\r\n font-weight: normal;\r\n font-size:90%;\r\n font-style: italic;\r\n line-height: 12px;\r\n border:0px;\r\n border-bottom: 1px solid #ccc;\r\n}\r\n\r\n#footer {\r\n margin:0 auto;\r\n padding: 7px 0;\r\n border-top:#BBC4A3 1px solid;\r\n clear: both;\r\n font-size: 0.8em;\r\n color: #999;\r\n text-align:center;\r\n width:740px;\r\n}\r\n#footer a {\r\nborder:none;\r\ncolor:#7A7636;\r\n}\r\n\r\n.comments {\r\n font-size:1em;\r\n font-weight:normal; \r\n}\r\n#comments\r\n{\r\n margin:0 0 0 40px;\r\n}\r\n#comments textarea {\r\n width: 80%;\r\n}\r\n#comments p {\r\n margin: 0 0 1em;\r\n}\r\n#comments,#respond {\r\n text-transform: uppercase;\r\n margin: 3em 0 1em 40px;\r\n color: #676E04;\r\n font: 0.9em verdana, helvetica, sans-serif;\r\n}\r\n#comments li \r\n{\r\n margin:5px 0;\r\n padding:10px 10px 20px 10px;\r\n background:#F3F6ED url(_template/connections/comments_bottom.jpg) repeat-x bottom;\r\n border:#E1D6C6 1px solid;\r\n}\r\n#comments .alt \r\n{\r\n\r\n}\r\n\r\n#global_menuoptions \r\n{\r\n list-style:none;\r\n font-size:0.9em;\r\n margin:0 auto; \r\n padding:12px 20px 0 0;\r\n text-align:right; \r\n font-family:Verdana, Arial, Sans-Serif;\r\n}\r\n#global_menuoptions li \r\n{\r\n list-style:none;\r\n display:inline;\r\n padding:0;\r\n margin:0;\r\n font-weight:bold;\r\n}\r\n\r\n#global_menuoptions li a:link, #global_menuoptions li a:visited\r\n{\r\n text-decoration:none; \r\n color:#BBC4A3;\r\n}\r\n#global_menuoptions li a:hover, #global_menuoptions li a:active\r\n{\r\n color:#F7F3ED; \r\n}\r\n\r\n/*-------------------------------------\r\n Input forms\r\n--------------------------------------*/\r\n\r\n.textarea{\r\n border: 1px solid #7F9DB9;\r\n color:#71717B;\r\n width: 95%;\r\n height:200px;\r\n padding:3px;\r\n -moz-border-radius: 3px;\r\n}\r\n\r\n.medium_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n.small_textarea {\r\n width:95%;\r\n}\r\n\r\n.keywords_textarea {\r\n width:95%;\r\n height:100px;\r\n}', {$connections->ident});"); } if (!record_exists('template_elements', 'name', 'css', 'template_id', $gc->ident)) { modify_database('', "INSERT INTO `{$CFG->prefix}template_elements` (name,content,template_id) VALUES ( 'css', '/*\r\n Theme Name: Gentle Calm\r\n Theme URI: http://ifelse.co.uk/gentlecalm\r\n Description: Liquid Serenity\r\n Version: 1.0\r\n Author: Phu Ly\r\n Author URI: http://ifelse.co.uk/\r\n*/\r\n\r\n/************************************************\r\n * Main structure *\r\n ************************************************/\r\nbody {\r\n margin:0px;\r\n padding:0px;\r\n text-align:center;\r\n font:11px \"Lucida Grande\", \"Lucida Sans Unicode\", Verdana, Helvetica, Arial, sans-serif;\r\n color: #474E44;\r\n background:#F3F4EC;\r\n}\r\n\r\n/*-------------------------------------------------\r\nSTATUS BAR\r\n-------------------------------------------------*/\r\n\r\n#statusbar {\r\n padding: 3px 10px 2px 0;\r\n margin: 0px;\r\n text-align: bottom;\r\n height:15px;\r\n}\r\n\r\n\r\n#welcome {\r\n float: left;\r\n}\r\n\r\n#welcome p{\r\n font-weight:bold;\r\n font-size:110%;\r\n padding:0 0 0 4px;\r\n margin:0px;\r\n}\r\n\r\n#global_menuoptions {\r\n text-align: right;\r\n padding:0 5px 0 0;\r\n margin:0px;\r\n float:right;\r\n}\r\n\r\n#global_menuoptions a:hover{\r\n text-decoration:underline;\r\n}\r\n\r\n#global_menuoptions ul {\r\n margin: 0; \r\n padding: 0;\r\n}\r\n\r\n#global_menuoptions li {\r\n margin: 0; \r\n padding: 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n\r\n#global_menuoptions a {\r\n text-decoration: none;\r\n}\r\n\r\n#global_menuoptions a:hover{\r\n text-decoration:underline;\r\n}\r\n\r\n#maincontent_container {\r\n width:72%;\r\n float:left;\r\n}\r\n#maincontent_container .col {\r\n padding-bottom: 0.5em;\r\n padding-left:2.5em;\r\n padding-right:8.5em;\r\n line-height:1.6em;\r\n}\r\n#sidebar {\r\n padding:0.5em;\r\n padding-top: 2em;\r\n clear:right;\r\n width:25%;\r\n right:0px;\r\n float:right;\r\n font-size:1em; \r\n}\r\n#content_holder { \r\n width:80%;\r\n text-align:left;\r\n margin-left: auto;\r\n display:block;\r\n margin-right: auto;\r\n padding-bottom:0;\r\n}\r\n\r\n#content_holder:after {\r\n content: \".\"; \r\n display: block; \r\n height: 0; \r\n clear: both; \r\n visibility: hidden;\r\n}\r\n#footer{\r\n border-top:1px solid #324031;\r\n border-bottom:1px solid #324031;\r\n color: #eee;\r\n background: #87a284;\r\n clear:both;\r\n padding: 0.8em;\r\n text-align:center;\r\n margin-left: auto;\r\n display:block;\r\n margin-right: auto;\r\n font-size: 0.9em;\r\n margin-top:5em;\r\n}\r\n#footer a{\r\n color: #fff;\r\n font-weight:bold;\r\n}\r\na{\r\n color: #3C657B;\r\n text-decoration: none;\r\n}\r\na:hover {\r\n text-decoration:underline;\r\n}\r\n/************************************************\r\n * Header *\r\n ************************************************/\r\n#header {\r\n padding: 0px; \r\n margin-top: 0.3em;\r\n padding-top:1em; \r\n padding-bottom:1em;\r\n margin-bottom:0px;\r\n border-bottom: 1px solid #bab1b1;\r\n background: #CCCFBC;\r\n text-align:right;\r\n padding-right:2em;\r\n padding-left:-.5em;\r\n}\r\n\r\n#header h1{\r\n padding:0px;\r\n margin: 0px;\r\n font-size: 1.6em;\r\n letter-spacing:0.2em;\r\n}\r\n#header h1 {\r\n color:#5B7B57;\r\n}\r\n#header h1 a:hover {\r\n text-decoration:none;\r\n color: #bb4444;\r\n \r\n}\r\n#header img {\r\n border:none;\r\n}\r\n#header h2 {\r\n margin-bottom:0.3em;\r\n font-size: 0.8em;\r\n text-transform:uppercase;\r\n color:#A37B45;\r\n}\r\n\r\n/*-------------------------------------------------\r\nnavigation\r\n-------------------------------------------------*/\r\n\r\n#navigation {\r\n height: 21px;\r\n margin: 0;\r\n padding: 0 0 0 20px;\r\n text-align:left;\r\n}\r\n\r\n#navigation li {\r\n margin: 0; \r\n padding: 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n \r\n#navigation a:link, #navigation a:visited {\r\n\r\n background: #524B21; /*#9BBB38;*/\r\n font-size:85%;\r\n font-weight: normal;\r\n padding: 4px 6px;\r\n margin: 0 2px 0 0;\r\n border: 0px solid #036;\r\n border-bottom: #9BBB38;\r\n text-decoration: none;\r\n color: #fff;\r\n}\r\n\r\n#navigation a:link.current, #navigation a:visited.current {\r\n border-bottom: 0px solid #9BBB38;\r\n background: #F5F5E7;\r\n color: #9BBB38;\r\n font-weight: bold;\r\n}\r\n\r\n#navigation a:hover {\r\n color: #fff;\r\n background: #000;\r\n}\r\n#navigation li a:hover{\r\n background:#000;\r\n }\r\n\r\n/************************************************\r\n * Content *\r\n ************************************************/\r\nh1, h2, h3, h4 {\r\n font-family:\"Century Gothic\", \"Lucida Grande\", \"Lucida Sans Unicode\", Verdana, Helvetica, Arial, sans-serif;\r\n}\r\nh1 {\r\n font-size:130%;\r\n padding:10px 0 0 0;\r\n }\r\nh3 {\r\n font-size:100%;\r\n }\r\n\r\nh4 {\r\n font-size:100%;\r\n }\r\n\r\nh2 {\r\n font-size: 1.2em;\r\n margin-bottom:0.5em;\r\n}\r\nh2.entrydate{\r\n margin-bottom:0.3em;\r\n font-size: 1.8em;\r\n font-weight:normal;\r\n color:#86942A;\r\n text-transform:uppercase;\r\n}\r\n.entrymeta{\r\n font-weight:bold;\r\n color:#99A879;\r\n}\r\nh3.entrytitle a{\r\n color: #507642;\r\n}\r\nh3.weblog_title{\r\n margin-top:0px;\r\n margin-bottom:0.1em;\r\n font-size: 1.8em;\r\n}\r\n\r\n.user {\r\n float: left;\r\n margin: 4px;\r\n padding:0 0 5px 0;\r\n width: 105px;\r\n text-align: left;\r\n}\r\n\r\n.post p {\r\n margin-top:0.8em;\r\n margin-bottom:1.6em;\r\n}\r\n.weblog_posts{\r\n padding-bottom: 2em;\r\n font-family:\"Trebuchet MS\",\"Lucida Grande\", \"Lucida Sans Unicode\", Verdana, Helvetica, Arial, sans-serif;\r\n}\r\n/************************************************\r\n * Navigation Sidebar *\r\n ************************************************/\r\nul {\r\n margin:0 0 1em 0;\r\n padding-left:0px;\r\n list-style-type:none;\r\n}\r\n/************************************************\r\n * Comments *\r\n ************************************************/\r\nh2#comments{\r\n text-align:center;\r\n border-top:1px solid #9ba1aa;\r\n background:#E2ECD5;\r\n padding:0.7em;\r\n border-bottom:1px solid #9ba1aa;\r\n margin-bottom:1em;\r\n margin-top:8em;\r\n}\r\nol#commentlist {\r\n margin-top:0px;\r\n padding: 0.5em;\r\n margin-left: 0px;\r\n color: #9b9b9b;\r\n list-style-type: none;\r\n font-size:0.9em;\r\n}\r\n#comments li p{\r\n padding: 0px;\r\n margin: 0px;\r\n}\r\n.commentname {\r\n float: left;\r\n margin: 0;\r\n padding: 0 0 0.2em 0;\r\n}\r\n.commentinfo{\r\n width: 20em;\r\n float: right;\r\n text-align: right;\r\n}\r\n.commenttext {\r\n clear: both;\r\n padding-top: 0px;\r\n margin-top: 0px;\r\n margin-bottom: 3em;\r\n border-top: 1px solid #ebebeb;\r\n line-height:1.2em;\r\n color: #5b5b5b;\r\n}\r\n#commentsformheader{\r\n padding-left:1.5em;\r\n font-size: 1.4em;\r\n}\r\n#commentsform{\r\n margin-top:none;\r\n text-align:center;\r\n border:1px solid #ddd;\r\n background:#ecefdf;\r\n padding:0em 1em;\r\n}\r\n#commentsform form{\r\n text-align:left;\r\n margin:0px;\r\n}\r\n#commentsform p{\r\n margin:0.5em;\r\n}\r\n#commentsform form textarea{\r\n width:100%;\r\n}\r\n/************************************************\r\n * Extra *\r\n ************************************************/\r\ncode{\r\n font-family: ''lucida console'', ''Courier New'', monospace;\r\n font-size: 0.8em;\r\n display:block;\r\n padding:0.5em;\r\n background-color: #E5EaE4;\r\n border: 1px solid #d2d8d1;\r\n}\r\ninput[type=\"text\"], textarea {\r\n padding:0.3em;\r\n border: 1px solid #CCCFBC;\r\n color: #656F5C;\r\n -moz-border-radius: 0.5em;\r\n}\r\ninput[type=\"submit\"]{\r\n padding:0.2em;\r\n font-size: 1.25em;\r\n border: 1px solid #CCCFBC;\r\n color: #353F2f;\r\n background: #fefff8;\r\n -moz-border-radius: 0.5em;\r\n}\r\nblockquote {\r\n border-left: 3px solid #686868;\r\n color: #888;\r\n padding-left: 0.8em;\r\n margin-left: 2.5em;\r\n}\r\na img {\r\n border:none;\r\n}\r\n.imgborder img{\r\n border: 1px solid #87a284;\r\n background:#CCCFBC;\r\n padding:0.3em;\r\n}\r\n.imgborder{\r\n text-align: center;\r\n}\r\n\r\n#system_message{ \r\n border:1px solid #5B7B57;\r\n background:#CCCFBC;\r\n margin:20px 0 0 0;\r\n}\r\n\r\n#system_message p{\r\n padding:0px;\r\n margin:2px;\r\n }\r\n\r\n /*-------------------------------------\r\n Input forms\r\n--------------------------------------*/\r\n\r\n.textarea{\r\n border: 1px solid #7F9DB9;\r\n color:#71717B;\r\n width: 95%;\r\n height:200px;\r\n padding:3px;\r\n -moz-border-radius: 3px;\r\n}\r\n\r\n.medium_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n.small_textarea {\r\n width:95%;\r\n}\r\n\r\n.keywords_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n/*-----------------------------------------------------------------------\r\nDIV''s to help control look and feel - infoholder holds all the profile data\r\nand is always located in within ''maincontentdisplay''\r\n\r\n-------------------------------------------------------------------------*/\r\n\r\n/*------ holds profile data -------*/\r\n.infoholder {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.infoholder p {\r\n padding:0 0 0 5px;\r\n}\r\n\r\n.infoholder .fieldname h2 {\r\n border:0;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n padding:5px;\r\n} \r\n\r\n.infoholder_twocolumn {\r\n padding:4px;\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 10px 0;\r\n }\r\n\r\n.infoholder_twocolumn .fieldname h3{\r\n border:0px;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n}', {$gc->ident});"); } if (!record_exists('template_elements', 'name', 'pageshell', 'template_id', $connections->ident)) { modify_database('', "INSERT INTO `{$CFG->prefix}template_elements` (name,content,template_id) VALUES ( 'pageshell', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>{{title}}</title>\r\n{{metatags}}\r\n</head>\r\n<body>\r\n <!-- elgg banner and logo -->\r\n<div id=\"container\"><!-- start container -->\r\n<div id=\"header\"><!-- start header -->\r\n {{topmenu}}\r\n <ul id=\"navigation\">\r\n {{menu}}\r\n </ul>\r\n</div><!-- end header -->\r\n<div id=\"content_holder\"><!-- start contentholder -->\r\n<div id=\"maincontent_container\"><!-- start main content -->\r\n {{messageshell}}\r\n {{mainbody}}\r\n</div><!-- end main content -->\r\n<div id=\"sidebar_container\">\r\n<div id=\"sidebar\"><!-- start sidebar -->\r\n <ul><!-- open sidebar lists -->\r\n {{sidebar}}\r\n </ul>\r\n</div><!-- end sidebar -->\r\n</div>\r\n</div><!-- end contentholder -->\r\n<div class=\"clearall\" />\r\n <div id=\"footer\"><!-- start footer -->\r\n <a href=\"http://elgg.net\"><img src=\"/_templates/elgg_powered.png\" border=\"0\"></a>\r\n </div><!-- end footer -->\r\n</div><!-- end container -->\r\n </body>\r\n </html>', {$connections->ident});"); } if (!record_exists('template_elements', 'name', 'css', 'template_id', $northern->ident)) { modify_database('', "INSERT INTO `{$CFG->prefix}template_elements` (name,content,template_id) VALUES ( 'css', '/*\r\nTheme Name: Northern-Web-Coders\r\nTheme URI: http://www.northern-web-coders.de/\r\nDescription: Northern-Web-Coders Theme\r\nVersion: 1.0\r\n\r\nAuthor: Kai Ackermann\r\n*/\r\n\r\nbody\r\n{\r\nbackground: #d8d8d3;\r\nfont-family: Lucida Grande, Verdana, sans-serif;\r\nmargin: 0;\r\npadding: 0;\r\nfont-size:80%;\r\ntext-align: center;\r\n}\r\n\r\na\r\n{\r\nfont-size:100%;\r\ncolor: #495865;\r\n}\r\n\r\na:hover\r\n{\r\ncolor: #6F6F6F;\r\n}\r\n\r\nh2, h3, h4, h5 {\r\n margin:0px 0px 5px 0px;\r\n padding:0px;\r\n font-size:100%\r\n}\r\n\r\n#container\r\n{\r\nbackground: #FFFFFF;\r\nmargin: 0 auto 0 auto;\r\nwidth: 769px;\r\ntext-align: left;\r\nborder: 2px solid #5F707A;\r\n}\r\n\r\n/*-----------------------------------------\r\nSTATUS BAR \r\n-------------------------------------------*/\r\n\r\n#statusbar {\r\n padding: 3px 5px 0 0;\r\n margin: 0px;\r\n height:16px;\r\n background:#eee;\r\n color: #333;\r\n font-size:80%;\r\n}\r\n\r\n#statusbar a {\r\n color: #666;\r\n background:#eee;\r\n}\r\n\r\n#welcome {\r\n float: left;\r\n}\r\n\r\n#welcome p{\r\n font-weight:bold;\r\n padding:0 0 0 4px;\r\n margin:0px;\r\n}\r\n\r\n#global_menuoptions {\r\n text-align: right;\r\n padding:0px;\r\n margin:0px;\r\n float:right;\r\n}\r\n\r\n#global_menuoptions ul {\r\n margin: 0; \r\n padding: 0;\r\n}\r\n\r\n#global_menuoptions li {\r\n margin: 0; \r\n padding: 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n\r\n#global_menuoptions a {\r\n text-decoration: none;\r\n}\r\n\r\n#global_menuoptions a:hover{\r\n text-decoration:underline;\r\n}\r\n\r\n/*--------------------------------------------\r\n Header\r\n -------------------------------------------*/\r\n\r\n#header\r\n{\r\nbackground: url(/_templates/northern/totems_2.jpg);\r\nwidth: 769px;\r\nheight: 200px;\r\nmargin: 0;\r\npadding: 0;\r\ntext-align: right;\r\n}\r\n\r\n#header h1 {\r\n padding:0 5px 0 5px;\r\n margin:0px;\r\n color:#fff;\r\n }\r\n\r\n#header h2 {\r\n padding:0 5px 0 5px;\r\n margin:0px;\r\n color:#fff;\r\n }\r\n\r\n/*--------------------------------------------\r\nNAVIGATION \r\n----------------------------------------------*/\r\n\r\n#navigation ul\r\n{\r\npadding: 0;\r\nmargin: 0;\r\nbackground: #5F707A;\r\nborder-top: 1px solid #DFDFDF;\r\nborder-bottom: 0px solid #DFDFDF;\r\nfloat: left;\r\nwidth: 769px;\r\nfont-family: arial, helvetica, sans-serif;\r\n}\r\n\r\n\r\n\r\n#navigation ul li { display: inline; }\r\n\r\n#navigation ul li a\r\n{\r\npadding: 10px 14px 11px 14px;\r\nbackground: #9C9D95;\r\ncolor: #ffffff;\r\ntext-decoration: none;\r\nfont-weight: bold;\r\nfloat: left;\r\nfont-size:85%;\r\nborder-right: 1px solid #FFFFFF;\r\n}\r\n\r\n#navigation ul li a:hover\r\n{\r\ncolor: #990000;\r\nbackground: #C9C0B0;\r\n}\r\n\r\n#navigation a:link.current, #navigation a:visited.current\r\n{\r\npadding: 10px 14px 11px 14px;\r\nbackground: #C9C0B0;\r\ncolor: #990000;\r\ntext-decoration: none;\r\nfont-weight: bold;\r\nfloat: left;\r\nborder-right: 1px solid #DFDFDF;\r\n}\r\n\r\n#navigation a:link.current, #navigation a:visited.current a:hover\r\n{\r\nbackground: #6F6F6F;\r\n}\r\n\r\n\r\n/*-------------------------------------------------\r\nHOLDS THE MAIN CONTENT E.G. BLOG, PROFILE ETC \r\n----------------------------------------------------*/\r\n\r\n#maincontent_container\r\n{\r\nposition: relative;\r\nleft: 20px;\r\nfloat: left;\r\npadding: 0;\r\nwidth: 68%;\r\ncolor: #495865;\r\nfont-size:85%;\r\n}\r\n\r\n/*#maincontent_container h2\r\n{\r\nborder-bottom: 1px solid #6F6F6F;\r\ncolor: #5F707A;\r\nmargin: 20px 0 5px 0;\r\npadding: 0 0 3px 3px;\r\ntext-align: right;\r\n}*/\r\n\r\n/*-------------------------------------------------------------\r\nTHIS DISPLAYS THE ACTUAL CONTENT WITHIN maincontent_container\r\n--------------------------------------------------------------*/\r\n\r\n#maincontent_display h1 {\r\n padding-bottom: 2px;\r\n border-bottom: 1px solid #666;\r\n margin: 10px 0 0 0;\r\n font-size:120%;\r\n color: #666;\r\n}\r\n\r\n#maincontent_display #sub_menu {\r\n font-family: verdana;\r\n padding: 2px 0 0 0;\r\n margin: 0 0 15px 0;\r\n font-weight: normal;\r\n color: #990000;\r\n}\r\n\r\n#maincontent_display #sub_menu a {\r\n font-weight:bold;\r\n margin:0px;\r\n padding:0px;\r\n color: #990000;\r\n}\r\n\r\n#maincontent_display #sub_menu a:hover {\r\n text-decoration: underline;\r\n}\r\n\r\n#maincontent_display #sub_menu p {\r\n margin:0px;\r\n padding:0px;\r\n}\r\n\r\n/*-----------------------------------------\r\n SIDEBAR\r\n ----------------------------------------*/\r\n\r\n#sidebar\r\n{\r\nclear: right;\r\nfloat: left;\r\nposition: relative;\r\ntop: 10px;\r\nleft: 50px;\r\nmargin: 0 0 10px 0;\r\nwidth: 30%;\r\nfont-size:90%;\r\n}\r\n\r\n#sidebar ul\r\n{\r\nlist-style-type: none;\r\nmargin: 10px 0;\r\npadding: 0;\r\n}\r\n\r\n#sidebar ul li\r\n{\r\ncolor: #5F5F5F;\r\nmargin: 0;\r\npadding: 0;\r\n}\r\n\r\n#sidebar ul li p\r\n{\r\nwidth: 190px;\r\nfont-weight: bold;\r\n}\r\n\r\n#sidebar ul li h2\r\n{\r\nborder-bottom: 1px solid;\r\nwidth: 190px;\r\nfont-weight: bold;\r\nmargin: 0;\r\npadding: 0;\r\n}\r\n\r\n#sidebar ul li ul\r\n{\r\n/*margin: 5px 0 15px 10px;*/\r\n}\r\n\r\n#sidebar ul li ul li\r\n{\r\nfont-weight: normal;\r\nmargin: 0 0 3px 0;\r\npadding: 0;\r\nline-height: 12px\r\n}\r\n\r\n#sidebar ul li#winamp ul li\r\n{\r\nwidth: 190px\r\n}\r\n\r\n#sidebar ul li ul li a\r\n{\r\ncolor: #5F5F5F;\r\ntext-decoration: none;\r\n}\r\n\r\n#sidebar ul li ul li a:hover\r\n{\r\nfont-weight: bold;\r\ntext-decoration: none\r\n}\r\n\r\n/*-------------------------------------------\r\nSIDEBAR DISPLAY COMPONENTS \r\n----------------------------------------------*/\r\n\r\n#sidebar_user {\r\n}\r\n\r\n#recent_activity {\r\n}\r\n\r\n#community_owned {\r\n}\r\n\r\n#community_membership {\r\n}\r\n\r\n#sidebar_friends {\r\n}\r\n\r\n#search {\r\n}\r\n\r\n#me {\r\n padding: 3px;\r\n margin:0;\r\n}\r\n\r\n#me p{\r\n font-weight:normal;\r\n font-weight: normal;\r\n margin:0;\r\n }\r\n\r\n#sidebar #sidebar_user p {\r\n padding:4px 0 0 0;\r\n font-weight: normal;\r\n }\r\n\r\n\r\n/*--- extra div''s when looking at someone else''s page ---*/\r\n\r\n#sidebar_weblog {\r\n}\r\n\r\n#sidebar_files {\r\n}\r\n\r\n#searchform\r\n{\r\nmargin: 2px 0 15px 0;\r\n}\r\n\r\n#searchform input\r\n{\r\nbackground: #FFFFFF;\r\nborder: 1px solid #6F6F6F;\r\nfont-size: 11px;\r\nmargin-top: 3px;\r\npadding: 2px;\r\n}\r\n\r\n/*--------------------------------------\r\n FOOTER\r\n --------------------------------------*/\r\n\r\n#footer\r\n{\r\ncolor: #FFFFFF;\r\nbackground: #5F707A;\r\nborder-top: 1px solid #DFDFDF;\r\nclear: both;\r\nmargin: 0 auto 0 auto;\r\npadding: 16px 0 17px 0;\r\ntext-align: center;\r\nwidth: 769px;\r\n}\r\n\r\n#footer a\r\n{\r\ncolor: #ffffff\r\n}\r\n\r\n/*-------------------------------------\r\n Blog classes\r\n ------------------------------------*/\r\n\r\n.weblog_posts {\r\n margin:0 0 30px 0;\r\n}\r\n\r\n.weblog_posts .entry h3 {\r\n color:#1181AA;\r\n background:#fff;\r\n padding: 0 0 10px 110px;\r\n}\r\n\r\n.user {\r\n float: left;\r\n margin: 0px;\r\n /* padding: 0.3em 2em 2em 0; */\r\n width: 105px;\r\n text-align: left;\r\n}\r\n\r\n.post {\r\n margin: 0 0 0 77px;\r\n padding:0 0 0 40px;\r\n font-family: arial;\r\n}\r\n\r\n.post p {\r\n padding: 0;\r\n margin: 3px 0 10px 0;\r\n line-height: 16px;\r\n}\r\n\r\n.post ol, .post ul {\r\n margin: 3px 0 10px 0;\r\n padding: 0;\r\n}\r\n\r\n.post li {\r\n margin: 0 0 0 30px;\r\n line-height: 16px;\r\n}\r\n\r\n.post ul li {\r\n list-style-type: square;\r\n}\r\n\r\n.post .blog_edit_functions p {\r\n \r\n}\r\n\r\n.post .blog_edit_functions a {\r\n \r\n}\r\n\r\n.post .weblog_keywords p {\r\n \r\n}\r\n\r\n.post .weblog_keywords a {\r\n \r\n}\r\n\r\n.info p {\r\n padding: 0px;\r\n margin: 0 0 5px 0;\r\n color: #666;\r\n background:#fff;\r\n font-family: verdana;\r\n font-weight: normal;\r\n line-height: 14px;\r\n text-align: left;\r\n}\r\n\r\n.info p a {\r\n color: #666;\r\n background:#fff;\r\n text-decoration: none;\r\n border-bottom: 1px dotted #666;\r\n padding-bottom: 0;\r\n}\r\n\r\n#comments ol, #comments ul {\r\n margin: 3px 0 10px 0;\r\n padding: 0;\r\n}\r\n\r\n#comments li {\r\n margin: 0 0 0 30px;\r\n line-height: 16px;\r\n}\r\n\r\n#comments ul li {\r\n list-style-type: square;\r\n}\r\n\r\n#comments h4 {\r\n color:#1181AA;\r\n}\r\n\r\n.weblog_dateheader {\r\n padding: 0px;\r\n margin: 0 0 5px 0;\r\n color: #333;\r\n background:#fff;\r\n font-weight: normal;\r\n font-style: italic;\r\n line-height: 12px;\r\n border:0px;\r\n border-bottom: 1px solid #ccc;\r\n}\r\n\r\n.clearing{clear:both;}\r\n\r\n.post p, post li\r\n{\r\nfont-family: Lucida Grande, Verdana, sans-serif;\r\nline-height: 130%;\r\n}\r\n\r\n.post blockquote\r\n{\r\nbackground: #fef7e9;\r\nborder: 1px solid #e6ddcb;\r\nborder-left: 2px solid #6F6F6F;\r\nfont-family: Georgia, Times New Roman, serif;\r\npadding: 4px 4px 4px 7px;\r\n}\r\n\r\n/*-------------------------------------\r\n Input forms\r\n--------------------------------------*/\r\n\r\n.textarea {\r\n border: 1px solid #7F9DB9;\r\n color:#71717B;\r\n width: 95%;\r\n height:200px;\r\n padding:3px;\r\n}\r\n\r\n.medium_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n.small_textarea {\r\n width:95%;\r\n}\r\n\r\n.keywords_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n/*----- System Messages ------*/\r\n\r\n#system_message { \r\n border:1px solid #D3322A;\r\n background:#F7DAD8;\r\n padding:3px 50px;\r\n margin:5px 0 0 0; \r\n}\r\n\r\n#system_message p{\r\n padding:0px;\r\n margin:2px;\r\n }\r\n\r\n/*-----------------------------------------------------------------------\r\nDIV''s to help control look and feel - infoholder holds all the profile data\r\nand is always located in within ''maincontentdisplay''\r\n\r\n-------------------------------------------------------------------------*/\r\n\r\n/*------ holds profile data -------*/\r\n.infoholder {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.infoholder p {\r\n padding:0 0 0 5px;\r\n}\r\n\r\n.infoholder .fieldname {\r\n /* border:0;\r\n margin:0;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n padding:5px;\r\n color:#666;\r\n background:#fff; */\r\ncolor: #5F707A;\r\nmargin: 0px 0 5px 0;\r\npadding: 0 0 0px 3px;\r\ntext-align: left;\r\nborder:0px;\r\n} \r\n\r\n.infoholder_twocolumn {\r\n padding:4px;\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 10px 0;\r\n }\r\n\r\n.infoholder_twocolumn .fieldname h3{\r\n color:#666;\r\n background:#fff;\r\n border:0px;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n}\r\n\r\n/*----------- holds administration data---------*/\r\n\r\n.admin_datatable {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.admin_datatable p {\r\n padding:0px;\r\n margin:0px;\r\n}\r\n\r\n.admin_datatable a {\r\n \r\n}\r\n\r\n\r\n.admin_datatable td {\r\n text-align:left;\r\n}\r\n\r\n.admin_datatable h3{\r\n color:#666;\r\n background:#fff;\r\n}\r\n\r\n.admin_datatable h4 {\r\n}\r\n\r\n/*---- header plus one row of content ------*/\r\n\r\n.databox_vertical {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n padding:5px;\r\n }\r\n\r\n .databox_vertical p{\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n }\r\n\r\n.databox_vertical .fieldname h3 {\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n}\r\n\r\n/*------- holds file content ----*/\r\n\r\n.filetable {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n width:100%;\r\n }\r\n\r\n .filetable p{\r\n padding:0px;\r\n margin:0px;\r\n color:#000; /*#1181AA;*/\r\n background:#fff;\r\n }\r\n\r\n.filetable a{\r\n \r\n }\r\n\r\n\r\n.filetable table {\r\n text-align:left;\r\n}\r\n\r\n#edit_files h4 {\r\n \r\n}\r\n \r\n\r\n/*------- holds fodler content ------*/\r\n\r\n.foldertable {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n width:100%;\r\n }\r\n\r\n.foldertable a{\r\n \r\n }\r\n\r\n .foldertable p{\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n }\r\n\r\n.foldertable table {\r\n text-align:left;\r\n}\r\n\r\n/*------- holds network data ------*/\r\n\r\n.networktable {\r\n \r\n}\r\n\r\n/*---------------------------------------------\r\n Your Resources\r\n-----------------------------------------------*/\r\n\r\n.feeds {\r\n border-bottom: 1px dotted #aaaaaa;\r\n background: transparent url(\"//_templates/sunflower.jpg\") bottom right no-repeat;\r\n}\r\n\r\n.feed_content a {\r\n color:black;\r\n border:0px;\r\n}\r\n\r\n.feed_content a:hover{\r\n background:#fff;\r\n }\r\n\r\n.feed_content img {\r\n border: 1px solid #666666;\r\n padding:5px;\r\n}\r\n\r\n.feed_content h3 {\r\n padding:0 0 4px 0;\r\n margin:0px;\r\n}\r\n\r\n.feed_content h3 a{\r\n color:black;\r\n border:0px;\r\n border-bottom:1px;\r\n border-style:dotted;\r\n border-color:grey;\r\n}\r\n\r\n.feed_content h3 a:hover{\r\n background:#FCD63F;\r\n color:#000;\r\n }\r\n\r\n.feed_date {\r\n line-height: 21px;\r\n font-weight: bold;\r\n padding: 5px 10px 4px 5px;\r\n margin:0 0 10px 0;\r\n background-color: #D0DEDF;\r\n color:#000;\r\n text-decoration:none;\r\n}\r\n\r\n.via a {\r\n color:#1181AA;\r\n background:#fff;\r\n border:0px;\r\n}\r\n\r\n.via a:hover {\r\n background:#ffc;\r\n color:#1181AA;\r\n}', {$northern->ident});"); } if (!record_exists('template_elements', 'name', 'pageshell', 'template_id', $northern->ident)) { modify_database('', "INSERT INTO `{$CFG->prefix}template_elements` (name,content,template_id) VALUES ( 'pageshell', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>{{title}}</title>\r\n{{metatags}}\r\n</head>\r\n<body>\r\n <!-- elgg banner and logo -->\r\n<div id=\"container\"><!-- start container -->\r\n<div id=\"statusbar\"><!-- start statusbar -->\r\n <div id=\"welcome\"><!-- start welcome -->\r\n <p>Welcome {{userfullname}}</p>\r\n </div><!-- end welcome -->\r\n {{topmenu}}\r\n</div><!-- end statusbar -->\r\n<div id=\"header\"><!-- start header -->\r\n <h1>Elgg</h1>\r\n <h2>Community learning space</h2>\r\n</div><!-- end header -->\r\n<div id=\"navigation\">\r\n <ul>\r\n {{menu}}\r\n </ul>\r\n</div>\r\n<div id=\"content_holder\"><!-- start contentholder -->\r\n<div id=\"maincontent_container\"><!-- start main content -->\r\n {{messageshell}}\r\n {{mainbody}}\r\n</div><!-- end main content -->\r\n<div id=\"sidebar_container\">\r\n<div id=\"sidebar\"><!-- start sidebar -->\r\n <ul><!-- open sidebar lists -->\r\n {{sidebar}}\r\n </ul>\r\n</div><!-- end sidebar -->\r\n</div>\r\n</div><!-- end contentholder -->\r\n<div class=\"clearall\" />\r\n <div id=\"footer\"><!-- start footer -->\r\n <a href=\"http://elgg.net\"><img src=\"/_templates/elgg_powered.png\" border=\"0\"></a>\r\n </div><!-- end footer -->\r\n</div><!-- end container -->\r\n </body>\r\n </html>', {$northern->ident});"); } } if ($oldversion < 2006022300) { // Display errors error_reporting(E_ERROR | E_WARNING | E_PARSE); // Set time limit to 60 minutes @set_time_limit(3600); // Publish RSS echo "<h2>" . gettext("Publishing RSS") . "</h2>"; if ($users = get_records('users')) { foreach ($users as $user) { $ident = $user->ident; echo "<p>" . sprintf(gettext("Publishing RSS for user %d"), $ident) . "</p>"; $rssresult = run("weblogs:rss:publish", array($ident, false)); $rssresult = run("files:rss:publish", array($ident, false)); $rssresult = run("profile:rss:publish", array($ident, false)); } } } if ($oldversion < 2006022301) { // This handles upgrades from _files/data to $CFG->dataroot too... // Alter file repository to remove path information echo "<h2>" . gettext("Adjusting file repository information") . "</h2>"; // Get all files with path in the location $tostrip = $CFG->dirroot . '_files/data/'; if ($files = get_records_select('files', 'location LIKE ?', array($tostrip . '%'))) { foreach ($files as $file) { $ident = $file->ident; $filename = str_replace($tostrip, "files/", $file->location); set_field('files', 'location', $filename, 'ident', $ident); echo "<p>" . sprintf(gettext("Updating file %d: %s"), $ident, $filename) . "</p>"; } } // Get all files that start with _files $tostrip = '_files/data/'; if ($files = get_records_select('files', 'location LIKE ?', array($tostrip . '%'))) { foreach ($files as $file) { $ident = $file->ident; $filename = str_replace($tostrip, "files/", $file->location); set_field('files', 'location', $filename, 'ident', $ident); echo "<p>" . sprintf(gettext("Updating file %d: %s"), $ident, $filename) . "</p>"; } } // copy the files across. if ($dir = opendir($CFG->dirroot . '_files/data/')) { while ($file = readdir($dir)) { if ($file == "." || $file == ".." || $file == '.htaccess') { continue; } copy_file($CFG->dirroot . "_files/data/{$file}", $CFG->dataroot . "files/{$file}"); } } // now the profile images.. this is harder. if ($icons = get_records_sql("SELECT i.*,u.username FROM {$CFG->prefix}icons i JOIN {$CFG->prefix}users u ON i.owner = u.ident")) { foreach ($icons as $icon) { $upload_folder = $textlib->substr($icon->username, 0, 1); $fromfile = $CFG->dirroot . '_icons/data/' . $icon->filename; $tofile = $CFG->dataroot . 'icons/' . $upload_folder . '/' . $icon->username . '/' . $icon->filename; echo "<p>" . sprintf(gettext("Moving icon file %s to %s"), $fromfile, $tofile) . "</p>"; if (!is_dir($CFG->dataroot . 'icons/' . $upload_folder)) { umask(00); $status = mkdir($CFG->dataroot . 'icons/' . $upload_folder, $CFG->directorypermissions); } if (!is_dir($CFG->dataroot . 'icons/' . $upload_folder . '/' . $icon->username)) { umask(00); $status = mkdir($CFG->dataroot . 'icons/' . $upload_folder . '/' . $icon->username, $CFG->directorypermissions); } copy_file($fromfile, $tofile); } } } if ($oldversion < 2006052100) { // add some missing indexes execute_sql("ALTER TABLE `{$CFG->prefix}tags` ADD INDEX `tagliteral` (`tag`(20)) ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}tags` ADD INDEX `access` (`access`(20)) ;", false); } if ($oldversion < 2006052200) { // homogenise access field, shortest one was vc16, longest vc255 execute_sql("ALTER TABLE `{$CFG->prefix}file_folders` CHANGE `access` `access` VARCHAR(20) NOT NULL DEFAULT 'PUBLIC' ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}files` CHANGE `access` `access` VARCHAR(20) NOT NULL DEFAULT 'PUBLIC' ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}groups` CHANGE `access` `access` VARCHAR(20) NOT NULL DEFAULT 'PUBLIC' ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}profile_data` CHANGE `access` `access` VARCHAR(20) NOT NULL DEFAULT 'PUBLIC' ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}tags` CHANGE `access` `access` VARCHAR(20) NOT NULL DEFAULT 'PUBLIC' ;", false); execute_sql("ALTER TABLE `{$CFG->prefix}weblog_posts` CHANGE `access` `access` VARCHAR(20) NOT NULL DEFAULT 'PUBLIC' ;", false); } if ($oldversion < 2006052300) { // shorten another keyword field execute_sql("ALTER TABLE `{$CFG->prefix}tags` CHANGE `tagtype` `tagtype` VARCHAR(20) NOT NULL DEFAULT '' ;", false); } if ($oldversion < 2006052400) { // purge owner=0 watchlist entries from watchlist-on-comment bug delete_records('weblog_watchlist', 'owner', 0); } if ($oldversion < 2006060600) { execute_sql("ALTER TABLE `{$CFG->prefix}feed_posts` ADD INDEX `added` (`added`) ;", false); } if ($oldversion < 2006061600) { modify_database('', "ALTER TABLE `{$CFG->prefix}feed_posts` DROP INDEX `url` ;"); table_column('feed_posts', 'url', 'url', 'varchar', 255, '', ''); } if ($oldversion < 2006061700) { modify_database('', "ALTER TABLE `{$CFG->prefix}weblog_watchlist` DROP INDEX `owner` ;"); modify_database('', "ALTER TABLE `{$CFG->prefix}weblog_watchlist` ADD INDEX (`owner`) ;"); modify_database('', "ALTER TABLE `{$CFG->prefix}weblog_watchlist` ADD INDEX (`weblog_post`) ;"); } if ($oldversion < 2006081000) { // Add old Elgg default template as Classic Elgg $template = new StdClass(); $template->name = "Classic Elgg"; $template->owner = 1; $template->public = "yes"; $template_id = insert_record('templates', $template); execute_sql("INSERT INTO `{$CFG->prefix}template_elements` (`name`,`content`,`template_id`) VALUES ('pageshell', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>{{title}}</title>\r\n{{metatags}}\r\n</head>\r\n<body>\r\n<!-- elgg banner and logo -->\r\n<div id=\"container\"><!-- start container -->\r\n <div id=\"statusbar\"><!-- start statusbar -->\r\n <div id=\"welcome\"><!-- start welcome -->\r\n <p>Welcome {{userfullname}}</p>\r\n </div><!-- end welcome -->\r\n {{topmenu}}\r\n </div><!-- end statusbar -->\r\n <div id=\"header\"><!-- start header -->\r\n <h1>{{sitename}}</h1>\r\n <h2>Personal Learning Landscape</h2>\r\n <ul id=\"navigation\">\r\n {{menu}}\r\n </ul>\r\n </div><!-- end header -->\r\n <div id=\"content_holder\"><!-- start contentholder -->\r\n <div id=\"maincontent_container\"><!-- start main content -->\r\n {{messageshell}}\r\n {{mainbody}}\r\n </div><!-- end main content -->\r\n <div id=\"sidebar_container\">\r\n <div id=\"sidebar\"><!-- start sidebar -->\r\n <ul><!-- open sidebar lists -->\r\n {{sidebar}}\r\n </ul>\r\n </div><!-- end sidebar -->\r\n </div><!-- end sidebar_container -->\r\n </div><!-- end contentholder -->\r\n <div class=\"clearall\" />\r\n <div id=\"footer\"><!-- start footer -->\r\n <a href=\"http://elgg.net/\"><img src=\"{{url}}_templates/elgg_powered.png\" alt=\"Powered by Elgg\" title=\"Powered by Elgg\" border=\"0\" /></a>\r\n </div><!-- end footer -->\r\n</div><!-- end container -->\r\n</body>\r\n</html>', {$template_id})"); execute_sql("INSERT INTO `{$CFG->prefix}template_elements` (`name`,`content`,`template_id`) VALUES ('css', '/*\r\n CSS for Elgg Classic default\r\n*/\r\n\r\nbody{\r\n padding: 0;\r\n font-family: arial, verdana, helvetica, sans-serif;\r\n color: #333;\r\n background: #eee;\r\n width:97%;\r\n margin:auto;\r\n font-size:80%;\r\n }\r\n\r\na {\r\n text-decoration: none;\r\n color: #7289AF;\r\n background: #fff;\r\n font-family:verdana, arial, helvetica, sans-serif;\r\n font-size:100%;\r\n\r\n }\r\n\r\np {\r\n font-size: 100%; \r\n}\r\n\r\nh1 {\r\n margin:0px 0px 15px 0px;\r\n padding:0px;\r\n font-size:120%;\r\n font-weight:900;\r\n}\r\n\r\n\r\nh2 {\r\n margin:0px 0px 5px 0px;\r\n padding:0px;\r\n font-size:100%\r\n}\r\n\r\n\r\nh3 {\r\n margin:0px 0px 5px 0px;\r\n padding:0px;\r\n font-size:100%\r\n}\r\n\r\nh4 {\r\n margin:0px 0px 5px 0px;\r\n padding:0px;\r\n font-size:100%\r\n}\r\n\r\nh5 {\r\n margin:0px 0px 5px 0px;\r\n padding:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n font-size:100%\r\n}\r\n\r\nblockquote {\r\n padding: 0 1pc 1pc 1pc;\r\n border: 1px solid #ddd;\r\n background-color: #F0F0F0;\r\n color:#000;\r\n background-image: url(\"{{url}}_templates/double-quotes.png\");\r\n background-repeat: no-repeat;\r\n background-position: -10px -7px;\r\n}\r\n\r\n/*---------------------------------------\r\nWraps the entire page \r\n-----------------------------------------*/\r\n\r\n#container {\r\n margin: 0 auto;\r\n text-align: center;\r\n width: 100%;\r\n min-width: 750px;\r\n }\r\n\r\n\r\n/*-----------------------------------------\r\nTOP STATUS BAR \r\n-------------------------------------------*/\r\n\r\n#statusbar {\r\n padding: 3px 0px 2px 0;\r\n margin: 0px;\r\n height:19px;\r\n background:#eee;\r\n color: #333;\r\n font-size:85%;\r\n}\r\n\r\n#statusbar a {\r\n color: #666;\r\n background:#eee;\r\n}\r\n\r\n#welcome {\r\n float: left;\r\n}\r\n\r\n#welcome p{\r\n font-weight:bold;\r\n font-size:110%;\r\n padding:0 0 0 4px;\r\n margin:0px;\r\n}\r\n\r\n#global_menuoptions {\r\n text-align: right;\r\n padding:0px;\r\n margin:0px;\r\n float:right;\r\n}\r\n\r\n#global_menuoptions ul {\r\n margin: 0; \r\n padding: 0;\r\n}\r\n\r\n#global_menuoptions li {\r\n margin: 0; \r\n padding: 0 8px 0 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n\r\n#global_menuoptions a {\r\n text-decoration: none;\r\n}\r\n\r\n#global_menuoptions a:hover{\r\n text-decoration:underline;\r\n}\r\n\r\n\r\n/*---------------------------------------------\r\nHEADER \r\n------------------------------------------------*/\r\n\r\n#header {\r\n width: 100%;\r\n background: #1181AA;\r\n color:#fff;\r\n border: 1px solid #ccc;\r\n border-bottom: none;\r\n padding: 0px;\r\n margin: 0px;\r\n text-align: left;\r\n }\r\n\r\n#header h1 {\r\n padding: 0 0 4px 0;\r\n margin: 7px 0 0 20px;\r\n color: #FAC83D;\r\n background: #1181AA;\r\n text-align: left;\r\n font-size:140%;\r\n font-weight:normal;\r\n } \r\n\r\n#header h2 {\r\n padding: 0 0 7px 0;\r\n margin: 0 0 0 20px;\r\n font-weight: normal;\r\n color: #fff;\r\n background: #1181AA;\r\n border: none;\r\n font-family: \"Lucida Grande\", arial, sans-serif;\r\n font-size:120%;\r\n } \r\n\r\n/*--------------------------------------------\r\nNAVIGATION \r\n----------------------------------------------*/\r\n\r\n#navigation {\r\n height: 19px;\r\n margin: 0;\r\n padding-left: 20px;\r\n text-align:left;\r\n}\r\n\r\n#navigation li {\r\n margin: 0; \r\n padding: 0;\r\n display: inline;\r\n list-style-type: none;\r\n border: none;\r\n}\r\n\r\n#navigation a:link, #navigation a:visited {\r\n\r\n background: #eaeac7;\r\n font-weight: normal;\r\n padding: 5px;\r\n margin: 0 2px 0 0;\r\n border: 0px solid #036;\r\n text-decoration: none;\r\n color: #333;\r\n font-size:85%;\r\n}\r\n\r\n#navigation a:link.selected, #navigation a:visited.selected {\r\n border-bottom: 1px solid #fff;\r\n background: #fff;\r\n color: #393;\r\n font-weight: bold;\r\n}\r\n\r\n#navigation a:hover {\r\n color: #000;\r\n background: #ffc;\r\n}\r\n\r\n#navigation li a:hover{\r\n background:#FCD63F;\r\n color: #000;\r\n }\r\n\r\n\r\n/*-----------------------------------------------\r\nSITE CONTENT WRAPPER \r\n-------------------------------------------------*/\r\n\r\n#content_holder {\r\n margin: 0;\r\n padding: 20px 0;\r\n width: 100%;\r\n text-align: left;\r\n float: left;\r\n border: 1px solid #ccc;\r\n border-top: none;\r\n background-color: #fff;\r\n color:#000;\r\n}\r\n\r\n/*-------------------------------------------------\r\nHOLDS THE MAIN CONTENT E.G. BLOG, PROFILE ETC \r\n----------------------------------------------------*/\r\n\r\n#maincontent_container {\r\n margin: 0;\r\n padding: 5px;\r\n text-align: left;\r\n width: 65%;\r\n float: left;\r\n }\r\n\r\n#maincontent_container h2 {\r\n padding-bottom: 5px;\r\n padding-top: 5px;\r\n margin: 0;\r\n /*color: #666;\r\n background-color:#fff;*/\r\n}\r\n\r\n#maincontent_container h1 {\r\n padding-bottom: 5px;\r\n padding-top: 5px;\r\n margin: 0;\r\n color: #666;\r\n background-color:#fff;\r\n}\r\n\r\n#maincontent_container h3 {\r\n padding-bottom: 5px;\r\n padding-top: 5px;\r\n margin: 0;\r\n /*color: #666;\r\n background-color:#fff;*/\r\n}\r\n\r\n#Footer .performanceinfo {\r\n color: #000;\r\n}\r\n\r\n/*-------------------------------------------------------------\r\nTHIS DISPLAYS THE ACTUAL CONTENT WITHIN maincontent_container\r\n--------------------------------------------------------------*/\r\n\r\n#maincontent_display {\r\n margin: 0;\r\n padding: 0 0 20px 20px;\r\n width: 100%;\r\n text-align: left;\r\n float: left;\r\n background-color: #fff;\r\n color:#000;\r\n}\r\n\r\n#maincontent_display h1 {\r\n padding-bottom: 2px;\r\n border-bottom: 1px solid #666;\r\n margin: 0;\r\n font-size:130%;\r\n color: #666;\r\n background-color: #fff;\r\n}\r\n\r\n/*---- Sub Menu attributes ----*/\r\n\r\n#maincontent_display #sub_menu {\r\n font-family: verdana;\r\n padding: 0px;\r\n margin: 5px 0 20px 0;\r\n color: #000;\r\n background-color:#fff;\r\n}\r\n\r\n#maincontent_display #sub_menu a {\r\n font-weight:bold;\r\n margin:0px;\r\n padding:0px;\r\n}\r\n\r\n#maincontent_display #sub_menu a:hover {\r\n text-decoration: underline;\r\n}\r\n\r\n#maincontent_display #sub_menu p {\r\n margin:0px;\r\n padding:0px;\r\n}\r\n\r\n/*-----------------------------------------------------------------------\r\nDIV''s to help control look and feel - infoholder holds all the profile data\r\nand is always located in within ''maincontentdisplay''\r\n\r\n-------------------------------------------------------------------------*/\r\n\r\n/*------ holds profile data -------*/\r\n.infoholder {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.infoholder p {\r\n padding:0 0 0 5px;\r\n}\r\n\r\n.infoholder .fieldname h2 {\r\n border:0;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n padding:5px;\r\n color:#666;\r\n background:#fff;\r\n} \r\n\r\n.infoholder_twocolumn {\r\n padding:4px;\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 10px 0;\r\n }\r\n\r\n.infoholder_twocolumn .fieldname h3{\r\n color:#666;\r\n background:#fff;\r\n border:0px;\r\n border-bottom:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n}\r\n\r\n/*----------- holds administration data---------*/\r\n\r\n.admin_datatable {\r\n border:1px;\r\n border-color:#eee;\r\n border-style:solid;\r\n margin:0 0 5px 0;\r\n}\r\n\r\n.admin_datatable p {\r\n padding:0px;\r\n margin:0px;\r\n}\r\n\r\n.admin_datatable a {\r\n \r\n}\r\n\r\n\r\n.admin_datatable td {\r\n text-align:left;\r\n}\r\n\r\n.admin_datatable h3{\r\n color:#666;\r\n background:#fff;\r\n}\r\n\r\n.admin_datatable h4 {\r\n}\r\n\r\n/*---- header plus one row of content ------*/\r\n\r\n.databox_vertical {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n padding:5px;\r\n }\r\n\r\n .databox_vertical p{\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n }\r\n\r\n.databox_vertical .fieldname h3 {\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n}\r\n\r\n/*------- holds file content ----*/\r\n\r\n.filetable {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n width:100%;\r\n }\r\n\r\n .filetable p{\r\n padding:0px;\r\n margin:0px;\r\n color:#000; /*#1181AA;*/\r\n background:#fff;\r\n }\r\n\r\n.filetable a{\r\n \r\n }\r\n\r\n\r\n.filetable table {\r\n text-align:left;\r\n}\r\n\r\n#edit_files h4 {\r\n \r\n}\r\n \r\n\r\n/*------- holds fodler content ------*/\r\n\r\n.foldertable {\r\n background-color: #F9F9F9;\r\n color:#000;\r\n border:1px;\r\n border-style:solid;\r\n border-color:#DDD;\r\n margin:0 0 5px 0;\r\n width:100%;\r\n }\r\n\r\n.foldertable a{\r\n \r\n }\r\n\r\n .foldertable p{\r\n padding:0px;\r\n margin:0px;\r\n color:#1181AA;\r\n background:#fff;\r\n }\r\n\r\n.foldertable table {\r\n text-align:left;\r\n}\r\n\r\n/*------- holds network data ------*/\r\n\r\n.networktable {\r\n \r\n}\r\n\r\n\r\n/*-------------------------------------------\r\nSIDEBAR CONTAINER \r\n---------------------------------------------*/\r\n\r\n#sidebar_container {\r\n margin: 0px;\r\n text-align: left;\r\n float: right;\r\n width: 26%;\r\n min-width: 100px;\r\n border-left: 1px dotted #dcdcdc;\r\n padding: 0 10px;\r\n /*width:220px;*/\r\n /*overflow: hidden;*/\r\n }\r\n\r\n/*-----------------------------------------\r\nACTUAL SIDEBAR CONTENT\r\n-------------------------------------------*/\r\n\r\n#sidebar {\r\nmin-width: 100px;\r\n padding: 0 10px;\r\n }\r\n\r\n#sidebar ul {\r\n margin: 0;\r\n padding: 0;\r\n list-style: none;\r\n}\r\n\r\n#sidebar ul li ul {\r\n \r\n}\r\n\r\n#sidebar ul li {\r\n margin: 10px 0;\r\n padding-left: 5px;\r\n}\r\n\r\n\r\n#sidebar h2 {\r\n font-family: \"Lucida Grande\", arial, sans-serif;\r\n font-weight: bold;\r\n color: #333;\r\n background:#fff;\r\n margin: 20px 0 3px 0;\r\n padding: 0;\r\n border: none;\r\n}\r\n\r\n#sidebar h2 {\r\n border-bottom: 1px solid #666; \r\n}\r\n\r\n/*-------------------------------------------\r\nSIDEBAR DISPLAY COMPONENTS \r\n----------------------------------------------*/\r\n\r\n#sidebar_user {\r\n}\r\n\r\n#recent_activity {\r\n}\r\n\r\n#community_owned {\r\n}\r\n\r\n#community_membership {\r\n}\r\n\r\n#sidebar_friends {\r\n}\r\n\r\n#search {\r\n}\r\n\r\n#me {\r\n padding: 0 3px 3px 3px;\r\n background-color:#FAC83D;\r\n min-height: 71px;\r\n}\r\n\r\n#me a {\r\n background-color:#FAC83D;\r\n color: #7289AF;\r\n }\r\n\r\n#me #icon {\r\n margin:3px 0 0 0;\r\n float: left; \r\n width: 70px;\r\n}\r\n\r\n#me #contents {\r\n margin: 0 0 0 75px;\r\n text-align: left;\r\n}\r\n\r\n\r\n/*--- extra div''s when looking at someone else''s page ---*/\r\n\r\n#sidebar_weblog {\r\n}\r\n\r\n#sidebar_files {\r\n}\r\n\r\n\r\n\r\n/*------------------------------------------\r\n FOOTER \r\n ------------------------------------------*/\r\n\r\n#footer {\r\n margin: 10px 0 20px 20px;\r\n text-align: center;\r\n padding:5px;\r\n}\r\n\r\n#footer a:link, #footer a:visited {\r\n text-align:right;\r\n}\r\n\r\n\r\n/*-------------------------------------------\r\n INDIVIDUAL BLOG POSTS \r\n -------------------------------------------*/\r\n\r\n\r\n/*------ wraps all blog components ------*/\r\n\r\n.weblog_posts {\r\n}\r\n\r\n.weblog_posts .entry h3 {\r\n color:#1181AA;\r\n background:#fff;\r\n padding: 0 0 10px 110px;\r\n}\r\n\r\n.user {\r\n float: left;\r\n margin: 0px;\r\n padding:0 0 5px 0;\r\n width: 105px;\r\n text-align: left;\r\n}\r\n\r\n.user a {\r\n \r\n}\r\n\r\n.post {\r\n margin: 0 0 10px 0;\r\n padding: 0 0 20px 110px;\r\n font-family: arial;\r\n}\r\n\r\n.post p {\r\n padding: 0;\r\n margin: 3px 0 10px 0;\r\n line-height: 16px;\r\n}\r\n\r\n.post ol, .post ul {\r\n margin: 3px 0 10px 0;\r\n padding: 0;\r\n}\r\n\r\n.post li {\r\n margin: 0 0 0 30px;\r\n line-height: 16px;\r\n}\r\n\r\n.post ul li {\r\n list-style-type: square;\r\n}\r\n\r\n.post .blog_edit_functions p {\r\n \r\n}\r\n\r\n.post .blog_edit_functions a {\r\n \r\n}\r\n\r\n.post .weblog_keywords p {\r\n \r\n}\r\n\r\n.post .weblog_keywords a {\r\n \r\n}\r\n\r\n.info p {\r\n padding: 0px;\r\n margin: 0 0 5px 0;\r\n color: #666;\r\n background:#fff;\r\n font-family: verdana;\r\n font-weight: normal;\r\n line-height: 14px;\r\n text-align: left;\r\n}\r\n\r\n.info p a {\r\n color: #666;\r\n background:#fff;\r\n text-decoration: none;\r\n border-bottom: 1px dotted #666;\r\n padding-bottom: 0;\r\n}\r\n\r\n#comments ol, #comments ul {\r\n margin: 3px 0 10px 0;\r\n padding: 0;\r\n}\r\n\r\n#comments li {\r\n margin: 10px 0 10px 30px;\r\n line-height: 16px;\r\n}\r\n\r\n#comments ul li {\r\n list-style-type: square;\r\n}\r\n\r\n#comments h4 {\r\n color:#1181AA;\r\n}\r\n\r\n.comment_owner {\r\n border:1px solid #eee;\r\n\tbackground:#f2f7fb;\r\n\tpadding:5px;\r\n\theight:50px;\r\n}\r\n\r\n.comment_owner img {\r\n margin:0px 5px 0px 0px;\r\n}\r\n\r\n.comment_owner a {\r\n background:#f2f7fb;\r\n}\r\n\r\n.comment_owner p {\r\n padding:0;\r\n margin:0 0 10px 0;\r\n}\r\n\r\n.weblog_dateheader {\r\n padding: 0px;\r\n margin: 0 0 5px 0;\r\n color: #333;\r\n background:#fff;\r\n font-weight: normal;\r\n font-style: italic;\r\n line-height: 12px;\r\n border:0px;\r\n border-bottom: 1px solid #ccc;\r\n}\r\n\r\n.clearing{clear:both;}\r\n\r\n/*---------------------------------------------\r\n Your Resources\r\n-----------------------------------------------*/\r\n\r\n.feeds {\r\n border-bottom: 1px dotted #aaaaaa;\r\n background: transparent url(\"{{url}}_templates/sunflower.jpg\") bottom right no-repeat;\r\n}\r\n\r\n.feed_content a {\r\n color:black;\r\n border:0px;\r\n border-bottom:1px;\r\n border-style:dotted;\r\n border-color:#eee;\r\n}\r\n\r\n.feed_content a:hover{\r\n background:#fff;\r\n }\r\n\r\n.feed_content img {\r\n border: 1px solid #666666;\r\n padding:5px;\r\n}\r\n\r\n.feed_content h3 {\r\n padding:0 0 4px 0;\r\n margin:0px;\r\n}\r\n\r\n.feed_content h3 a{\r\n color:black;\r\n border:0px;\r\n border-bottom:1px;\r\n border-style:dotted;\r\n border-color:#eee;\r\n}\r\n\r\n.feed_content h3 a:hover{\r\n background:#FCD63F;\r\n color:#000;\r\n }\r\n\r\n.feed_date h2 {\r\n font-size:13px;\r\n line-height: 21px;\r\n font-weight: bold;\r\n padding: 5px 10px 5px 5px;\r\n background: #D0DEDF;\r\n color:#000;\r\n text-decoration:none;\r\n}\r\n\r\n.via a {\r\n font-size:80%;\r\n color:#1181AA;\r\n background:#fff;\r\n border:0px;\r\n border-bottom:1px;\r\n border-style:dashed;\r\n border-color:#ebebeb;\r\n}\r\n\r\n.via a:hover {\r\n background:#ffc;\r\n color:#1181AA;\r\n}\r\n\r\n\r\n/*---------------------------------------\r\n SYSTEM MESSAGES \r\n ---------------------------------------*/\r\n\r\n#system_message{ \r\n border:1px solid #D3322A;\r\n background:#F7DAD8;\r\n color:#000;\r\n padding:3px 50px;\r\n margin:0 0 0 20px;\r\n}\r\n\r\n#system_message p{\r\n padding:0px;\r\n margin:2px;\r\n }\r\n\r\n\r\n/* ------------- help files -------------*/\r\n\r\n.helpfiles ul {\r\n font-family: arial, helvetica, Tahoma;\r\n color: #000000;\r\n background:#fff;\r\n}\r\n\r\n.helpfiles h4 {\r\n \r\n}\r\n\r\n/*------ site news for home.php ---------*/\r\n\r\n.sitenews {\r\n background:#ebebeb;\r\n color:#000;\r\n}\r\n\r\n.sitenews h2 {\r\n background:#1181AA;\r\n color:#FAC83D;\r\n padding:0 0 5px 0;\r\n}\r\n\r\n/*-------------------------------------\r\n Input forms\r\n--------------------------------------*/\r\n\r\n.textarea {\r\n border: 1px solid #7F9DB9;\r\n color:#71717B;\r\n width: 95%;\r\n height:200px;\r\n padding:3px;\r\n}\r\n\r\n.medium_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n.small_textarea {\r\n width:95%;\r\n}\r\n\r\n.keywords_textarea {\r\n width:95%;\r\n height:100px;\r\n}\r\n\r\n\r\n/*--------------------------------------\r\n MISC \r\n--------------------------------------*/\r\n\r\n.clearall {\r\n padding: 0px;\r\n clear: both;\r\n font-size: 0px;\r\n }\r\n\r\n.flagcontent {\r\n background:#eee;\r\n color:#000;\r\n border:1px;\r\n border-color:#000;\r\n border-style:solid;\r\n padding:3px;\r\n}\r\n\r\n.flagcontent h5 {\r\n background:#eee;\r\n color:#1181AA;\r\n}', {$template_id})"); // Clean up slashes execute_sql("update {$CFG->prefix}weblog_posts set title = replace(title,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}weblog_posts set title = replace(title,'\\\"','\"')"); execute_sql("update {$CFG->prefix}weblog_posts set body = replace(body,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}weblog_posts set body = replace(body,'\\\"','\"')"); execute_sql("update {$CFG->prefix}weblog_comments set body = replace(body,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}weblog_comments set body = replace(body,'\\\"','\"')"); execute_sql("update {$CFG->prefix}weblog_comments set postedname = replace(postedname,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}weblog_comments set postedname = replace(postedname,'\\\"','\"')"); execute_sql("update {$CFG->prefix}tags set tag = replace(tag,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}tags set tag = replace(tag,'\\\"','\"')"); execute_sql("update {$CFG->prefix}files set title = replace(title,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}files set title = replace(title,'\\\"','\"')"); execute_sql("update {$CFG->prefix}files set description = replace(description,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}files set description = replace(description,'\\\"','\"')"); execute_sql("update {$CFG->prefix}file_folders set name = replace(name,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}file_folders set name = replace(name,'\\\"','\"')"); execute_sql("update {$CFG->prefix}profile_data set value = replace(value,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}profile_data set value = replace(value,'\\\"','\"')"); execute_sql("update {$CFG->prefix}users set name = replace(name,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}users set name = replace(name,'\\\"','\"')"); execute_sql("update {$CFG->prefix}groups set name = replace(name,'\\\\'','\\'')"); execute_sql("update {$CFG->prefix}groups set name = replace(name,'\\\"','\"')"); } return $result; }
/** * Restore From Backup to custom destintation * source locked to GSBACKUPSPATH * * @since 3.4 * * @param string $backfilepath filepath to backup file * @param string $destination filepath retore to * @return bool success */ function restore_backup($bakfilepath, $destination) { if (!filepath_is_safe($bakfilepath, GSBACKUPSPATH)) { return false; } return copy_file($bakfilepath, $destination); }
/** * 复制目录和文件 * @param $src * @param $dst */ function copy_file($src, $dst) { // 原目录,复制到的目录 if (is_file($src)) { $file = basename($src); $r = copy($src, $dst . '/' . $file); // echo $r; } //echo $src; $dir = opendir($src); @mkdir($dst); while (false !== ($file = readdir($dir))) { if ($file != '.' && $file != '..') { if (is_dir($src . '/' . $file)) { copy_file($src . '/' . $file, $dst . '/' . $file); } else { // dump($src . '/' . $file) ; //dump($dst . '/' . $file) ; $r = copy($src . '/' . $file, $dst . '/' . $file); echo $r; } } } closedir($dir); }
function copy_thumbnail($image_media_file, $image_thumb_file, $from_cat = 0, $to_cat = 0) { if (is_remote($image_thumb_file)) { return $image_thumb_file; } $thumb_src = $from_cat != -1 ? THUMB_PATH . ($from_cat != 0 ? "/" . $from_cat : "") : THUMB_TEMP_PATH; $thumb_dest = $to_cat != -1 ? THUMB_PATH . ($to_cat != 0 ? "/" . $to_cat : "") : THUMB_TEMP_PATH; if ($image_thumb_file != "" && file_exists($thumb_src . "/" . $image_thumb_file)) { $thumb_extension = get_file_extension($image_thumb_file); $new_thumb = get_file_name($image_media_file) . "." . $thumb_extension; if ($new_thumb = copy_file($thumb_src, $thumb_dest, $image_thumb_file, $new_thumb, 1)) { $image_thumb_file = $new_thumb; } } return $image_thumb_file; }
function moveAttachment(&$row, $db, $from_prefix, $attachmentUploadDir) { static $smf_folders = null; if ($smf_folders === null) { $request = $db->query("\n\t\t\tSELECT value\n\t\t\tFROM {$from_prefix}settings\n\t\t\tWHERE variable='attachmentUploadDir';"); list($smf_attachments_dir) = $db->fetch_row($request); $smf_folders = @unserialize($smf_attachments_dir); if (!is_array($smf_folders)) { $smf_folders = array(1 => $smf_attachments_dir); } } // If something is broken, better try to account for it as well. if (isset($row['id_folder']) && isset($smf_folders[$row['id_folder']])) { $smf_attachments_dir = $smf_folders[$row['id_folder']]; } else { $smf_attachments_dir = $smf_folders[1]; } if (empty($row['file_hash'])) { $row['file_hash'] = createAttachmentFileHash($row['filename']); $source_file = $row['filename']; } else { $source_file = $row['id_attach'] . '_' . $row['file_hash']; } if (empty($row['mime_type'])) { $fileext = ''; $mimetype = ''; $is_thumb = false; if (preg_match('/\\.(jpg|jpeg|gif|png)(_thumb)?$/i', $row['filename'], $m)) { $fileext = strtolower($m[1]); $is_thumb = !empty($m[2]); if (empty($row['mime_type'])) { // AFAIK, all thumbnails got created as PNG if ($is_thumb) { $mimetype = 'image/png'; } elseif ($fileext == 'jpg') { $mimetype = 'image/jpeg'; } else { $mimetype = 'image/' . $fileext; } } } else { if (preg_match('/\\.([a-z][a-z0-9]*)$/i', $row['filename'], $m)) { $fileext = strtolower($m[1]); } } if (empty($row['fileext'])) { $row['fileext'] = $fileext; } // try using getimagesize to calculate the mime type, otherwise use the $mimetype set from above $size = @getimagesize($filename); $row['mime_type'] = empty($size['mime']) ? $mimetype : $size['mime']; } copy_file($smf_attachments_dir . '/' . $source_file, $attachmentUploadDir . '/' . $row['id_attach'] . '_' . $row['file_hash'] . '.elk'); }
function copy_move_items($dir) { // copy/move file/dir if (($GLOBALS["permissions"] & 01) != 01) { show_error($GLOBALS["error_msg"]["accessfunc"]); } // Vars $first = $GLOBALS['__POST']["first"]; if ($first == "y") { $new_dir = $dir; } else { $new_dir = stripslashes($GLOBALS['__POST']["new_dir"]); } if ($new_dir == ".") { $new_dir = ""; } $cnt = count($GLOBALS['__POST']["selitems"]); // Copy or Move? if ($GLOBALS["action"] != "move") { $_img = "_img/__copy.gif"; } else { $_img = "_img/__cut.gif"; } // Get New Location & Names if (!isset($GLOBALS['__POST']["confirm"]) || $GLOBALS['__POST']["confirm"] != "true") { show_header($GLOBALS["action"] != "move" ? $GLOBALS["messages"]["actcopyitems"] : $GLOBALS["messages"]["actmoveitems"]); // JavaScript for Form: // Select new target directory / execute action ?> <script language="JavaScript1.2" type="text/javascript"> <!-- function NewDir(newdir) { document.selform.new_dir.value = newdir; document.selform.submit(); } function Execute() { document.selform.confirm.value = "true"; } //--> </script><?php // "Copy / Move from .. to .." $s_dir = $dir; if (strlen($s_dir) > 40) { $s_dir = "..." . substr($s_dir, -37); } $s_ndir = $new_dir; if (strlen($s_ndir) > 40) { $s_ndir = "..." . substr($s_ndir, -37); } echo "<BR><IMG SRC=\"" . $_img . "\" align=\"ABSMIDDLE\" ALT=\"\"> "; echo sprintf($GLOBALS["action"] != "move" ? $GLOBALS["messages"]["actcopyfrom"] : $GLOBALS["messages"]["actmovefrom"], $s_dir, $s_ndir); echo "<IMG SRC=\"_img/__paste.gif\" align=\"ABSMIDDLE\" ALT=\"\">\n"; // Form for Target Directory & New Names echo "<BR><BR><FORM name=\"selform\" method=\"post\" action=\""; echo make_link("post", $dir, NULL) . "\"><TABLE>\n"; echo "<INPUT type=\"hidden\" name=\"do_action\" value=\"" . $GLOBALS["action"] . "\">\n"; echo "<INPUT type=\"hidden\" name=\"confirm\" value=\"false\">\n"; echo "<INPUT type=\"hidden\" name=\"first\" value=\"n\">\n"; echo "<INPUT type=\"hidden\" name=\"new_dir\" value=\"" . $new_dir . "\">\n"; // List Directories to select Target dir_print(dir_list($new_dir), $new_dir); echo "</TABLE><BR><TABLE>\n"; // Print Text Inputs to change Names for ($i = 0; $i < $cnt; ++$i) { $selitem = stripslashes($GLOBALS['__POST']["selitems"][$i]); if (isset($GLOBALS['__POST']["newitems"][$i])) { $newitem = stripslashes($GLOBALS['__POST']["newitems"][$i]); if ($first == "y") { $newitem = $selitem; } } else { $newitem = $selitem; } $s_item = $selitem; if (strlen($s_item) > 50) { $s_item = substr($s_item, 0, 47) . "..."; } echo "<TR><TD><IMG SRC=\"_img/_info.gif\" align=\"ABSMIDDLE\" ALT=\"\">"; // Old Name echo "<INPUT type=\"hidden\" name=\"selitems[]\" value=\""; echo $selitem . "\"> " . $s_item . " "; // New Name echo "</TD><TD><INPUT type=\"text\" size=\"25\" name=\"newitems[]\" value=\""; echo $newitem . "\"></TD></TR>\n"; } // Submit & Cancel echo "</TABLE><BR><TABLE><TR>\n<TD>"; echo "<INPUT type=\"submit\" value=\""; echo $GLOBALS["action"] != "move" ? $GLOBALS["messages"]["btncopy"] : $GLOBALS["messages"]["btnmove"]; echo "\" onclick=\"javascript:Execute();\"></TD>\n<TD>"; echo "<input type=\"button\" value=\"" . $GLOBALS["messages"]["btncancel"]; echo "\" onClick=\"javascript:location='" . make_link("list", $dir, NULL); echo "';\"></TD>\n</TR></FORM></TABLE><BR>\n"; return; } // DO COPY/MOVE // ALL OK? if (!@file_exists(get_abs_dir($new_dir))) { show_error($new_dir . ": " . $GLOBALS["error_msg"]["targetexist"]); } if (!get_show_item($new_dir, "")) { show_error($new_dir . ": " . $GLOBALS["error_msg"]["accesstarget"]); } if (!down_home(get_abs_dir($new_dir))) { show_error($new_dir . ": " . $GLOBALS["error_msg"]["targetabovehome"]); } // copy / move files $err = false; for ($i = 0; $i < $cnt; ++$i) { $tmp = stripslashes($GLOBALS['__POST']["selitems"][$i]); $new = base_name(stripslashes($GLOBALS['__POST']["newitems"][$i])); $abs_item = get_abs_item($dir, $tmp); $abs_new_item = get_abs_item($new_dir, $new); $items[$i] = $tmp; // Check if ($new == "") { $error[$i] = $GLOBALS["error_msg"]["miscnoname"]; $err = true; continue; } if (!@file_exists($abs_item)) { $error[$i] = $GLOBALS["error_msg"]["itemexist"]; $err = true; continue; } if (!get_show_item($dir, $tmp)) { $error[$i] = $GLOBALS["error_msg"]["accessitem"]; $err = true; continue; } if (@file_exists($abs_new_item)) { $error[$i] = $GLOBALS["error_msg"]["targetdoesexist"]; $err = true; continue; } // Copy / Move if ($GLOBALS["action"] == "copy") { if (@is_link($abs_item) || @is_file($abs_item)) { // check file-exists to avoid error with 0-size files (PHP 4.3.0) $ok = @copy_file($abs_item, $abs_new_item); //||@file_exists($abs_new_item); } elseif (@is_dir($abs_item)) { $ok = copy_dir($abs_item, $abs_new_item); } } else { $ok = @rename($abs_item, $abs_new_item); } if ($ok === false) { $error[$i] = $GLOBALS["action"] == "copy" ? $GLOBALS["error_msg"]["copyitem"] : $GLOBALS["error_msg"]["moveitem"]; $err = true; continue; } $error[$i] = NULL; } if ($err) { // there were errors $err_msg = ""; for ($i = 0; $i < $cnt; ++$i) { if ($error[$i] == NULL) { continue; } $err_msg .= $items[$i] . " : " . $error[$i] . "<BR>\n"; } show_error($err_msg); } header("Location: " . make_link("list", $dir, NULL)); }
/** * Copy thumbnails of uploaded images from the 2.0.x forum * This is only used if the Attachment MOD was installed */ function phpbb_copy_thumbnails() { global $db, $convert, $user, $config, $cache, $phpbb_root_path; $src_path = $convert->options['forum_path'] . '/' . phpbb_get_files_dir() . '/thumbs/'; if ($handle = @opendir($src_path)) { while ($entry = readdir($handle)) { if ($entry[0] == '.') { continue; } if (is_dir($src_path . $entry)) { continue; } else { copy_file($src_path . $entry, $config['upload_path'] . '/' . preg_replace('/^t_/', 'thumb_', $entry)); @unlink($phpbb_root_path . $config['upload_path'] . '/thumbs/' . $entry); } } closedir($handle); } }
/** * Import user's avatar * * @param integer User ID (from b2evo) * @param string Path avatars * @param string File name of user's avatar */ function phpbb_import_avatar($user_ID, $path_avatars, $user_avatar) { global $DB, $tableprefix; if (!empty($user_avatar) && file_exists($path_avatars . $user_avatar)) { // Import user's avatar $FileRootCache =& get_FileRootCache(); $root_ID = FileRoot::gen_ID('user', $user_ID); $imported_file_ID = copy_file($path_avatars . $user_avatar, $root_ID, 'profile_pictures', false); if (!empty($imported_file_ID)) { // Update user's avatar mysqli_query($DB->dbhandle, 'UPDATE ' . $tableprefix . 'users SET user_avatar_file_ID = ' . $DB->quote($imported_file_ID) . ' WHERE user_ID = ' . $DB->quote($user_ID) . ' AND user_avatar_file_ID IS NULL'); // Insert a link with new file global $localtimenow; mysql_query($DB->dbhandle, 'INSERT INTO ' . $tableprefix . 'links ( link_datecreated, link_datemodified, link_creator_user_ID, link_lastedit_user_ID, link_usr_ID, link_file_ID ) VALUES ( ' . $DB->quote(date('Y-m-d H:i:s', $localtimenow)) . ', ' . $DB->quote(date('Y-m-d H:i:s', $localtimenow)) . ', ' . $DB->quote($user_ID) . ', ' . $DB->quote($user_ID) . ', ' . $DB->quote($user_ID) . ', ' . $DB->quote($imported_file_ID) . ' )'); } } }
if (file_exists($dir)) { gs_chmod($dir, 0755); $result_755 = copy_file($tmpfile, $dir . 'tmp.tmp'); if (!$result_755) { gs_chmod($dir, 0777); $result_777 = copy_file($tmpfile, $dir . 'tmp.tmp'); if (!$result_777) { $kill = i18n_r('CHMOD_ERROR'); } } } else { create_dir($dir, 0755); $result_755 = copy_file($tmpfile, $dir . 'tmp.tmp'); if (!$result_755) { gs_chmod($dir, 0777); $result_777 = copy_file($tmpfile, $dir . 'tmp.tmp'); if (!$result_777) { $kill = i18n_r('CHMOD_ERROR'); } } } if (file_exists($dir . 'tmp.tmp')) { delete_file($dir . 'tmp.tmp'); } } // get available language files $filenames = getFiles(GSLANGPATH); if ($LANG == '') { $LANG = GSDEFAULTLANG; } foreach ($filenames as $lfile) {
# user filename $file = _id($_POST['username']) . '.xml'; # get user information from existing XML file if (filepath_is_safe(GSUSERSPATH . $file, GSUSERSPATH) && file_exists(GSUSERSPATH . $file)) { $data = getXML(GSUSERSPATH . $file); $userid = strtolower($data->USR); $EMAIL = $data->EMAIL; if (strtolower($_POST['username']) === $userid) { # create new random password $random = createRandomPassword(); // $random = '1234'; # create backup backup_datafile(GSUSERSPATH . $file); # copy user file into password change trigger file $flagfile = GSUSERSPATH . getPWDresetName(_id($userid), 'xml'); copy_file(GSUSERSPATH . $file, $flagfile); # change password and resave xml file $data->PWD = passhash($random); $status = XMLsave($data, GSUSERSPATH . $file); # send the email with the new password $subject = $site_full_name . ' ' . i18n_r('RESET_PASSWORD') . ' ' . i18n_r('ATTEMPT'); $message = "<p>" . cl($SITENAME) . " " . i18n_r('RESET_PASSWORD') . " " . i18n_r('ATTEMPT') . '</p>'; $message .= "<p>" . i18n_r('LABEL_USERNAME') . ": <strong>" . $userid . "</strong>"; $message .= "<br>" . i18n_r('NEW_PASSWORD') . ": <strong>" . $random . "</strong>"; $message .= '<br>' . i18n_r('EMAIL_LOGIN') . ': <a href="' . $SITEURL . $GSADMIN . '/">' . $SITEURL . $GSADMIN . '/</a></p>'; exec_action('resetpw-success'); // @hook resetpw-success a user password reset occured $emailstatus = sendmail($EMAIL, $subject, $message); # if email fails, we do nothing, maybe handle this in the future # show the result of the reset attempt usleep($randSleep);
function MOH_Files_ListGroup() { global $mysqli; $session =& $_SESSION['MOH_Files_ListGroup']; $smarty = smarty_init(dirname(__FILE__) . '/templates'); $errors = array(); // Init message (Message) $Message = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : ""; if ($_REQUEST['PK_Group']) { $selectedGroup = $_REQUEST['PK_Group']; } else { header("Location: /admin/MOH_Files_List.php"); exit; } if ($_REQUEST['submit']) { $selectedPKFiles = $_REQUEST['Files']; if (is_array($selectedPKFiles)) { $move_PK_Group = $_REQUEST['move_group']; $copy_PK_Group = $_REQUEST['copy_group']; $submit = $_REQUEST['submit']; switch ($submit) { case 'delete': foreach ($selectedPKFiles as $PK_File) { $errors = delete_file($PK_File); } break; case 'move': foreach ($selectedPKFiles as $PK_File) { $errors = move_file($PK_File, $move_PK_Group); } break; case 'copy': foreach ($selectedPKFiles as $PK_File) { $errors = copy_file($PK_File, $copy_PK_Group); } break; } if (count($errors) == 0) { $Message = strtoupper($submit) . "_SUCCESSFULLY"; } } else { $errors['EmptySelection'] = true; } } // Init sort order (Order) $Order = 'asc'; $session['Order'] = $Order; // Init sort field (Sort) $Sort = 'Order'; $session['Sort'] = $Sort; // Init files list (Files) $Files = array(); $query = "\n\t\tSELECT\n\t\t\tPK_File AS `_PK_`, \n\t\t\tFilename AS `Filename`, \n\t\t\tFileext AS `Fileext`, \n\t\t\t`Order` AS `Order`, \t\t\t\n\t\t\tMoh_Files.DateCreated AS `DateCreated`,\n\t\t\tMoh_Groups.Name AS `Group`,\n\t\t\tMoh_Groups.PK_Group AS `_PK_Group_`\n\t\tFROM\n\t\t\tMoh_Files \n\t\t\tINNER JOIN Moh_Groups ON FK_Group = PK_Group\n\t\tWHERE\n\t\t\tFK_Group={$selectedGroup}\n\t\tORDER BY \n\t\t\t`{$Sort}` {$Order}\n\t"; $result = $mysqli->query($query) or die($mysqli->error . $query); while ($row = $result->fetch_assoc()) { $Files[] = $row; } // Init available groups (Groups) $query = "SELECT * FROM Moh_Groups ORDER BY Name"; $result = $mysqli->query($query) or die($mysqli->error . $query); while ($row = $result->fetch_assoc()) { $Groups[] = $row; } $smarty->assign('selectedGroup', $selectedGroup); $smarty->assign('Errors', $errors); $smarty->assign('Link', '/admin/MOH_Files_ListGroup.php?PK_Group=' . $_REQUEST['PK_Group']); $smarty->assign('Files', $Files); $smarty->assign('Groups', $Groups); $smarty->assign('Sort', $Sort); $smarty->assign('Order', $Order); $smarty->assign('Message', $Message); $smarty->assign('Hilight', isset($_REQUEST['hilight']) ? $_REQUEST['hilight'] : ""); return $smarty->fetch('MOH_Files_ListGroup.tpl'); }
printheaderb(); $user = $_SESSION["CashierNo"]; $remote_oux = remote_oux(); $value = '='; $track = $_SESSION["strRemembered"]; $equal = strpos($track, $value); $equalFour = $equal - 4; $four = substr($track, $equalFour, 4); //check to see if the file exists if (file_exists($remote_oux)) { $today = date('mdYHis'); $emp = $_SESSION['CashierNo']; $trans = $_SESSION['transno']; $stamp = $today . "_" . $emp . "_" . $trans; $local = 'OUX/' . $stamp; copy_file($remote_oux, $local); $amountIn = $_SESSION["ccAmt"]; $_SESSION["ccAmt"] = 0; $_SESSION["ccAmtEntered"] = 0; $_SESSION["ouxWait"] = 0; //$fp = fopen($filename,'r'); //open the file with read permissions $fp = fopen($remote_oux, 'r'); //fixed CvR 07/07/05 parse_oux(); fclose($fp); //close the file $catTroutD = "{$four}" + "{$TroutD}"; if ($Result == "CAPTURED") { $_SESSION["msgrepeat"] = 0; $_SESSION["ccTender"] = 1; tender("CC", $amountIn * 100);
function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_failure = true, $source_relative_path = true) { global $convert, $phpbb_root_path, $config, $user, $db; $dirlist = $filelist = $bad_dirs = array(); $src = path($src, $source_relative_path); $trg = path($trg); $src_path = relative_base($src, $source_relative_path, __LINE__, __FILE__); $trg_path = $phpbb_root_path . $trg; if (!is_dir($trg_path)) { @mkdir($trg_path, 0777); @chmod($trg_path, 0777); } if (!phpbb_is_writable($trg_path)) { $bad_dirs[] = path($config['script_path']) . $trg; } if ($handle = @opendir($src_path)) { while ($entry = readdir($handle)) { if ($entry[0] == '.' || $entry == 'CVS' || $entry == 'index.htm') { continue; } if (is_dir($src_path . $entry)) { $dirlist[] = $entry; } else { $filelist[] = $entry; } } closedir($handle); } else { if ($dir = @dir($src_path)) { while ($entry = $dir->read()) { if ($entry[0] == '.' || $entry == 'CVS' || $entry == 'index.htm') { continue; } if (is_dir($src_path . $entry)) { $dirlist[] = $entry; } else { $filelist[] = $entry; } } $dir->close(); } else { $convert->p_master->error(sprintf($user->lang['CONV_ERROR_COULD_NOT_READ'], relative_base($src, $source_relative_path)), __LINE__, __FILE__); } } if ($copy_subdirs) { for ($i = 0; $i < sizeof($dirlist); ++$i) { $dir = $dirlist[$i]; if ($dir == 'CVS') { continue; } if (!is_dir($trg_path . $dir)) { @mkdir($trg_path . $dir, 0777); @chmod($trg_path . $dir, 0777); } if (!phpbb_is_writable($trg_path . $dir)) { $bad_dirs[] = $trg . $dir; $bad_dirs[] = $trg_path . $dir; } if (!sizeof($bad_dirs)) { copy_dir($src . $dir, $trg . $dir, true, $overwrite, $die_on_failure, $source_relative_path); } } } if (sizeof($bad_dirs)) { $str = sizeof($bad_dirs) == 1 ? $user->lang['MAKE_FOLDER_WRITABLE'] : $user->lang['MAKE_FOLDERS_WRITABLE']; sort($bad_dirs); $convert->p_master->error(sprintf($str, implode('<br />', $bad_dirs)), __LINE__, __FILE__); } for ($i = 0; $i < sizeof($filelist); ++$i) { copy_file($src . $filelist[$i], $trg . $filelist[$i], $overwrite, $die_on_failure, $source_relative_path); } }
<?php create_dir($target_dir); $out = array(); $tmp_dir = path(dirname(__DIR__), 'assets'); $base_dir = path($tmp_dir, 'static'); \IO\Dir::each($base_dir, '*', function ($file) use($target_dir, $base_dir) { $new = str_replace($base_dir . DIRECTORY_SEPARATOR, '', $file); $out = path($target_dir, $new); if (!is_dir($file)) { $path = dirname($out); if (!is_dir($path)) { status('create', $path); mkdir($path, 0755, TRUE); } status('copy', $out); copy($file, $out); } }); copy_file(path($target_dir, 'assets', 'css'), path($tmp_dir, 'sauce.less')); copy_file(path($target_dir, 'assets', 'css'), path($tmp_dir, 'base.less')); copy_file(path($target_dir, 'assets', 'css'), path($tmp_dir, 'media.less')); copy_file(path($target_dir, 'assets', 'css'), path($tmp_dir, 'styles.css.less')); copy_file(path($target_dir, 'assets', 'js', 'lib'), path($tmp_dir, 'console.js')); copy_file(path($target_dir, 'assets', 'js', 'lib'), path($tmp_dir, 'jquery.min.js')); copy_file(path($target_dir, 'assets', 'js', 'lib'), path($tmp_dir, 'modernizr.min.js')); copy_file(path($target_dir, 'assets', 'js'), path($tmp_dir, 'script.js.coffee')); $name = camelcase(basename($target_dir)); create_file(path($target_dir, '.gitignore'), ".cache\nstatic/*"); create_file(path($target_dir, 'config.php'), '<' . "?php\n\n\$config['title'] = '{$name}';\n\$config['base_url'] = '';\n");
} } if ($big && $do_resize && !$big_file) { if ($big_file = copy_file(MEDIA_PATH . "/" . $cat_id, MEDIA_PATH . "/" . $cat_id . "/" . $big_folder, $image_media_file, $image_media_file, 1, 1, 0)) { $log[] = str_replace("{name}", MEDIA_DIR . "/" . $cat_id . "/" . $big_folder, $lang['cni_copy_success']); } else { $log[] = str_replace("{name}", MEDIA_DIR . "/" . $cat_id . "/" . $big_folder, $lang['cni_copy_error']); } } if ($backup_orig && !$backup && ($do_resize || $do_annotate)) { if ($big_file) { $src_dir = MEDIA_PATH . "/" . $cat_id . "/" . $big_folder; } else { $src_dir = MEDIA_PATH . "/" . $cat_id; } if ($backup_file = copy_file($src_dir, $backup_orig . "/" . $cat_id, $image_media_file, $image_media_file, 1, 1, 0)) { $log[] = str_replace("{name}", str_replace(ROOT_PATH, "", $backup_orig) . "/" . $cat_id . "/" . $image_media_file, $lang['cni_backup_success']); } else { $log[] = str_replace("{name}", str_replace(ROOT_PATH, "", $backup_orig) . "/" . $cat_id . "/" . $image_media_file, $lang['cni_backup_error']); } } $file_thumb = THUMB_PATH . "/" . $cat_id . "/" . $image_media_file; if ($do_thumb && $auto_thumbs && $image_thumb_file == "" && !file_exists($file_thumb)) { $ok = 0; if ($resize_type_thumbs == 1 && ($image_info[0] > $dimension_thumbs || $image_info[1] > $dimension_thumbs)) { $ok = 1; } elseif ($resize_type_thumbs == 2 && $image_info[0] > $dimension_thumbs) { $ok = 1; } elseif ($resize_type_thumbs == 3 && $image_info[1] > $dimension_thumbs) { $ok = 1; }
function upload_items($dir) { // upload file if (($GLOBALS["permissions"] & 01) != 01) { show_error($GLOBALS["error_msg"]["accessfunc"]); } // Execute if (isset($GLOBALS['__POST']["confirm"]) && $GLOBALS['__POST']["confirm"] == "true") { $cnt = count($GLOBALS['__FILES']['userfile']['name']); $err = false; $err_avaliable = isset($GLOBALS['__FILES']['userfile']['error']); // upload files & check for errors for ($i = 0; $i < $cnt; $i++) { $errors[$i] = NULL; $tmp = $GLOBALS['__FILES']['userfile']['tmp_name'][$i]; $items[$i] = stripslashes($GLOBALS['__FILES']['userfile']['name'][$i]); if ($err_avaliable) { $up_err = $GLOBALS['__FILES']['userfile']['error'][$i]; } else { $up_err = file_exists($tmp) ? 0 : 4; } $abs = get_abs_item($dir, $items[$i]); if ($items[$i] == "" || $up_err == 4) { continue; } if ($up_err == 1 || $up_err == 2) { $errors[$i] = $GLOBALS["error_msg"]["miscfilesize"]; $err = true; continue; } if ($up_err == 3) { $errors[$i] = $GLOBALS["error_msg"]["miscfilepart"]; $err = true; continue; } if (!@is_uploaded_file($tmp)) { $errors[$i] = $GLOBALS["error_msg"]["uploadfile"]; $err = true; continue; } if (@file_exists($abs)) { $errors[$i] = $GLOBALS["error_msg"]["itemdoesexist"]; $err = true; continue; } // Upload if (function_exists("move_uploaded_file")) { $ok = @move_uploaded_file($tmp, $abs); } else { $ok = @copy_file($tmp, $abs); @unlink($tmp); // try to delete... } if ($ok === false) { $errors[$i] = $GLOBALS["error_msg"]["uploadfile"]; $err = true; continue; } } if ($err) { // there were errors $err_msg = ""; for ($i = 0; $i < $cnt; $i++) { if ($errors[$i] == NULL) { continue; } $err_msg .= $items[$i] . " : " . $errors[$i] . "<BR>\n"; } show_error($err_msg); } header("Location: " . make_link("list", $dir, NULL)); return; } show_header($GLOBALS["messages"]["actupload"]); // List echo "<BR><FORM enctype=\"multipart/form-data\" action=\"" . make_link("upload", $dir, NULL); echo "\" method=\"post\">\n<INPUT type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\""; echo get_max_file_size() . "\"><INPUT type=\"hidden\" name=\"confirm\" value=\"true\"><TABLE>\n"; for ($i = 0; $i < 10; $i++) { echo "<TR><TD nowrap align=\"center\">"; echo "<INPUT name=\"userfile[]\" type=\"file\" size=\"40\"></TD></TR>\n"; } echo "</TABLE>\n<BR><TABLE><TR><TD><INPUT type=\"submit\" value=\"" . $GLOBALS["messages"]["btnupload"]; echo "\"></TD>\n<TD><input type=\"button\" value=\"" . $GLOBALS["messages"]["btncancel"]; echo "\" onClick=\"javascript:location='" . make_link("list", $dir, NULL) . "';\">\n</TD></TR></FORM></TABLE><BR>\n"; return; }