From: <wis...@us...> - 2015-12-01 15:59:12
|
Revision: 13174 http://sourceforge.net/p/xoops/svn/13174 Author: wishcraft Date: 2015-12-01 15:59:10 +0000 (Tue, 01 Dec 2015) Log Message: ----------- Pingtrax -- the Pinglist and Trackback Automated module -- Pre-alpha 1.01 -- Planning Modified Paths: -------------- XoopsModules/pingtrax/trunk/class/plugins.php XoopsModules/pingtrax/trunk/language/english/modinfo.php XoopsModules/pingtrax/trunk/xoops_version.php Modified: XoopsModules/pingtrax/trunk/class/plugins.php =================================================================== --- XoopsModules/pingtrax/trunk/class/plugins.php 2015-12-01 14:58:33 UTC (rev 13173) +++ XoopsModules/pingtrax/trunk/class/plugins.php 2015-12-01 15:59:10 UTC (rev 13174) @@ -72,9 +72,10 @@ foreach(get_declared_classes() as $class) { - if (substr(strtolower($class), 0, strlen($this->getModuleDirname()))==strtolower($this->getModuleDirname()) && (!strpos(strtolower($class), 'categor') && !strpos(strtolower($this->getModulePHPSelf()), 'categor'))) + if ($this->getModuleDirname() != '' && substr(strtolower($class), 0, strlen($this->getModuleDirname()))==strtolower($this->getModuleDirname()) && (!strpos(strtolower($class), 'categor') && !strpos(strtolower($this->getModulePHPSelf()), 'categor'))) { - if (is_a(@new $class(), "XoopsPersistableObjectHandler")) + @$obj = new $class(); + if (is_a($obj, "XoopsPersistableObjectHandler")) return strtolower(str_replace(array(ucfirst($this->getModuleDirname()), $this->getModuleDirname(), 'handler', 'Handler'), '', $class)); } } @@ -93,7 +94,7 @@ { default: - $idnaming = explode(array("\n", "\n\r", "\r\n"), file_get_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'item-id-names.txt')); + $idnaming = explode(PHP_EOL, file_get_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'item-id-names.txt')); foreach($_GET as $key => $value) { if (!is_array($value)) @@ -102,7 +103,7 @@ { if (strpos($key, $idname) && is_numeric($_GET[$key])) $id = $_GET[$key]; - elseif (is_numeric($_GET[$key]) && !in_array($key, explode(array("\n", "\n\r", "\r\n"), file_get_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'exclude-names.txt')))) + elseif (is_numeric($_GET[$key]) && !in_array($key, explode(PHP_EOL, file_get_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'exclude-names.txt')))) $id = $_GET[$key]; } } @@ -147,7 +148,7 @@ { default: - $idnaming = explode(array("\n", "\n\r", "\r\n"), file_get_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'category-id-names.txt')); + $idnaming = explode(PHP_EOL, file_get_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'category-id-names.txt')); foreach($_GET as $key => $value) { if (!is_array($value)) @@ -156,7 +157,7 @@ { if (strpos($key, $idname) && is_numeric($_GET[$key])) $id = $_GET[$key]; - elseif ($id = 0 && is_numeric($_GET[$key]) && !in_array($key, explode(array("\n", "\n\r", "\r\n"), file_get_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'exclude-names.txt')))) + elseif ($id = 0 && is_numeric($_GET[$key]) && !in_array($key, explode(PHP_EOL, file_get_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'exclude-names.txt')))) $id = $_GET[$key]; } } @@ -186,8 +187,6 @@ */ function getItemRefererURI() { - if (parse_url(strtolower(XOOPS_URL), PHP_URL_PATH) == substr(strtolower($_SERVER["REQUEST_URI"]), 0, strlen(parse_url(strtolower(XOOPS_URL), PHP_URL_PATH)))) - return substr($_SERVER["REQUEST_URI"], strlen(parse_url(strtolower(XOOPS_URL), PHP_URL_PATH))-1); return $_SERVER["REQUEST_URI"]; } @@ -340,7 +339,7 @@ */ function getFeedProtocol() { - return parse_url(strtolower($this->_configs['default_feed_url']), PHP_URL_SCHEME); + return parse_url(strtolower(str_replace("%xoops_url%", XOOPS_URL, $this->_configs['default_feed_url'])), PHP_URL_SCHEME); } /** @@ -348,7 +347,7 @@ */ function getFeedDomain() { - return parse_url(strtolower($this->_configs['default_feed_url']), PHP_URL_HOST); + return parse_url(strtolower(str_replace("%xoops_url%", XOOPS_URL, $this->_configs['default_feed_url'])), PHP_URL_HOST); } /** @@ -356,7 +355,7 @@ */ function getFeedRefererURI() { - return parse_url(strtolower($this->_configs['default_feed_url']), PHP_URL_PATH) . "?" .parse_url(strtolower($this->_configs['default_feed_url']), PHP_URL_QUERY); + return parse_url(strtolower(str_replace("%xoops_url%", XOOPS_URL, $this->_configs['default_feed_url'])), PHP_URL_PATH) . "?" .parse_url(strtolower($this->_configs['default_feed_url']), PHP_URL_QUERY); } } @@ -408,6 +407,7 @@ } if (is_object($this->_plugins[$dirname])) { + $ret['type'] = 'local'; $ret['module-dirname'] = $this->_plugins[$dirname]->getModuleDirname(); $ret['module-class'] = $this->_plugins[$dirname]->getModuleClass(); $ret['module-item-id'] = $this->_plugins[$dirname]->getModuleItemID(); @@ -426,9 +426,9 @@ if (!empty($ret)) { $itemsHandler = xoops_getmodulehandler('items', 'pingtrax'); - $item = $itemHandler->create(true); + $item = $itemsHandler->create(true); $item->setVars($ret); - $ret = $itemHandler->get($itemHandler->insert($item)); + $ret = $itemsHandler->get($itemsHandler->insert($item)); } return $ret; } @@ -464,7 +464,7 @@ $item->setVar('item-title', $this->_plugins[$dirname]->getItemTitle()); $item->setVar('item-description', $this->_plugins[$dirname]->getItemTitle()); $itemsHandler = xoops_getmodulehandler('items', 'pingtrax'); - return $itemHandler->get($itemHandler->insert($item)); + return $itemsHandler->get($itemsHandler->insert($item)); } return $item; } Modified: XoopsModules/pingtrax/trunk/language/english/modinfo.php =================================================================== --- XoopsModules/pingtrax/trunk/language/english/modinfo.php 2015-12-01 14:58:33 UTC (rev 13173) +++ XoopsModules/pingtrax/trunk/language/english/modinfo.php 2015-12-01 15:59:10 UTC (rev 13174) @@ -1,14 +1,27 @@ <?php -// $Id: modinfo.php 12363 2014-03-08 10:39:06Z beckmi $ -// _LANGCODE: en -// _CHARSET : UTF-8 -// Translator: XOOPS Translation Team -define('_IPV4_MI_NAME',"IPv4 Debt"); -define('_IPV4_MI_DESC',"Module for displaying the IPv4 debt to Chronolabs Cooperative"); -define('_IPV4_MI_HTACCESS',"Support HTACCESS"); -define('_IPV4_MI_HTACCESS_DESC',"This will enable support for htaccess"); -define('_IPV4_MI_BASEURL',"Base URL for htaccess"); -define('_IPV4_MI_BASEURL_DESC',"This is the base URL of htaccess"); -define('_IPV4_MI_ENDURL',"End of URL"); -define('_IPV4_MI_ENDURL_DESC',""); +/** + * PingTrax Module Global Constants + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://sourceforge.net/projects/chronolabs/ + * @license GNU GPL 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Antony Roberts <wis...@us...> + * @see http://sourceforge.net/projects/xoops/ + * @see http://sourceforge.net/projects/chronolabs/ + * @see http://sourceforge.net/projects/chronolabsapi/ + * @see http://labs.coop + * @version 1.0.1 + * @since 1.0.1 + */ +define('_MI_PINGTRAX_NAME',"PingTrax"); +define('_MI_PINGTRAX_DESC',"Module for Automated PingList's and Trackbacks as well as sitemaps in XML!"); +define('_MI_PINGTRAX_DEFAULT_FEED_URL',"Default URL for the RSS Feed Backend"); +define('_MI_PINGTRAX_DEFAULT_FEED_URL_DESC',"This will provide the default URL for the feed, <em>%xoops_url%</em> will be replaced with <em>".XOOPS_URL."</em>"); + Modified: XoopsModules/pingtrax/trunk/xoops_version.php =================================================================== --- XoopsModules/pingtrax/trunk/xoops_version.php 2015-12-01 14:58:33 UTC (rev 13173) +++ XoopsModules/pingtrax/trunk/xoops_version.php 2015-12-01 15:59:10 UTC (rev 13174) @@ -79,31 +79,12 @@ $modversion['hasMain'] = 0; $modversion['config'] = array(); -/* $modversion['config'][] = array( - 'name' => 'htaccess', - 'title' => '_MI_PINGTRAX_HTACCESS', - 'description' => '_MI_PINGTRAX_HTACCESS_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => false -); - -$modversion['config'][] = array( - 'name' => 'base_url', - 'title' => '_MI_PINGTRAX_BASEURL', - 'description' => '_MI_PINGTRAX_BASEURL_DESC', - 'formtype' => 'textbox', + 'name' => 'default_feed_url', + 'title' => '_MI_PINGTRAX_DEFAULT_FEED_URL', + 'description' => '_MI_PINGTRAX_DEFAULT_FEED_URL_DESC', + 'formtype' => 'text', 'valuetype' => 'text', - 'default' => "ipv4" + 'default' => '%xoops_url%/backend.php' ); -$modversion['config'][] = array( - 'name' => 'end_url', - 'title' => '_MI_PINGTRAX_ENDURL', - 'description' => '_MI_PINGTRAX_ENDURL_DESC', - 'formtype' => 'textbox', - 'valuetype' => 'text', - 'default' => ".html" -); -*/ |