From: <wis...@us...> - 2015-12-07 14:35:43
|
Revision: 13183 http://sourceforge.net/p/xoops/svn/13183 Author: wishcraft Date: 2015-12-07 14:35:39 +0000 (Mon, 07 Dec 2015) Log Message: ----------- PingTrax Pre-alpha :: More done\!\!\! Added Paths: ----------- XoopsModules/pingtrax/releases/1.01/ XoopsModules/pingtrax/releases/1.01/class/ XoopsModules/pingtrax/releases/1.01/class/smarty/ XoopsModules/pingtrax/releases/1.01/class/smarty/xoops_plugins/ XoopsModules/pingtrax/releases/1.01/class/smarty/xoops_plugins/function.xoTrackbacks.php XoopsModules/pingtrax/releases/1.01/modules/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/about.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin_footer.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin_header.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/menu.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/api/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/api/.htaccess XoopsModules/pingtrax/releases/1.01/modules/pingtrax/api/index.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/blocks/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/blocks/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/items.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/items_pings.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/items_sitemaps.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/pings.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/plugins.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/simple_html_dom.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/sitemaps.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/trackback.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/images/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/images/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/images/link.png XoopsModules/pingtrax/releases/1.01/modules/pingtrax/images/logo.png XoopsModules/pingtrax/releases/1.01/modules/pingtrax/include/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/include/category-id-names.txt XoopsModules/pingtrax/releases/1.01/modules/pingtrax/include/exclude-names.txt XoopsModules/pingtrax/releases/1.01/modules/pingtrax/include/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/include/item-id-names.txt XoopsModules/pingtrax/releases/1.01/modules/pingtrax/language/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/language/english/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/language/english/help/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/language/english/help/help.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/language/english/help/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/language/english/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/language/english/modinfo.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/language/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/pingtrax.css XoopsModules/pingtrax/releases/1.01/modules/pingtrax/plugins/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/plugins/default.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/plugins/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/preloads/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/preloads/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/preloads/items.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/preloads/ping.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/preloads/sitemap.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/preloads/trackback.php XoopsModules/pingtrax/releases/1.01/modules/pingtrax/sql/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/sql/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/sql/mysql.sql XoopsModules/pingtrax/releases/1.01/modules/pingtrax/sql/tables.json XoopsModules/pingtrax/releases/1.01/modules/pingtrax/templates/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/templates/admin/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/templates/admin/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/templates/blocks/ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/templates/blocks/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/templates/index.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/templates/sitemaps.xml.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/templates/xoTrackback.html XoopsModules/pingtrax/releases/1.01/modules/pingtrax/xoops_version.php Added: XoopsModules/pingtrax/releases/1.01/class/smarty/xoops_plugins/function.xoTrackbacks.php =================================================================== --- XoopsModules/pingtrax/releases/1.01/class/smarty/xoops_plugins/function.xoTrackbacks.php (rev 0) +++ XoopsModules/pingtrax/releases/1.01/class/smarty/xoops_plugins/function.xoTrackbacks.php 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1,51 @@ +<?php +/** + * PingTrax Smarty Trackback Function + * + * 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 + */ + +function smarty_function_xoTrackbacks($tag_args, &$comp) +{ + $attrs = $comp->_parse_attrs($tag_args); + foreach ($attrs as $arg_name => $arg_value) { + if ($arg_name == 'dirname') { + $dirname = $arg_value; + continue; + } + } + global $pingtraxitem; + if (is_a($pingtraxitem, "PingtraxItems")) + { + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . "/modules/pingtrax/pingtrax.css"); + $trackbacksTpl = new XoopsTpl(); + $trackbacksTpl->assign('permlink', $pingtraxitem->getVar('item-protocol').$pingtraxitem->getVar('item-domain').$pingtraxitem->getVar('item-referer-uri')); + $commentHandler = xoops_gethandler('comment'); + $moduleHandler = xoops_gethandler('module'); + $criteria = new CriteriaCompo(new Criteria('com_modid', $moduleHandler->getByDirname('pingtrax')->getVar('mid'))); + $criteria->add(new Criteria('com_itemid', $pingtraxitem->getVar('id'))); + $criteria->setOrder('com_created'); + $criteria->setSort('DESC'); + foreach($commentHandler->getObjects($criteria) as $comid => $comment) + $trackbacksTpl->append('trackbacks', array('subject'=>$comment->getVar('com_title'), 'comment'=>$comment->getVar('com_text'))); + ob_start(); + $trackbacksTpl->display($GLOBALS['xoops']->path('/modules/pingtrax/templates/xoTrackback.html')); + return ob_get_clean(); + } + return ''; +} Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/about.php =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/about.php (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/about.php 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1,34 @@ +<?php +/** + * PingTrax Admin + * + * 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 + */ + +include_once dirname(__FILE__) . '/../../../include/cp_header.php'; +include '../../../class/xoopsformloader.php'; +include_once dirname(__FILE__) . '/admin_header.php'; +xoops_cp_header(); + +$aboutAdmin = new ModuleAdmin(); + +echo $aboutAdmin->addNavigation('about.php'); +echo $aboutAdmin->renderabout('6KJ7RW5DR3VTJ', false); + +include_once dirname(__FILE__) . '/admin_footer.php'; +//xoops_cp_footer(); Property changes on: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/about.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin.php =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin.php (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin.php 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1,32 @@ +<?php +/** + * PingTrax Admin + * + * 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 + */ + +include_once dirname(__FILE__) . '/admin_header.php'; +xoops_cp_header(); + +$indexAdmin = new ModuleAdmin(); + +echo $indexAdmin->addNavigation('admin.php'); +echo $indexAdmin->renderIndex(); + +include_once dirname(__FILE__) . '/admin_footer.php'; +//xoops_cp_footer(); Property changes on: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin_footer.php =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin_footer.php (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin_footer.php 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1,30 @@ +<?php +/** + * PingTrax Admin + * + * 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 + */ + +echo "<div class='adminfooter'>\n" + ." <div style='text-align: center;'>\n" + ." <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" + ." </div>\n" + ." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" + ."</div>"; + +xoops_cp_footer(); Property changes on: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin_footer.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin_header.php =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin_header.php (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin_header.php 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1,68 @@ +<?php +/** + * PingTrax Admin + * + * 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 + */ + + +$path = dirname(dirname(dirname(dirname(__FILE__)))); +include_once $path . '/mainfile.php'; +include_once $path . '/include/cp_functions.php'; +require_once $path . '/include/cp_header.php'; + +global $xoopsModule; + +$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); + +//if functions.php file exist +//require_once dirname(dirname(__FILE__)) . '/include/functions.php'; + +// Load language files +xoops_loadLanguage('admin', $thisModuleDir); +xoops_loadLanguage('modinfo', $thisModuleDir); +xoops_loadLanguage('main', $thisModuleDir); + +$pathIcon16 = '../'.$xoopsModule->getInfo('icons16'); +$pathIcon32 = '../'.$xoopsModule->getInfo('icons32'); +$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); + +include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); + +if ($xoopsUser) { + $moduleperm_handler =& xoops_gethandler('groupperm'); + if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) { + redirect_header(XOOPS_URL, 1, _NOPERM); + exit(); + } +} else { + redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM); + exit(); +} + +if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once(XOOPS_ROOT_PATH."/class/template.php"); + $xoopsTpl = new XoopsTpl(); +} + +//$xoopsTpl->assign('pathIcon16', $pathIcon16); + +if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) { + include_once XOOPS_ROOT_PATH . '/class/template.php'; + $GLOBALS['xoopsTpl'] = new XoopsTpl(); +} Property changes on: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/admin_header.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/index.html =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/index.html (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/index.html 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/menu.php =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/menu.php (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/menu.php 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1,50 @@ +<?php +/** + * PingTrax Admin + * + * 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 + */ + +// defined("XOOPS_ROOT_PATH") || die("XOOPS root path not defined"); + +$path = dirname(dirname(dirname(dirname(__FILE__)))); +include_once $path . '/mainfile.php'; + +$dirname = basename(dirname(dirname(__FILE__))); +$module_handler = xoops_gethandler('module'); +$module = $module_handler->getByDirname($dirname); +$pathIcon32 = $module->getInfo('icons32'); +$pathModuleAdmin = $module->getInfo('dirmoduleadmin'); +$pathLanguage = $path . $pathModuleAdmin; + +if (!file_exists($fileinc = $pathLanguage . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) { + $fileinc = $pathLanguage . '/language/english/main.php'; +} + +include_once $fileinc; + +$adminmenu = array(); + +$i = 1; +$adminmenu[$i]['title'] = _PM_MI_INDEX; +$adminmenu[$i]['link'] = "admin/admin.php"; +$adminmenu[$i]['icon'] = $pathIcon32.'/home.png' ; +++$i; +$adminmenu[$i]['title'] = _PM_MI_ABOUT; +$adminmenu[$i]['link'] = 'admin/about.php'; +$adminmenu[$i]['icon'] = $pathIcon32.'/about.png'; Property changes on: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/admin/menu.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/api/.htaccess =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/api/.htaccess (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/api/.htaccess 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1,2 @@ +RewriteEngine On +RewriteRule ^([0-9a-z]{32})$ index.php?referer=$1 [L] \ No newline at end of file Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/api/index.php =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/api/index.php (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/api/index.php 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1,50 @@ +<?php + +require_once dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . "mainfile.php"; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . "class". DIRECTORY_SEPARATOR . "trackback.php"; + +$trackback = new PingtraxTrackback($GLOBALS['xoopsConfig']['sitename'], $GLOBALS['xoopsConfig']['sitename'], 'UTF-8'); + +if (!isset($_GET['referer'])) + die($trackback->recieve(false, "\$_GET['referer'] not specified and is required for trackback API!")); + +xoops_load("XoopsUserUtility"); +$moduleHandler = xoops_gethandler('module'); +$commentHandler = xoops_gethandler('comment'); +$itemsHandler = xoops_getmodulehandler('items', 'pingtrax'); +$item = $itemsHandler->getByReferer($_GET['referer']); + +if (!is_a($item, "PingtraxItems")) + die($trackback->recieve(false, $_GET['referer'] . " does not match any recorded item on the trackback API!")); + +$url = $_REQUEST["url"]; +if ($url) { + $excerpt = $_REQUEST["excerpt"]; + $name = ($_REQUEST["blog_name"]) ? $_REQUEST["blog_name"] : $url; + $subject = ($_REQUEST["title"]) ? $_REQUEST["title"] : $url; + $comment = "<strong> TrackBack from <a href=\"$url\">$name</a>:</strong><br />"; + $comment .= "<blockquote>$excerpt</blockquote>"; + + $pluginHandler = xoops_getmodulehandler('plugins', 'pingtrax'); + $remoteitem = $pluginHandler->getRemoteObject($item, $url, $name, $subject, $comment); + if (is_a($remoteitem, "PingtraxItems")) + { + $comment = $commentHandler->create(); + $comment->setVar('com_modid', $moduleHandler->getByDirname('pingtrax')->getVar('mid')); + $comment->setVar('com_title', $subject); + $comment->setVar('com_text', $comment); + $comment->setVar('com_created', time()); + $comment->setVar('com_url', $url); + $comment->setVar('com_ip', XoopsUserUtility::getIP(true)); + $comment->setVar('com_itemid', $item->getVar('id')); + $comment->setVar('dohtml', true); + $comment->setVar('dosmiley', true); + $comment->setVar('doxcode', true); + $comment->setVar('doimage', true); + $comment->setVar('dobr', true); + $commentHandler->insert($comment); + } +} else { + die($trackback->recieve(false, "Missing URL for trackback API!")); +} +die($trackback->recieve(true, "")); Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/blocks/index.html =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/blocks/index.html (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/blocks/index.html 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/blocks/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/index.html =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/index.html (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/index.html 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/items.php =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/items.php (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/items.php 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1,242 @@ +<?php +/** + * Pingtrax Database Class Handler module + * + * 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 + */ + + +/** + * Class PingtraxItems + * + * @subpackage pingtrax + * + * Database MySQL Table:- + * + * CREATE TABLE `pingtrax_items` ( + * `id` mediumint(20) NOT NULL AUTO_INCREMENT, + * `parent-id` mediumint(20) NOT NULL DEFAULT '0', + * `referer` varchar(44) NOT NULL DEFAULT '', + * `type` enum('local','remote','unknown') NOT NULL DEFAULT 'unknown', + * `module-dirname` varchar(30) NOT NULL DEFAULT '', + * `module-class` varchar(100) NOT NULL DEFAULT '', + * `module-item-id` mediumint(30) NOT NULL DEFAULT '0', + * `module-php-self` varchar(150) NOT NULL DEFAULT '', + * `module-get` tinytext, + * `item-author-uid` int(13) NOT NULL DEFAULT '0', + * `item-author-name` varchar(64) NOT NULL DEFAULT '', + * `item-category-id` int(20) NOT NULL DEFAULT '0', + * `item-title` varchar(180) NOT NULL DEFAULT '', + * `item-description` varchar(250) NOT NULL DEFAULT '', + * `item-protocol` enum('https://','http://') NOT NULL DEFAULT 'http://', + * `item-domain` varchar(150) NOT NULL DEFAULT '', + * `item-referer-uri` varchar(250) NOT NULL DEFAULT '', + * `item-php-self` varchar(250) NOT NULL DEFAULT '', + * `feed-protocol` enum('https://','http://') NOT NULL DEFAULT 'http://', + * `feed-domain` varchar(150) NOT NULL DEFAULT '', + * `feed-referer-uri` varchar(250) NOT NULL DEFAULT '', + * `discovery-hook` enum('php','preloader','smarty','combination','unknown') NOT NULL DEFAULT 'unknown', + * `user-session` enum('admin','user','guest','unknown') NOT NULL DEFAULT 'unknown', + * `created` int(12) NOT NULL DEFAULT '0', + * `updated` int(12) NOT NULL DEFAULT '0', + * `offlined` int(12) NOT NULL DEFAULT '0', + * PRIMARY KEY (`id`), + * KEY `SEARCH` (`referer`,`item-author-uid`,`item-author-name`,`module-dirname`,`item-protocol`,`item-domain`,`item-referer-uri`,`module-php-self`,`item-php-self`,`discovery-hook`,`id`) KEY_BLOCK_SIZE=128, + * KEY `CHRONOLOGISTICS` (`id`,`referer`,`created`,`updated`,`offlined`) USING BTREE KEY_BLOCK_SIZE=64 + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=16; + */ +class PingtraxItems extends XoopsObject +{ + /** + * + * @var unknown + */ + var $_configs = array(); + + /** + * + */ + function __construct() + { + $moduleHandler = xoops_gethandler('module'); + $configHandler = xoops_gethandler('config'); + $this->_configs = $configHandler->getConfigList($moduleHandler->getByDirname(basename(dirname(__DIR__)))->getVar('mid')); + + $this->XoopsObject(); + $this->initVar('id', XOBJ_DTYPE_INT, null, false); + $this->initVar('parent-id', XOBJ_DTYPE_INT, null, false); + $this->initVar('referer', XOBJ_DTYPE_OTHER, sha1(NULL), false, 44); + $this->initVar('type', XOBJ_DTYPE_ENUM, 'unknown', true, false, false, false, array('local','remote','unknown')); + $this->initVar('module-dirname', XOBJ_DTYPE_OTHER, '', false, 30); + $this->initVar('module-class', XOBJ_DTYPE_OTHER, '', false, 100); + $this->initVar('module-item-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('module-php-self', XOBJ_DTYPE_OTHER, '', false, 150); + $this->initVar('module-get', XOBJ_DTYPE_ARRAY, array(), false); + $this->initVar('item-author-uid', XOBJ_DTYPE_INT, 0, false); + $this->initVar('item-author-name', XOBJ_DTYPE_TXTBOX, '', false, 64); + $this->initVar('item-category-id', XOBJ_DTYPE_INT, null, false); + $this->initVar('item-title', XOBJ_DTYPE_TXTBOX, '', false, 180); + $this->initVar('item-description', XOBJ_DTYPE_TXTBOX, '', false, 250); + $this->initVar('item-protocol', XOBJ_DTYPE_ENUM, XOOPS_PROT, true, false, false, false, array('https://','http://')); + $this->initVar('item-domain', XOBJ_DTYPE_TXTBOX, parse_url(XOOPS_URL, PHP_URL_HOST), true, 150); + $this->initVar('item-referer-uri', XOBJ_DTYPE_TXTBOX, $_SERVER["REQUEST_URI"], true, 250); + $this->initVar('item-php-self', XOBJ_DTYPE_TXTBOX, str_replace(XOOPS_ROOT_PATH, "", $_SERVER["PHP_SELF"]), true, 250); + $this->initVar('feed-protocol', XOBJ_DTYPE_ENUM, parse_url(str_replace("%xoops_url%", XOOPS_URL, $this->_configs['default_feed_url']), PHP_URL_SCHEME), true, false, false, false, array('https://','http://')); + $this->initVar('feed-domain', XOBJ_DTYPE_TXTBOX, parse_url(str_replace("%xoops_url%", XOOPS_URL, $this->_configs['default_feed_url']), PHP_URL_HOST), true, 150); + $this->initVar('feed-referer-uri', XOBJ_DTYPE_TXTBOX, parse_url(str_replace("%xoops_url%", XOOPS_URL, $this->_configs['default_feed_url']), PHP_URL_PATH) . '/backend.php', true, 250); + $this->initVar('discovery-hook', XOBJ_DTYPE_ENUM, 'unknown', true, false, false, false, array('php','preloader','smarty','combination','unknown')); + $this->initVar('user-session', XOBJ_DTYPE_ENUM, 'unknown', true, false, false, false, array('admin','user','guest','unknown')); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + $this->initVar('offline', XOBJ_DTYPE_INT, 0, false); + } + + /** + * + * @return string + */ + function getPingXML() + { + $xml = "<?xml version=\"1.0\"?>\n"; + $xml .= "<methodCall>\n"; + $xml .= "\t<methodName>weblogUpdates.extendedPing</methodName>\n"; + $xml .= "\t<params>\n"; + $xml .= "\t\t<param>\n"; + $xml .= "\t\t\t<value>".$this->getVar('item-title')."</value>\n"; + $xml .= "\t\t</param>\n"; + $xml .= "\t\t<param>\n"; + $xml .= "\t\t\t<value>".$this->getVar('item-protocol').$this->getVar('item-domain')."</value>\n"; + $xml .= "\t\t</param>\n"; + $xml .= "\t\t<param>\n"; + $xml .= "\t\t\t<value>".$this->getVar('item-protocol').$this->getVar('item-domain').$this->getVar('item-referer-uri')."</value>\n"; + $xml .= "\t\t</param>\n"; + $xml .= "\t\t<param>\n"; + $xml .= "\t\t\t<value>".$this->getVar('feed-protocol').$this->getVar('feed-domain').$this->getVar('feed-referer-uri')."</value>\n"; + $xml .= "\t\t</param>\n"; + $xml .= "\t</params>\n"; + $xml .= "</methodCall>"; + return $xml; + } +} + +/** + * Class PingtraxItemsHandler + */ +class PingtraxItemsHandler extends XoopsPersistableObjectHandler +{ + + /** + * @param null|object $db + */ + function __construct(&$db) + { + parent::__construct($db, "pingtrax_items", 'PingtraxItems', 'id', 'referer'); + } + + + function insert($object = NULL, $force = true) + { + if ($object->isNew()) + { + $criteria = new Criteria('referer', $object->getVar('referer')); + if ($this->getCount($criteria)==0) + $object->setVar('created', time()); + else + { + $objs = $this->getObjects($criteria, false); + if (isset($objs[0])) + return $objs[0]->getVar('id'); + else + return false; + } + if ($object->getVar('type') == 'local') + { + $sitemapsHandler = xoops_getmodulehandler('sitemaps', 'pingtrax'); + $criteria = new CriteriaCompo(new Criteria('protocol', XOOPS_PROT)); + $criteria->add(new Criteria('domain', parse_url(XOOPS_URL, PHP_URL_HOST))); + $criteria->add(new Criteria('baseurl', parse_url(XOOPS_URL, PHP_URL_PATH))); + if ($sitemapsHandler->getCount($criteria)==0) + { + $sitemap = $sitemapsHandler->create(); + $sitemap->setVar('referer', md5(XOOPS_URL.microtime(true).XOOPS_DB_USER.XOOPS_DB_PASS)); + $sitemap->setVar('protocol', XOOPS_PROT); + $sitemap->setVar('domain', parse_url(XOOPS_URL, PHP_URL_HOST)); + $sitemap->setVar('baseurl', parse_url(XOOPS_URL, PHP_URL_PATH)); + $sitemap->setVar('filename', 'sitemap.'.str_replace("://", "", XOOPS_PROT) . "." . parse_url(XOOPS_URL, PHP_URL_HOST) . '.xml'); + $sitemap = $sitemapsHandler->get($sitemap = $sitemapsHandler->insert($sitemap, true)); + } else { + $obj = $sitemapsHandler->getObjects($criteria, false); + if (is_object($obj[0])) + $sitemap = $obj[0]; + } + $items_sitemapsHandler = xoops_getmodulehandler('items_sitemaps', 'pingtrax'); + $itemsitemap = $items_sitemapsHandler->create(); + $itemsitemap->setVar('map-referer', $sitemap->getVar('referer')); + $itemsitemap->setVar('item-referer', $object->getVar('referer')); + $items_sitemapsHandler->insert($itemsitemap, true); + $items_pingsHandler = xoops_getmodulehandler('items_pings', 'pingtrax'); + $pingsHandler = xoops_getmodulehandler('pings', 'pingtrax'); + $criteria = new CriteriaCompo(new Criteria('type', 'XML-RPC')); + $criteria->add(new Criteria('offline', 0)); + foreach($pingsHandler->getObjects($criteria, true) as $id => $ping) + { + $itemping = $items_pingsHandler->create(); + $itemping->setVar('ping-referer', $ping->getVar('referer')); + $itemping->setVar('item-referer', $object->getVar('referer')); + $items_pingsHandler->insert($itemping, true); + } + } + } else { + $object->setVar('updated', time()); + } + switch ($object->getVar('user-session')) + { + default: + case 'unknown': + if (is_object($GLOBALS['xoopsUser'])) + { + if ($GLOBALS['xoopsUser']->isAdmin()) + $object->setVar('user-session', 'admin'); + } + case 'admin': + if (is_object($GLOBALS['xoopsUser'])) + { + if (!$GLOBALS['xoopsUser']->isAdmin()) + $object->setVar('user-session', 'user'); + } + case 'user': + if (!is_object($GLOBALS['xoopsUser'])) + $object->setVar('user-session', 'guest'); + case 'guest': + break; + } + return parent::insert($object, $force); + } + + function getByReferer($referer = '') + { + $criteria = new CriteriaCompo(new Criteria('referer', $referer)); + $criteria->add(new Criteria('offline', 0)); + if ($this->getCount($criteria)==0) + return NULL; + $objs = $this->getObjects($criteria, false); + if (isset($objs[0]) && is_a($objs[0], "PingtraxItems")) + return $objs[0]; + return NULL; + } +} Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/items_pings.php =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/items_pings.php (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/items_pings.php 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1,73 @@ +<?php +/** + * Pingtrax Database Class Handler module + * + * 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 + */ + + +/** + * Class PingtraxItems_pings + * + * @subpackage itemtrax + * + * Database MySQL Table:- + * + * CREATE TABLE `pingtrax_items_pings` ( + * `id` mediumint(32) NOT NULL AUTO_INCREMENT, + * `ping-referer` varchar(44) NOT NULL DEFAULT '', + * `item-referer` varchar(44) NOT NULL DEFAULT '', + * `when` int(12) NOT NULL DEFAULT '0', + * PRIMARY KEY (`id`), + * KEY `SEARCH` (`id`,`ping-referer`,`item-referer`) USING BTREE, + * KEY `CHRONOLOGISTICS` (`ping-referer`,`item-referer`,`when`) USING BTREE KEY_BLOCK_SIZE=64 + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=8; + * + */ +class PingtraxItems_pings extends XoopsObject +{ + /** + * + */ + function __construct() + { + $this->XoopsObject(); + $this->initVar('id', XOBJ_DTYPE_INT, null, false); + $this->initVar('ping-referer', XOBJ_DTYPE_TXTBOX, null, true, 44); + $this->initVar('item-referer', XOBJ_DTYPE_TXTBOX, null, true, 44); + $this->initVar('when', XOBJ_DTYPE_INT, 0, false); + } + +} + +/** + * Class PingtraxItems_pingsHandler + */ +class PingtraxItems_pingsHandler extends XoopsPersistableObjectHandler +{ + + /** + * @param null|object $db + */ + function __construct(&$db) + { + parent::__construct($db, "pingtrax_items_pings", 'PingtraxItems_pings', 'id', 'ping-referer'); + } + + +} Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/items_sitemaps.php =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/items_sitemaps.php (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/items_sitemaps.php 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1,353 @@ +<?php +/** + * Pingtrax Database Class Handler module + * + * 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 + */ + +require_once __DIR__ . DIRECTORY_SEPARATOR . 'simple_html_dom.php'; + +/** + * Class PingtraxItems_sitemaps + * + * @subpackage itemtrax + * + * Database MySQL Table:- + * + * CREATE TABLE `pingtrax_items_sitemaps` ( + * `id` mediumint(32) NOT NULL AUTO_INCREMENT, + * `map-referer` varchar(44) NOT NULL DEFAULT '', + * `item-referer` varchar(44) NOT NULL DEFAULT '', + * `frequency` enum('monthly','fortnightly','weekly','daily') NOT NULL DEFAULT 'monthly', + * `priority` float(2,1) NOT NULL DEFAULT '0.9', + * `checking` int(12) NOT NULL DEFAULT '0', + * `changed` int(12) NOT NULL DEFAULT '0', + * `changes` int(12) NOT NULL DEFAULT '0', + * `when` int(12) NOT NULL DEFAULT '0', + * `header-md5` varchar(32) NOT NULL DEFAULT '0', + * `header-changes` int(12) NOT NULL DEFAULT '0', + * `header-changed` int(12) NOT NULL DEFAULT '0', + * `header-bytes` int(12) NOT NULL DEFAULT '0', + * `body-md5` varchar(32) NOT NULL DEFAULT '0', + * `body-changes` int(12) NOT NULL DEFAULT '0', + * `body-changed` int(12) NOT NULL DEFAULT '0', + * `body-bytes` int(12) NOT NULL DEFAULT '0', + * `tabled-md5` varchar(32) NOT NULL DEFAULT '0', + * `tabled-changes` int(12) NOT NULL DEFAULT '0', + * `tabled-changed` int(12) NOT NULL DEFAULT '0', + * `tabled-bytes` int(12) NOT NULL DEFAULT '0', + * `dived-md5` varchar(32) NOT NULL DEFAULT '0', + * `dived-changes` int(12) NOT NULL DEFAULT '0', + * `dived-changed` int(12) NOT NULL DEFAULT '0', + * `dived-bytes` int(12) NOT NULL DEFAULT '0', + * `header-md5-last` varchar(32) NOT NULL DEFAULT '0', + * `header-changes-last` int(12) NOT NULL DEFAULT '0', + * `header-changed-last` int(12) NOT NULL DEFAULT '0', + * `header-bytes-last` int(12) NOT NULL DEFAULT '0', + * `body-md5-last` varchar(32) NOT NULL DEFAULT '0', + * `body-changes-last` int(12) NOT NULL DEFAULT '0', + * `body-changed-last` int(12) NOT NULL DEFAULT '0', + * `body-bytes-last` int(12) NOT NULL DEFAULT '0', + * `tabled-md5-last` varchar(32) NOT NULL DEFAULT '0', + * `tabled-changes-last` int(12) NOT NULL DEFAULT '0', + * `tabled-changed-last` int(12) NOT NULL DEFAULT '0', + * `tabled-bytes-last` int(12) NOT NULL DEFAULT '0', + * `dived-md5-last` varchar(32) NOT NULL DEFAULT '0', + * `dived-changes-last` int(12) NOT NULL DEFAULT '0', + * `dived-changed-last` int(12) NOT NULL DEFAULT '0', + * `dived-bytes-last` int(12) NOT NULL DEFAULT '0', + * PRIMARY KEY (`id`), + * KEY `SEARCH` (`id`,`map-referer`,`item-referer`) USING BTREE, + * KEY `CHRONOLOGISTICS` (`map-referer`,`item-referer`) USING BTREE KEY_BLOCK_SIZE=64 + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=8; + * + */ +class PingtraxItems_sitemaps extends XoopsObject +{ + /** + * + */ + function __construct() + { + $this->XoopsObject(); + $this->initVar('id', XOBJ_DTYPE_INT, null, false); + $this->initVar('map-referer', XOBJ_DTYPE_TXTBOX, null, true, 44); + $this->initVar('item-referer', XOBJ_DTYPE_TXTBOX, null, true, 44); + $this->initVar('frequency', XOBJ_DTYPE_ENUM, 'daily', false, false, false, false, false, array('monthly','fortnightly','weekly','daily')); + $this->initVar('priority', XOBJ_DTYPE_FLOAT, 0.9, false); + $this->initVar('checking', XOBJ_DTYPE_INT, time(), false); + $this->initVar('changed', XOBJ_DTYPE_INT, time(), false); + $this->initVar('changes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('when', XOBJ_DTYPE_INT, time(), false); + $this->initVar('header-md5', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('header-changes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('header-changed', XOBJ_DTYPE_INT, time(), false); + $this->initVar('header-bytes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('body-md5', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('body-changes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('body-changed', XOBJ_DTYPE_INT, time(), false); + $this->initVar('body-bytes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('tabled-md5', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('tabled-changes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('tabled-changed', XOBJ_DTYPE_INT, time(), false); + $this->initVar('tabled-bytes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('dived-md5', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('dived-changes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('dived-changed', XOBJ_DTYPE_INT, time(), false); + $this->initVar('dived-bytes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('header-md5-last', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('header-changes-last', XOBJ_DTYPE_INT, 0, false); + $this->initVar('header-changed-last', XOBJ_DTYPE_INT, time(), false); + $this->initVar('header-bytes-last', XOBJ_DTYPE_INT, 0, false); + $this->initVar('body-md5-last', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('body-changes-last', XOBJ_DTYPE_INT, 0, false); + $this->initVar('body-changed-last', XOBJ_DTYPE_INT, time(), false); + $this->initVar('body-bytes-last', XOBJ_DTYPE_INT, 0, false); + $this->initVar('tabled-md5-last', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('tabled-changes-last', XOBJ_DTYPE_INT, 0, false); + $this->initVar('tabled-changed-last', XOBJ_DTYPE_INT, time(), false); + $this->initVar('tabled-bytes-last', XOBJ_DTYPE_INT, 0, false); + $this->initVar('dived-md5-last', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('dived-changes-last', XOBJ_DTYPE_INT, 0, false); + $this->initVar('dived-changed-last', XOBJ_DTYPE_INT, time(), false); + $this->initVar('dived-bytes-last', XOBJ_DTYPE_INT, 0, false); + } + + /** + * + */ + function checkForChanges() + { + $changes = 0; + $itemsHandler = xoops_getmodulehandler('items', 'pingtrax'); + $item = $itemsHandler->getByReferer($this->getVar('item-referer')); + if (is_a($item, "PingtraxItems")) + { + $html = $this->getURIData($item->getVar('item-protocol').$item->getVar('item-domain').$item->getVar('item-referer-uri'), 65, 65, $item->getVar('module-get')); + if (strlen($html)==0) + { + foreach($item->getVar('module-get') as $item => $value) + $get[$item] = $value; + $html = $this->getURIData($item->getVar('item-protocol').$item->getVar('item-domain').$item->getVar('item-php-self')."?".http_build_query($get), 65, 65, $get); + } + if (strlen($html)!=0) + { + $dom = str_get_html($html); + // Does headers + $head = $dom->find("head"); + $changes .+ $this->setVars(array('header-md5' => md5($head->innertext), 'header-bytes' => strlen($head->innertext))); + // Does Full Body + $body = $dom->find("body"); + $changes .+ $this->setVars(array('body-md5' => md5($body->plaintext), 'body-bytes' => strlen($body->plaintext))); + // Does Tables + $tablesbytes = 0; + $tablesmd5 = ''; + foreach($dom->find('table') as $table) + { + $tablesmd5 = md5($tablesmd5 . sha1($table->plaintext)); + $tablesbytes = $tablesbytes + strlen($table->plaintext); + } + $changes .+ $this->setVars(array('tabled-md5' => $tablesmd5, 'tabled-bytes' => $tablesbytes)); + // Does Div's + $divsbytes = 0; + $divsmd5 = ''; + foreach($dom->find('div') as $div) + { + $divsmd5 = md5($divsmd5 . sha1($div->plaintext)); + $divsbytes = $divsbytes + strlen($div->plaintext); + } + $changes .+ $this->setVars(array('dived-md5' => $divsmd5, 'dived-bytes' => $divsbytes)); + } + } + return $changes; + } + + /** + * + * {@inheritDoc} + * @see XoopsObject::setVars() + */ + function setVars($var_arr = array()) + { + $changes = 0; + $lasting = array('header' => array('-md5', '-bytes'), 'body' => array('-md5', '-bytes'), 'tabled' => array('-md5', '-bytes'), 'dived' => array('-md5', '-bytes')); + foreach($lasting as $key=> $values) + { + $found = false; + foreach($values as $value) + if (in_array($key.$value, array_keys($var_arr))) + { + if ($this->getVar($key.$value)!=$var_arr[$key.$value]) + foreach($values as $val) + $this->setVar($key.$val.'-last', $this->getVar($key.$val)); + $found = true; + } + if ($found == true) + { + $changes .+ 1; + $this->setVar($key.'-changes', $this->getVar($key.'-changes')+1); + $this->setVar($key.'-changed', time()); + if ($this->getVar('changed')>0) + { + if (time() - $this->getVar('changed') < (3600 * 24)) + { + $this->setvar('frequency', 'daily'); + } elseif (time() - $this->getVar('changed') < (3600 * 24 * 7)) + { + $this->setvar('frequency', 'weekly'); + } elseif (time() - $this->getVar('changed') < (3600 * 24 * 14)) + { + $this->setvar('frequency', 'fortnightly'); + } else { + $this->setvar('frequency', 'monthly'); + } + } else + $this->setvar('frequency', 'daily'); + $this->setVar('changed', time()); + $this->setVar('changes', $this->getVar('changes')+1); + if ($this->getvar('priority') < 0.9) + $this->setVar('priority', $this->getVar('priority') + 0.1); + } else { + if ($this->getVar('changed')>0) + { + if (time() - $this->getVar('changed') < (3600 * 24)) + { + $this->setvar('frequency', 'daily'); + } elseif (time() - $this->getVar('changed') < (3600 * 24 * 7)) + { + $this->setvar('frequency', 'weekly'); + } elseif (time() - $this->getVar('changed') < (3600 * 24 * 14)) + { + $this->setvar('frequency', 'fortnightly'); + } else { + $this->setvar('frequency', 'monthly'); + } + } else { + $this->setvar('frequency', 'daily'); + $this->setVar('changed', time()); + } + if ($this->getvar('frequency')=='') + $this->setvar('frequency', 'daily'); + if ($this->getvar('priority') > 0.1) + $this->setVar('priority', $this->getVar('priority') - 0.1); + } + } + + switch($this->getVar('frequency')) + { + case 'daily': + default: + $this->setvar('frequency', 'daily'); + $this->setVar('checking', time() + (3600 * 24 - 900)); + break; + case 'weekly': + $this->setVar('checking', time() + (3600 * 24 * 7 - 900)); + break; + case 'fortnightly': + $this->setVar('checking', time() + (3600 * 24 * 14 - 900)); + break; + case 'monthly': + $this->setVar('checking', time() + (3600 * 24 * 7 * 4 - 900)); + break; + } + parent::setVars($var_arr); + return ($changes>0?$changes:false); + } + + + /* function getURIData() + * + * cURL Routine + * @author Simon Roberts (Chronolabs) si...@la... + * + * @return float() + */ + private function getURIData($uri = '', $timeout = 65, $connectout = 65, $post_data = array()) + { + if (!function_exists("curl_init")) + { + return file_get_contents($uri); + } + if (!$btt = curl_init($uri)) { + return false; + } + curl_setopt($btt, CURLOPT_HEADER, 0); + curl_setopt($btt, CURLOPT_POST, (count($posts)==0?false:true)); + if (count($posts)!=0) + curl_setopt($btt, CURLOPT_POSTFIELDS, http_build_query($post_data)); + curl_setopt($btt, CURLOPT_CONNECTTIMEOUT, $connectout); + curl_setopt($btt, CURLOPT_TIMEOUT, $timeout); + curl_setopt($btt, CURLOPT_RETURNTRANSFER, true); + curl_setopt($btt, CURLOPT_VERBOSE, false); + curl_setopt($btt, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($btt, CURLOPT_SSL_VERIFYPEER, false); + $data = curl_exec($btt); + curl_close($btt); + return $data; + } + + +} + +/** + * Class PingtraxItems_sitemapsHandler + */ +class PingtraxItems_sitemapsHandler extends XoopsPersistableObjectHandler +{ + + /** + * @param null|object $db + */ + function __construct(&$db) + { + parent::__construct($db, "itemtrax_items_sitemaps", 'PingtraxItems_sitemaps', 'id', 'map-referer'); + } + + + /** + * + * @param array $array + */ + private function addTimeLimit($seconds = 30) + { + global $timelimit; + $timelimit .+ $seconds; + set_time_limit($timelimit); + } + + /** + * + * @param string $mapreferer + */ + function checkForChanges($mapreferer = '') + { + $changes = 0; + $this->addTimeLimit(120); + $criteria = new CriteriaCompo(new Criteria('checking', time(), "<=")); + if (!empty($mapreferer)) + $criteria->add(new Criteria('map-referer', $mapreferer)); + foreach($this->getObjects($criteria, true) as $id => $item) + { + $start = microtime(true); + if (is_a($item, "PingtraxItems_sitemaps")) + $changes = $changes + $item->checkForChanges(); + $this->addTimeLimit(microtime(true)-$start+5); + } + return $changes; + } +} Added: XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/pings.php =================================================================== --- XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/pings.php (rev 0) +++ XoopsModules/pingtrax/releases/1.01/modules/pingtrax/class/pings.php 2015-12-07 14:35:39 UTC (rev 13183) @@ -0,0 +1,252 @@ +<?php +/** + * Pingtrax Database Class Handler module + * + * 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 + */ + + +/** + * Class PingtraxPings + * + * @subpackage pingtrax + * + * Database MySQL Table:- + * + * CREATE TABLE `pingtrax_pings` ( + * `id` int(14) NOT NULL AUTO_INCREMENT, + * `referer` varchar(44) NOT NULL DEFAULT '', + * `type` enum('XML-RPC','SITEMAPS') NOT NULL DEFAULT 'XML-RPC', + * `uri` varchar(250) NOT NULL DEFAULT '', + * `last-item-referer` varchar(44) NOT NULL DEFAULT '', + * `successful-pings` int(18) NOT NULL DEFAULT '0', + * `failed-pings` int(18) NOT NULL DEFAULT '0', + * `sleep-till` int(12) NOT NULL DEFAULT '0', + * `success-time` int(12) NOT NULL DEFAULT '0', + * `failure-time` int(12) NOT NULL DEFAULT '0', + * `created` int(12) NOT NULL DEFAULT '0', + * `updated` int(12) NOT NULL DEFAULT '0', + * `offlined` int(12) NOT NULL DEFAULT '0', + * PRIMARY KEY (`id`,`referer`,`type`,`uri`), + * KEY `SEARCH` (`referer`,`type`,`uri`,`last-item-referer`,`successful-pings`,`failed-pings`,`id`) USING BTREE, + * KEY `CHRONOLOGISTICS` (`id`,`referer`,`created`,`updated`,`offlined`,`failure-time`,`success-time`,`sleep-till`) USING BTREE KEY_BLOCK_SIZE=128 + * ) ENGINE=InnoDB AUTO_INCREMENT=150 DEFAULT CHARSET=utf8 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=16; + * + */ +class PingtraxPings extends XoopsObject +{ + /** + * + */ + function __construct() + { + $this->XoopsObject(); + $this->initVar('id', XOBJ_DTYPE_INT, null, false); + $this->initVar('referer', XOBJ_DTYPE_OTHER, sha1(NULL), false, 44); + $this->initVar('type', XOBJ_DTYPE_ENUM, 'XML-RPC', true, false, false, false, array('XML-RPC','SITEMAPS')); + $this->initVar('uri', XOBJ_DTYPE_TXTBOX, null, true, 250); + $this->initVar('last-item-referer', XOBJ_DTYPE_OTHER, sha1(NULL), false, 44); + $this->initVar('successful-pings', XOBJ_DTYPE_INT, 0, false); + $this->initVar('failed-pings', XOBJ_DTYPE_INT, 0, false); + $this->initVar('sleep-till', XOBJ_DTYPE_INT, 0, false); + $this->initVar('success-time', XOBJ_DTYPE_INT, 0, false); + $this->initVar('failure-time', XOBJ_DTYPE_INT, 0, false); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + $this->initVar('offline', XOBJ_DTYPE_INT, 0, false); + } + + /** + * + * @param PingtraxItems $item + * @return mixed + */ + function getPingURL(PingtraxItems $item) + { + $uri = $this->getVar('uri'); + $uri = str_replace(urlencode($item->getVar('item-title')), '%title', $uri); + $uri = str_replace(urlencode($item->getVar('item-decription')), '%description', $uri); + $uri = str_replace(urlencode($item->getVar('item-protocol').$item->getVar('item-domain').$item->getVar('item-referer-uri')), '%url', $uri); + $uri = str_replace(urlencode($item->getVar('feed-protocol').$item->getVar('feed-domain').$item->getVar('feed-referer-uri')), '%feed', $uri); + return $uri; + } + /** + * + * @param PingtraxItems $item + * @return mixed + */ + function getSitemapURL(PingtraxSitemaps $sitemap) + { + $uri = $this->getVar('uri'); + $uri = str_replace(urlencode($sitemap->getVar('protocol').$sitemap->getVar('domain').(strlen($sitemap->getVar('baseurl'))>1?((substr($sitemap->getVar('baseurl'),0,1)!="/"?"/":"").$sitemap->getVar('baseurl').(substr($sitemap->getVar('baseurl'),strlen($sitemap->getVar('baseurl'))-1,1)!="/"?"/":"")):"/")).$sitemap->getVar('filename'), '%url', $uri); + return $uri; + } + +} + +/** + * Class PingtraxPingsHandler + */ +class PingtraxPingsHandler extends XoopsPersistableObjectHandler +{ + /** + * + * @var unknown + */ + var $_configs = array(); + + /** + * var string URL of JSON Resource for Install + */ + var $_resource = "https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/pingtrax/data/ping-resources.json?format=raw"; + + /** + * @param null|object $db + */ + function __construct(&$db) + { + $moduleHandler = xoops_gethandler('module'); + $configHandler = xoops_gethandler('config'); + $this->_configs = $configHandler->getConfigList($moduleHandler->getByDirname(basename(dirname(__DIR__)))->getVar('mid')); + + parent::__construct($db, "pingtrax_pings", 'PingtraxPings', 'id', 'referer'); + + $criteria = new Criteria('id',0,"<>"); + if ($this->getCount($criteria)==0) + { + $data = json_decode(file_get_contents($this->_resource), true); + foreach($data as $referer => $values) + { + $obj = $this->create(true); + $obj->setVar('referer', $referer); + $obj->setVar('type', $values['type']); + $obj->setVar('uri', $values['uri']); + $this->insert($obj); + } + } + } + + function insert($object = NULL, $force = true) + { + if ($object->isNew()) + { + $object->setVar('created', time()); + } else { + $object->setVar('updated', time()); + } + return parent::insert($object, $force); + } + + + function makePings($referer = '') + { + $this->addTimeLimit(120); + $items_pingsHandler = xoops_getmodulehandler('items_pings', 'pingtrax'); + $itemsHandler = xoops_getmodulehandler('items', 'pingtrax'); + $criteria = new CriteriaCompo(new Criteria('offline', 0)); + if (!empty($referer)) + $criteria->add(new Criteria('referer', $r... [truncated message content] |
From: <wis...@us...> - 2015-12-08 22:35:08
|
Revision: 13188 http://sourceforge.net/p/xoops/svn/13188 Author: wishcraft Date: 2015-12-08 22:35:05 +0000 (Tue, 08 Dec 2015) Log Message: ----------- Ping Trax 1.02 Stable -- Finished\!\! Added Paths: ----------- XoopsModules/pingtrax/releases/1.02/ XoopsModules/pingtrax/releases/1.02/class/ XoopsModules/pingtrax/releases/1.02/class/smarty/ XoopsModules/pingtrax/releases/1.02/class/smarty/xoops_plugins/ XoopsModules/pingtrax/releases/1.02/class/smarty/xoops_plugins/function.xoTrackbacks.php XoopsModules/pingtrax/releases/1.02/modules/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/about.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin_footer.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin_header.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/items.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/menu.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/pings.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/api/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/api/.htaccess XoopsModules/pingtrax/releases/1.02/modules/pingtrax/api/index.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/blocks/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/blocks/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/blocks/pingtrax_blocks.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/items.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/items_pings.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/items_sitemaps.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/pings.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/plugins.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/simple_html_dom.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/sitemaps.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/trackback.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/images/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/images/add.png XoopsModules/pingtrax/releases/1.02/modules/pingtrax/images/copy.png XoopsModules/pingtrax/releases/1.02/modules/pingtrax/images/delete.png XoopsModules/pingtrax/releases/1.02/modules/pingtrax/images/edit.png XoopsModules/pingtrax/releases/1.02/modules/pingtrax/images/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/images/link.png XoopsModules/pingtrax/releases/1.02/modules/pingtrax/images/logo.png XoopsModules/pingtrax/releases/1.02/modules/pingtrax/include/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/include/category-id-names.txt XoopsModules/pingtrax/releases/1.02/modules/pingtrax/include/exclude-names.txt XoopsModules/pingtrax/releases/1.02/modules/pingtrax/include/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/include/install.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/include/item-id-names.txt XoopsModules/pingtrax/releases/1.02/modules/pingtrax/language/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/language/english/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/language/english/admin.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/language/english/help/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/language/english/help/help.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/language/english/help/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/language/english/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/language/english/modinfo.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/language/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/pingtrax.css XoopsModules/pingtrax/releases/1.02/modules/pingtrax/plugins/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/plugins/default.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/plugins/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/plugins/xcenter.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/preloads/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/preloads/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/preloads/items.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/preloads/ping.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/preloads/sitemap.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/preloads/trackback.php XoopsModules/pingtrax/releases/1.02/modules/pingtrax/sql/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/sql/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/sql/mysql.sql XoopsModules/pingtrax/releases/1.02/modules/pingtrax/sql/tables.json XoopsModules/pingtrax/releases/1.02/modules/pingtrax/templates/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/templates/admin/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/templates/admin/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/templates/admin/items.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/templates/admin/pings.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/templates/blocks/ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/templates/blocks/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/templates/blocks/trackbacks_block.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/templates/index.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/templates/sitemaps.xml.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/templates/xoTrackback.html XoopsModules/pingtrax/releases/1.02/modules/pingtrax/xoops.org.news.article.txt XoopsModules/pingtrax/releases/1.02/modules/pingtrax/xoops_version.php Added: XoopsModules/pingtrax/releases/1.02/class/smarty/xoops_plugins/function.xoTrackbacks.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/class/smarty/xoops_plugins/function.xoTrackbacks.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/class/smarty/xoops_plugins/function.xoTrackbacks.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,51 @@ +<?php +/** + * PingTrax Smarty Trackback Function + * + * 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 + */ + +function smarty_function_xoTrackbacks($tag_args, &$comp) +{ + $attrs = $comp->_parse_attrs($tag_args); + foreach ($attrs as $arg_name => $arg_value) { + if ($arg_name == 'dirname') { + $dirname = $arg_value; + continue; + } + } + global $pingtraxitem; + if (is_a($pingtraxitem, "PingtraxItems")) + { + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL . "/modules/pingtrax/pingtrax.css"); + $trackbacksTpl = new XoopsTpl(); + $trackbacksTpl->assign('permlink', $pingtraxitem->getVar('item-protocol').$pingtraxitem->getVar('item-domain').$pingtraxitem->getVar('item-referer-uri')); + $commentHandler = xoops_gethandler('comment'); + $moduleHandler = xoops_gethandler('module'); + $criteria = new CriteriaCompo(new Criteria('com_modid', $moduleHandler->getByDirname('pingtrax')->getVar('mid'))); + $criteria->add(new Criteria('com_itemid', $pingtraxitem->getVar('id'))); + $criteria->setOrder('com_created'); + $criteria->setSort('DESC'); + foreach($commentHandler->getObjects($criteria) as $comid => $comment) + $trackbacksTpl->append('trackbacks', array('subject'=>$comment->getVar('com_title'), 'comment'=>$comment->getVar('com_text'))); + ob_start(); + $trackbacksTpl->display($GLOBALS['xoops']->path('/modules/pingtrax/templates/xoTrackback.html')); + return ob_get_clean(); + } + return ''; +} Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/about.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/about.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/about.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,34 @@ +<?php +/** + * PingTrax Admin + * + * 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 + */ + +include_once dirname(__FILE__) . '/../../../include/cp_header.php'; +include '../../../class/xoopsformloader.php'; +include_once dirname(__FILE__) . '/admin_header.php'; +xoops_cp_header(); + +$aboutAdmin = new ModuleAdmin(); + +echo $aboutAdmin->addNavigation('about.php'); +echo $aboutAdmin->renderabout('6KJ7RW5DR3VTJ', false); + +include_once dirname(__FILE__) . '/admin_footer.php'; +//xoops_cp_footer(); Property changes on: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/about.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,48 @@ +<?php +/** + * PingTrax Admin + * + * 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 + */ + +include_once dirname(__FILE__) . '/admin_header.php'; +xoops_cp_header(); + + +$pingsHandler = xoops_getmodulehandler('pings', 'pingtrax'); +$itemsHandler = xoops_getmodulehandler('items', 'pingtrax'); + +$indexAdmin = new ModuleAdmin(); + +$indexAdmin->addInfoBox(_AM_PINGTRAX_STATISTICS); + +$indexAdmin->addInfoBoxLine(_AM_PINGTRAX_STATISTICS, "<label>"._AM_PINGTRAX_STATISTICS_PINGLISTS."</label>", $pingsHandler->getCountPinglists(), 'Green'); +$indexAdmin->addInfoBoxLine(_AM_PINGTRAX_STATISTICS, "<label>"._AM_PINGTRAX_STATISTICS_SITEMAPS."</label>", $pingsHandler->getCountSitemaps(), 'Green'); +$indexAdmin->addInfoBoxLine(_AM_PINGTRAX_STATISTICS, "<label>"._AM_PINGTRAX_STATISTICS_PINGSUCCESS."</label>", $pingsHandler->getSumSuccessful(), 'Green'); +$indexAdmin->addInfoBoxLine(_AM_PINGTRAX_STATISTICS, "<label>"._AM_PINGTRAX_STATISTICS_PINGFAILURES."</label>", $pingsHandler->getSumFailures(), 'Green'); +$indexAdmin->addInfoBoxLine(_AM_PINGTRAX_STATISTICS, "<label>"._AM_PINGTRAX_STATISTICS_PINGLASTSUCCESS."</label>", $pingsHandler->getLastSuccessDate('Y-m-d H:i:s'), 'Purple'); +$indexAdmin->addInfoBoxLine(_AM_PINGTRAX_STATISTICS, "<label>"._AM_PINGTRAX_STATISTICS_PINGLASTFAILED."</label>", $pingsHandler->getLastFailedDate('Y-m-d H:i:s'), 'Red'); +$indexAdmin->addInfoBoxLine(_AM_PINGTRAX_STATISTICS, "<label>"._AM_PINGTRAX_STATISTICS_URISADMIN."</label>", $itemsHandler->getCount(new Criteria('user-session', 'admin')), 'Blue'); +$indexAdmin->addInfoBoxLine(_AM_PINGTRAX_STATISTICS, "<label>"._AM_PINGTRAX_STATISTICS_URISUSERS."</label>", $itemsHandler->getCount(new Criteria('user-session', 'user')), 'Blue'); +$indexAdmin->addInfoBoxLine(_AM_PINGTRAX_STATISTICS, "<label>"._AM_PINGTRAX_STATISTICS_URISGUEST."</label>", $itemsHandler->getCount(new Criteria('user-session', 'guest')), 'Blue'); + +echo $indexAdmin->addNavigation('admin.php'); +echo $indexAdmin->renderIndex(); + +include_once dirname(__FILE__) . '/admin_footer.php'; +//xoops_cp_footer(); Property changes on: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin_footer.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin_footer.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin_footer.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,30 @@ +<?php +/** + * PingTrax Admin + * + * 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 + */ + +echo "<div class='adminfooter'>\n" + ." <div style='text-align: center;'>\n" + ." <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" + ." </div>\n" + ." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" + ."</div>"; + +xoops_cp_footer(); Property changes on: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin_footer.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin_header.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin_header.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin_header.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,69 @@ +<?php +/** + * PingTrax Admin + * + * 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 + */ + + +$path = dirname(dirname(dirname(dirname(__FILE__)))); +include_once $path . '/mainfile.php'; +include_once $path . '/include/cp_functions.php'; +require_once $path . '/include/cp_header.php'; +require_once $path . '/class/pagenav.php'; + +global $xoopsModule; + +$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); + +//if functions.php file exist +//require_once dirname(dirname(__FILE__)) . '/include/functions.php'; + +// Load language files +xoops_loadLanguage('admin', $thisModuleDir); +xoops_loadLanguage('modinfo', $thisModuleDir); +xoops_loadLanguage('main', $thisModuleDir); + +$pathIcon16 = '../'.$xoopsModule->getInfo('icons16'); +$pathIcon32 = '../'.$xoopsModule->getInfo('icons32'); +$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); + +include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); + +if ($xoopsUser) { + $moduleperm_handler =& xoops_gethandler('groupperm'); + if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) { + redirect_header(XOOPS_URL, 1, _NOPERM); + exit(); + } +} else { + redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM); + exit(); +} + +if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once(XOOPS_ROOT_PATH."/class/template.php"); + $xoopsTpl = new XoopsTpl(); +} + +//$xoopsTpl->assign('pathIcon16', $pathIcon16); + +if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) { + include_once XOOPS_ROOT_PATH . '/class/template.php'; + $GLOBALS['xoopsTpl'] = new XoopsTpl(); +} Property changes on: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/admin_header.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/index.html =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/index.html (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/index.html 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/items.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/items.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/items.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,103 @@ +<?php +/** + * PingTrax Admin + * + * 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 + */ + +include_once dirname(__FILE__) . '/admin_header.php'; +xoops_cp_header(); + +xoops_load('PageNav'); +xoops_load('XoopsFormLoader'); + +$indexAdmin = new ModuleAdmin(); +echo $indexAdmin->addNavigation('pings.php'); + +$start = !isset($_REQUEST['start'])?0:(integer)$_REQUEST['start']; +$num = !isset($_REQUEST['num'])?30:(integer)$_REQUEST['num']; +$domain = !isset($_REQUEST['domain'])?'':(string)$_REQUEST['domain']; +$protocol = !isset($_REQUEST['protocol'])?'':(string)$_REQUEST['protocol']; + +$sitemapsHandler = xoops_getmodulehandler('sitemaps', 'pingtrax'); +$itemsHandler = xoops_getmodulehandler('items', 'pingtrax'); +$itemsSitemapsHandler = xoops_getmodulehandler('items_sitemaps', 'pingtrax'); + +$criteria = new Criteria('offlined', 0); +foreach($sitemapsHandler->getObjects($criteria) as $id => $sitemap) + $GLOBALS['xoopsTpl']->append('filter', array('protocol'=>$sitemap->getVar('protocol'), 'domain'=>$sitemap->getVar('domain'),'filename'=>$sitemap->getVar('filename'))); + + +$criteria = new CriteriaCompo(new Criteria('`offlined`', 0)); +if (!empty($protocol)) + $criteria->add(new Criteria('`item-protocol`', mysql_escape_string($protocol))); +if (!empty($domain)) + $criteria->add(new Criteria('`item-domain`', $domain)); +$criteria->add(new Criteria('`type`', 'local')); +$total = $itemsHandler->getCount($criteria); +$criteria->setStart($start); +$criteria->setLimit($num); + +foreach($itemsHandler->getObjects($criteria, true) as $id => $item) +{ + $local = array(); + $local['id'] = $item->getVar('id'); + $local['dirname'] = $item->getVar('module-dirname'); + $local['class'] = $item->getVar('module-class'); + $local['itemid'] = $item->getVar('module-item-id'); + $local['catid'] = $item->getVar('item-category-id'); + $local['author']['uid'] = $item->getVar('item-author-uid'); + $local['author']['name'] = $item->getVar('item-author-name'); + $local['uri'] = $item->getVar('item-protocol').$item->getVar('item-domain').$item->getVar('item-referer-uri'); + $local['title'] = $item->getVar('item-title'); + $local['refereruri'] = $item->getVar('item-referer-uri'); + $local['discovery'] = $item->getVar('discovery-hook'); + $local['session'] = $item->getVar('user-session'); + $criteria = new CriteriaCompo(new Criteria('type', 'remote')); + $criteria->add(new Criteria('parent-id', $local['id'])); + $local['children'] = $itemsHandler->getCount($criteria); + $criteria = new CriteriaCompo(new Criteria('item-referer', $item->getVar('referer'))); + if ($itemsSitemapsHandler->getCount($criteria)==0) + { + $local['changed'] = $local['checking'] = $local['priority'] = $local['frequency'] = '---'; + } else { + $itemsitemaps = $itemsSitemapsHandler->getObjects($criteria, false); + if (isset($itemsitemaps[0]) && is_object($itemsitemaps[0])) + { + $local['frequency'] = $itemsitemaps[0]->getVar('frequency'); + $local['priority'] = $itemsitemaps[0]->getVar('priority'); + $local['changed'] = ($itemsitemaps[0]->getVar('changed')==0?"---":date('Y-m-d H:i:s', $itemsitemaps[0]->getVar('changed'))); + $local['checking'] = ($itemsitemaps[0]->getVar('checking')==0?"---":date('Y-m-d H:i:s', $itemsitemaps[0]->getVar('checking'))); + } else + $local['changed'] = $local['checking'] = $local['priority'] = $local['frequency'] = '---'; + } + $GLOBALS['xoopsTpl']->append('locals', $local); +} + +$pagenav = new XoopsPageNav($total, $num, $start, 'start', "&num=$num&protocol=$protocol&domain=$domain"); +$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(5)); +$GLOBALS['xoopsTpl']->assign('start', $start); +$GLOBALS['xoopsTpl']->assign('num', $num); +$GLOBALS['xoopsTpl']->assign('protocol', $protocol); +$GLOBALS['xoopsTpl']->assign('domain', $domain); +$GLOBALS['xoopsTpl']->assign('phpself', XOOPS_URL . $_SERVER["PHP_SELF"]); +$GLOBALS['xoopsTpl']->display($GLOBALS['xoops']->path('/modules/pingtrax/templates/admin/items.html')); + + +include_once dirname(__FILE__) . '/admin_footer.php'; +//xoops_cp_footer(); Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/menu.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/menu.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/menu.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,58 @@ +<?php +/** + * PingTrax Admin + * + * 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 + */ + +// defined("XOOPS_ROOT_PATH") || die("XOOPS root path not defined"); + +$path = dirname(dirname(dirname(dirname(__FILE__)))); +include_once $path . '/mainfile.php'; + +$dirname = basename(dirname(dirname(__FILE__))); +$module_handler = xoops_gethandler('module'); +$module = $module_handler->getByDirname($dirname); +$pathIcon32 = $module->getInfo('icons32'); +$pathModuleAdmin = $module->getInfo('dirmoduleadmin'); +$pathLanguage = $path . $pathModuleAdmin; + +if (!file_exists($fileinc = $pathLanguage . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) { + $fileinc = $pathLanguage . '/language/english/main.php'; +} + +include_once $fileinc; + +$adminmenu = array(); + +$i = 1; +$adminmenu[$i]['title'] = _MI_PINGTRAX_DASHBOARD; +$adminmenu[$i]['link'] = "admin/admin.php"; +$adminmenu[$i]['icon'] = $pathIcon32.'/home.png' ; +++$i; +$adminmenu[$i]['title'] = _MI_PINGTRAX_PINGS; +$adminmenu[$i]['link'] = 'admin/pings.php'; +$adminmenu[$i]['icon'] = $pathIcon32.'/globe.png'; +++$i; +$adminmenu[$i]['title'] = _MI_PINGTRAX_ITEMS; +$adminmenu[$i]['link'] = 'admin/items.php'; +$adminmenu[$i]['icon'] = $pathIcon32.'/playlist.png'; +++$i; +$adminmenu[$i]['title'] = _MI_PINGTRAX_ABOUT; +$adminmenu[$i]['link'] = 'admin/about.php'; +$adminmenu[$i]['icon'] = $pathIcon32.'/about.png'; Property changes on: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/menu.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/pings.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/pings.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/admin/pings.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,109 @@ +<?php +/** + * PingTrax Admin + * + * 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 + */ + +include_once dirname(__FILE__) . '/admin_header.php'; +xoops_cp_header(); + +xoops_load('PageNav'); +xoops_load('XoopsFormLoader'); + +$indexAdmin = new ModuleAdmin(); +echo $indexAdmin->addNavigation('pings.php'); + +$start = !isset($_REQUEST['start'])?0:(integer)$_REQUEST['start']; +$num = !isset($_REQUEST['num'])?30:(integer)$_REQUEST['num']; +$id = !isset($_REQUEST['id'])?0:(integer)$_REQUEST['id']; +$op = !isset($_REQUEST['op'])?'default':(string)$_REQUEST['op']; + +$pingsHandler = xoops_getmodulehandler('pings', 'pingtrax'); +$itemsHandler = xoops_getmodulehandler('items', 'pingtrax'); + +switch ($op) +{ + default: + $criteria = new Criteria('offlined', 0); + $total = $pingsHandler->getCount($criteria); + $criteria->setStart($start); + $criteria->setLimit($num); + + foreach($pingsHandler->getObjects($criteria, true) as $id => $ping) + { + if ($ping->getVar('last-item-referer')!='') + { + $item = $itemsHandler->getByReferer($ping->getVar('last-item-referer')); + if (is_object($item)) + $last = array('uri'=>$item->getVar('item-protocol').$item->getVar('item-domain').$item->getVar('item-referer-uri'), 'title' => $item->getVar('item-title')); + else + $last = array(); + } else + $last = array(); + $GLOBALS['xoopsTpl']->append('pings', array('id' => $ping->getVar('id'), 'type' => $ping->getVar('type'), 'uri' => $ping->getVar('uri'), 'last' => $last, "successes" => number_format($ping->getVar('successful-pings'), 0), "failures" => number_format($ping->getVar('failed-pings'), 0), 'success' => ($ping->getVar('success-time')!=0?date("Y-m-d H:i:s", $ping->getVar('success-time')):"---"), 'failed' => ($ping->getVar('failure-time')!=0?date("Y-m-d H:i:s", $ping->getVar('failure-time')):"---"), 'sleeptill' => ($ping->getVar('sleep-till')!=0?date("Y-m-d H:i:s", $ping->getVar('sleep-till')):"---"))); + } + + $pagenav = new XoopsPageNav($total, $num, $start, 'start', "&num=$num"); + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(5)); + $GLOBALS['xoopsTpl']->assign('start', $start); + $GLOBALS['xoopsTpl']->assign('num', $num); + + $form = new XoopsThemeForm(_AM_PINGTRAX_PING_ADD, 'add-pinglist', $_SERVER['PHP_SELF']."?op=add&start=$start&num=&num"); + $form->addElement(new XoopsFormText(_AM_PINGTRAX_PING_URI, 'uri', 50, 250)); + $type = new XoopsFormSelect(_AM_PINGTRAX_PING_TYPE, 'type'); + $type->addOption('XML-RPC', 'XML-RPC'); + $type->addOption('SITEMAPS', 'SITEMAPS'); + $form->addElement($type); + $form->addElement(new XoopsFormButton(_SUBMIT, 'submit', _SUBMIT)); + $GLOBALS['xoopsTpl']->assign('addform', $form->render()); + $GLOBALS['xoopsTpl']->display($GLOBALS['xoops']->path('/modules/pingtrax/templates/admin/pings.html')); + break; + case "add": + if (!empty($_POST['uri']) && !empty($_POST['type'])) + { + $ping = $pingsHandler->create(); + $ping->setVar('uri', $_POST['uri']); + $ping->setVar('type', $_POST['type']); + if($pingsHandler->insert($ping)) + redirect_header($_SERVER["PHP_SELF"]."?start=$start&num=$num", 7, _AM_PINGTRAX_PING_ADD_SUCCESSFUL); + } + redirect_header($_SERVER["PHP_SELF"]."?start=$start&num=$num", 7, _AM_PINGTRAX_PING_ADD_FAILED); + exit(0); + case "edit": + foreach($_POST['uri'] as $id=> $uri) + { + $ping = $pingsHandler->get($id); + $ping->setVar('uri', $uri); + $ping->setVar('type', $_POST['type'][$id]); + $pingsHandler->insert($ping); + } + redirect_header($_SERVER["PHP_SELF"]."?start=$start&num=$num", 7, _AM_PINGTRAX_PING_EDIT_COMPLETE); + exit(0); + case "delete": + $ping = $pingsHandler->get($id); + if (is_a($ping, "PingtraxPings")) + if ($pingsHandler->delete($ping)) + redirect_header($_SERVER["PHP_SELF"]."?start=$start&num=$num", 7, _AM_PINGTRAX_PING_DELETE_SUCCESS); + redirect_header($_SERVER["PHP_SELF"]."?start=$start&num=$num", 7, _AM_PINGTRAX_PING_DELETE_FAILED); + exit(0); + break; +} + +include_once dirname(__FILE__) . '/admin_footer.php'; +//xoops_cp_footer(); Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/api/.htaccess =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/api/.htaccess (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/api/.htaccess 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,2 @@ +RewriteEngine On +RewriteRule ^([0-9a-z]{32,44})$ index.php?referer=$1 [L] \ No newline at end of file Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/api/index.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/api/index.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/api/index.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,50 @@ +<?php + +require_once dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . "mainfile.php"; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . "class". DIRECTORY_SEPARATOR . "trackback.php"; + +$trackback = new PingtraxTrackback($GLOBALS['xoopsConfig']['sitename'], $GLOBALS['xoopsConfig']['sitename'], 'UTF-8'); + +if (!isset($_GET['referer'])) + die($trackback->recieve(false, "\$_GET['referer'] not specified and is required for trackback API!")); + +xoops_load("XoopsUserUtility"); +$moduleHandler = xoops_gethandler('module'); +$commentHandler = xoops_gethandler('comment'); +$itemsHandler = xoops_getmodulehandler('items', 'pingtrax'); +$item = $itemsHandler->getByReferer($_GET['referer']); + +if (!is_a($item, "PingtraxItems")) + die($trackback->recieve(false, $_GET['referer'] . " does not match any recorded item on the trackback API!")); + +$url = $_REQUEST["url"]; +if ($url) { + $excerpt = $_REQUEST["excerpt"]; + $name = ($_REQUEST["blog_name"]) ? $_REQUEST["blog_name"] : $url; + $subject = ($_REQUEST["title"]) ? $_REQUEST["title"] : $url; + $comment = "<strong> TrackBack from <a href=\"$url\">$name</a>:</strong><br />"; + $comment .= "<blockquote>$excerpt</blockquote>"; + + $pluginHandler = xoops_getmodulehandler('plugins', 'pingtrax'); + $remoteitem = $pluginHandler->getRemoteObject($item, $url, $name, $subject, $comment); + if (is_a($remoteitem, "PingtraxItems")) + { + $comment = $commentHandler->create(); + $comment->setVar('com_modid', $moduleHandler->getByDirname('pingtrax')->getVar('mid')); + $comment->setVar('com_title', $subject); + $comment->setVar('com_text', $comment); + $comment->setVar('com_created', time()); + $comment->setVar('com_url', $url); + $comment->setVar('com_ip', XoopsUserUtility::getIP(true)); + $comment->setVar('com_itemid', $item->getVar('id')); + $comment->setVar('dohtml', true); + $comment->setVar('dosmiley', true); + $comment->setVar('doxcode', true); + $comment->setVar('doimage', true); + $comment->setVar('dobr', true); + $commentHandler->insert($comment); + } +} else { + die($trackback->recieve(false, "Missing URL for trackback API!")); +} +die($trackback->recieve(true, "")); Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/blocks/index.html =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/blocks/index.html (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/blocks/index.html 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/blocks/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/blocks/pingtrax_blocks.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/blocks/pingtrax_blocks.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/blocks/pingtrax_blocks.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,33 @@ +<?php +/** + * Pingtrax Block Trackbacks Handler module + * + * 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 + */ + + +function pingtrax_trackbacks_block_show($args = array()) +{ + +} + + +function pingtrax_trackbacks_block_edit($args = array()) +{ + +} \ No newline at end of file Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/index.html =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/index.html (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/index.html 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/items.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/items.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/items.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,242 @@ +<?php +/** + * Pingtrax Database Class Handler module + * + * 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 + */ + + +/** + * Class PingtraxItems + * + * @subpackage pingtrax + * + * Database MySQL Table:- + * + * CREATE TABLE `pingtrax_items` ( + * `id` mediumint(20) NOT NULL AUTO_INCREMENT, + * `parent-id` mediumint(20) NOT NULL DEFAULT '0', + * `referer` varchar(44) NOT NULL DEFAULT '', + * `type` enum('local','remote','unknown') NOT NULL DEFAULT 'unknown', + * `module-dirname` varchar(30) NOT NULL DEFAULT '', + * `module-class` varchar(100) NOT NULL DEFAULT '', + * `module-item-id` mediumint(30) NOT NULL DEFAULT '0', + * `module-php-self` varchar(150) NOT NULL DEFAULT '', + * `module-get` tinytext, + * `item-author-uid` int(13) NOT NULL DEFAULT '0', + * `item-author-name` varchar(64) NOT NULL DEFAULT '', + * `item-category-id` int(20) NOT NULL DEFAULT '0', + * `item-title` varchar(180) NOT NULL DEFAULT '', + * `item-description` varchar(250) NOT NULL DEFAULT '', + * `item-protocol` enum('https://','http://') NOT NULL DEFAULT 'http://', + * `item-domain` varchar(150) NOT NULL DEFAULT '', + * `item-referer-uri` varchar(250) NOT NULL DEFAULT '', + * `item-php-self` varchar(250) NOT NULL DEFAULT '', + * `feed-protocol` enum('https://','http://') NOT NULL DEFAULT 'http://', + * `feed-domain` varchar(150) NOT NULL DEFAULT '', + * `feed-referer-uri` varchar(250) NOT NULL DEFAULT '', + * `discovery-hook` enum('php','preloader','smarty','combination','unknown') NOT NULL DEFAULT 'unknown', + * `user-session` enum('admin','user','guest','unknown') NOT NULL DEFAULT 'unknown', + * `created` int(12) NOT NULL DEFAULT '0', + * `updated` int(12) NOT NULL DEFAULT '0', + * `offlined` int(12) NOT NULL DEFAULT '0', + * PRIMARY KEY (`id`), + * KEY `SEARCH` (`referer`,`item-author-uid`,`item-author-name`,`module-dirname`,`item-protocol`,`item-domain`,`item-referer-uri`,`module-php-self`,`item-php-self`,`discovery-hook`,`id`) KEY_BLOCK_SIZE=128, + * KEY `CHRONOLOGISTICS` (`id`,`referer`,`created`,`updated`,`offlined`) USING BTREE KEY_BLOCK_SIZE=64 + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=16; + */ +class PingtraxItems extends XoopsObject +{ + /** + * + * @var unknown + */ + var $_configs = array(); + + /** + * + */ + function __construct() + { + $moduleHandler = xoops_gethandler('module'); + $configHandler = xoops_gethandler('config'); + $this->_configs = $configHandler->getConfigList($moduleHandler->getByDirname(basename(dirname(__DIR__)))->getVar('mid')); + + $this->XoopsObject(); + $this->initVar('id', XOBJ_DTYPE_INT, null, false); + $this->initVar('parent-id', XOBJ_DTYPE_INT, null, false); + $this->initVar('referer', XOBJ_DTYPE_OTHER, sha1(NULL), false, 44); + $this->initVar('type', XOBJ_DTYPE_ENUM, 'unknown', true, false, false, false, array('local','remote','unknown')); + $this->initVar('module-dirname', XOBJ_DTYPE_OTHER, '', false, 30); + $this->initVar('module-class', XOBJ_DTYPE_OTHER, '', false, 100); + $this->initVar('module-item-id', XOBJ_DTYPE_INT, 0, false); + $this->initVar('module-php-self', XOBJ_DTYPE_OTHER, '', false, 150); + $this->initVar('module-get', XOBJ_DTYPE_ARRAY, array(), false); + $this->initVar('item-author-uid', XOBJ_DTYPE_INT, 0, false); + $this->initVar('item-author-name', XOBJ_DTYPE_TXTBOX, '', false, 64); + $this->initVar('item-category-id', XOBJ_DTYPE_INT, null, false); + $this->initVar('item-title', XOBJ_DTYPE_TXTBOX, '', false, 180); + $this->initVar('item-description', XOBJ_DTYPE_TXTBOX, '', false, 250); + $this->initVar('item-protocol', XOBJ_DTYPE_ENUM, XOOPS_PROT, true, false, false, false, array('https://','http://')); + $this->initVar('item-domain', XOBJ_DTYPE_TXTBOX, parse_url(XOOPS_URL, PHP_URL_HOST), true, 150); + $this->initVar('item-referer-uri', XOBJ_DTYPE_TXTBOX, $_SERVER["REQUEST_URI"], true, 250); + $this->initVar('item-php-self', XOBJ_DTYPE_TXTBOX, str_replace(XOOPS_ROOT_PATH, "", $_SERVER["PHP_SELF"]), true, 250); + $this->initVar('feed-protocol', XOBJ_DTYPE_ENUM, parse_url(str_replace("%xoops_url%", XOOPS_URL, $this->_configs['default_feed_url']), PHP_URL_SCHEME), true, false, false, false, array('https://','http://')); + $this->initVar('feed-domain', XOBJ_DTYPE_TXTBOX, parse_url(str_replace("%xoops_url%", XOOPS_URL, $this->_configs['default_feed_url']), PHP_URL_HOST), true, 150); + $this->initVar('feed-referer-uri', XOBJ_DTYPE_TXTBOX, parse_url(str_replace("%xoops_url%", XOOPS_URL, $this->_configs['default_feed_url']), PHP_URL_PATH) . '/backend.php', true, 250); + $this->initVar('discovery-hook', XOBJ_DTYPE_ENUM, 'unknown', true, false, false, false, array('php','preloader','smarty','combination','unknown')); + $this->initVar('user-session', XOBJ_DTYPE_ENUM, 'unknown', true, false, false, false, array('admin','user','guest','unknown')); + $this->initVar('created', XOBJ_DTYPE_INT, 0, false); + $this->initVar('updated', XOBJ_DTYPE_INT, 0, false); + $this->initVar('offlined', XOBJ_DTYPE_INT, 0, false); + } + + /** + * + * @return string + */ + function getPingXML() + { + $xml = "<?xml version=\"1.0\"?>\n"; + $xml .= "<methodCall>\n"; + $xml .= "\t<methodName>weblogUpdates.extendedPing</methodName>\n"; + $xml .= "\t<params>\n"; + $xml .= "\t\t<param>\n"; + $xml .= "\t\t\t<value>".$this->getVar('item-title')."</value>\n"; + $xml .= "\t\t</param>\n"; + $xml .= "\t\t<param>\n"; + $xml .= "\t\t\t<value>".$this->getVar('item-protocol').$this->getVar('item-domain')."</value>\n"; + $xml .= "\t\t</param>\n"; + $xml .= "\t\t<param>\n"; + $xml .= "\t\t\t<value>".$this->getVar('item-protocol').$this->getVar('item-domain').$this->getVar('item-referer-uri')."</value>\n"; + $xml .= "\t\t</param>\n"; + $xml .= "\t\t<param>\n"; + $xml .= "\t\t\t<value>".$this->getVar('feed-protocol').$this->getVar('feed-domain').$this->getVar('feed-referer-uri')."</value>\n"; + $xml .= "\t\t</param>\n"; + $xml .= "\t</params>\n"; + $xml .= "</methodCall>"; + return $xml; + } +} + +/** + * Class PingtraxItemsHandler + */ +class PingtraxItemsHandler extends XoopsPersistableObjectHandler +{ + + /** + * @param null|object $db + */ + function __construct(&$db) + { + parent::__construct($db, "pingtrax_items", 'PingtraxItems', 'id', 'referer'); + } + + + function insert($object = NULL, $force = true) + { + if ($object->isNew()) + { + $criteria = new Criteria('referer', $object->getVar('referer')); + if ($this->getCount($criteria)==0) + $object->setVar('created', time()); + else + { + $objs = $this->getObjects($criteria, false); + if (isset($objs[0])) + return $objs[0]->getVar('id'); + else + return false; + } + if ($object->getVar('type') == 'local') + { + $sitemapsHandler = xoops_getmodulehandler('sitemaps', 'pingtrax'); + $criteria = new CriteriaCompo(new Criteria('protocol', XOOPS_PROT)); + $criteria->add(new Criteria('domain', parse_url(XOOPS_URL, PHP_URL_HOST))); + $criteria->add(new Criteria('baseurl', parse_url(XOOPS_URL, PHP_URL_PATH))); + if ($sitemapsHandler->getCount($criteria)==0) + { + $sitemap = $sitemapsHandler->create(); + $sitemap->setVar('referer', md5(XOOPS_URL.microtime(true).XOOPS_DB_USER.XOOPS_DB_PASS)); + $sitemap->setVar('protocol', XOOPS_PROT); + $sitemap->setVar('domain', parse_url(XOOPS_URL, PHP_URL_HOST)); + $sitemap->setVar('baseurl', parse_url(XOOPS_URL, PHP_URL_PATH)); + $sitemap->setVar('filename', 'sitemap.'.str_replace("://", "", XOOPS_PROT) . "." . parse_url(XOOPS_URL, PHP_URL_HOST) . '.xml'); + $sitemap = $sitemapsHandler->get($sitemap = $sitemapsHandler->insert($sitemap, true)); + } else { + $obj = $sitemapsHandler->getObjects($criteria, false); + if (is_object($obj[0])) + $sitemap = $obj[0]; + } + $items_sitemapsHandler = xoops_getmodulehandler('items_sitemaps', 'pingtrax'); + $itemsitemap = $items_sitemapsHandler->create(); + $itemsitemap->setVar('map-referer', $sitemap->getVar('referer')); + $itemsitemap->setVar('item-referer', $object->getVar('referer')); + $items_sitemapsHandler->insert($itemsitemap, true); + $items_pingsHandler = xoops_getmodulehandler('items_pings', 'pingtrax'); + $pingsHandler = xoops_getmodulehandler('pings', 'pingtrax'); + $criteria = new CriteriaCompo(new Criteria('`type`', 'XML-RPC')); + $criteria->add(new Criteria('`offlined`', 0)); + foreach($pingsHandler->getObjects($criteria, true) as $id => $ping) + { + $itemping = $items_pingsHandler->create(); + $itemping->setVar('ping-referer', $ping->getVar('referer')); + $itemping->setVar('item-referer', $object->getVar('referer')); + $items_pingsHandler->insert($itemping, true); + } + } + } else { + $object->setVar('updated', time()); + } + switch ($object->getVar('user-session')) + { + default: + case 'unknown': + if (is_object($GLOBALS['xoopsUser'])) + { + if ($GLOBALS['xoopsUser']->isAdmin()) + $object->setVar('user-session', 'admin'); + } + case 'admin': + if (is_object($GLOBALS['xoopsUser'])) + { + if (!$GLOBALS['xoopsUser']->isAdmin()) + $object->setVar('user-session', 'user'); + } + case 'user': + if (!is_object($GLOBALS['xoopsUser'])) + $object->setVar('user-session', 'guest'); + case 'guest': + break; + } + return parent::insert($object, $force); + } + + function getByReferer($referer = '') + { + $criteria = new CriteriaCompo(new Criteria('referer', $referer)); + $criteria->add(new Criteria('offline', 0)); + if ($this->getCount($criteria)==0) + return NULL; + $objs = $this->getObjects($criteria, false); + if (isset($objs[0]) && is_a($objs[0], "PingtraxItems")) + return $objs[0]; + return NULL; + } +} Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/items_pings.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/items_pings.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/items_pings.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,73 @@ +<?php +/** + * Pingtrax Database Class Handler module + * + * 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 + */ + + +/** + * Class PingtraxItems_pings + * + * @subpackage itemtrax + * + * Database MySQL Table:- + * + * CREATE TABLE `pingtrax_items_pings` ( + * `id` mediumint(32) NOT NULL AUTO_INCREMENT, + * `ping-referer` varchar(44) NOT NULL DEFAULT '', + * `item-referer` varchar(44) NOT NULL DEFAULT '', + * `when` int(12) NOT NULL DEFAULT '0', + * PRIMARY KEY (`id`), + * KEY `SEARCH` (`id`,`ping-referer`,`item-referer`) USING BTREE, + * KEY `CHRONOLOGISTICS` (`ping-referer`,`item-referer`,`when`) USING BTREE KEY_BLOCK_SIZE=64 + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=8; + * + */ +class PingtraxItems_pings extends XoopsObject +{ + /** + * + */ + function __construct() + { + $this->XoopsObject(); + $this->initVar('id', XOBJ_DTYPE_INT, null, false); + $this->initVar('ping-referer', XOBJ_DTYPE_TXTBOX, null, true, 44); + $this->initVar('item-referer', XOBJ_DTYPE_TXTBOX, null, true, 44); + $this->initVar('when', XOBJ_DTYPE_INT, 0, false); + } + +} + +/** + * Class PingtraxItems_pingsHandler + */ +class PingtraxItems_pingsHandler extends XoopsPersistableObjectHandler +{ + + /** + * @param null|object $db + */ + function __construct(&$db) + { + parent::__construct($db, "pingtrax_items_pings", 'PingtraxItems_pings', 'id', 'ping-referer'); + } + + +} Added: XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/items_sitemaps.php =================================================================== --- XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/items_sitemaps.php (rev 0) +++ XoopsModules/pingtrax/releases/1.02/modules/pingtrax/class/items_sitemaps.php 2015-12-08 22:35:05 UTC (rev 13188) @@ -0,0 +1,366 @@ +<?php +/** + * Pingtrax Database Class Handler module + * + * 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 + */ + +require_once __DIR__ . DIRECTORY_SEPARATOR . 'simple_html_dom.php'; + +/** + * Class PingtraxItems_sitemaps + * + * @subpackage itemtrax + * + * Database MySQL Table:- + * + * CREATE TABLE `pingtrax_items_sitemaps` ( + * `id` mediumint(32) NOT NULL AUTO_INCREMENT, + * `map-referer` varchar(44) NOT NULL DEFAULT '', + * `item-referer` varchar(44) NOT NULL DEFAULT '', + * `frequency` enum('monthly','fortnightly','weekly','daily') NOT NULL DEFAULT 'monthly', + * `priority` float(2,1) NOT NULL DEFAULT '0.9', + * `checking` int(12) NOT NULL DEFAULT '0', + * `changed` int(12) NOT NULL DEFAULT '0', + * `changes` int(12) NOT NULL DEFAULT '0', + * `when` int(12) NOT NULL DEFAULT '0', + * `header-md5` varchar(32) NOT NULL DEFAULT '0', + * `header-changes` int(12) NOT NULL DEFAULT '0', + * `header-changed` int(12) NOT NULL DEFAULT '0', + * `header-bytes` int(12) NOT NULL DEFAULT '0', + * `body-md5` varchar(32) NOT NULL DEFAULT '0', + * `body-changes` int(12) NOT NULL DEFAULT '0', + * `body-changed` int(12) NOT NULL DEFAULT '0', + * `body-bytes` int(12) NOT NULL DEFAULT '0', + * `tabled-md5` varchar(32) NOT NULL DEFAULT '0', + * `tabled-changes` int(12) NOT NULL DEFAULT '0', + * `tabled-changed` int(12) NOT NULL DEFAULT '0', + * `tabled-bytes` int(12) NOT NULL DEFAULT '0', + * `dived-md5` varchar(32) NOT NULL DEFAULT '0', + * `dived-changes` int(12) NOT NULL DEFAULT '0', + * `dived-changed` int(12) NOT NULL DEFAULT '0', + * `dived-bytes` int(12) NOT NULL DEFAULT '0', + * `header-md5-last` varchar(32) NOT NULL DEFAULT '0', + * `header-changes-last` int(12) NOT NULL DEFAULT '0', + * `header-changed-last` int(12) NOT NULL DEFAULT '0', + * `header-bytes-last` int(12) NOT NULL DEFAULT '0', + * `body-md5-last` varchar(32) NOT NULL DEFAULT '0', + * `body-changes-last` int(12) NOT NULL DEFAULT '0', + * `body-changed-last` int(12) NOT NULL DEFAULT '0', + * `body-bytes-last` int(12) NOT NULL DEFAULT '0', + * `tabled-md5-last` varchar(32) NOT NULL DEFAULT '0', + * `tabled-changes-last` int(12) NOT NULL DEFAULT '0', + * `tabled-changed-last` int(12) NOT NULL DEFAULT '0', + * `tabled-bytes-last` int(12) NOT NULL DEFAULT '0', + * `dived-md5-last` varchar(32) NOT NULL DEFAULT '0', + * `dived-changes-last` int(12) NOT NULL DEFAULT '0', + * `dived-changed-last` int(12) NOT NULL DEFAULT '0', + * `dived-bytes-last` int(12) NOT NULL DEFAULT '0', + * PRIMARY KEY (`id`), + * KEY `SEARCH` (`id`,`map-referer`,`item-referer`) USING BTREE, + * KEY `CHRONOLOGISTICS` (`map-referer`,`item-referer`) USING BTREE KEY_BLOCK_SIZE=64 + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=8; + * + */ +class PingtraxItems_sitemaps extends XoopsObject +{ + /** + * + */ + function __construct() + { + $this->XoopsObject(); + $this->initVar('id', XOBJ_DTYPE_INT, null, false); + $this->initVar('map-referer', XOBJ_DTYPE_TXTBOX, null, true, 44); + $this->initVar('item-referer', XOBJ_DTYPE_TXTBOX, null, true, 44); + $this->initVar('frequency', XOBJ_DTYPE_ENUM, 'daily', false, false, false, false, false, array('monthly','fortnightly','weekly','daily')); + $this->initVar('priority', XOBJ_DTYPE_FLOAT, 0.9, false); + $this->initVar('checking', XOBJ_DTYPE_INT, time(), false); + $this->initVar('changed', XOBJ_DTYPE_INT, time(), false); + $this->initVar('changes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('when', XOBJ_DTYPE_INT, time(), false); + $this->initVar('header-md5', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('header-changes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('header-changed', XOBJ_DTYPE_INT, time(), false); + $this->initVar('header-bytes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('body-md5', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('body-changes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('body-changed', XOBJ_DTYPE_INT, time(), false); + $this->initVar('body-bytes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('tabled-md5', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('tabled-changes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('tabled-changed', XOBJ_DTYPE_INT, time(), false); + $this->initVar('tabled-bytes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('dived-md5', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('dived-changes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('dived-changed', XOBJ_DTYPE_INT, time(), false); + $this->initVar('dived-bytes', XOBJ_DTYPE_INT, 0, false); + $this->initVar('header-md5-last', XOBJ_DTYPE_OTHER, md5(NULL), false, 32); + $this->initVar('header-changes-last', X... [truncated message content] |