|
From: <be...@us...> - 2014-05-19 07:28:58
|
Revision: 12536
http://sourceforge.net/p/xoops/svn/12536
Author: beckmi
Date: 2014-05-19 07:28:51 +0000 (Mon, 19 May 2014)
Log Message:
-----------
added update routine to delete .html templates (slider84)
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/admin/menu.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/docs/changelog.txt
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/include/update.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/preloads/core.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/preloads/system.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/changelog.txt
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/header.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/include/update.php
Added Paths:
-----------
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/assets/css/style.css
Removed Paths:
-------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/templates/style.css
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/admin/menu.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/admin/menu.php 2014-05-16 16:51:21 UTC (rev 12535)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/admin/menu.php 2014-05-19 07:28:51 UTC (rev 12536)
@@ -17,7 +17,7 @@
* @version $Id$
*/
-defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
+// defined("XOOPS_ROOT_PATH") || die("XOOPS root path not defined");
$path = dirname(dirname(dirname(dirname(__FILE__))));
include_once $path . '/mainfile.php';
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/docs/changelog.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/docs/changelog.txt 2014-05-16 16:51:21 UTC (rev 12535)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/docs/changelog.txt 2014-05-19 07:28:51 UTC (rev 12536)
@@ -2,6 +2,7 @@
-------------------
- moved all images, CSS, and JS files to /assets (mamba)
- renamed .html Smarty templates to .tpl (mamba)
+- added routine to delete .html templates (slider84)
Version 1.09
-------------------
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/include/update.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/include/update.php 2014-05-16 16:51:21 UTC (rev 12535)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/include/update.php 2014-05-19 07:28:51 UTC (rev 12536)
@@ -21,19 +21,29 @@
{
if ($oldversion <= 100) {
- GLOBAL $xoopsDB;
- // Check pm table version
- $sql = "SHOW COLUMNS FROM " . $xoopsDB->prefix("priv_msgs");
- if (!$result = $xoopsDB->queryF($sql)) {
- return false;
+ GLOBAL $xoopsDB;
+ // Check pm table version
+ $sql = "SHOW COLUMNS FROM " . $xoopsDB->prefix("priv_msgs");
+ if (!$result = $xoopsDB->queryF($sql)) {
+ return false;
+ }
+ // Migrate from existent pm module
+ if (($rows = $xoopsDB->getRowsNum($result)) == 12) {
+ return true;
+ } elseif ($rows == 8) {
+ return $xoopsDB->queryFromFile(XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/sql/mysql.upgrade.sql");
+ } else {
+ return false;
+ }
}
- // Migrate from existent pm module
- if ( ($rows = $xoopsDB->getRowsNum($result)) == 12) {
- return true;
- } elseif ($rows == 8) {
- return $xoopsDB->queryFromFile(XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/sql/mysql.upgrade.sql");
- } else {
- return false;
+ // remove old html template files
+ $template_directory = XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/templates/";
+ $template_list = array_diff(scandir($template_directory), array('..', '.'));
+ foreach ($template_list as $k => $v) {
+ $fileinfo = new SplFileInfo($template_directory . $v);
+ if ($fileinfo->getExtension() == 'html' && $fileinfo->getFilename() != 'index.html') {
+ @unlink($template_directory . $v);
+ }
}
- }
+ return null;
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/preloads/core.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/preloads/core.php 2014-05-16 16:51:21 UTC (rev 12535)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/preloads/core.php 2014-05-19 07:28:51 UTC (rev 12536)
@@ -17,7 +17,7 @@
* @version $Id$
*/
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
+// defined('XOOPS_ROOT_PATH') || die('Restricted access');
/**
* PM core preloads
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/preloads/system.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/preloads/system.php 2014-05-16 16:51:21 UTC (rev 12535)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/pm/preloads/system.php 2014-05-19 07:28:51 UTC (rev 12536)
@@ -17,7 +17,7 @@
* @version $Id$
*/
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
+// defined('XOOPS_ROOT_PATH') || die('Restricted access');
/**
* PM system preloads
Added: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/assets/css/style.css
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/assets/css/style.css (rev 0)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/assets/css/style.css 2014-05-19 07:28:51 UTC (rev 12536)
@@ -0,0 +1,13 @@
+.breadcrumbs { font-size: 1.2em; padding: 10px 2px;}
+.breadcrumbs span { border: 0; padding: 0 2px;}
+.breadcrumbs .item {}
+.breadcrumbs .delimiter { font-size: 1.2em;}
+.register-steps { font-size: 1.2em; padding: 5px 2px;}
+.register-steps span { border: 0; padding: 0 2px;}
+.register-steps .current { font-weight: bold; text-decoration: underline;}
+.register-steps .delimiter { font-size: 1.2em;}
+table.profile-form { width: 90%;}
+.profile-form td.head { width: 20%;}
+.profile-list-category table { width: 80%; margin: 10px 5px;}
+.profile-list-category td.head { width: 20%;}
+.profile-list-activity { width: 90%; padding: 5px;}
\ No newline at end of file
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/changelog.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/changelog.txt 2014-05-16 16:51:21 UTC (rev 12535)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/docs/changelog.txt 2014-05-19 07:28:51 UTC (rev 12536)
@@ -3,6 +3,7 @@
- moved all images, CSS, and JS files to /assets (mamba)
- renamed .html Smarty templates to .tpl (mamba)
- fixed missing .tpl (cesag/slider84)
+- added routine to delete .html templates (slider84)
1.64 Final
--------------------------------------
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/header.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/header.php 2014-05-16 16:51:21 UTC (rev 12535)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/header.php 2014-05-19 07:28:51 UTC (rev 12536)
@@ -20,7 +20,7 @@
$xoopsOption['pagetype'] = 'user';
include dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'mainfile.php';
-$xoopsOption['xoops_module_header'] = '<link rel="stylesheet" type="text/css" href="templates/style.css" />';
+$xoopsOption['xoops_module_header'] = '<link rel="stylesheet" type="text/css" href="assets/css/style.css" />';
$xoBreadcrumbs = array();
$xoBreadcrumbs[] = array("title" => $GLOBALS['xoopsModule']->getVar('name'), "link" => XOOPS_URL . "/modules/" . $GLOBALS['xoopsModule']->getVar('dirname', 'n') . '/');
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/include/update.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/include/update.php 2014-05-16 16:51:21 UTC (rev 12535)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/include/update.php 2014-05-19 07:28:51 UTC (rev 12536)
@@ -106,6 +106,17 @@
$GLOBALS['xoopsDB']->queryF("UPDATE `" . $GLOBALS['xoopsDB']->prefix("profile_field") . "` SET `field_valuetype`=1 WHERE `field_name`='umode'");
}
+
+// remove old html template files
+ $template_directory = XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname', 'n') . "/templates/";
+ $template_list = array_diff(scandir($template_directory), array('..', '.'));
+ foreach ($template_list as $k => $v) {
+ $fileinfo = new SplFileInfo($template_directory . $v);
+ if ($fileinfo->getExtension() == 'html' && $fileinfo->getFilename() != 'index.html') {
+ @unlink($template_directory . $v);
+ }
+ }
+
$profile_handler =& xoops_getModuleHandler("profile", $module->getVar('dirname', 'n') );
$profile_handler->cleanOrphan($GLOBALS['xoopsDB']->prefix("users"), "uid", "profile_id");
$field_handler =& xoops_getModuleHandler('field', $module->getVar('dirname', 'n') );
Deleted: XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/templates/style.css
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/templates/style.css 2014-05-16 16:51:21 UTC (rev 12535)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/modules/profile/templates/style.css 2014-05-19 07:28:51 UTC (rev 12536)
@@ -1,13 +0,0 @@
-.breadcrumbs { font-size: 1.2em; padding: 10px 2px;}
-.breadcrumbs span { border: 0; padding: 0 2px;}
-.breadcrumbs .item {}
-.breadcrumbs .delimiter { font-size: 1.2em;}
-.register-steps { font-size: 1.2em; padding: 5px 2px;}
-.register-steps span { border: 0; padding: 0 2px;}
-.register-steps .current { font-weight: bold; text-decoration: underline;}
-.register-steps .delimiter { font-size: 1.2em;}
-table.profile-form { width: 90%;}
-.profile-form td.head { width: 20%;}
-.profile-list-category table { width: 80%; margin: 10px 5px;}
-.profile-list-category td.head { width: 20%;}
-.profile-list-activity { width: 90%; padding: 5px;}
\ No newline at end of file
|