From: <zy...@us...> - 2015-01-29 06:01:20
|
Revision: 12953 http://sourceforge.net/p/xoops/svn/12953 Author: zyspec Date: 2015-01-29 06:01:11 +0000 (Thu, 29 Jan 2015) Log Message: ----------- - added breadcrumb display to top of index page - improved index.tpl rendering - changed to allow HTML in quote entry (XoopsRequest::getText) in admin - moved some hard coded language strings from templates to language files - fixed typo in block text length calculation - fixed bug where 'item_tag' wasn't correctly assigned to template in /class/quotes.php - fixed bug in install script PHP version checking - fixed bug where language file wasn't being loaded in install script Modified Paths: -------------- XoopsModules/randomquote/branches/zyspec/randomquote/admin/main.php XoopsModules/randomquote/branches/zyspec/randomquote/blocks/views.php XoopsModules/randomquote/branches/zyspec/randomquote/class/quotes.php XoopsModules/randomquote/branches/zyspec/randomquote/docs/changelog.txt XoopsModules/randomquote/branches/zyspec/randomquote/include/action.module.php XoopsModules/randomquote/branches/zyspec/randomquote/index.php XoopsModules/randomquote/branches/zyspec/randomquote/language/english/main.php XoopsModules/randomquote/branches/zyspec/randomquote/templates/randomquote_header.tpl XoopsModules/randomquote/branches/zyspec/randomquote/templates/randomquote_index.tpl XoopsModules/randomquote/branches/zyspec/randomquote/xoops_version.php Modified: XoopsModules/randomquote/branches/zyspec/randomquote/admin/main.php =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/admin/main.php 2015-01-28 21:33:49 UTC (rev 12952) +++ XoopsModules/randomquote/branches/zyspec/randomquote/admin/main.php 2015-01-29 06:01:11 UTC (rev 12953) @@ -114,11 +114,11 @@ $input = new stdClass; // setup input array $input->id = XoopsRequest::getInt('id', RandomquoteConstants::DEFAULT_ID, 'POST'); - $input->quote = XoopsRequest::getString('quote', '', 'POST'); - $input->author = XoopsRequest::getString('author', '', 'POST'); + $input->quote = XoopsRequest::getText('quote', '', 'POST'); + $input->author = XoopsRequest::getText('author', '', 'POST'); $input->item_tag = XoopsRequest::getString('item_tag', '', 'POST'); - $verify_quote_status = XoopsRequest::getInt('quote_status', RandomquoteConstants::STATUS_OFFLINE, 'POST'); + $verify_quote_status = XoopsRequest::getInt('quote_status', RandomquoteConstants::STATUS_OFFLINE, 'POST'); $input->quote_status = (in_array($verify_quote_status, array(RandomquoteConstants::STATUS_ONLINE, RandomquoteConstants::STATUS_OFFLINE, RandomquoteConstants::STATUS_WAITING))) ? $verify_quote_status : RandomquoteConstants::STATUS_OFFLINE; if (!empty($input->id)) { Modified: XoopsModules/randomquote/branches/zyspec/randomquote/blocks/views.php =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/blocks/views.php 2015-01-28 21:33:49 UTC (rev 12952) +++ XoopsModules/randomquote/branches/zyspec/randomquote/blocks/views.php 2015-01-29 06:01:11 UTC (rev 12953) @@ -44,14 +44,12 @@ */ function showRandomquoteBlockViews($options) { -// xoops_load('quotes', 'randomquote'); - xoops_load('constants', 'randomquote'); +// xoops_load('constants', 'randomquote'); - $citas = array(); - $type_block = $options[0]; - $nb_quotes = $options[1]; - $length_title = $options[2]; - + $citas = array(); + $type_block = $options[0]; + $nb_quotes = (int) $options[1]; + $length_title = (int) $options[2]; $quotesHandler =& xoops_getmodulehandler('quotes', 'randomquote'); $criteria = new CriteriaCompo(); @@ -83,10 +81,10 @@ } $quoteObjsArray = $quotesHandler->getAll($criteria); foreach ($quoteObjsArray as $thisQuote) { - if ($options[2] > 0) { - $short_quote = xoops_substr($thisQuote->getVar('quote'), 0, $options[2], $trimmarker = '...'); + if ($length_title > 0) { + $short_quote = xoops_substr($thisQuote->getVar('quote'), 0, $length_title, $trimmarker = '...'); } else { - $shotr_quote = $thisQuote->getVar('quote'); + $short_quote = $thisQuote->getVar('quote'); } $citas[] = array('quote' => $short_quote, 'author' => $thisQuote->getVar('author') @@ -106,8 +104,8 @@ $quotes_arr = array(); $form = "" . _MB_RANDOMQUOTE_QUOTES_DISPLAY . "\n" . "<input type='hidden' name='options[0]' value='" . $options[0] . "' />\n" - . "<input name='options[1]' size='5' maxlength='255' value='" . $options[1] . "' type='text' /> <br />\n" - . "" . _MB_RANDOMQUOTE_QUOTES_SHORTEN . " <input name='options[2]' size='5' maxlength='255' value='" . $options[2] . "' type='number' min='0' /> " . _MB_RANDOMQUOTE_QUOTES_CHARACTERS . "<br /><br />"; + . "<input name='options[1]' size='3' maxlength='4' value='" . $options[1] . "' type='text' /> <br />\n" + . "" . _MB_RANDOMQUOTE_QUOTES_SHORTEN . " <input name='options[2]' size='3' maxlength='5' value='" . $options[2] . "' type='number' min='0' step='5' /> " . _MB_RANDOMQUOTE_QUOTES_CHARACTERS . "<br /><br />"; /* array_shift($options); array_shift($options); Modified: XoopsModules/randomquote/branches/zyspec/randomquote/class/quotes.php =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/class/quotes.php 2015-01-28 21:33:49 UTC (rev 12952) +++ XoopsModules/randomquote/branches/zyspec/randomquote/class/quotes.php 2015-01-29 06:01:11 UTC (rev 12953) @@ -85,8 +85,8 @@ $editorConfigs = array("name" => "quote", "value" => $this->getVar("quote", "e"), - "rows" => 10, - "cols" => 80, + "rows" => 8, + "cols" => 50, "width" => "100%", "height" => "400px", "editor" => $GLOBALS["xoopsModuleConfig"]["randomquote_editor"] @@ -115,7 +115,7 @@ $form->addElement(new TagFormTag('item_tag', 60, 255, $tag_string, 0)); } } else { - $form->XoopsFormHidden('item_tag', ''); + $form->addElement(new XoopsFormHidden('item_tag', '')); } $quote_status = ($this->isNew()) ? RandomquoteConstants::STATUS_OFFLINE : $this->getVar("quote_status"); Modified: XoopsModules/randomquote/branches/zyspec/randomquote/docs/changelog.txt =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/docs/changelog.txt 2015-01-28 21:33:49 UTC (rev 12952) +++ XoopsModules/randomquote/branches/zyspec/randomquote/docs/changelog.txt 2015-01-29 06:01:11 UTC (rev 12953) @@ -1,20 +1,28 @@ -Version 2.1 Beta 1 from 2014-12-08 -================================= -- Require PHP 5.3 -- Require XOOPS 2.5.7+ -- Significant security improvements for all vars passed from forms -- Replaced cleanVarsRandomquote with XoopsRequest +<u>Version 2.1 Beta 2 from 2015-1-28</u> +- added breadcrumb display to top of index page +- improved index.tpl rendering +- changed to allow HTML in quote entry (XoopsRequest::getText) in admin +- moved some hard coded language strings from templates to language files +- fixed typo in block text length calculation +- fixed bug where 'item_tag' wasn't correctly assigned to template in /class/quotes.php +- fixed bug in install script PHP version checking +- fixed bug where language file wasn't being loaded in install script + +<u>Version 2.1 Beta 1 from 2014-12-08</u> +- require PHP 5.3 +- require XOOPS 2.5.7+ +- significant security improvements for all vars passed from forms +- replaced cleanVarsRandomquote with XoopsRequest - removed need for ./include/config.php - fixed typo in ./docs/licencs file name to license.txt -- Clean up phpdocumentor comments -- General code cleanup +- clean up phpdocumentor comments +- general code cleanup - added module search capability - added support for XOOPS Tag module - added date quote was created to database - removed "day" block - can be accomplished setting quote cache -Version 2.00 from 2013-06-27 -================================= - - Original release RandomQuote 2.0 Alpha 1. +<u>Version 2.00 from 2013-06-27</u> + - original release RandomQuote 2.0 Alpha 1. This module is developed from scratch using TDMCreate, but it's inspired by the original code from RandomQuote Modified: XoopsModules/randomquote/branches/zyspec/randomquote/include/action.module.php =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/include/action.module.php 2015-01-28 21:33:49 UTC (rev 12952) +++ XoopsModules/randomquote/branches/zyspec/randomquote/include/action.module.php 2015-01-29 06:01:11 UTC (rev 12953) @@ -53,6 +53,7 @@ * @return bool true if meets requirements, false if not */ function randomquoteCheckXoopsVer(&$module) { + xoops_loadLanguage('admin', $module->dirname()); //check for minimum XOOPS version $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string $currArray = explode('.', $currentVer); @@ -90,14 +91,15 @@ * @return bool true if meets requirements, false if not */ function randomquoteCheckPHPVer(&$module) { + xoops_loadLanguage('admin', $module->dirname()); // check for minimum PHP version - $phpLen = strlen(PHP_VERSION); - $extraLen = strlen(PHP_EXTRA_VERSION); - $verNum = substr(PHP_VERSION, 0, ($phpLen-$extraLen)); - $reqVer = $module->getInfo('min_php'); + $phpLen = strlen(PHP_VERSION); + $extraLen = strlen(PHP_EXTRA_VERSION); + $verNum = trim(substr(PHP_VERSION, 0, ($phpLen-$extraLen))); + $reqVer = trim($module->getInfo('min_php') . ""); //make sure it's a string and then trim it - $success = true; - if ($verNum < $reqVer) { + $success = true; + if ($verNum >= $reqVer) { $module->setErrors(sprintf(_AM_RANDOMQUOTE_ERROR_BAD_PHP, $reqVer, $verNum)); $success = false; } @@ -190,6 +192,7 @@ function xoops_module_uninstall_randomquote(&$module) { + $success = true; return $success; } Modified: XoopsModules/randomquote/branches/zyspec/randomquote/index.php =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/index.php 2015-01-28 21:33:49 UTC (rev 12952) +++ XoopsModules/randomquote/branches/zyspec/randomquote/index.php 2015-01-29 06:01:11 UTC (rev 12953) @@ -39,7 +39,8 @@ 'fbcomments' => $GLOBALS['xoopsModuleConfig']['fbcomments'], 'admin' => $GLOBALS['xoops']->url("www/modules/randomquote/admin/index.php"), 'copyright' => "<a href='http://xoops.org' title='XOOPS Project' target='_blank'> - <img src='" . $GLOBALS['xoops']->url("www/modules/randomquote/assets/images/randomquote_logo.png") . "' alt='XOOPS Project' /></a>" + <img src='" . $GLOBALS['xoops']->url("www/modules/randomquote/assets/images/randomquote_logo.png") . "' alt='XOOPS Project' /></a>", + 'breadcrumb' => '<a href="' . $GLOBALS['xoops']->url('www') . '">' . _YOURHOME . '</a> » ' . $GLOBALS['xoopsModule']->name(), ) ); @@ -77,7 +78,7 @@ . " <td class='txtcenter'>" . $thisQuote->getVar("author") . "</td>\n" . " </tr>\n"; $GLOBALS['xoopsTpl']->append('sets', array('quote' => $thisQuote->getVar("quote"), - 'author' => $thisQuote->getVar("author")) + 'author' => $thisQuote->getVar("author")) ); // } } Modified: XoopsModules/randomquote/branches/zyspec/randomquote/language/english/main.php =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/language/english/main.php 2015-01-28 21:33:49 UTC (rev 12952) +++ XoopsModules/randomquote/branches/zyspec/randomquote/language/english/main.php 2015-01-29 06:01:11 UTC (rev 12953) @@ -23,8 +23,9 @@ // Main define('_MA_RANDOMQUOTE_INDEX', "Home"); -define('_MA_RANDOMQUOTE_TITLE', "randomquote"); +define('_MA_RANDOMQUOTE_TITLE', "Random Quote Module"); define('_MA_RANDOMQUOTE_DESC', "This module is for collecting and showing Random Quotes"); +define('_MA_RANDOMQUOTE_NO_QUOTES', "There are no quotes that match your request."); define('_MA_RANDOMQUOTE_QUOTES', "Quotes"); //define('_MA_RANDOMQUOTE_QUOTES', "quotes"); define('_MA_RANDOMQUOTE_ADMIN', "Admin"); Modified: XoopsModules/randomquote/branches/zyspec/randomquote/templates/randomquote_header.tpl =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/templates/randomquote_header.tpl 2015-01-28 21:33:49 UTC (rev 12952) +++ XoopsModules/randomquote/branches/zyspec/randomquote/templates/randomquote_header.tpl 2015-01-29 06:01:11 UTC (rev 12953) @@ -1,5 +1,5 @@ -<span class='txtleft bold'><{$smarty.const._MA_RANDOMQUOTE_TITLE}>: </span> -<span class='txtleft'><{$smarty.const._MA_RANDOMQUOTE_DESC}></span><br/> -<{if $adv != ''}> +<div class="breadcrumb"><{$breadcrumb}></div> +<div class='txtleft marg5'><strong></b><{$smarty.const._MA_RANDOMQUOTE_TITLE}>:</strong> <{$smarty.const._MA_RANDOMQUOTE_DESC}></div> +<{if '' != $adv}> <div class="center"><{$adv}></div> <{/if}> Modified: XoopsModules/randomquote/branches/zyspec/randomquote/templates/randomquote_index.tpl =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/templates/randomquote_index.tpl 2015-01-28 21:33:49 UTC (rev 12952) +++ XoopsModules/randomquote/branches/zyspec/randomquote/templates/randomquote_index.tpl 2015-01-29 06:01:11 UTC (rev 12953) @@ -1,8 +1,8 @@ -<{include file="db:randomquote_header.tpl"}> +<{include file="db:randomquote_header.tpl" breadcrumb = $breadcrumb}> <{* <link rel="stylesheet" href="assets/css/table.css" type="text/css"/> *}> <{* <div class="outer"> - <div class="center">Randomquote</div> + <div class="center"><{$smarty.const._MA_RANDOMQUOTE_TITLE}></div> <br /> </div> *}> @@ -11,6 +11,7 @@ <{if !empty($sets)}> <div class="head border marg10"> <div class="outer"> +<{* <div class="breadcrumb"><{$breadcrumb}></div> *}> <div class="width80 floatleft center bold big"><{$smarty.const._MA_RANDOMQUOTE_QUOTES_QUOTE}></div> <div class="width10 floatleft center bold big"><{$smarty.const._MA_RANDOMQUOTE_QUOTES_AUTHOR}></div> <div class="clear"></div> @@ -25,9 +26,7 @@ <{* $pagenav *}> </div> <{else}> -<div class='txtcenter bold italic marg3'> - There are no quotes that match your request. -</div> +<div class='txtcenter bold italic marg3'><{$smarty.const._MA_RANDOMQUOTE_NO_QUOTES}></div> <{/if}> <{include file="db:randomquote_footer.tpl"}> Modified: XoopsModules/randomquote/branches/zyspec/randomquote/xoops_version.php =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/xoops_version.php 2015-01-28 21:33:49 UTC (rev 12952) +++ XoopsModules/randomquote/branches/zyspec/randomquote/xoops_version.php 2015-01-29 06:01:11 UTC (rev 12953) @@ -32,7 +32,7 @@ 'version' => 2.10, 'module_status' => "Beta 1", 'official' => 0, //1 if supported by XOOPS CORE Dev Team, 0 otherwise - 'release_date' => "2014/12/06", + 'release_date' => "2015/1/28", 'author' => "XOOPS Module Development Team", 'author_mail' => "na...@si...", 'author_website_url' => "http://xoops.org", |