From: <wis...@us...> - 2017-05-01 19:18:56
|
Revision: 13235 http://sourceforge.net/p/xoops/svn/13235 Author: wishcraft Date: 2017-05-01 19:18:52 +0000 (Mon, 01 May 2017) Log Message: ----------- fontier+ ~ client for Chronolabs Fonting Repository Service API - Alpha2 of 1.01 Added Paths: ----------- XoopsModules/fontier+/trunk/modules/ XoopsModules/fontier+/trunk/modules/fontier/ XoopsModules/fontier+/trunk/modules/fontier/.htaccess XoopsModules/fontier+/trunk/modules/fontier/admin/ XoopsModules/fontier+/trunk/modules/fontier/admin/.htaccess XoopsModules/fontier+/trunk/modules/fontier/admin/index.html XoopsModules/fontier+/trunk/modules/fontier/blocks/ XoopsModules/fontier+/trunk/modules/fontier/blocks/index.html XoopsModules/fontier+/trunk/modules/fontier/class/ XoopsModules/fontier+/trunk/modules/fontier/class/identities.php XoopsModules/fontier+/trunk/modules/fontier/class/index.html XoopsModules/fontier+/trunk/modules/fontier/class/indexes.php XoopsModules/fontier+/trunk/modules/fontier/class/objects.php XoopsModules/fontier+/trunk/modules/fontier/comment_delete.php XoopsModules/fontier+/trunk/modules/fontier/comment_edit.php XoopsModules/fontier+/trunk/modules/fontier/comment_new.php XoopsModules/fontier+/trunk/modules/fontier/comment_post.php XoopsModules/fontier+/trunk/modules/fontier/comment_reply.php XoopsModules/fontier+/trunk/modules/fontier/crons/ XoopsModules/fontier+/trunk/modules/fontier/crons/caching.php XoopsModules/fontier+/trunk/modules/fontier/crons/glyphs.php XoopsModules/fontier+/trunk/modules/fontier/crons/identities.php XoopsModules/fontier+/trunk/modules/fontier/crons/index.html XoopsModules/fontier+/trunk/modules/fontier/crons/polling.php XoopsModules/fontier+/trunk/modules/fontier/download/ XoopsModules/fontier+/trunk/modules/fontier/download/.htaccess XoopsModules/fontier+/trunk/modules/fontier/download/index.html XoopsModules/fontier+/trunk/modules/fontier/download.php XoopsModules/fontier+/trunk/modules/fontier/font/ XoopsModules/fontier+/trunk/modules/fontier/font/.htaccess XoopsModules/fontier+/trunk/modules/fontier/font/index.html XoopsModules/fontier+/trunk/modules/fontier/font.php XoopsModules/fontier+/trunk/modules/fontier/glyph/ XoopsModules/fontier+/trunk/modules/fontier/glyph/.htaccess XoopsModules/fontier+/trunk/modules/fontier/glyph/index.html XoopsModules/fontier+/trunk/modules/fontier/glyph.php XoopsModules/fontier+/trunk/modules/fontier/header.php XoopsModules/fontier+/trunk/modules/fontier/images/ XoopsModules/fontier+/trunk/modules/fontier/images/assets/ XoopsModules/fontier+/trunk/modules/fontier/images/assets/index.html XoopsModules/fontier+/trunk/modules/fontier/images/icons/ XoopsModules/fontier+/trunk/modules/fontier/images/icons/16x16/ XoopsModules/fontier+/trunk/modules/fontier/images/icons/16x16/index.html XoopsModules/fontier+/trunk/modules/fontier/images/icons/24x24/ XoopsModules/fontier+/trunk/modules/fontier/images/icons/24x24/index.html XoopsModules/fontier+/trunk/modules/fontier/images/icons/32x32/ XoopsModules/fontier+/trunk/modules/fontier/images/icons/32x32/index.html XoopsModules/fontier+/trunk/modules/fontier/images/icons/48x48/ XoopsModules/fontier+/trunk/modules/fontier/images/icons/48x48/index.html XoopsModules/fontier+/trunk/modules/fontier/images/icons/index.html XoopsModules/fontier+/trunk/modules/fontier/images/icons/module_fontier+.png XoopsModules/fontier+/trunk/modules/fontier/images/index.html XoopsModules/fontier+/trunk/modules/fontier/include/ XoopsModules/fontier+/trunk/modules/fontier/include/comment_functions.php XoopsModules/fontier+/trunk/modules/fontier/include/functions.php XoopsModules/fontier+/trunk/modules/fontier/include/index.html XoopsModules/fontier+/trunk/modules/fontier/include/notification.inc.php XoopsModules/fontier+/trunk/modules/fontier/index.php XoopsModules/fontier+/trunk/modules/fontier/language/ XoopsModules/fontier+/trunk/modules/fontier/language/english/ XoopsModules/fontier+/trunk/modules/fontier/language/english/admin.php XoopsModules/fontier+/trunk/modules/fontier/language/english/errors.php XoopsModules/fontier+/trunk/modules/fontier/language/english/index.html XoopsModules/fontier+/trunk/modules/fontier/language/english/mail_template/ XoopsModules/fontier+/trunk/modules/fontier/language/english/mail_template/fontier_newfont_notify.tpl XoopsModules/fontier+/trunk/modules/fontier/language/english/mail_template/fontier_newindex_notify.tpl XoopsModules/fontier+/trunk/modules/fontier/language/english/main.php XoopsModules/fontier+/trunk/modules/fontier/language/english/modinfo.php XoopsModules/fontier+/trunk/modules/fontier/language/english/style.css XoopsModules/fontier+/trunk/modules/fontier/language/index.html XoopsModules/fontier+/trunk/modules/fontier/naming/ XoopsModules/fontier+/trunk/modules/fontier/naming/.htaccess XoopsModules/fontier+/trunk/modules/fontier/naming/index.html XoopsModules/fontier+/trunk/modules/fontier/naming.php XoopsModules/fontier+/trunk/modules/fontier/notification_update.php XoopsModules/fontier+/trunk/modules/fontier/preloads/ XoopsModules/fontier+/trunk/modules/fontier/preloads/caching.php XoopsModules/fontier+/trunk/modules/fontier/preloads/glyphs.php XoopsModules/fontier+/trunk/modules/fontier/preloads/identities.php XoopsModules/fontier+/trunk/modules/fontier/preloads/index.html XoopsModules/fontier+/trunk/modules/fontier/preloads/polling.php XoopsModules/fontier+/trunk/modules/fontier/preview/ XoopsModules/fontier+/trunk/modules/fontier/preview/.htaccess XoopsModules/fontier+/trunk/modules/fontier/preview/index.html XoopsModules/fontier+/trunk/modules/fontier/preview.php XoopsModules/fontier+/trunk/modules/fontier/releases.php XoopsModules/fontier+/trunk/modules/fontier/sql/ XoopsModules/fontier+/trunk/modules/fontier/sql/index.html XoopsModules/fontier+/trunk/modules/fontier/sql/mysql.sql XoopsModules/fontier+/trunk/modules/fontier/sql/tables.diz XoopsModules/fontier+/trunk/modules/fontier/templates/ XoopsModules/fontier+/trunk/modules/fontier/templates/admin/ XoopsModules/fontier+/trunk/modules/fontier/templates/admin/index.html XoopsModules/fontier+/trunk/modules/fontier/templates/blocks/ XoopsModules/fontier+/trunk/modules/fontier/templates/blocks/index.html XoopsModules/fontier+/trunk/modules/fontier/templates/index.html XoopsModules/fontier+/trunk/modules/fontier/uploads.php XoopsModules/fontier+/trunk/modules/fontier/xoops_version.php Removed Paths: ------------- XoopsModules/fontier+/trunk/modules/ XoopsModules/fontier+/trunk/xoops_data/ XoopsModules/fontier+/trunk/xoops_lib/ Added: XoopsModules/fontier+/trunk/modules/fontier/.htaccess =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/.htaccess (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/.htaccess 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,47 @@ +############################################################################################################################ +# +# Chronolabs Cooperative Fontier+ +# +# 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://labs.coop +# @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) +# @package fontier+ +# @since 1.0.1 +# @author Simon Roberts <wis...@us...> +# @subpackage fontier+ +# @description XOOPS Client for Fonts REST API - http://fonts.labs.coop +# @link http://fonts.labs.coop +# @link http://sourceforge.net/projects/chronolabs +# @link http://cipher.labs.coop +# +############################################################################################################################ +php_value memory_limit 360M +php_value error_reporting 0 +php_value display_errors 0 + +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d + +RewriteRule ^bin/(.*?)/(font).ufo/(.*?)$ $2.php?mode=ufo&clause=$1&path=$3 [L,NC,QSA] +RewriteRule ^bin/(.*?)/(font).(.*?)?(.*?)$ $2.php?mode=$3&clause=$1&$4 [L,NC,QSA] +RewriteRule ^bin/(.*?)/(font).(.*?)$ $2.php?mode=$3&clause=$1 [L,NC,QSA] +RewriteRule ^css/(.*?)/(.*?).(css)?(.*?)$ $3.php?clause=$1&$4 [L,NC,QSA] +RewriteRule ^css/(.*?)/(.*?).(css)$ $3.php?clause=$1 [L,NC,QSA] +RewriteRule ^api/(.*?)/(callback).api?(.*?)$ $2.php?mode=$1&$3 [L,NC,QSA] +RewriteRule ^api/(.*?)/(callback).api$ $2.php?mode=$1 [L,NC,QSA] +RewriteRule ^(download)/([0-9]+)$ $1.php?mode=$1&clause=$2 [L,NC,QSA] +RewriteRule ^([0-9a-z]+)/upload.html$ index.php?mode=upload&clause=$1 [L,NC,QSA] +RewriteRule ^([0-9a-z]+)/surveys.html$ index.php?mode=surveys&clause=$1 [L,NC,QSA] +RewriteRule ^([0-9a-z]+)/survey.html$ index.php?mode=survey&clause=$1 [L,NC,QSA] +RewriteRule ^([0-9a-z]+)/(.*?)/font.html$ index.php?mode=font&clause=$1&name=$2 [L,NC,QSA] +RewriteRule ^([0-9a-z]+)/node.html$ index.php?mode=node&clause=$1 [L,NC,QSA] +RewriteRule ^(keys|fixes|typal)/nodes.html$ index.php?mode=nodes&clause=$1 [L,NC,QSA] +RewriteRule ^index.html$ index.php?mode=index [L,NC,QSA] + Property changes on: XoopsModules/fontier+/trunk/modules/fontier/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/admin/.htaccess =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/admin/.htaccess (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/admin/.htaccess 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,38 @@ +############################################################################################################################ +# +# Chronolabs Cooperative Fontier+ +# +# 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://labs.coop +# @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) +# @package fontier+ +# @since 1.0.1 +# @author Simon Roberts <wis...@us...> +# @subpackage fontier+ +# @description XOOPS Client for Fonts REST API - http://fonts.labs.coop +# @link http://fonts.labs.coop +# @link http://sourceforge.net/projects/chronolabs +# @link http://cipher.labs.coop +# +############################################################################################################################ +php_value memory_limit 360M +php_value error_reporting 0 +php_value display_errors 0 + +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d + +RewriteRule ^([0-9a-z]+)/upload.html$ admin.php?op=upload&clause=$1 [L,NC,QSA] +RewriteRule ^([0-9a-z]+)/surveys.html$ admin.php?op=surveys&clause=$1 [L,NC,QSA] +RewriteRule ^([0-9a-z]+)/survey.html$ admin.php?op=survey&clause=$1 [L,NC,QSA] +RewriteRule ^([0-9a-z]+)/(.*?)/font.html$ admin.php?op=font&clause=$1&name=$2 [L,NC,QSA] +RewriteRule ^([0-9a-z]+)/node.html$ admin.php?op=node&clause=$1 [L,NC,QSA] +RewriteRule ^(keys|fixes|typal)/nodes.html$ admin.php?op=nodes&clause=$1 [L,NC,QSA] + Property changes on: XoopsModules/fontier+/trunk/modules/fontier/admin/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/admin/index.html =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/admin/index.html (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/admin/index.html 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1 @@ +<script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/fontier+/trunk/modules/fontier/admin/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/blocks/index.html =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/blocks/index.html (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/blocks/index.html 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1 @@ +<script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/fontier+/trunk/modules/fontier/blocks/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/class/identities.php =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/class/identities.php (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/class/identities.php 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,324 @@ +<?php +/** + * Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * + * 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 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage fontier+ + * @description Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * @version 1.0.1 + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/fontier + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/fontier + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/fontier + * @link http://internetfounder.wordpress.com + */ + + +if (!defined('_MD_FONTIER_MODULE_DIRNAME')) { + return false; +} + +//* +require_once (__DIR__ . DIRECTORY_SEPARATOR . 'objects.php'); + +/** + * Class for Glyphs in Fonts2Web.org.uk Font Converter + * + * For Table:- + * <code> + * CREATE TABLE `fontier_identities` ( + * `id` mediumint(24) NOT NULL AUTO_INCREMENT, + * `identity` varchar(45) DEFAULT '', + * `base` varchar(1) DEFAULT '', + * `second` varchar(2) DEFAULT '', + * `thirds` varchar(3) DEFAULT '', + * `downloads` int(13) DEFAULT '0', + * `views` int(13) DEFAULT '0', + * `css` tinytext, + * `glyphs` tinytext, + * `name` varchar(255) DEFAULT '', + * `barcode` varchar(32) DEFAULT '', + * `referee` varchar(128) DEFAULT '', + * `polled` int(13) DEFAULT '0', + * `last` int(13) DEFAULT '0', + * `downloaded` int(13) DEFAULT '0', + * `glyphed` int(13) DEFAULT '0', + * `notified` int(13) DEFAULT '0', + * PRIMARY KEY (`id`) + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + * </code> + * @author Simon Roberts (wis...@us...) + * @copyright copyright (c) 2015 labs.coop + */ +class fontierIdentities extends fontierXoopsObject +{ + + var $handler = ''; + + function __construct($id = null) + { + + self::initVar('id', XOBJ_DTYPE_INT, 0, false); + self::initVar('identity', XOBJ_DTYPE_TXTBOX, md5(null), false, 45); + self::initVar('base', XOBJ_DTYPE_TXTBOX, '', false, 1); + self::initVar('second', XOBJ_DTYPE_TXTBOX, '', false, 2); + self::initVar('thirds', XOBJ_DTYPE_TXTBOX, '', false, 3); + self::initVar('downloads', XOBJ_DTYPE_INT, 0, false); + self::initVar('views', XOBJ_DTYPE_INT, 0, false); + self::initVar('css', XOBJ_DTYPE_OBJECT, '', false); + self::initVar('glyphs', XOBJ_DTYPE_ARRAY, array(), false); + self::initVar('json', XOBJ_DTYPE_ARRAY, '', false); + self::initVar('diz', XOBJ_DTYPE_OBJECT, '', false); + self::initVar('name', XOBJ_DTYPE_TXTBOX, '', false, 255); + self::initVar('barcode', XOBJ_DTYPE_TXTBOX, '', false, 32); + self::initVar('referee', XOBJ_DTYPE_TXTBOX, '', false, 128); + self::initVar('polled', XOBJ_DTYPE_INT, 0, false); + self::initVar('last', XOBJ_DTYPE_INT, 0, false); + self::initVar('downloaded', XOBJ_DTYPE_INT, 0, false); + self::initVar('glyphed', XOBJ_DTYPE_INT, 0, false); + self::initVar('notified', XOBJ_DTYPE_INT, 0, false); + + $this->handler = __CLASS__ . 'Handler'; + if (!empty($id) && !is_null($id)) + { + $handler = new $this->handler; + self::assignVars($handler->get($id)->getValues(array_keys($this->vars))); + } + + } + + function addViewCount($num = 1) + { + $this->setVar('views', $this->getVar('views') + $num); + $this->setVar('last', time()); + xoops_getModuleHandler('indexes',_MD_FONTIER_MODULE_DIRNAME)->addViewsByBase($this->getVar('base'), $num); + xoops_getModuleHandler('indexes',_MD_FONTIER_MODULE_DIRNAME)->addViewsByBase($this->getVar('second'), $num); + xoops_getModuleHandler('indexes',_MD_FONTIER_MODULE_DIRNAME)->addViewsByBase($this->getVar('thirds'), $num); + } + + + function addDownloadCount($num = 1) + { + $this->setVar('downloads', $this->getVar('downloads') + $num); + $this->setVar('downloaded', time()); + xoops_getModuleHandler('indexes',_MD_FONTIER_MODULE_DIRNAME)->addDownloadsByBase($this->getVar('base'), $num); + xoops_getModuleHandler('indexes',_MD_FONTIER_MODULE_DIRNAME)->addDownloadsByBase($this->getVar('second'), $num); + xoops_getModuleHandler('indexes',_MD_FONTIER_MODULE_DIRNAME)->addDownloadsByBase($this->getVar('thirds'), $num); + } + + /** + * + * @param string $base + * @return boolean|string + */ + function getFontURL($field = 'id') + { + global $fontierConfigsList; + + if ($fontierConfigsList['htaccess']) { + return XOOPS_URL . '/' . $fontierConfigsList['base'] . '/font/'.urlencode($this->get($field)) . '/' . sef($this->get('name')) . '.' . $fontierConfigsList['html']; + } + return XOOPS_URL . '/modules/' . _MD_FONTIER_MODULE_DIRNAME. '/font.php?'.$field.'='.urlencode($this->get($field)); + } + + /** + * + * @param string $base + * @return boolean|string + */ + function getFontBrowseURL() + { + global $fontierConfigsList; + + if ($fontierConfigsList['htaccess']) { + return XOOPS_URL . '/' . $fontierConfigsList['base'] . '/font/' . urlencode($this->getVar('id')) . '/' . sef($this->getVar('name')) . '.' . $fontierConfigsList['html']; + } + return XOOPS_URL . '/modules/' . _MD_FONTIER_MODULE_DIRNAME. '/font.php?id=' . urlencode($this->getVar('id')); + } + + + /** + * + * @param string $base + * @return boolean|string + */ + function getPreviewURL($format = 'png') + { + global $fontierConfigsList; + + if ($fontierConfigsList['htaccess']) { + return XOOPS_URL . '/' . $fontierConfigsList['base'] . '/preview/' . urlencode($this->getVar('id')) . '.' . $format; + } + return XOOPS_URL . '/modules/' . _MD_FONTIER_MODULE_DIRNAME. '/preview.php?id=' . urlencode($this->getVar('id')) . '&format=' . $format; + } + + + /** + * + * @param string $base + * @return boolean|string + */ + function getNamingURL($format = 'png') + { + global $fontierConfigsList; + + if ($fontierConfigsList['htaccess']) { + return XOOPS_URL . '/' . $fontierConfigsList['base'] . '/naming/' . urlencode($this->getVar('id')) . '.' . $format; + } + return XOOPS_URL . '/modules/' . _MD_FONTIER_MODULE_DIRNAME. '/naming.php?id=' . urlencode($this->getVar('id')) . '&format=' . $format; + } + + + /** + * + * @param string $base + * @return boolean|string + */ + function getGlyphURL($char = '', $format = 'png') + { + global $fontierConfigsList; + + if ($fontierConfigsList['htaccess']) { + return XOOPS_URL . '/' . $fontierConfigsList['base'] . '/glyph/' . urlencode($this->getVar('id')) . '-' . urlencode($char) . '.' . $format; + } + return XOOPS_URL . '/modules/' . _MD_FONTIER_MODULE_DIRNAME. '/glyph.php?id=' . urlencode($this->getVar('id')) . '&char=' . $char . '&format=' . $format; + } + + + /** + * + * @param string $base + * @return boolean|string + */ + function getDownloadURL($pack = 'zip') + { + global $fontierConfigsList; + + if ($fontierConfigsList['htaccess']) { + return XOOPS_URL . '/' . $fontierConfigsList['base'] . '/download/' . urlencode($this->getVar('id')) . '.' . $pack; + } + return XOOPS_URL . '/modules/' . _MD_FONTIER_MODULE_DIRNAME. '/download.php?id=' . urlencode($this->getVar('id')) . '&pack=' . $pack; + } + + /** + * + * @return mixed + */ + function getCSSURL() + { + global $fontierConfigsList; + return str_replace("%apipath%", $fontierConfigsList['api_path'], str_replace("%identity%", $this->getVar('identity'), $fontierConfigsList['api_path_css'])); + } + + /** + * + * @param string $format + * @return boolean[]|string[] + */ + function getGlyphsURLArray($format = 'png') + { + $return = array(); + foreach($this->getVar('glyphs') as $key => $value) + { + $return[$value] = $this->getGlyphURL($value, $format); + } + return $return; + } + + /** + * + * @param array $packs + * @param string $filename + * @return boolean[]|string[] + */ + function getDownloadURLsArray($packs = array(), $filename = '') + { + $return = array(); + foreach($packs as $key => $extension) + $return[$filename . '.' . $extension] = $this->getDownloadURL($extension); + return $return; + } +} + + +/** + * Handler Class for Glyphs in Fonts2Web.org.uk Font Converter + * @author Simon Roberts (wis...@us...) + * @copyright copyright (c) 2015 labs.coop + */ +class fontierIdentitiesHandler extends fontierXoopsObjectHandler +{ + + + /** + * Table Name without prefix used + * + * @var string + */ + var $tbl = 'fontier_identities'; + + /** + * Child Object Handling Class + * + * @var string + */ + var $child = 'fontierIdentities'; + + /** + * Child Object Identity Key + * + * @var string + */ + var $identity = 'id'; + + /** + * Child Object Default Envaluing Costs + * + * @var string + */ + var $envalued = 'value'; + + function __construct(&$db) + { + if (!is_object($db)) + $db = $GLOBAL["xoopsDB"]; + parent::__construct($db, $this->tbl, $this->child, $this->identity, $this->envalued); + } + + /** + * + * @param string $base + * @return array|NULL[][]|unknown[][] + */ + function getIndexesListbyBase($base = '') + { + if (strlen($base) == 0) + { + $sql = "SELECT DISTINCT `base` as `index`, count(*) as `num` FROM `" . $GLOBALS['xoopsDB']->prefix($this->tbl) . "` WHERE LENGTH(`base`) = 1 ORDER BY `base` ASC"; + if (strlen($base) == 1) + { + $sql = "SELECT DISTINCT `second` as `index`, count(*) as `num` FROM `" . $GLOBALS['xoopsDB']->prefix($this->tbl) . "` WHERE `base` LIKE '$base' ORDER BY `second` ASC"; + } elseif (strlen($base) == 2) + { + $sql = "SELECT DISTINCT `thirds` as `index`, count(*) as `num` FROM `" . $GLOBALS['xoopsDB']->prefix($this->tbl) . "` WHERE `second` LIKE '$base' ORDER BY `thirds` ASC"; + } elseif (strlen($base) == 3) + { + return array(); + } + + $return = array(); + $result = $GLOBALS['xoopsDB']->queryF($sql); + while($row = $GLOBALS['xoopsDB']->fetchArray($result)) + $return[$row['index']] = array('url'=>xoops_getModuleHandler('indexes',_MD_FONTIER_MODULE_DIRNAME)->getIndexBrowseURL($row['index']), 'count' => $row['num']); + return $return; + } +} +} \ No newline at end of file Property changes on: XoopsModules/fontier+/trunk/modules/fontier/class/identities.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/class/index.html =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/class/index.html (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/class/index.html 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1 @@ +<script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/fontier+/trunk/modules/fontier/class/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/class/indexes.php =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/class/indexes.php (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/class/indexes.php 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,276 @@ +<?php +/** + * Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * + * 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 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage fontier+ + * @description Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * @version 1.0.1 + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/fontier + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/fontier + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/fontier + * @link http://internetfounder.wordpress.com + */ + + +if (!defined('_MD_FONTIER_MODULE_DIRNAME')) { + return false; +} + +require_once (__DIR__ . DIRECTORY_SEPARATOR . 'objects.php'); + +/** + * Class for Fonts in Fonts2Web.org.uk Font Converter + * + * For Table:- + * <code> + * CREATE TABLE `fontier_indexes` ( + * `id` mediumint(24) NOT NULL AUTO_INCREMENT, + * `base` varchar(3) DEFAULT '', + * `ids` mediumtext, + * `fonts` int(13) DEFAULT '0', + * `last` int(13) DEFAULT '0', + * `downloads` int(13) DEFAULT '0', + * `views` int(13) DEFAULT '0', + * `notified` int(13) DEFAULT '0', + * PRIMARY KEY (`id`) + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + * </code> + * @author Simon Roberts (wis...@us...) + * @copyright copyright (c) 2015 labs.coop + */ +class fontierIndexes extends fontierXoopsObject +{ + + var $handler = ''; + + function __construct($id = null) + { + + self::initVar('id', XOBJ_DTYPE_INT, null, false); + self::initVar('base', XOBJ_DTYPE_TXTBOX, null, false, 3); + self::initVar('ids', XOBJ_DTYPE_ARRAY, array(), false); + self::initVar('fonts', XOBJ_DTYPE_INT, null, false); + self::initVar('last', XOBJ_DTYPE_INT, null, false); + self::initVar('downloads', XOBJ_DTYPE_INT, 0, false); + self::initVar('views', XOBJ_DTYPE_INT, 0, false); + self::initVar('notified', XOBJ_DTYPE_INT, 0, false); + + $this->handler = __CLASS__ . 'Handler'; + if (!empty($id) && !is_null($id)) + { + $handler = new $this->handler; + self::assignVars($handler->get($id)->getValues(array_keys($this->vars))); + } + + } + + /** + * + * @param unknown $id + * @return boolean + */ + function addFontID($id) + { + if (empty($id)) + return false; + + $ids = $this->getVar('ids'); + $ids[] = $id; + sort(array_unique($ids)); + array_unique($ids); + $this->setVar('ids', $ids); + + $this->setVar('fonts', $this->getVar('fonts')+1); + $this->setVar('last', time()); + + return true; + } + + + /** + * + * @param string $base + * @return boolean|string + */ + function getIndexBrowseURL() + { + global $fontierConfigsList; + + if ($fontierConfigsList['htaccess']) { + return XOOPS_URL . '/' . $fontierConfigsList['base'] . '/index/0/30/' . urlencode($this->getVar('base')) . '.' . $fontierConfigsList['html']; + } + return XOOPS_URL . '/modules/' . _MD_FONTIER_MODULE_DIRNAME. '/?op=index&start=0&limit=30&base=' . urlencode($this->getVar('base')); + } +} + +/** + * Handler Class for Fonts in Fonts2Web.org.uk Font Converter + * @author Simon Roberts (wis...@us...) + * @copyright copyright (c) 2015 labs.coop + */ +class fontierIndexesHandler extends fontierXoopsObjectHandler +{ + + + /** + * Table Name without prefix used + * + * @var string + */ + var $tbl = 'fontier_indexes'; + + /** + * Child Object Handling Class + * + * @var string + */ + var $child = 'fontierIndexes'; + + /** + * Child Object Identity Key + * + * @var string + */ + var $identity = 'id'; + + /** + * Child Object Default Envaluing Costs + * + * @var string + */ + var $envalued = 'referee'; + + function __construct(&$db) + { + if (!is_object($db)) + $db = $GLOBAL["xoopsDB"]; + parent::__construct($db, $this->tbl, $this->child, $this->identity, $this->envalued); + } + + /** + * + * @param string $base + * @param number $excludeid + * @param number $start + * @param number $limit + * @return boolean|NULL[][] + */ + function getFontsURLsFromBase($base = '', $excludeid = 0, $start = 0, $limit = 0) + { + if (strlen($base)==1) + $criteria = new CriteriaCompo(new Criteria('base', $base, 'LIKE')); + elseif (strlen($base)==2) + $criteria = new CriteriaCompo(new Criteria('second', $base, 'LIKE')); + elseif (strlen($base)==3) + $criteria = new CriteriaCompo(new Criteria('thirds', $base, 'LIKE')); + else + return false; + if (!empty($excludeid) && $excludeid != 0) + $criteria->add(new Criteria('id', $excludeid, '!=')); + $criteria->order('`name`'); + $criteria->sort('ASC'); + if ($start != 0 || $limit != 0) + { + $criteria->start($start); + $criteria->sort($limit); + } + $fonts = xoops_getModuleHandler('identities',_MD_FONTIER_MODULE_DIRNAME)->getObjects($criteria); + $return = array(); + foreach($fonts as $id => $font) + { + $return[$id] = array('name' => $font->getVar('name'), 'url' => $font->getFontBrowseURL(), 'naming' => $font->getNamingURL()); + } + return $return; + } + /** + * + * @param string $base + * @return boolean|string + */ + function getIndexBrowseURL($base = '') + { + global $fontierConfigsList; + + if (empty($base)) + return false; + + if ($fontierConfigsList['htaccess']) { + return XOOPS_URL . '/' . $fontierConfigsList['base'] . '/index/0/30/' . urlencode($base) . '.' . $fontierConfigsList['html']; + } + return XOOPS_URL . '/modules/' . _MD_FONTIER_MODULE_DIRNAME. '/?op=index&start=0&limit=30&base=' . urlencode($base); + } + + /** + * + * @param string $base + * @return boolean|unknown + */ + function getIndexesArrayByBase($base = '') + { + if (empty($base)) + return false; + return xoops_getModuleHandler('indexes',_MD_FONTIER_MODULE_DIRNAME)->getIndexesListbyBase($base); + } + + /** + * + * @param string $base + * @return boolean|XoopsObject + */ + function getByBase($base = '') + { + if (empty($base)) + return false; + + $sql = "SELECT `id` FROM `" . $GLOBALS['xoopsDB']->prefix($this->tbl) . "` WHERE `base` LIKE '$base'"; + list($id) = $GLOBALS['xoopsDB']->fetchRow($GLOBALS['xoopsDB']->queryF($sql)); + + if (isset($id) && !empty($id)) + return $this->get($id); + + return false; + } + + /** + * + * @param string $base + * @param number $number + * @return boolean|unknown + */ + function addViewsByBase($base = '', $number = 1) + { + if (empty($base) || $number = 0) + return false; + + $sql = "UPDATE `" . $GLOBALS['xoopsDB']->prefix($this->tbl) . "` SET `views` = `views` + '$number' WHERE `base` LIKE '$base'"; + return $GLOBALS['xoopsDB']->queryF($sql); + } + + /** + * + * @param string $base + * @param number $number + * @return boolean|unknown + */ + function addDownloadsByBase($base = '', $number = 1) + { + if (empty($base) || $number = 0) + return false; + + $sql = "UPDATE `" . $GLOBALS['xoopsDB']->prefix($this->tbl) . "` SET `downloads` = `downloads` + '$number' WHERE `base` LIKE '$base'"; + return $GLOBALS['xoopsDB']->queryF($sql); + } +} + + +?> \ No newline at end of file Property changes on: XoopsModules/fontier+/trunk/modules/fontier/class/indexes.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/class/objects.php =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/class/objects.php (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/class/objects.php 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,146 @@ +<?php +/** + * Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * + * 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 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage fontier+ + * @description Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * @version 1.0.1 + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/fontier + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/fontier + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/fontier + * @link http://internetfounder.wordpress.com + */ + + +if (!defined('_MI_PLEASE_MODULE_DIRNAME')) { + return false; +} + +//* +require_once (__DIR__ . DIRECTORY_SEPARATOR . 'objects.php'); + + +/** + * Class for Addresses in Please email ticketer + * @author Simon Roberts (wis...@us...) + * @copyright copyright (c) 2015 labs.coop + */ +class fontierXoopsObject extends XoopsObject +{ + /** + * (non-PHPdoc) + * @see XoopsObject::assignVar() + */ + function assignVar($key, $value) + { + if ($this->vars[$key]['data_type'] == XOBJ_DTYPE_OTHER) { + parent::assignVar($key, convertDecompressData($value)); + } elseif (strpos($key, 'pass')||strpos($key, 'password')) { + parent::assignVar($key, convertDecryptPassword($value, PLEASE_SALT . PLEASE_SALT_WHENSET)); + } else + parent::assignVar($key, $value); + } + + /** + * (non-PHPdoc) + * @see XoopsObject::cleanVars() + */ + function cleanVars($object = null) + { + $ret = false; + if (empty($object)||is_null($object)) + $object = self; + if (is_a($object, "XoopsObject")) + if ($ret = parent::cleanVars($object)) + { + foreach(array_keys($object->vars) as $field) + { + if ($object->vars[$field]['data_type'] == XOBJ_DTYPE_OTHER) { + $object->vars[$field]['value'] = convertCompressData($object->vars[$field]['value']); + } elseif (strpos($field, 'pass')||strpos($field, 'password')) { + $object->vars[$field]['value'] = convertEncryptPassword($object->vars[$field]['value'], PLEASE_SALT . PLEASE_SALT_WHENSET); + } + } + } + return $ret; + } + + /** + * Returns MD5 Identify hash for handler getMD5()' + * + * @param string $field + * @return string + */ + function getMD5($field = 'id') + { + return md5(PLEASE_SALT . $this->getVar($field) . PLEASE_SALT); + } +} + +/** + * Handler Modelling Class for Addresses in Please email ticketer + * @author Simon Roberts (wis...@us...) + * @copyright copyright (c) 2015 labs.coop + */ +class fontierXoopsObjectHandler extends XoopsPersistableObjectHandler +{ + + + /** + * Table Name without prefix used + * + * @var string + */ + var $tbl = ''; + + /** + * Child Object Handling Class + * + * @var string + */ + var $child = ''; + + /** + * Child Object Identity Key + * + * @var string + */ + var $identity = ''; + + /** + * Child Object Default Envaluing Costs + * + * @var string + */ + var $envalued = ''; + + /** + * Class Constructor + * @param XoopsDB $db + * @param string $tbl + * @param string $child + * @param string $identity + * @param string $envalued + */ + function __construct($db, $tbl = '', $child = '', $identity = '', $envalued = '') + { + if (!is_object($db)) + $db = $GLOBAL["xoopsDB"]; + $this->tbl = $tbl; + $this->child = $child; + $this->identity = $identity; + $this->envalued = $envalued; + return parent::__construct($db, $this->tbl, $this->child, $this->identity, $this->envalued); + } + +} \ No newline at end of file Property changes on: XoopsModules/fontier+/trunk/modules/fontier/class/objects.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/comment_delete.php =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/comment_delete.php (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/comment_delete.php 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,26 @@ +<?php +/** + * Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * + * 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 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage fontier+ + * @description Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * @version 1.0.1 + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/fontier + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/fontier + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/fontier + * @link http://internetfounder.wordpress.com + */ + +include_once 'header.php'; +include_once XOOPS_ROOT_PATH.'/include/comment_delete.php'; +?> \ No newline at end of file Property changes on: XoopsModules/fontier+/trunk/modules/fontier/comment_delete.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/comment_edit.php =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/comment_edit.php (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/comment_edit.php 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,26 @@ +<?php +/** + * Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * + * 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 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage fontier+ + * @description Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * @version 1.0.1 + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/fontier + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/fontier + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/fontier + * @link http://internetfounder.wordpress.com + */ + +include_once 'header.php'; +include_once XOOPS_ROOT_PATH.'/include/comment_edit.php'; +?> \ No newline at end of file Property changes on: XoopsModules/fontier+/trunk/modules/fontier/comment_edit.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/comment_new.php =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/comment_new.php (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/comment_new.php 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,57 @@ +<?php +/** + * Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * + * 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 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage fontier+ + * @description Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * @version 1.0.1 + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/fontier + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/fontier + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/fontier + * @link http://internetfounder.wordpress.com + */ + +include_once 'header.php'; +include_once NW_MODULE_PATH . '/class/class.newsstory.php'; +include_once NW_MODULE_PATH . '/include/functions.php'; + +// We verify that the user can post comments ********************************** +if(!isset($xoopsModuleConfig)) { + die(); +} + +if($xoopsModuleConfig['com_rule'] == 0) { // Comments are deactivate + die(); +} + +if($xoopsModuleConfig['com_anonpost'] == 0 && !is_object($xoopsUser)) { // Anonymous users can't post + die(); +} +// **************************************************************************** + +$com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0; +if ($com_itemid > 0) { + $article = new nw_NewsStory($com_itemid); + if($article->storyid>0) { + $com_replytext = _POSTEDBY.' <b>'.$article->uname().'</b> '._DATE.' <b>'.formatTimestamp($article->published(),nw_getmoduleoption('dateformat', NW_MODULE_DIR_NAME)).'</b><br /><br />'.$article->hometext(); + $bodytext = $article->bodytext(); + if ($bodytext != '') { + $com_replytext .= '<br /><br />'.$bodytext.''; + } + $com_replytitle = $article->title(); + include_once XOOPS_ROOT_PATH.'/include/comment_new.php'; + } else { + exit; + } +} +?> Property changes on: XoopsModules/fontier+/trunk/modules/fontier/comment_new.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/comment_post.php =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/comment_post.php (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/comment_post.php 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,41 @@ +<?php +/** + * Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * + * 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 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage fontier+ + * @description Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * @version 1.0.1 + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/fontier + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/fontier + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/fontier + * @link http://internetfounder.wordpress.com + */ + +// ------------------------------------------------------------------------ // +include_once 'header.php'; + +// We verify that the user can post comments ********************************** +if(!isset($xoopsModuleConfig)) { + die(); +} + +if($xoopsModuleConfig['com_rule'] == 0) { // Comments are deactivate + die(); +} + +if($xoopsModuleConfig['com_anonpost'] == 0 && !is_object($xoopsUser)) { // Anonymous users can't post + die(); +} +// **************************************************************************** +include_once XOOPS_ROOT_PATH.'/include/comment_post.php'; +?> \ No newline at end of file Property changes on: XoopsModules/fontier+/trunk/modules/fontier/comment_post.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/comment_reply.php =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/comment_reply.php (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/comment_reply.php 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,26 @@ +<?php +/** + * Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * + * 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 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage fontier+ + * @description Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * @version 1.0.1 + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/fontier + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/fontier + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/fontier + * @link http://internetfounder.wordpress.com + */ + +include_once 'header.php'; +include_once XOOPS_ROOT_PATH.'/include/comment_reply.php'; +?> \ No newline at end of file Property changes on: XoopsModules/fontier+/trunk/modules/fontier/comment_reply.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/crons/caching.php =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/crons/caching.php (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/crons/caching.php 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,45 @@ +<?php +/** + * Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * + * 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 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage fontier+ + * @description Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * @version 1.0.1 + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/fontier + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/fontier + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/fontier + * @link http://internetfounder.wordpress.com + */ + + + require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'header.php'; + + set_time_limit(8444); + + global $fontierConfigsList; + + xoops_load("XoopsCache"); + + $caches = XoopsCache::read(_MD_FONTIER_MODULE_DIRNAME . "-caches-session"); + if (!is_array($caches)) + $caches = array(); + foreach($caches as $key => $time) + { + if ($time < time()) + { + XoopsCache::delete($key); + unset($caches[$key]); + } + } + XoopsCache::write(_MD_FONTIER_MODULE_DIRNAME . "-caches-session", $caches, 60*60*24*90*128); + \ No newline at end of file Added: XoopsModules/fontier+/trunk/modules/fontier/crons/glyphs.php =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/crons/glyphs.php (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/crons/glyphs.php 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,55 @@ +<?php +/** + * Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * + * 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 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage fontier+ + * @description Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * @version 1.0.1 + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/fontier + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/fontier + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/fontier + * @link http://internetfounder.wordpress.com + */ + + + require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'header.php'; + + set_time_limit(8444); + + global $fontierConfigsList; + + $identitiesHandler= xoops_getModuleHandler('identities',_MD_FONTIER_MODULE_DIRNAME); + + $criteria = new CriteriaCompo(new Criteria('polling', 0, '>')); + $criteria->add(new Criteria('glyphed', time() - $fontierConfigsList['cache_glyphs'], "<=")); + if (!empty($fontierConfigsList['api_path']) && $identitiesHandler->getCount($criteria) > 0) + { + $criteria->order('RAND()'); + if ($fontierConfigsList['num_polled_glyphs'] > 0) + $criteria->setLimit($fontierConfigsList['num_polled_glyphs']); + if ($fonts = $identitiesHandler->getObjects($criteria)) + { + foreach($fonts as $font) + { + $glyphs = array(); + for($utf=31;$utf<128;$utf++) + if ($utf > 31 && $utf< 124) + if (mt_rand(0,3)==2 || mt_rand(0,6)==5) + $glyphs[] = $utf; + $font->setVar('glyphs', $glyphs); + $font->setVar('glyphed', time()); + $identitiesHandler->insert($font, true); + } + } + } + \ No newline at end of file Added: XoopsModules/fontier+/trunk/modules/fontier/crons/identities.php =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/crons/identities.php (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/crons/identities.php 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,47 @@ +<?php +/** + * Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * + * 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 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license General Public License version 3 (http://labs.coop/briefs/legal/general-public-licence/13,3.html) + * @author Simon Roberts (wishcraft) <wis...@us...> + * @subpackage fontier+ + * @description Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * @version 1.0.1 + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.5/Modules/fontier + * @link https://sourceforge.net/projects/chronolabs/files/XOOPS%202.6/Modules/fontier + * @link https://sourceforge.net/p/xoops/svn/HEAD/tree/XoopsModules/fontier + * @link http://internetfounder.wordpress.com + */ + + require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'header.php'; + + set_time_limit(8444); + + global $fontierConfigsList; + + $identitiesHandler= xoops_getModuleHandler('identities',_MD_FONTIER_MODULE_DIRNAME); + + if (!empty($fontierConfigsList['api_path'])) + { + $data = json_decode(getURIData(str_replace("%apipath%", $fontierConfigsList['api_path'], $fontierConfigsList['api_path_json_identities'])), true); + if (!empty($data)) { + foreach($data as $identity) + { + $criteria = new Criteria('identity', $identity, 'LIKE'); + if ($identitiesHandler->getCount($criteria) == 0) + { + $obj = $identitiesHandler->create(); + $obj->setVar('identity', $identity); + $identitiesHandler->insert($obj, true); + } + } + } + } \ No newline at end of file Added: XoopsModules/fontier+/trunk/modules/fontier/crons/index.html =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/crons/index.html (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/crons/index.html 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1 @@ +<script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/fontier+/trunk/modules/fontier/crons/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/fontier+/trunk/modules/fontier/crons/polling.php =================================================================== --- XoopsModules/fontier+/trunk/modules/fontier/crons/polling.php (rev 0) +++ XoopsModules/fontier+/trunk/modules/fontier/crons/polling.php 2017-05-01 19:18:52 UTC (rev 13235) @@ -0,0 +1,102 @@ +<?php +/** + * Font Repository Browser for the Chronolabs Cooperative Fonting Repository Services API + * + * 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 ... [truncated message content] |