|
From: <zy...@us...> - 2013-05-14 02:42:55
|
Revision: 11540
http://sourceforge.net/p/xoops/svn/11540
Author: zyspec
Date: 2013-05-14 02:42:51 +0000 (Tue, 14 May 2013)
Log Message:
-----------
Incomplete - task : xoopspoll 'extras' files not included in initial branch creation
Added Paths:
-----------
XoopsModules/xoopspoll/branches/zyspec/extras/
XoopsModules/xoopspoll/branches/zyspec/extras/index.html
XoopsModules/xoopspoll/branches/zyspec/extras/marquee/
XoopsModules/xoopspoll/branches/zyspec/extras/marquee/plugins/
XoopsModules/xoopspoll/branches/zyspec/extras/marquee/plugins/xoopspoll.php
XoopsModules/xoopspoll/branches/zyspec/extras/marquee/readme.txt
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/index.html
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/class/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/class/post.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/class/userlanguage.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/language/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/language/english/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/language/english/main.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/polls.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/templates/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/templates/css/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/templates/css/language/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/templates/css/language/english/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/templates/css/language/english/style.css
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/templates/css/language/persian/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/templates/css/language/persian/style.css
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/templates/newbb_poll_results.html
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/templates/newbb_poll_view.html
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/templates/newbb_viewtopic.html
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/topicmanager.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/viewtopic.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/votepolls.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/readme.txt
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/class/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/class/post.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/language/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/language/main.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/polls.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/templates/
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/templates/newbb_poll_results.html
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/templates/newbb_poll_view.html
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/topicmanager.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/viewtopic.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/votepolls.php
XoopsModules/xoopspoll/branches/zyspec/extras/smartclone/
XoopsModules/xoopspoll/branches/zyspec/extras/smartclone/plugins/
XoopsModules/xoopspoll/branches/zyspec/extras/smartclone/plugins/xoopspoll.php
XoopsModules/xoopspoll/branches/zyspec/extras/smartclone/readme.txt
Added: XoopsModules/xoopspoll/branches/zyspec/extras/index.html
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/extras/index.html (rev 0)
+++ XoopsModules/xoopspoll/branches/zyspec/extras/index.html 2013-05-14 02:42:51 UTC (rev 11540)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xoopspoll/branches/zyspec/extras/marquee/plugins/xoopspoll.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/extras/marquee/plugins/xoopspoll.php (rev 0)
+++ XoopsModules/xoopspoll/branches/zyspec/extras/marquee/plugins/xoopspoll.php 2013-05-14 02:42:51 UTC (rev 11540)
@@ -0,0 +1,58 @@
+<?php
+/**
+ * ****************************************************************************
+ * Marquee - MODULE FOR XOOPS
+ * Copyright (c) Herv\xE9 Thouzard (http://www.herve-thouzard.com)
+ *
+ * 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:: {@link http://www.herve-thouzard.com Herv\xE9 Thouzard}
+ * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
+ * @author:: Herv\xE9 Thouzard (http://www.herve-thouzard.com)
+ * @package:: marquee
+ * @subpackage:: plugins
+ * @version:: $Id: $
+ */
+/**
+ * Script to list the recent polls from the xoopspoll module version 1.40
+ */
+function b_marquee_xoopspoll($limit, $dateformat, $itemssize)
+{
+ include_once $GLOBALS['xoops']->path('modules'
+ . DIRECTORY_SEPARATOR . 'marquee'
+ . DIRECTORY_SEPARATOR . 'include'
+ . DIRECTORY_SEPARATOR . 'functions.php'
+ );
+ $block = array();
+ $myts =& MyTextSanitizer::getInstance();
+ $poll_handler =& xoops_getmodulehandler('poll', 'xoopspoll');
+ $criteria = new CriteriaCompo();
+ $criteria->add (new Criteria('start_time', time(), '<='));
+ $criteria->add (new Criteria('end_time', time(), '>'));
+ $criteria->setLimit(intval($limit));
+ $criteria->setSort('start_time');
+ $criteria->setOrder('DESC');
+ $pollFields = array('poll_id', 'question', 'start_time', 'user_id');
+ $pollObjs = $poll_handler->getAll($criteria, $pollFields);
+ foreach($pollObjs as $pollObj) {
+ $pollValues = $pollObj->getValues();
+ $title = $myts->htmlSpecialChars($pollValues['question']);
+ if (intval($itemssize) > 0) {
+ $title = xoops_substr($title, 0, $itemssize+3);
+ }
+ $xuStartTimestamp = xoops_getUserTimestamp($pollValues['start_time']);
+ $block[]=array( 'date' => formatTimestamp($xuStartTimestamp, $dateformat),
+ 'category' => '',
+ 'author' => $pollValues['user_id'],
+ 'title' => $title,
+ 'link' => "<a href='" . $GLOBALS['xoops']->url('modules/xoopspoll/index.php') . "?poll_id={$pollValues['poll_id']}'>{$title}</a>");
+ unset ($pollValues);
+ }
+ return $block;
+}
\ No newline at end of file
Added: XoopsModules/xoopspoll/branches/zyspec/extras/marquee/readme.txt
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/extras/marquee/readme.txt (rev 0)
+++ XoopsModules/xoopspoll/branches/zyspec/extras/marquee/readme.txt 2013-05-14 02:42:51 UTC (rev 11540)
@@ -0,0 +1,6 @@
+Marquee Usage
+=============
+
+Copy the ./xoopspoll/extras/marquee/plugins/xoopspoll.php to the
+./marquee/plugins folder to enable xoopspoll support within the XOOPS Marquee
+module.
\ No newline at end of file
Added: XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/index.html
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/index.html (rev 0)
+++ XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/index.html 2013-05-14 02:42:51 UTC (rev 11540)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/class/post.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/class/post.php (rev 0)
+++ XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/class/post.php 2013-05-14 02:42:51 UTC (rev 11540)
@@ -0,0 +1,1091 @@
+<?php
+// $Id: post.php,v 1.3 2005/10/19 17:20:32 phppp Exp $
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000 XOOPS.org //
+// <http://www.xoops.org/> //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation; either version 2 of the License, or //
+// (at your option) any later version. //
+// //
+// 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. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program; if not, write to the Free Software //
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
+// ------------------------------------------------------------------------ //
+// Author: phppp (D.J., in...@gm...) //
+// URL: http://xoopsforge.com, http://xoops.org.cn //
+// Project: Article Project //
+// ------------------------------------------------------------------------ //
+
+if (!defined("XOOPS_ROOT_PATH")) {
+ exit("Restricted Access");
+}
+
+defined("NEWBB_FUNCTIONS_INI") || include XOOPS_ROOT_PATH.'/modules/newbb/include/functions.ini.php';
+newbb_load_object();
+
+class Post extends ArtObject {
+//class Post extends XoopsObject {
+ var $attachment_array = array();
+
+ function Post()
+ {
+ $this->ArtObject("bb_posts");
+ //$this->XoopsObject();
+ $this->initVar('post_id', XOBJ_DTYPE_INT);
+ $this->initVar('topic_id', XOBJ_DTYPE_INT, 0, true);
+ $this->initVar('forum_id', XOBJ_DTYPE_INT, 0, true);
+ $this->initVar('post_time', XOBJ_DTYPE_INT, 0, true);
+ $this->initVar('poster_ip', XOBJ_DTYPE_INT, 0);
+ $this->initVar('poster_name', XOBJ_DTYPE_TXTBOX, "");
+ $this->initVar('subject', XOBJ_DTYPE_TXTBOX, "", true);
+ $this->initVar('pid', XOBJ_DTYPE_INT, 0);
+ $this->initVar('dohtml', XOBJ_DTYPE_INT, 0);
+ $this->initVar('dosmiley', XOBJ_DTYPE_INT, 1);
+ $this->initVar('doxcode', XOBJ_DTYPE_INT, 1);
+ $this->initVar('doimage', XOBJ_DTYPE_INT, 1);
+ $this->initVar('dobr', XOBJ_DTYPE_INT, 1);
+ $this->initVar('uid', XOBJ_DTYPE_INT, 1);
+ $this->initVar('icon', XOBJ_DTYPE_TXTBOX, "");
+ $this->initVar('attachsig', XOBJ_DTYPE_INT, 0);
+ $this->initVar('approved', XOBJ_DTYPE_INT, 1);
+ $this->initVar('post_karma', XOBJ_DTYPE_INT, 0);
+ $this->initVar('require_reply', XOBJ_DTYPE_INT, 0);
+ $this->initVar('attachment', XOBJ_DTYPE_TXTAREA, "");
+ $this->initVar('post_text', XOBJ_DTYPE_TXTAREA, "");
+ $this->initVar('post_edit', XOBJ_DTYPE_TXTAREA, "");
+ }
+
+ // ////////////////////////////////////////////////////////////////////////////////////
+ // attachment functions TODO: there should be a file/attachment management class
+ function getAttachment()
+ {
+ if (count($this->attachment_array)) return $this->attachment_array;
+ $attachment = $this->getVar('attachment');
+ if (empty($attachment)) $this->attachment_array = null;
+ else $this->attachment_array = @unserialize(base64_decode($attachment));
+ return $this->attachment_array;
+ }
+
+ function incrementDownload($attach_key)
+ {
+ if (!$attach_key) return false;
+ $this->attachment_array[strval($attach_key)]['num_download'] ++;
+ return $this->attachment_array[strval($attach_key)]['num_download'];
+ }
+
+ function saveAttachment()
+ {
+ if (is_array($this->attachment_array) && count($this->attachment_array) > 0)
+ $attachment_save = base64_encode(serialize($this->attachment_array));
+ else $attachment_save = '';
+ $this->setVar('attachment', $attachment_save);
+ $sql = "UPDATE " . $GLOBALS["xoopsDB"]->prefix("bb_posts") . " SET attachment=" . $GLOBALS["xoopsDB"]->quoteString($attachment_save) . " WHERE post_id = " . $this->getVar('post_id');
+ if (!$result = $GLOBALS["xoopsDB"]->queryF($sql)) {
+ //xoops_error($GLOBALS["xoopsDB"]->error());
+ return false;
+ }
+ return true;
+ }
+
+ function deleteAttachment($attach_array = null)
+ {
+ $attach_old = $this->getAttachment();
+ if (!is_array($attach_old) || count($attach_old) < 1) return true;
+ $this->attachment_array = array();
+
+ if ($attach_array === null) $attach_array = array_keys($attach_old); // to delete all!
+ if (!is_array($attach_array)) $attach_array = array($attach_array);
+
+ foreach ($attach_old as $key => $attach) {
+ if (in_array($key, $attach_array)) {
+ @unlink(XOOPS_ROOT_PATH . '/' . $GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attach['name_saved']);
+ @unlink(XOOPS_ROOT_PATH . '/' . $GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/thumbs/' . $attach['name_saved']); // delete thumbnails
+ continue;
+ }
+ $this->attachment_array[$key] = $attach;
+ }
+ if (is_array($this->attachment_array) && count($this->attachment_array) > 0)
+ $attachment_save = base64_encode(serialize($this->attachment_array));
+ else $attachment_save = '';
+ $this->setVar('attachment', $attachment_save);
+ return true;
+ }
+
+ function setAttachment($name_saved = '', $name_display = '', $mimetype = '', $num_download = 0)
+ {
+ static $counter=0;
+ $this->attachment_array = $this->getAttachment();
+ if ($name_saved) {
+ $key = strval(time()+$counter++);
+ $this->attachment_array[$key] = array('name_saved' => $name_saved,
+ 'name_display' => isset($name_display)?$name_display:$name_saved,
+ 'mimetype' => $mimetype,
+ 'num_download' => isset($num_download)?intval($num_download):0
+ );
+ }
+ if (is_array($this->attachment_array)) {
+ $attachment_save = base64_encode(serialize($this->attachment_array));
+ } else {
+ $attachment_save = null;
+ }
+ $this->setVar('attachment', $attachment_save);
+ return true;
+ }
+
+ /**
+ * TODO: refactor
+ */
+ function displayAttachment($asSource = false)
+ {
+ $post_attachment = '';
+ $attachments = $this->getAttachment();
+ if (is_array($attachments) && count($attachments) > 0) {
+ $icon_handler = newbb_getIconHandler();
+ $mime_path = $icon_handler->getPath("mime");
+ include_once $GLOBALS['xoops']->path("modules/" . $GLOBALS['xoopsModule']->getVar("dirname", "n") . "/include/functions.image.php");
+ $image_extensions = array("jpg", "jpeg", "gif", "png", "bmp"); // need improve !!!
+ $post_attachment .= '<br /><strong>' . _MD_ATTACHMENT . '</strong>:';
+ $post_attachment .= "<div style='margin: 1em 0em; border-top: 1px solid;'></div>\n";
+// $post_attachment .= '<br /><hr style="height: 1px;" noshade="noshade" /><br />';
+ foreach ($attachments as $key => $att) {
+ $file_extension = ltrim(strrchr($att['name_saved'], '.'), '.');
+ $filetype = $file_extension;
+ if (file_exists($GLOBALS['xoops']->path("{$mime_path}/{$filetype}.gif"))) {
+ $icon_filetype = $GLOBALS['xoops']->url("{$mime_path}/{$filetype}.gif");
+ } else {
+ $icon_filetype = $GLOBALS['xoops']->url("{$mime_path}/unknown.gif");
+ }
+ $file_size = @filesize($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $att['name_saved']));
+ $file_size = number_format ($file_size / 1024, 2)." KB";
+ if (in_array(strtolower($file_extension), $image_extensions) && $GLOBALS['xoopsModuleConfig']['media_allowed']) {
+ $post_attachment .= '<br /><img src="' . $icon_filetype . '" alt="' . $filetype . '" /><strong> ' . $att['name_display'] . '</strong> <small>('.$file_size.')</small>';
+ $post_attachment .= '<br />' . newbb_attachmentImage($att['name_saved']);
+ $isDisplayed = true;
+ } else {
+ if (empty($GLOBALS['xoopsModuleConfig']['show_userattach'])) {
+ $post_attachment .= "<a href='" . $GLOBALS['xoops']->url("/modules/" . $GLOBALS['xoopsModule']->getVar("dirname", "n") . "/dl_attachment.php?attachid={$key}&post_id=" . $this->getVar('post_id')) . "'> <img src='{$icon_filetype}' alt='{$filetype}' /> {$att['name_display']}</a> " . _MD_FILESIZE . ": {$file_size}; " . _MD_HITS . ": {$att['num_download']}";
+ } elseif ((($GLOBALS['xoopsUser'] instanceof XoopsUser) && $GLOBALS['xoopsUser']->uid() > 0 && $GLOBALS['xoopsUser']->isActive()) ) {
+ $post_attachment .= "<a href='" . $GLOBALS['xoops']->url("/modules/" . $GLOBALS['xoopsModule']->getVar("dirname", "n") . "/dl_attachment.php?attachid={$key}&post_id=" . $this->getVar('post_id')) . "'> <img src='" . $icon_filetype . "' alt='{$filetype}' /> {$att['name_display']}</a> " . _MD_FILESIZE . ": {$file_size}; " . _MD_HITS . ": {$att['num_download']}";
+ } else {
+ $post_attachment .= _MD_NEWBB_SEENOTGUEST;
+ }
+ }
+ $post_attachment .= '<br />';
+ }
+ }
+ return $post_attachment;
+ }
+ // attachment functions
+ // ////////////////////////////////////////////////////////////////////////////////////
+
+ function setPostEdit($poster_name = '',$post_editmsg='')
+ {
+ if ( empty($GLOBALS['xoopsModuleConfig']['recordedit_timelimit'])
+ || (time()-$this->getVar('post_time'))< $GLOBALS['xoopsModuleConfig']['recordedit_timelimit'] * 60
+ || $this->getVar('approved') < 1
+ ) {
+ return true;
+ }
+ if (($GLOBALS['xoopsUser'] instanceof XoopsUser) && $GLOBALS['xoopsUser']->isActive()) {
+ if ($GLOBALS['xoopsModuleConfig']['show_realname'] && $GLOBALS['xoopsUser']->getVar('name')) {
+ $edit_user = $GLOBALS['xoopsUser']->getVar('name');
+ } else {
+ $edit_user = $GLOBALS['xoopsUser']->getVar('uname');
+ }
+ }
+ $post_edit = array();
+ $post_edit['edit_user'] = $edit_user; // The proper way is to store uid instead of name. However, to save queries when displaying, the current way is ok.
+ $post_edit['edit_time'] = time();
+ $post_edit['edit_msg'] = $post_editmsg;
+
+ $post_edits = $this->getVar('post_edit');
+ if (!empty($post_edits)) $post_edits = unserialize(base64_decode($post_edits));
+ if (!is_array($post_edits)) $post_edits = array();
+ $post_edits[] = $post_edit;
+ $post_edit = base64_encode(serialize($post_edits));
+ unset($post_edits);
+ $this->setVar('post_edit', $post_edit);
+ return true;
+ }
+
+ function displayPostEdit()
+ {
+ global $myts;
+
+ if ( empty($GLOBALS['xoopsModuleConfig']['recordedit_timelimit']) ) return false;
+
+ $post_edit = '';
+ $post_edits = $this->getVar('post_edit');
+ if (!empty($post_edits)) $post_edits = unserialize(base64_decode($post_edits));
+ if (!isset($post_edits) || !is_array($post_edits)) $post_edits = array();
+ if (is_array($post_edits) && count($post_edits) > 0) {
+ foreach ($post_edits as $postedit) {
+ $edit_time = intval($postedit['edit_time']);
+ $edit_user = $myts->stripSlashesGPC($postedit['edit_user']);
+ $edit_msg = (!empty($postedit['edit_msg'])) ? $myts->stripSlashesGPC($postedit['edit_msg']) : '';
+ // Start irmtfan add option to do only the latest edit when do_latestedit=0 (Alfred)
+ if ( empty($GLOBALS['xoopsModuleConfig']['do_latestedit']) ) {
+ $post_edit = '';
+ }
+ // End irmtfan add option to do only the latest edit when do_latestedit=0 (Alfred)
+ // START hacked by irmtfan
+ // display/save all edit records.
+ $post_edit .= _MD_EDITEDBY . " " . $edit_user . " " . _MD_ON . " " . newbb_formatTimestamp(intval($edit_time))."<br />";
+ // if reason is not empty
+ if ($edit_msg != "") {
+ $post_edit .= _MD_EDITEDMSG . " " .$edit_msg."<br />";
+ }
+ // START hacked by irmtfan
+ }
+ }
+ return $post_edit;
+ }
+
+
+ function &getPostBody()
+ {
+ global $myts;
+ $GLOBALS['xoopsModuleConfig'] = newbb_load_config(); // irmtfan load all newbb configs - newbb config in blocks activated in some modules like profile
+ mod_loadFunctions("user", "newbb");
+ mod_loadFunctions("render", "newbb");
+
+ $uid = ($GLOBALS['xoopsUser'] instanceof XoopsUser)? $GLOBALS['xoopsUser']->getVar('uid') : 0;
+ $karma_handler =& xoops_getmodulehandler('karma', 'newbb');
+ $user_karma = $karma_handler->getUserKarma();
+
+
+ $post = array();
+ $post['attachment'] = false;
+ $post_text = newbb_displayTarea($this->vars['post_text']['value'], $this->getVar('dohtml'), $this->getVar('dosmiley'), $this->getVar('doxcode'), $this->getVar('doimage'), $this->getVar('dobr'));
+ if (newbb_isAdmin($this->getVar('forum_id')) or $this->checkIdentity()) {
+ $post['text'] = $post_text. '<br />' .$this->displayAttachment();
+ } elseif ($GLOBALS['xoopsModuleConfig']['enable_karma'] && $this->getVar('post_karma') > $user_karma) {
+ $post['text'] = sprintf(_MD_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma'));
+ } elseif ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $this->getVar('require_reply') && (!$uid || !isset($viewtopic_users[$uid]))) {
+ $post['text'] = _MD_REPLY_REQUIREMENT;
+ } else {
+ $post['text'] = $post_text. '<br />' .$this->displayAttachment();
+ }
+ $member_handler =& xoops_gethandler('member');
+ $eachposter =& $member_handler->getUser($this->getVar('uid'));
+ if (is_object($eachposter) && $eachposter->isActive()) {
+ if ($GLOBALS['xoopsModuleConfig']['show_realname'] && $eachposter->getVar('name')) {
+ $post['author'] = $eachposter->getVar('name');
+ } else {
+ $post['author'] = $eachposter->getVar('uname');
+ }
+ unset($eachposter);
+ } else {
+ $post['author'] = $this->getVar('poster_name')?$this->getVar('poster_name'):$GLOBALS['xoopsConfig']['anonymous'];
+ }
+
+ $post['subject'] = newbb_htmlSpecialChars($this->vars['subject']['value']);
+ $post['date'] = $this->getVar('post_time');
+ return $post;
+ }
+
+ function isTopic()
+ {
+ return !$this->getVar('pid');
+ }
+
+ function checkTimelimit($action_tag = 'edit_timelimit')
+ {
+ $newbb_config = newbb_load_config();
+ if (empty($newbb_config["edit_timelimit"])) {
+ return true;
+ }
+ return ($this->getVar('post_time') > time() - $newbb_config[$action_tag] * 60);
+ }
+
+ function checkIdentity($uid = -1)
+ {
+ $uid = ($uid > -1) ? $uid : (($GLOBALS['xoopsUser'] instanceof XoopsUser)? $GLOBALS['xoopsUser']->getVar('uid') : 0);
+ if ($this->getVar('uid') > 0) {
+ $user_ok = ($uid == $this->getVar('uid')) ? true : false;
+ } else {
+ static $user_ip;
+ if (!isset($user_ip)) {
+ $user_ip = XoopsUserUtility::getIP();
+ }
+ $user_ok = ($user_ip == $this->getVar('poster_ip')) ? true : false;
+ }
+ return $user_ok;
+ }
+
+ // TODO: cleaning up and merge with post hanldings in viewpost.php
+ function showPost($isadmin)
+ {
+ global $myts;
+ global $forumUrl, $forumImage;
+ global $viewtopic_users, $viewtopic_posters, $forum_obj, $topic_obj, $online, $user_karma, $viewmode, $order, $start, $total_posts, $topic_status;
+ static $post_NO = 0;
+ static $name_anonymous;
+
+ if (!isset($name_anonymous)) {
+ $name_anonymous = $myts->htmlSpecialChars($GLOBALS["xoopsConfig"]['anonymous']);
+ }
+
+ mod_loadFunctions("time", "newbb");
+ mod_loadFunctions("render", "newbb");
+ mod_loadFunctions("text", "newbb"); // irmtfan add text functions
+
+ $post_id = $this->getVar('post_id');
+ $topic_id = $this->getVar('topic_id');
+ $forum_id = $this->getVar('forum_id');
+
+ $query_vars = array("status", "order", "start", "mode", "viewmode");
+ $query_array = array();
+ $query_array["topic_id"] = "topic_id={$topic_id}";
+ foreach ($query_vars as $var) {
+ if (!empty($_GET[$var])) {
+ $query_array[$var] = "{$var}={$_GET[$var]}";
+ }
+ }
+ $page_query = htmlspecialchars( implode("&", array_values($query_array)) );
+
+ $uid = ($GLOBALS['xoopsUser'] instanceof XoopsUser) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
+
+ $post_NO++;
+ if (strtolower($order) == "desc") {
+ $post_no = $total_posts - ($start + $post_NO) + 1;
+ } else {
+ $post_no = $start + $post_NO;
+ }
+
+ if ($isadmin || $this->checkIdentity()) {
+ $post_text = $this->getVar('post_text');
+ $post_attachment = $this->displayAttachment();
+ } elseif ($GLOBALS['xoopsModuleConfig']['enable_karma'] && $this->getVar('post_karma') > $user_karma) {
+ $post_text = "<div class='karma'>" . sprintf(_MD_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma')) . "</div>";
+ $post_attachment = '';
+ } elseif (
+ $GLOBALS['xoopsModuleConfig']['allow_require_reply']
+ && $this->getVar('require_reply')
+ && (
+ !$uid
+ || !in_array($uid, $viewtopic_posters)
+ )
+ ) {
+ $post_text = "<div class='karma'>" . _MD_REPLY_REQUIREMENT . "</div>\n";
+ $post_attachment = '';
+ } else {
+ $post_text = $this->getVar('post_text');
+ $post_attachment = $this->displayAttachment();
+ }
+ // START irmtfan add highlight feature
+ // Hightlighting searched words
+ $post_title = $this->getVar('subject');
+ if (isset($_GET['keywords']) && !empty($_GET['keywords'])) {
+ $keywords = $myts->htmlSpecialChars(trim(urldecode($_GET['keywords'])));
+ $post_text = newbb_highlightText($post_text, $keywords);
+ $post_title = newbb_highlightText($post_title, $keywords);
+ }
+ // END irmtfan add highlight feature
+ if ( isset($viewtopic_users[$this->getVar('uid')]) ) {
+ $poster = $viewtopic_users[$this->getVar('uid')];
+ } else {
+ $name = ($post_name = $this->getVar('poster_name')) ? $post_name : $name_anonymous;
+ $poster = array(
+ 'poster_uid' => 0,
+ 'name' => $name,
+ 'link' => $name
+ );
+ }
+
+ if ($posticon = $this->getVar('icon')) {
+ $post_image = "<a name='{$post_id}'><img src='" . $GLOBALS['xoops']->url("images/subject/{$posticon}") . "' alt='' /></a>";
+ } else {
+ $post_image = "<a name='{$post_id}'><img src='" . $GLOBALS['xoops']->url("images/icons/posticon.gif") . "' alt='' /></a>";
+ }
+
+ $thread_buttons = array();
+ $mod_buttons = array()...
[truncated message content] |
|
From: <zy...@us...> - 2013-05-14 03:25:08
|
Revision: 11541
http://sourceforge.net/p/xoops/svn/11541
Author: zyspec
Date: 2013-05-14 03:25:04 +0000 (Tue, 14 May 2013)
Log Message:
-----------
Incomplete - task : xoopspoll including files that were not included in initial branch creation
Added Paths:
-----------
XoopsModules/xoopspoll/branches/zyspec/admin/utility.php
XoopsModules/xoopspoll/branches/zyspec/blocks/multipoll.php
XoopsModules/xoopspoll/branches/zyspec/blocks/singlepoll.php
XoopsModules/xoopspoll/branches/zyspec/class/constants.php
XoopsModules/xoopspoll/branches/zyspec/class/formdatetimepicker.php
XoopsModules/xoopspoll/branches/zyspec/class/log.php
XoopsModules/xoopspoll/branches/zyspec/class/option.php
XoopsModules/xoopspoll/branches/zyspec/class/poll.php
XoopsModules/xoopspoll/branches/zyspec/class/pollutility.php
XoopsModules/xoopspoll/branches/zyspec/class/renderer.php
XoopsModules/xoopspoll/branches/zyspec/class/request.php
XoopsModules/xoopspoll/branches/zyspec/css/datetimepicker.css
XoopsModules/xoopspoll/branches/zyspec/images/colorbars/black.gif
XoopsModules/xoopspoll/branches/zyspec/include/oninstall.inc.php
XoopsModules/xoopspoll/branches/zyspec/include/onuninstall.inc.php
XoopsModules/xoopspoll/branches/zyspec/include/search.inc.php
XoopsModules/xoopspoll/branches/zyspec/js/
XoopsModules/xoopspoll/branches/zyspec/js/index.html
XoopsModules/xoopspoll/branches/zyspec/js/jquery-ui-sliderAccess.js
XoopsModules/xoopspoll/branches/zyspec/js/jquery-ui-timepicker-addon.js
XoopsModules/xoopspoll/branches/zyspec/language/english/mail_template/index.html
XoopsModules/xoopspoll/branches/zyspec/language/english/mail_template/mail_voter.tpl
XoopsModules/xoopspoll/branches/zyspec/language/french_iso/mail_template/mail_voter.tpl
XoopsModules/xoopspoll/branches/zyspec/language/french_utf8/mail_template/mail_voter.tpl
XoopsModules/xoopspoll/branches/zyspec/language/nederlands/mail_template/index.html
XoopsModules/xoopspoll/branches/zyspec/language/nederlands/mail_template/mail_voter.tpl
XoopsModules/xoopspoll/branches/zyspec/language/persian/mail_template/index.html
XoopsModules/xoopspoll/branches/zyspec/language/persian/mail_template/mail_voter.tpl
XoopsModules/xoopspoll/branches/zyspec/language/spanish/mail_template/mail_voter.tpl
XoopsModules/xoopspoll/branches/zyspec/language/swedish/mail_template/index.html
XoopsModules/xoopspoll/branches/zyspec/language/swedish/mail_template/mail_voter.tpl
XoopsModules/xoopspoll/branches/zyspec/preloads/
XoopsModules/xoopspoll/branches/zyspec/preloads/core.php
XoopsModules/xoopspoll/branches/zyspec/preloads/index.html
XoopsModules/xoopspoll/branches/zyspec/templates/admin/
XoopsModules/xoopspoll/branches/zyspec/templates/admin/index.html
XoopsModules/xoopspoll/branches/zyspec/templates/admin/xoopspoll_index.html
XoopsModules/xoopspoll/branches/zyspec/templates/admin/xoopspoll_list.html
XoopsModules/xoopspoll/branches/zyspec/templates/admin/xoopspoll_utility.html
XoopsModules/xoopspoll/branches/zyspec/templates/blocks/xoopspoll_block_singlepoll.html
XoopsModules/xoopspoll/branches/zyspec/templates/xoopspoll_results_renderer.html
Added: XoopsModules/xoopspoll/branches/zyspec/admin/utility.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/admin/utility.php (rev 0)
+++ XoopsModules/xoopspoll/branches/zyspec/admin/utility.php 2013-05-14 03:25:04 UTC (rev 11541)
@@ -0,0 +1,251 @@
+<?php
+/*
+ XOOPS - PHP Content Management System
+ Copyright (c) 2000 XOOPS.org
+ <http://www.xoops.org/>
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ 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. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+ /**
+ * Administration menu for the XoopsPoll Module
+ *
+ * @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
+ * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
+ * @package:: xoopspoll
+ * @subpackage:: admin
+ * @since:: 2.5.0
+ * @author:: XOOPS Module Team
+ * @version:: $Id: $
+ */
+
+require_once 'admin_header.php';
+xoops_load('request', 'xoopspoll');
+xoops_load('pollUtility', 'xoopspoll');
+
+$op = XoopspollRequest::getString('op', 'list');
+switch ($op) {
+
+case 'list':
+default:
+
+ xoops_cp_header();
+ $admin_class = new ModuleAdmin();
+
+ $GLOBALS['xoopsTpl']->assign('navigation', $admin_class->addNavigation('utility.php'));
+
+ $admin_class->addItemButton(_AM_XOOPSPOLL_IMPORT_UMFRAGE, 'utility.php' . '?op=umfrage', $icon = 'download');
+ $GLOBALS['xoopsTpl']->assign('addPollButton', $admin_class->renderButton('left'));
+
+ $GLOBALS['xoopsTpl']->assign('navigation', $admin_class->addNavigation('index.php'));
+
+ $GLOBALS['xoopsTpl']->assign('umfrageIntro', _AM_XOOPSPOLL_UMFRAGE_INTRO);
+ $GLOBALS['xoopsTpl']->display($GLOBALS['xoops']->path('modules' . DIRECTORY_SEPARATOR
+ . 'xoopspoll' . DIRECTORY_SEPARATOR
+ . 'templates' . DIRECTORY_SEPARATOR
+ . 'admin' . DIRECTORY_SEPARATOR
+ . 'xoopspoll_utility.html')
+ );
+
+ require 'admin_footer.php';
+ break;
+
+ /* Import data from umfrage */
+case 'umfrage':
+ //@todo: change zero (0) constant to use XoopspollConstants::
+ $ok = XoopspollRequest::getString('ok', 0, 'POST');
+ if ($ok) {
+ if (!$GLOBALS['xoopsSecurity']->check()) {
+ redirect_header($_SERVER['PHP_SELF'], XoopspollConstants::REDIRECT_DELAY_MEDIUM, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ // first check to see if umfrage module is installed and active
+ $moduleHandler =& xoops_gethandler('module');
+ $umModule =& $moduleHandler->getByDirname('umfrage');
+ try{
+ if (false !== $umModule && $umModule->isactive()) {
+ // make sure the umfrage database tables exist
+ $configHandler =& xoops_gethandler('config');
+ $umModuleConfig =& $configHandler->getConfigsByCat(0, $umModule->getVar('mid'));
+ $success = false;
+ $umTables = $umModule->getInfo('tables');
+ foreach ($umTables as $umTable) {
+ $s = XoopspollPollUtility::dbTableExists($GLOBALS['xoopsDB'], $umTable);
+ if (!$s) {
+ throw new Exception("Could not find the umfrage db table ({$umTable})");
+ }
+ // $success = $success && $s;
+ }
+
+ //setup poll objects for both umfrage and xoopspoll
+ require_once $GLOBALS['xoops']->path("modules"
+ . DIRECTORY_SEPARATOR . "umfrage"
+ . DIRECTORY_SEPARATOR . "class"
+ . DIRECTORY_SEPARATOR . "umfrage.php"
+ );
+ require_once $GLOBALS['xoops']->path("modules"
+ . DIRECTORY_SEPARATOR . "umfrage"
+ . DIRECTORY_SEPARATOR . "class"
+ . DIRECTORY_SEPARATOR . "umfrageoption.php"
+ );
+ require_once $GLOBALS['xoops']->path("modules"
+ . DIRECTORY_SEPARATOR . "umfrage"
+ . DIRECTORY_SEPARATOR . "class"
+ . DIRECTORY_SEPARATOR . "umfragelog.php"
+ );
+
+ $xpHandler =& xoops_getmodulehandler('poll', 'xoopspoll');
+ $xpOptHandler =& xoops_getmodulehandler('option', 'xoopspoll');
+ $xpLogHandler =& xoops_getmodulehandler('log', 'xoopspoll');
+
+ // maps umfrage_desc : polltype to xoopspoll_desc : visibility
+ $typeToVisMap = array(
+ 1 => XoopspollConstants::HIDE_NEVER,
+ 2 => XoopspollConstants::HIDE_ALWAYS,
+ 3 => XoopspollConstants::HIDE_VOTED,
+ );
+
+ $err = array();
+ $umContainer = new Umfrage();
+ $umOptContainer = new UmfrageOption();
+ $umLogContainer = new UmfrageLog();
+ $allUmfragePollObjs = $umContainer->getAll();
+ foreach ($allUmfragePollObjs as $umPollObj) {
+ // make sure we don't have this question already (pretty strict comparison)
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('question', trim($umPollObj->getVar('question')), '='));
+ $criteria->setLimit(1);
+ $pollExists = $xpHandler->getCount($criteria);
+ if (0 == $pollExists) {
+ // set the visibility for the poll
+ if (array_key_exists(intval($umPollObj->getVar('polltype')), $typeToVisMap)) {
+ $visibility = $typeToVisMap[$umPollObj->getVar('polltype')];
+ } else {
+ $visibility = XoopspollConstants::HIDE_END;
+ }
+ // save the poll into Xoopspoll database
+ $xpValues = array(
+ 'question' => $umPollObj->getVar('question'),
+ 'description' => $umPollObj->getVar('description'),
+ 'user_id' => $umPollObj->getVar('user_id'),
+ 'start_time' => $umPollObj->getVar('start_time'),
+ 'end_time' => $umPollObj->getVar('end_time'),
+ 'votes' => intval($umPollObj->getVar('votes')),
+ 'voters' => intval($umPollObj->getVar('voters')),
+ 'multiple' => $umPollObj->getVar('multiple'),
+ 'multilimit' => $umPollObj->getVar('multilimit'),
+ 'display' => $umPollObj->getVar('display'),
+ 'visibility' => $visibility,
+ 'weight' => $umPollObj->getVar('weight'),
+ 'mail_status' => $umPollObj->getVar('mail_status'),
+ 'mail_voter' => $umPollObj->getVar('mail_voter')
+ );
+ $xpObj = $xpHandler->create();
+ $xpObj->setVars($xpValues);
+ $newXpId = $xpHandler->insert($xpObj);
+
+ if ($newXpId) {
+// $newXpId = $newXpObj->getVar('poll_id');
+ $optionIdMap = array();
+ /* get the options for this poll and insert them */
+ $umOptObjs = $umOptContainer->getAllByPollId($umPollObj->getVar('poll_id'));
+ if (!$umOptObjs) {
+ throw new Exception("Could not find options for the " . $umPollObj->getVar('question') . " poll.");
+ }
+ foreach($umOptObjs as $umOptObj) {
+ $optValues = array(
+ 'poll_id' => $newXpId,
+ 'option_text' => $umOptObj->getVar('option_text'),
+ 'option_count' => $umOptObj->getVar('option_count'),
+ 'option_color' => $umOptObj->getVar('option_color')
+ );
+ $xpOptObj = $xpOptHandler->create();
+ $xpOptObj->setVars($optValues);
+ $newXpOptId = $xpOptHandler->insert($xpOptObj);
+
+ if ($newXpOptId) {
+ $newOptId = $newXpOptId;
+ $oldOptId = $umOptObj->getVar('option_id');
+ $optionIdMap[$oldOptId] = $newOptId;
+ } else{
+ throw new Exception("Could not create the '" . $umOptObj->getVar('option_text') . "' option for the '" . $umPollObj->getVar('question') . "' poll.<br />" . $xpOptObj->getHtmlErrors());
+ }
+ }
+ // now update the log for this poll
+ $allUmfrageLogObjs = $umLogContainer->getAllByPollId($umPollObj->getVar('poll_id'));
+ foreach ($allUmfrageLogObjs as $umLogObj) {
+ $logValues = array(
+ 'poll_id' => $newXpId,
+ 'option_id' => $optionIdMap[$umLogObj->getVar('option_id')],
+ 'ip' => $umLogObj->getVar('ip'),
+ 'user_id' => $umLogObj->getVar('user_id'),
+ 'time' => $umLogObj->getVar('time')
+ );
+ $xpLogObj = $xpLogHandler->create();
+ $xpLogObj->setVars($logValues);
+ $newLogId = $xpLogHandler->insert($xpLogObj);
+ if (!$newLogId) {
+ throw new Exception("There was an error updating the logs for the '" . $umPollObj->getVar('question') . "' poll.<br />" . $xpLogObj->getHtmlErrors());
+ }
+ }
+ unset($optionIdMap, $umOptObjs, $allUmfrageLogObjs);
+ } else {
+ throw new Exception("Failed to create the '" . $umPollObj->getVar('question') . "' poll in the database.<br />" . $xpObj->getHtmlErrors());
+ // $err[] = "Failed to create poll in the database.";
+ }
+ } else {
+ throw new Exception("The '{$umPollObj->getVar('question')}' poll was not imported.<br />" . $umPollObj->getHtmlErrors());
+ //$err[] = "The '{$umPollObj->getVar('question')}' poll was not imported.";
+ }
+ unset($criteria, $umOptObjs);
+ }
+ redirect_header('index.php', XoopspollConstants::REDIRECT_DELAY_MEDIUM, "(" . count($allUmfragePollObjs) . ") polls successfully imported from Umfrage.");
+ } else {
+ throw new Exception('Please make sure umfrage is installed and active.');
+ // redirect_header('index.php', XoopspollConstants::REDIRECT_DELAY_MEDIUM, 'Please make sure umfrage is installed and active.');
+ }
+ } catch (Exception $e) {
+ xoops_cp_header();
+ $admin_class = new ModuleAdmin();
+ echo $admin_class->addNavigation('utility.php');
+ echo "<div class='floatcenter1'>" . xoops_error($e->getMessage(), "Import Error(s)") . "</div>\n";
+ include 'admin_footer.php';
+ exit();
+ }
+/*
+ if (empty($err)) {
+ redirect_header("index.php", XoopspollConstants::REDIRECT_DELAY_MEDIUM, count($allUmfragePollObjs) . " were successfully imported into Xoopspoll.");
+ } else {
+ xoops_cp_header();
+ $admin_class = new ModuleAdmin();
+ echo $admin_class->addNavigation('utility.php');
+ xoops_error($err, "Import Error(s)");
+ include 'admin_footer.php';
+ exit();
+ }
+*/
+ } else {
+ xoops_cp_header();
+ $admin_class = new ModuleAdmin();
+ echo $admin_class->addNavigation('utility.php');
+ xoops_confirm(array('op' => 'umfrage', 'ok' => 1), $_SERVER['PHP_SELF'], _AM_XOOPSPOLL_RUSUREUMFRAGE);
+ include 'admin_footer.php';
+// xoops_cp_footer();
+ exit();
+ }
+ break;
+}
\ No newline at end of file
Added: XoopsModules/xoopspoll/branches/zyspec/blocks/multipoll.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/blocks/multipoll.php (rev 0)
+++ XoopsModules/xoopspoll/branches/zyspec/blocks/multipoll.php 2013-05-14 03:25:04 UTC (rev 11541)
@@ -0,0 +1,263 @@
+<?php
+/*
+ XOOPS - PHP Content Management System
+ Copyright (c) 2000 XOOPS.org
+ <http://www.xoops.org/>
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ 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. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+/**
+ * XoopsPoll Display Multi-poll Block
+ *
+ * @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
+ * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
+ * @package:: xoopspoll
+ * @subpackage:: blocks
+ * @since:: 1.0
+ * @version:: $Id: $
+ *
+ **/
+
+xoops_loadLanguage('main', 'xoopspoll');
+/*
+include_once $GLOBALS['xoops']->path( "modules"
+ . DIRECTORY_SEPARATOR . "xoopspoll"
+ . DIRECTORY_SEPARATOR . "class"
+ . DIRECTORY_SEPARATOR . "pollutility.php"
+);
+*/
+xoops_load('pollUtility', 'xoopspoll');
+xoops_load('constants', 'xoopspoll');
+//xoops_load('log', 'xoopspoll');
+
+/**
+ *
+ * Display XOOPS polls in a block
+ *
+ * @access public
+ * @global mixed $GLOBALS['xoopsUser']
+ * @uses CriteriaCompo
+ * @uses Criteria
+ * @param array $options block options array
+ * @return array block keys and values to be used by block template
+ */
+function xoopspollBlockMultiShow($options)
+{
+ $block = array();
+
+ $moduleHandler =& xoops_gethandler('module');
+ $thisModule =& $moduleHandler->getByDirName('xoopspoll');
+ $configHandler =& xoops_gethandler('config');
+ $this_module_config =& $configHandler->getConfigsByCat(0, $thisModule->getVar('mid'));
+
+ $pollHandler =& xoops_getmodulehandler('poll', 'xoopspoll');
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('display', XoopspollConstants::DISPLAY_POLL_IN_BLOCK, '='));
+ $criteria->add(new Criteria('start_time', time(), '<='));
+ if (0 == $options[1]) {
+ $criteria->add(new Criteria('end_time', time(), '>='));
+ }
+
+ /**
+ * now check to see if we want to hide polls that were created using newbb
+ */
+ if (($thisModule instanceof XoopsModule) && $thisModule->isactive() && $this_module_config['hide_forum_polls']) {
+ $newbbModule =& $moduleHandler->getByDirname('newbb');
+ if ($newbbModule instanceof XoopsModule && $newbbModule->isactive()) {
+ $topic_handler = xoops_getmodulehandler('topic', 'newbb');
+ $tFields = array('topic_id', 'poll_id');
+ $tArray = $topic_handler->getAll(new Criteria('topic_haspoll', 0, '>'), $tFields, false);
+ if (!empty($tArray)) {
+ $tcriteria = array();
+ foreach($tArray as $t) {
+ $tcriteria[] = $t['poll_id'];
+ }
+ if (!empty($tcriteria)) {
+ $tstring = "(" . implode(',', $tcriteria) . ")";
+ $criteria->add(new Criteria('poll_id', $tstring, "NOT IN"));
+ }
+ }
+ unset($topic_handler, $tFields, $tArray);
+ }
+ unset($newbbModule);
+ }
+
+
+
+
+
+
+
+
+
+
+ $criteria->setSort('weight ASC, end_time'); // trick criteria to allow 2 sort criteria
+ $criteria->setOrder('DESC');
+ $pollObjs = $pollHandler->getAll($criteria);
+ $count = count($pollObjs);
+ if ($count) {
+ $block['langVote'] = _MD_XOOPSPOLL_VOTE;
+ $block['langResults'] = _MD_XOOPSPOLL_RESULTS;
+ $block['langExpires'] = _MB_XOOPSPOLL_WILLEXPIRE;
+ $block['langExpired'] = _MB_XOOPSPOLL_HASEXPIRED;
+ $block['langComments'] = _MB_XOOPSPOLL_COMMENTS;
+ $block['langComment'] = _MB_XOOPSPOLL_COMMENT;
+ $block['url'] = "http"
+ . ((!empty($_SERVER['HTTPS'])) ? "s" : "")
+ . "://".$_SERVER['SERVER_NAME']
+ . $_SERVER['REQUEST_URI'];
+ $block['dispVotes'] = $this_module_config['disp_vote_nums'];
+ $block['thisModuleDir'] = 'xoopspoll';
+ $block['asList'] = $options[0];
+
+ $optHandler =& xoops_getmodulehandler('option', 'xoopspoll');
+ $logHandler =& xoops_getmodulehandler('log', 'xoopspoll');
+
+ foreach($pollObjs as $pollObj) {
+ $criteria = new CriteriaCompo();
+ $pollVars = $pollObj->getValues();
+ $criteria->add(new Criteria('poll_id', $pollVars['poll_id'], '='));
+ $criteria->setSort('option_id');
+ $pollOptionObjs = $optHandler->getAll($criteria);
+ if (XoopspollConstants::MULTIPLE_SELECT_POLL == $pollVars['multiple']) {
+ $pollOptionType = 'checkbox';
+ $pollOptionName = 'option_id[]';
+ } else {
+ $pollOptionType = 'radio';
+ $pollOptionName = 'option_id';
+ }
+
+ if (isset($GLOBALS['xoopsUser']) && ($GLOBALS['xoopsUser'] instanceof XoopsUser)) {
+ $uid = $GLOBALS['xoopsUser']->getVar('uid');
+ } else {
+ $uid = 0;
+ }
+
+ $totalVotes = $pollVars['votes'];
+ $hasVoted = ($logHandler->hasVoted($pollVars['poll_id'], xoops_getenv('REMOTE_ADDR'), $uid)) ? true : false;
+ $canVote = (!$hasVoted) && ($pollObj->isAllowedToVote());
+ foreach ($pollOptionObjs as $pollOptionObj) {
+ $optionObjVars = $pollOptionObj->getValues();
+ $percent = ($totalVotes > 0) ? (100 * $optionObjVars['option_count'] / $totalVotes) : 0;
+// $percent = ($totalVotes > 0) ? intval(100 * $optionObjVars['option_count'] / $totalVotes) . '%' : '0%';
+ $pollOptionArray[] = array(
+ 'id' => $optionObjVars['option_id'],
+ 'text' => $optionObjVars['option_text'],
+ 'count' => $optionObjVars['option_count'],
+ 'percent' => sprintf(" %01.1f%%", $percent),
+ 'color' => $optionObjVars['option_color']
+ );
+ }
+ unset($pollOptionObjs, $optionObjVars);
+ $xuEndTimestamp = xoops_getUserTimestamp($pollObj->getVar('end_time'));
+ $xuEndFormattedTime = ucfirst(date(_MEDIUMDATESTRING, $xuEndTimestamp));
+
+ $isVisible = (true === $pollObj->isResultVisible()) ? true : false;
+ $multiple = ($pollVars['multiple']) ? true : false;
+ $multiLimit = intval($pollVars['multilimit']);
+ if ($multiple && ($multiLimit > 0)) {
+ $lang_multi = sprintf(_MB_XOOPSPOLL_MULTITEXT, $multiLimit);
+ } else {
+ $lang_multi = "";
+ }
+
+ $poll = array(
+ 'id' => $pollVars['poll_id'],
+ 'visible' => $isVisible,
+ 'question' => $pollVars['question'],
+ 'multiple' => $multiple,
+ 'lang_multi' => $lang_multi,
+ 'optionType' => $pollOptionType,
+ 'optionName' => $pollOptionName,
+ 'options' => $pollOptionArray,
+ 'hasExpired' => $pollObj->hasExpired(),
+ 'canVote' => $canVote,
+ 'votes' => $pollVars['votes'],
+ 'hasVoted' => $hasVoted,
+ 'totalVotes' => sprintf(_MD_XOOPSPOLL_TOTALVOTES, $totalVotes),
+ 'comments' => $pollObj->getComments($pollVars['poll_id']),
+ 'endTime' => $xuEndFormattedTime,
+ 'commentMode' => XoopspollPollUtility::commentMode()
+ );
+ $block['polls'][] = $poll;
+ unset($pollOptionArray, $poll, $pollVars);
+ }
+ }
+ return $block;
+}
+/**
+ *
+ * Display a form to edit poll block display option
+ *
+ * @access public
+ * @global mixed $GLOBALS['xoopsUser']
+ * @uses xoops_getmodulehandler() function to get class handler for this modules class(es)
+ * @param array options contains settings for block display (init in xoopsversion.php and saved in db)
+ * @return string HTML form for display by block admin
+ */
+function xoopspollBlockMultiEdit( $options )
+{
+ /**
+ * Options[]
+ * [0] 0|1 = show as option|select
+ * [1] 0|1 show expired polls in block
+ *
+ */
+
+ // find out if want to show expired polls in block
+ // (otherwise it will hide block once it expires)
+ if (0 == $options[1]) {
+ $chk0no = " checked='checked'";
+ $chk0yes = "";
+ } else {
+ $chk0no = "";
+ $chk0yes = " checked='checked'";
+ }
+ $form = "<table>\n"
+ . " <tr>\n"
+ . " <td class='width25 middle'>" . _MB_XOOPSPOLL_SHOW_EXP . ":</td>\n"
+ . " <td>\n"
+ . " <label class='middle' for='yes'>" . _YES . "</label>\n"
+ . " <input type='radio' name='options[1]' value='1'{$chk0yes} id='yes' />\n"
+ . " <label class='middle' style='margin-left: 2em;' for='no'> " . _NO . "</label>\n"
+ . " <input type='radio' name='options[1]' value='0'{$chk0no} id='no' />\n"
+ . " </td>\n"
+ . " </tr>\n";
+
+ // find out if want to show options as a lists or as a select boxes
+ if (XoopspollConstants::POLL_OPTIONS_SELECT == $options[0]) {
+ $chk0select = " checked='checked'";
+ $chk0list = "";
+ } else {
+ $chk0select = "";
+ $chk0list = " checked='checked'";
+ }
+ $form .= " <tr>\n"
+ . " <td class='width25 middle'>" . _MB_XOOPSPOLL_SHOW_OPTIONS . ":</td>\n"
+ . " <td>\n"
+ . " <label class='middle' for='list'>" . _MB_XOOPSPOLL_LIST . "</label>\n"
+ . " <input type='radio' name='options[0]' value='" . XoopspollConstants::POLL_OPTIONS_LIST . "'{$chk0list} id='list' />\n"
+ . " <label class='middle' style='margin-left: 2em;' for='select'> " . _MB_XOOPSPOLL_SELECT . "</label>\n"
+ . " <input type='radio' name='options[0]' value='" . XoopspollConstants::POLL_OPTIONS_SELECT . "'{$chk0select} id='select' />\n"
+ . " </td>\n"
+ . " </tr>\n"
+ . "</table>\n";
+ return $form;
+}
\ No newline at end of file
Added: XoopsModules/xoopspoll/branches/zyspec/blocks/singlepoll.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/blocks/singlepoll.php (rev 0)
+++ XoopsModules/xoopspoll/branches/zyspec/blocks/singlepoll.php 2013-05-14 03:25:04 UTC (rev 11541)
@@ -0,0 +1,321 @@
+<?php
+/*
+ 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.
+ */
+
+/**
+ * XoopsPoll Single Poll Block Definition (clonable)
+ *
+ * @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project}
+ * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
+ * @package:: xoopspoll
+ * @subpackage:: blocks
+ * @since:: 1.40
+ * @version:: $Id: $
+ */
+
+xoops_loadLanguage('main', 'xoopspoll');
+xoops_load('pollUtility', 'xoopspoll');
+/*
+include_once $GLOBALS['xoops']->path( "modules"
+ . DIRECTORY_SEPARATOR . "xoopspoll"
+ ...
[truncated message content] |
|
From: <zy...@us...> - 2013-05-15 20:47:36
|
Revision: 11547
http://sourceforge.net/p/xoops/svn/11547
Author: zyspec
Date: 2013-05-15 20:47:32 +0000 (Wed, 15 May 2013)
Log Message:
-----------
* moved hard coded language strings to language files
* added Userlog plugin for poll_id from pollresults.php and index.php
* fixed module uninstall to remove poll information from newbb forum topic
* minor code cleanup
Modified Paths:
--------------
XoopsModules/xoopspoll/branches/zyspec/admin/admin_footer.php
XoopsModules/xoopspoll/branches/zyspec/admin/admin_header.php
XoopsModules/xoopspoll/branches/zyspec/admin/main.php
XoopsModules/xoopspoll/branches/zyspec/admin/utility.php
XoopsModules/xoopspoll/branches/zyspec/blocks/multipoll.php
XoopsModules/xoopspoll/branches/zyspec/blocks/singlepoll.php
XoopsModules/xoopspoll/branches/zyspec/class/constants.php
XoopsModules/xoopspoll/branches/zyspec/class/formdatetimepicker.php
XoopsModules/xoopspoll/branches/zyspec/class/log.php
XoopsModules/xoopspoll/branches/zyspec/class/option.php
XoopsModules/xoopspoll/branches/zyspec/class/poll.php
XoopsModules/xoopspoll/branches/zyspec/class/renderer.php
XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/viewtopic.php
XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/trunk_4_00/viewtopic.php
XoopsModules/xoopspoll/branches/zyspec/include/onuninstall.inc.php
XoopsModules/xoopspoll/branches/zyspec/include/onupdate.inc.php
XoopsModules/xoopspoll/branches/zyspec/include/search.inc.php
XoopsModules/xoopspoll/branches/zyspec/index.php
XoopsModules/xoopspoll/branches/zyspec/language/english/admin.php
XoopsModules/xoopspoll/branches/zyspec/language/french_iso/admin.php
XoopsModules/xoopspoll/branches/zyspec/language/french_utf8/admin.php
XoopsModules/xoopspoll/branches/zyspec/language/nederlands/admin.php
XoopsModules/xoopspoll/branches/zyspec/language/persian/admin.php
XoopsModules/xoopspoll/branches/zyspec/language/spanish/admin.php
XoopsModules/xoopspoll/branches/zyspec/language/swedish/admin.php
XoopsModules/xoopspoll/branches/zyspec/pollresults.php
XoopsModules/xoopspoll/branches/zyspec/xoops_version.php
Added Paths:
-----------
XoopsModules/xoopspoll/branches/zyspec/class/index.html
XoopsModules/xoopspoll/branches/zyspec/class/plugin/
XoopsModules/xoopspoll/branches/zyspec/class/plugin/index.html
XoopsModules/xoopspoll/branches/zyspec/class/plugin/userlog.php
Modified: XoopsModules/xoopspoll/branches/zyspec/admin/admin_footer.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/admin/admin_footer.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/admin/admin_footer.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -30,7 +30,7 @@
$moduleHandler =& xoops_gethandler('module');
$moduleInfo =& $moduleHandler->get($GLOBALS['xoopsModule']->getVar('mid'));
-//$moduleInfo =& $moduleHandler->get($xoopsModule->getVar('mid'));
+
$pathImageAdmin = '..' . DIRECTORY_SEPARATOR . $moduleInfo->getInfo('icons32');
echo "<div class='adminfooter'>\n"
Modified: XoopsModules/xoopspoll/branches/zyspec/admin/admin_header.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/admin/admin_header.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/admin/admin_header.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -14,7 +14,7 @@
* @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
* @package:: xoopspoll
* @subpackage:: admin
- * @since:: 3.11
+ * @since:: 1.32
* @author:: XOOPS Module Team
* @version:: $Id $
*
@@ -29,31 +29,13 @@
/** {@internal the following 2 file includes aren't
* required as they are done by cp_header.php}
*/
-//require_once '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'mainfile.php';
-//require_once $GLOBALS['xoops']->path( 'include' . DIRECTORY_SEPARATOR . 'cp_functions.php' );
$path = dirname(dirname(dirname(dirname(__FILE__))));
require_once $path . DIRECTORY_SEPARATOR . 'include'
. DIRECTORY_SEPARATOR . 'cp_header.php';
-/*
-require_once '..' . DIRECTORY_SEPARATOR
- . '..' . DIRECTORY_SEPARATOR
- . '..' . DIRECTORY_SEPARATOR
- . 'include' . DIRECTORY_SEPARATOR
- . 'cp_header.php';
-if (!$GLOBALS['xoopsModule'] instanceof XoopsModule) {
- $GLOBALS['xoopsModule'] =& XoopsModule::getByDirname('xoopspoll');
-}
-
-$moduleHandler =& xoops_gethandler('module');
-*/
-
/** Load language files
- * {@internal the following load is not needed,
- * it's done in ./include/cp_header.php although
- * it may change in future versions of XOOPS}
- */
+ * {@internal the following load is not needed, it's done in ./include/cp_header.php */
//xoops_loadLanguage('admin', 'xoopspoll');
xoops_loadLanguage('modinfo', 'xoopspoll');
xoops_loadLanguage('main', 'xoopspoll');
@@ -64,15 +46,14 @@
$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
// technically this isn't needed if only supporting XOOPS >= 2.5.5+
-if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin . DIRECTORY_SEPARATOR . "moduleadmin.php")) ){
+if (file_exists($GLOBALS['xoops']->path($pathModuleAdmin . DIRECTORY_SEPARATOR . "moduleadmin.php"))) {
include_once $GLOBALS['xoops']->path($pathModuleAdmin . DIRECTORY_SEPARATOR . "moduleadmin.php");
} else {
redirect_header($GLOBALS['xoops']->path('admin.php'), XoopspollConstants::REDIRECT_DELAY_LONG, _AM_XOOPSPOLL_ADMIN_MISSING, false);
}
-/*
-$admin_class = new ModuleAdmin();
-*/
+
$myts =& MyTextSanitizer::getInstance();
+
/*
if (!isset($GLOBALS['xoopsTpl']) || !$GLOBALS['xoopsTpl'] instanceof XoopsTpl) {
include_once $GLOBALS['xoops']->path("class" . DIRECTORY_SEPARATOR . "template.php");
Modified: XoopsModules/xoopspoll/branches/zyspec/admin/main.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/admin/main.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/admin/main.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -50,14 +50,14 @@
*/
require_once 'admin_header.php';
-//include_once $GLOBALS['xoops']->path("class" . DIRECTORY_SEPARATOR . "xoopsblock.php");
+include_once $GLOBALS['xoops']->path("class" . DIRECTORY_SEPARATOR . "xoopsblock.php");
+
xoops_load('xoopsformloader');
xoops_load('xoopslists');
xoops_load('renderer', 'xoopspoll');
xoops_load('pollUtility', 'xoopspoll');
xoops_load('request', 'xoopspoll');
-//xoops_load('constants', 'xoopspoll');
$op = XoopspollRequest::getString('op', 'list');
switch ($op) {
@@ -82,7 +82,6 @@
$xoopsTpl->assign('navigation', $admin_class->addNavigation('main.php'));
$admin_class->addItemButton(_AM_XOOPSPOLL_CREATENEWPOLL, 'main.php' . '?op=add', $icon = 'add');
-// $body = $admin_class->renderButton();
$xoopsTpl->assign('addPollButton', $admin_class->renderButton());
$renderedNav = "";
Modified: XoopsModules/xoopspoll/branches/zyspec/admin/utility.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/admin/utility.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/admin/utility.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -29,7 +29,7 @@
* @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
* @package:: xoopspoll
* @subpackage:: admin
- * @since:: 2.5.0
+ * @since:: 1.40
* @author:: XOOPS Module Team
* @version:: $Id: $
*/
@@ -67,8 +67,7 @@
/* Import data from umfrage */
case 'umfrage':
- //@todo: change zero (0) constant to use XoopspollConstants::
- $ok = XoopspollRequest::getString('ok', 0, 'POST');
+ $ok = XoopspollRequest::getString('ok', XoopspollConstants::CONFIRM_NOT_OK, 'POST');
if ($ok) {
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header($_SERVER['PHP_SELF'], XoopspollConstants::REDIRECT_DELAY_MEDIUM, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
@@ -88,7 +87,6 @@
if (!$s) {
throw new Exception("Could not find the umfrage db table ({$umTable})");
}
- // $success = $success && $s;
}
//setup poll objects for both umfrage and xoopspoll
@@ -159,7 +157,6 @@
$newXpId = $xpHandler->insert($xpObj);
if ($newXpId) {
-// $newXpId = $newXpObj->getVar('poll_id');
$optionIdMap = array();
/* get the options for this poll and insert them */
$umOptObjs = $umOptContainer->getAllByPollId($umPollObj->getVar('poll_id'));
@@ -182,7 +179,7 @@
$oldOptId = $umOptObj->getVar('option_id');
$optionIdMap[$oldOptId] = $newOptId;
} else{
- throw new Exception("Could not create the '" . $umOptObj->getVar('option_text') . "' option for the '" . $umPollObj->getVar('question') . "' poll.<br />" . $xpOptObj->getHtmlErrors());
+ throw new Exception(sprintf(_AM_XOOPSPOLL_OPTION_FAILED, $umOptObj->getVar('option_text'), $umPollObj->getVar('question'), "<br />" . $xpOptObj->getHtmlErrors()));
}
}
// now update the log for this poll
@@ -199,52 +196,36 @@
$xpLogObj->setVars($logValues);
$newLogId = $xpLogHandler->insert($xpLogObj);
if (!$newLogId) {
- throw new Exception("There was an error updating the logs for the '" . $umPollObj->getVar('question') . "' poll.<br />" . $xpLogObj->getHtmlErrors());
+ throw new Exception(sprintf(_AM_XOOPSPOLL_LOG_FAILED, $umPollObj->getVar('question') . "<br />" . $xpLogObj->getHtmlErrors()));
}
}
unset($optionIdMap, $umOptObjs, $allUmfrageLogObjs);
} else {
- throw new Exception("Failed to create the '" . $umPollObj->getVar('question') . "' poll in the database.<br />" . $xpObj->getHtmlErrors());
- // $err[] = "Failed to create poll in the database.";
+ throw new Exception(sprintf(_AM_XOOPSPOLL_QUESTION_FAILED, $umPollObj->getVar('question'), "<br />" . $xpObj->getHtmlErrors()));
}
} else {
- throw new Exception("The '{$umPollObj->getVar('question')}' poll was not imported.<br />" . $umPollObj->getHtmlErrors());
- //$err[] = "The '{$umPollObj->getVar('question')}' poll was not imported.";
+ throw new Exception(sprintf(_AM_XOOPSPOLL_QUESTION_IMPORT_FAILED, $umPollObj->getVar('question'), "<br />" . $umPollObj->getHtmlErrors()));
}
unset($criteria, $umOptObjs);
}
- redirect_header('index.php', XoopspollConstants::REDIRECT_DELAY_MEDIUM, "(" . count($allUmfragePollObjs) . ") polls successfully imported from Umfrage.");
+ redirect_header('index.php', XoopspollConstants::REDIRECT_DELAY_MEDIUM, sprintf(_AM_XOOPSPOLL_IMPORT_SUCCESS, intval(count($allUmfragePollObjs))));
} else {
- throw new Exception('Please make sure umfrage is installed and active.');
- // redirect_header('index.php', XoopspollConstants::REDIRECT_DELAY_MEDIUM, 'Please make sure umfrage is installed and active.');
+ throw new Exception(_AM_XOOPSPOLL_UMFRAGE_FAILED);
}
} catch (Exception $e) {
xoops_cp_header();
$admin_class = new ModuleAdmin();
echo $admin_class->addNavigation('utility.php');
- echo "<div class='floatcenter1'>" . xoops_error($e->getMessage(), "Import Error(s)") . "</div>\n";
+ echo "<div class='floatcenter1'>" . xoops_error($e->getMessage(), _AM_XOOPSPOLL_IMPORT_FAILED) . "</div>\n";
include 'admin_footer.php';
exit();
}
-/*
- if (empty($err)) {
- redirect_header("index.php", XoopspollConstants::REDIRECT_DELAY_MEDIUM, count($allUmfragePollObjs) . " were successfully imported into Xoopspoll.");
- } else {
- xoops_cp_header();
- $admin_class = new ModuleAdmin();
- echo $admin_class->addNavigation('utility.php');
- xoops_error($err, "Import Error(s)");
- include 'admin_footer.php';
- exit();
- }
-*/
} else {
xoops_cp_header();
$admin_class = new ModuleAdmin();
echo $admin_class->addNavigation('utility.php');
xoops_confirm(array('op' => 'umfrage', 'ok' => 1), $_SERVER['PHP_SELF'], _AM_XOOPSPOLL_RUSUREUMFRAGE);
include 'admin_footer.php';
-// xoops_cp_footer();
exit();
}
break;
Modified: XoopsModules/xoopspoll/branches/zyspec/blocks/multipoll.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/blocks/multipoll.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/blocks/multipoll.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -45,7 +45,6 @@
*/
xoops_load('pollUtility', 'xoopspoll');
xoops_load('constants', 'xoopspoll');
-//xoops_load('log', 'xoopspoll');
/**
*
@@ -212,7 +211,7 @@
* @param array options contains settings for block display (init in xoopsversion.php and saved in db)
* @return string HTML form for display by block admin
*/
-function xoopspollBlockMultiEdit( $options )
+function xoopspollBlockMultiEdit($options)
{
/**
* Options[]
Modified: XoopsModules/xoopspoll/branches/zyspec/blocks/singlepoll.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/blocks/singlepoll.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/blocks/singlepoll.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -89,7 +89,7 @@
return $block;
}
} else {
- $pollObj = $pollHandler->get( (int)($options[1]));
+ $pollObj = $pollHandler->get((int)($options[1]));
}
if ($pollObj instanceof XoopspollPoll) {
@@ -202,7 +202,7 @@
* @param array options contains settings for block display (init in xoopsversion.php and saved in db)
* @return string HTML form for display by block admin
*/
-function xoopspollBlockSinglepollEdit( $options )
+function xoopspollBlockSinglepollEdit($options)
{
/**
* Options[]
Modified: XoopsModules/xoopspoll/branches/zyspec/class/constants.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/class/constants.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/class/constants.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -175,5 +175,13 @@
* look up host
*/
const LOOK_UP_HOST = 1;
+ /**
+ * confirm not ok to take action
+ */
+ const CONFIRM_NOT_OK = 0;
+ /**
+ * confirm ok to take action
+ */
+ const CONFIRM_OK = 1;
/**#@-*/
}
\ No newline at end of file
Modified: XoopsModules/xoopspoll/branches/zyspec/class/formdatetimepicker.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/class/formdatetimepicker.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/class/formdatetimepicker.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -77,12 +77,12 @@
$moduleConfig =& $config_handler->getConfigsByCat(0, $sys_module->getVar('mid'));
$jq_theme_dir = $moduleConfig['jquery_theme'];
- $GLOBALS['xoTheme']->addStylesheet( $GLOBALS['xoops']->url("modules/system/css/ui/{$jq_theme_dir}/ui.all.css") );
+ $GLOBALS['xoTheme']->addStylesheet($GLOBALS['xoops']->url("modules/system/css/ui/{$jq_theme_dir}/ui.all.css"));
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/jquery.js');
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
$GLOBALS['xoTheme']->addScript('browse.php?modules/xoopspoll/js/jquery-ui-timepicker-addon.js');
$GLOBALS['xoTheme']->addScript('browse.php?modules/xoopspoll/js/jquery-ui-sliderAccess.js');
- $GLOBALS['xoTheme']->addStylesheet( $GLOBALS['xoops']->url('modules/xoopspoll/css/datetimepicker.css'));
+ $GLOBALS['xoTheme']->addStylesheet($GLOBALS['xoops']->url('modules/xoopspoll/css/datetimepicker.css'));
if (!$included) {
$included = true;
Added: XoopsModules/xoopspoll/branches/zyspec/class/index.html
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/class/index.html (rev 0)
+++ XoopsModules/xoopspoll/branches/zyspec/class/index.html 2013-05-15 20:47:32 UTC (rev 11547)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Modified: XoopsModules/xoopspoll/branches/zyspec/class/log.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/class/log.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/class/log.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -59,7 +59,7 @@
$this->initVar('ip', XOBJ_DTYPE_OTHER, null);
$this->initVar('user_id', XOBJ_DTYPE_INT, 0);
$this->initVar('time', XOBJ_DTYPE_INT, null);
- if (!empty($id) && is_array($id) ) {
+ if (!empty($id) && is_array($id)) {
$this->assignVars($id);
}
}
Modified: XoopsModules/xoopspoll/branches/zyspec/class/option.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/class/option.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/class/option.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -274,7 +274,7 @@
$GLOBALS['xoops']->path( "modules" . DIRECTORY_SEPARATOR
. "xoopspoll" . DIRECTORY_SEPARATOR
. "images" . DIRECTORY_SEPARATOR
- . "colorbars" . DIRECTORY_SEPARATOR )
+ . "colorbars" . DIRECTORY_SEPARATOR)
);
/**
@@ -294,7 +294,7 @@
unset($thisBarColorArray[$currentBar]);
$thisObj->setVar('option_color', $currentBar);
$optionObjs[] = $thisObj;
- if ( empty($thisBarColorArray) ) {
+ if (empty($thisBarColorArray)) {
$thisBarColorArray = $barcolor_array;
unset($thisBarColorArray['blank.gif']);
}
Added: XoopsModules/xoopspoll/branches/zyspec/class/plugin/index.html
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/class/plugin/index.html (rev 0)
+++ XoopsModules/xoopspoll/branches/zyspec/class/plugin/index.html 2013-05-15 20:47:32 UTC (rev 11547)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xoopspoll/branches/zyspec/class/plugin/userlog.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/class/plugin/userlog.php (rev 0)
+++ XoopsModules/xoopspoll/branches/zyspec/class/plugin/userlog.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -0,0 +1,51 @@
+<?php
+/*
+ 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.
+*/
+/**
+ * userlog module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package newbb class plugin
+ * @since 4.31
+ * @author irmtfan (ir...@ya...)
+ * @author The XOOPS Project <www.xoops.org> <www.xoops.ir>
+ * @version $Id: userlog.php 4.31 2013/05/08 16:25:04Z irmtfan $
+ */
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class XoopspollUserlogPlugin extends Userlog_Module_Plugin_Abstract implements UserlogPluginInterface
+{
+ /**
+ * @param string $subscribe_from Name of the script
+ *
+ * 'name' => 'thread';
+ * 'title' => _MI_NEWBB_THREAD_NOTIFY;
+ * 'description' => _MI_NEWBB_THREAD_NOTIFYDSC;
+ * 'subscribe_from' => 'viewtopic.php';
+ * 'item_name' => 'topic_id';
+ * 'allow_bookmark' => 1;
+ *
+ * @return array $item["item_name"] name of the item, $item["item_id"] id of the item
+ */
+ public function item($subscribe_from)
+ {
+ xoops_load('request', 'xoopspoll');
+ $poll_id = XoopspollRequest::getInt('poll_id', 0);
+ switch ($subscribe_from) {
+ case "index.php":
+ case "pollresults.php":
+ return array("item_name"=>"poll_id", "item_id"=>$poll_id);
+ break;
+ }
+ return false;
+ }
+}
\ No newline at end of file
Modified: XoopsModules/xoopspoll/branches/zyspec/class/poll.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/class/poll.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/class/poll.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -263,7 +263,7 @@
$author = new XoopsUser($this->getVar('user_id'));
/* setup time variables */
- $timeTray = new XoopsFormElementTray( _AM_XOOPSPOLL_POLL_TIMES, " ", "time_tray" );
+ $timeTray = new XoopsFormElementTray( _AM_XOOPSPOLL_POLL_TIMES, " ", "time_tray");
$xuCurrentTimestamp = xoops_getUserTimestamp(time());
$xuCurrentFormatted = ucfirst(date(_MEDIUMDATESTRING, $xuCurrentTimestamp));
@@ -333,7 +333,7 @@
$pollForm->addElement(new XoopsFormHidden('poll_id', $this->getVar('poll_id')));
$pollForm->addElement(new XoopsFormHidden('user_id', $this->getVar('user_id')));
$pollForm->addElement(new XoopsFormButtonTray('submit', _SUBMIT, null, null, true));
-// $pollForm->addElement(new XoopsFormButtonTray( "form_submit", _SUBMIT, "submit", "", true ));
+// $pollForm->addElement(new XoopsFormButtonTray( "form_submit", _SUBMIT, "submit", "", true));
return $pollForm->display();
}
/**
@@ -551,20 +551,20 @@
xoops_load('constants', 'xoopspoll');
$criteria = new CriteriaCompo();
- $criteria->add( new Criteria('end_time', time(), '<')); // expired polls
- $criteria->add( new Criteria('mail_status', XoopspollConstants::POLL_NOT_MAILED, '=') ); // email not previously sent
+ $criteria->add(new Criteria('end_time', time(), '<')); // expired polls
+ $criteria->add(new Criteria('mail_status', XoopspollConstants::POLL_NOT_MAILED, '=')); // email not previously sent
if (!empty($pollObj) && ($pollObj instanceof XoopspollPoll)) {
- $criteria->add( new Criteria('poll_id', $pollObj->getVar('poll_id'), '='));
+ $criteria->add(new Criteria('poll_id', $pollObj->getVar('poll_id'), '='));
$criteria->setLimit(1);
}
$pollObjs = $this->getAll($criteria);
$tplFile = 'mail_results.tpl';
- if (file_exists($GLOBALS['xoops']->path( "modules" . DIRECTORY_SEPARATOR
- . "xoopspoll" . DIRECTORY_SEPARATOR
- . "language" . DIRECTORY_SEPARATOR
- . $GLOBALS['xoopsConfig']['language'] . DIRECTORY_SEPARATOR
- . "mail_template" . DIRECTORY_SEPARATOR
- . $tplFile )))
+ if (file_exists($GLOBALS['xoops']->path("modules" . DIRECTORY_SEPARATOR
+ . "xoopspoll" . DIRECTORY_SEPARATOR
+ . "language" . DIRECTORY_SEPARATOR
+ . $GLOBALS['xoopsConfig']['language'] . DIRECTORY_SEPARATOR
+ . "mail_template" . DIRECTORY_SEPARATOR
+ . $tplFile)))
{
$lang = $GLOBALS['xoopsConfig']['language'];
} else {
@@ -577,11 +577,11 @@
// setup mailer
$xoopsMailer = xoops_getMailer();
$xoopsMailer->useMail();
- $xoopsMailer->setTemplateDir($GLOBALS['xoops']->path( "modules" . DIRECTORY_SEPARATOR
- . "xoopspoll" . DIRECTORY_SEPARATOR
- . "language" . DIRECTORY_SEPARATOR
- . $lang . DIRECTORY_SEPARATOR
- . "mail_template" . DIRECTORY_SEPARATOR)
+ $xoopsMailer->setTemplateDir($GLOBALS['xoops']->path("modules" . DIRECTORY_SEPARATOR
+ . "xoopspoll" . DIRECTORY_SEPARATOR
+ . "language" . DIRECTORY_SEPARATOR
+ . $lang . DIRECTORY_SEPARATOR
+ . "mail_template" . DIRECTORY_SEPARATOR)
);
$xoopsMailer->setTemplate($tplFile);
Modified: XoopsModules/xoopspoll/branches/zyspec/class/renderer.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/class/renderer.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/class/renderer.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -181,7 +181,7 @@
$optObjsArray = $this->oHandler->getAll($criteria);
$total = $this->pollObj->getVar('votes');
$i = 0;
- foreach ($optObjsArray as $optObj ) {
+ foreach ($optObjsArray as $optObj) {
$optionVars = $optObj->getValues();
$percent = ($total > 0) ? (100 * $optionVars['option_count'] / $total) : 0;
if ($percent > 0) {
Modified: XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt 2013-05-15 20:47:32 UTC (rev 11547)
@@ -1,4 +1,4 @@
-v1.40 ALPHA (ZySpec) 2013/04/30
+v1.40 ALPHA (ZySpec) 2013/05/15
=================================
+ added ability to change poll results visibility
++ results always visible
@@ -23,6 +23,7 @@
+ added ability to select XoopsEditors to enable HTML in poll descriptions
+ added ability to hide polls created with forum (newbb) from frontside of polls module
+ added obscured graphic to hide votes/voters polls that don't have visible results
++ added Userlog plugin for poll_id from pollresults.php and index.php
+ fixed sorting bug when displaying log in admin
+ fixed bug where users could vote on expired polls
+ fixed bug where 'anonymous' table column wasn't created on module update
Modified: XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/viewtopic.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/viewtopic.php 2013-05-15 05:40:22 UTC (rev 11546)
+++ XoopsModules/xoopspoll/branches/zyspec/extras/newbb_4x/irmtfan/viewtopic.php 2013-05-15 20:47:32 UTC (rev 11547)
@@ -455,18 +455,15 @@
&& $topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "vote"))
|| ($topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "addpoll")))
{
- /*@TODO: Need to check to see if poll actually exists. Several error conditions
- * could exist:
- * - It may have been deleted via poll module interface
- * - The poll module may have been uninstalled and re-installed
- */
if ('xoopspoll' == $pollmodules) {
+/*
xoops_load('poll', 'xoopspoll');
xoops_load('option', 'xoopspoll');
-// xoops_load('log', 'xoopspoll');
- xoops_load('renderer', 'xoopspoll');
+ xoops_load('log', 'xoopspoll');
xoops_load('pollUtility', 'xoopspoll');
xoops_load('constants', 'xoopspoll');
+*/
+ xoops_load('renderer', 'xoopspoll');
xoops_loadLanguage('main', 'xoopspoll');
} else {
@include_once $GLOBALS['xoops']->path("modules/umfrage/class/umfrage.php");
@@ -477,6 +474,7 @@
}
if ($topic_obj->getVar('topic_haspoll')
+ && (0 != $topic_obj->getVar('poll_id')) // double check to make sure it's a non-zero poll
&& $topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "vote"))
{
$GLOBALS['xoopsTpl']->assign('topic_poll', 1);
@@ -486,51 +484,52 @@
$xpollHandler =& xoops_getmodulehandler('poll', 'xoopspoll');
$poll_obj = $xpollHandler->get($topic_obj->getVar('poll_id'));
+ ...
[truncated message content] |
|
From: <zy...@us...> - 2013-05-16 04:42:20
|
Revision: 11549
http://sourceforge.net/p/xoops/svn/11549
Author: zyspec
Date: 2013-05-16 04:42:11 +0000 (Thu, 16 May 2013)
Log Message:
-----------
* only display newbb info in admin polls list if poll created with newbb exists
* minor code cleanup
* include icons for search, etc.
Modified Paths:
--------------
XoopsModules/xoopspoll/branches/zyspec/admin/main.php
XoopsModules/xoopspoll/branches/zyspec/templates/admin/xoopspoll_list.html
Added Paths:
-----------
XoopsModules/xoopspoll/branches/zyspec/images/icons/
XoopsModules/xoopspoll/branches/zyspec/images/icons/index.html
XoopsModules/xoopspoll/branches/zyspec/images/icons/logo_large.png
XoopsModules/xoopspoll/branches/zyspec/images/icons/logo_small.png
XoopsModules/xoopspoll/branches/zyspec/images/icons/obscured.png
Modified: XoopsModules/xoopspoll/branches/zyspec/admin/main.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/admin/main.php 2013-05-15 20:53:29 UTC (rev 11548)
+++ XoopsModules/xoopspoll/branches/zyspec/admin/main.php 2013-05-16 04:42:11 UTC (rev 11549)
@@ -94,7 +94,8 @@
$topic_handler =& xoops_getmodulehandler('topic', 'newbb');
$topicFields = array('topic_id', 'topic_title', 'poll_id');
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria('topic_haspoll'));
+ $criteria->add(new Criteria('topic_haspoll', 0, '>'));
+ $pollsWithTopics = array();
$topicsWithPolls = $topic_handler->getAll($criteria, $topicFields, false);
foreach ($topicsWithPolls as $pollTopics) {
$pollsWithTopics[$pollTopics['poll_id']] = array(
@@ -102,9 +103,13 @@
'topic_title' => $pollTopics['topic_title']
);
}
- $admin_class->addInfoBox(_AM_XOOPSPOLL_NEWBB_SUPPORT);
- $admin_class->addInfoBoxLine(_AM_XOOPSPOLL_NEWBB_SUPPORT, "<img src='" . $pathIcon16 . DIRECTORY_SEPARATOR . "forum.png' alt='" . _AM_XOOPSPOLL_NEWBB_SUPPORT . "' /> " . _AM_XOOPSPOLL_NEWBB_INTRO, null, null, "information");
- $newbbIntro = $admin_class->renderInfoBox();
+ if (!empty($pollsWithTopics)) {
+ $admin_class->addInfoBox(_AM_XOOPSPOLL_NEWBB_SUPPORT);
+ $admin_class->addInfoBoxLine(_AM_XOOPSPOLL_NEWBB_SUPPORT, "<img src='" . $pathIcon16 . DIRECTORY_SEPARATOR . "forum.png' alt='" . _AM_XOOPSPOLL_NEWBB_SUPPORT . "' /> " . _AM_XOOPSPOLL_NEWBB_INTRO, null, null, "information");
+ $newbbIntro = $admin_class->renderInfoBox();
+ } else {
+ $newbbIntro = "";
+ }
} else {
$pollsWithTopics = array();
$newbbIntro = "";
Added: XoopsModules/xoopspoll/branches/zyspec/images/icons/index.html
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/images/icons/index.html (rev 0)
+++ XoopsModules/xoopspoll/branches/zyspec/images/icons/index.html 2013-05-16 04:42:11 UTC (rev 11549)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xoopspoll/branches/zyspec/images/icons/logo_large.png
===================================================================
(Binary files differ)
Index: XoopsModules/xoopspoll/branches/zyspec/images/icons/logo_large.png
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/images/icons/logo_large.png 2013-05-15 20:53:29 UTC (rev 11548)
+++ XoopsModules/xoopspoll/branches/zyspec/images/icons/logo_large.png 2013-05-16 04:42:11 UTC (rev 11549)
Property changes on: XoopsModules/xoopspoll/branches/zyspec/images/icons/logo_large.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/xoopspoll/branches/zyspec/images/icons/logo_small.png
===================================================================
(Binary files differ)
Index: XoopsModules/xoopspoll/branches/zyspec/images/icons/logo_small.png
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/images/icons/logo_small.png 2013-05-15 20:53:29 UTC (rev 11548)
+++ XoopsModules/xoopspoll/branches/zyspec/images/icons/logo_small.png 2013-05-16 04:42:11 UTC (rev 11549)
Property changes on: XoopsModules/xoopspoll/branches/zyspec/images/icons/logo_small.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/xoopspoll/branches/zyspec/images/icons/obscured.png
===================================================================
(Binary files differ)
Index: XoopsModules/xoopspoll/branches/zyspec/images/icons/obscured.png
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/images/icons/obscured.png 2013-05-15 20:53:29 UTC (rev 11548)
+++ XoopsModules/xoopspoll/branches/zyspec/images/icons/obscured.png 2013-05-16 04:42:11 UTC (rev 11549)
Property changes on: XoopsModules/xoopspoll/branches/zyspec/images/icons/obscured.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: XoopsModules/xoopspoll/branches/zyspec/templates/admin/xoopspoll_list.html
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/templates/admin/xoopspoll_list.html 2013-05-15 20:53:29 UTC (rev 11548)
+++ XoopsModules/xoopspoll/branches/zyspec/templates/admin/xoopspoll_list.html 2013-05-16 04:42:11 UTC (rev 11549)
@@ -8,19 +8,19 @@
<table class='outer width100 bnone pad3 marg2'>
<thead>
<tr>
- <th class='center'><{$smarty.const._AM_XOOPSPOLL_DISPLAYBLOCK}></th>
- <th class='left'><{$smarty.const._AM_XOOPSPOLL_DISPLAYORDER}></th>
- <th class='left'><{$smarty.const._AM_XOOPSPOLL_POLLQUESTION}></th>
- <th class='center'><{$smarty.const._AM_XOOPSPOLL_VOTERS}></th>
- <th class='center'><{$smarty.const._AM_XOOPSPOLL_VOTES}></th>
- <th class='center'><{$smarty.const._AM_XOOPSPOLL_START_TIME}></th>
- <th class='center'><{$smarty.const._AM_XOOPSPOLL_EXPIRATION}></th>
- <th class='center'><{$smarty.const._AM_XOOPSPOLL_ACTIONS}></th>
- </tr>
+ <th class='center'><{$smarty.const._AM_XOOPSPOLL_DISPLAYBLOCK}></th>
+ <th class='left'><{$smarty.const._AM_XOOPSPOLL_DISPLAYORDER}></th>
+ <th class='left'><{$smarty.const._AM_XOOPSPOLL_POLLQUESTION}></th>
+ <th class='center'><{$smarty.const._AM_XOOPSPOLL_VOTERS}></th>
+ <th class='center'><{$smarty.const._AM_XOOPSPOLL_VOTES}></th>
+ <th class='center'><{$smarty.const._AM_XOOPSPOLL_START_TIME}></th>
+ <th class='center'><{$smarty.const._AM_XOOPSPOLL_EXPIRATION}></th>
+ <th class='center'><{$smarty.const._AM_XOOPSPOLL_ACTIONS}></th>
+ </tr>
</thead>
<tfoot>
<tr class='right bg3'>
- <td class='center' colspan='2'>
+ <td class='center' colspan='2'>
<input type='hidden' name='op' value='quickupdate' />
<{$securityToken}>
<input type='submit' value='<{$smarty.const._SUBMIT}>' />
@@ -40,7 +40,7 @@
</td>
<td>
-<{ if "" != $pollItem.topic_title}>
+<{ if ("" != $pollItem.topic_title)}>
<{ html_image file=$pollItem.buttons.forum.file href=$pollItem.buttons.forum.href alt=$pollItem.buttons.forum.alt title=$pollItem.buttons.forum.alt}>
<{ /if}>
<{ $pollItem.question}>
|
|
From: <zy...@us...> - 2013-05-17 04:15:49
|
Revision: 11553
http://sourceforge.net/p/xoops/svn/11553
Author: zyspec
Date: 2013-05-17 04:15:44 +0000 (Fri, 17 May 2013)
Log Message:
-----------
* Minor PHP comment cleanup
* change version to v1.40 BETA 1 to prep for release
Modified Paths:
--------------
XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt
XoopsModules/xoopspoll/branches/zyspec/index.php
XoopsModules/xoopspoll/branches/zyspec/pollresults.php
XoopsModules/xoopspoll/branches/zyspec/xoops_version.php
Modified: XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt 2013-05-16 14:31:43 UTC (rev 11552)
+++ XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt 2013-05-17 04:15:44 UTC (rev 11553)
@@ -1,4 +1,4 @@
-v1.40 ALPHA (ZySpec) 2013/05/15
+v1.40 BETA (ZySpec) 2013/05/17
=================================
+ added ability to change poll results visibility
++ results always visible
Modified: XoopsModules/xoopspoll/branches/zyspec/index.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/index.php 2013-05-16 14:31:43 UTC (rev 11552)
+++ XoopsModules/xoopspoll/branches/zyspec/index.php 2013-05-17 04:15:44 UTC (rev 11553)
@@ -75,7 +75,7 @@
'lang_obscured_title' => _MD_XOOPSPOLL_OBSCURED)
);
- // get polls to display on this page
+ /* get polls to display on this page */
$limit = XoopspollRequest::getInt('limit', XoopspollConstants::DEFAULT_POLL_PAGE_LIMIT);
$start = XoopspollRequest::getInt('start', 0);
$criteria = new CriteriaCompo();
@@ -168,7 +168,7 @@
if (!$pollObj->hasExpired()) {
$msg = _MD_XOOPSPOLL_MUSTLOGIN;
//@todo:: add $url to all redirects
- //$url = $GLOBALS['xoops']->buildUrl("index.php", array('poll_id' => $pollId));
+// $url = $GLOBALS['xoops']->buildUrl("index.php", array('poll_id' => $pollId));
if ($pollObj->isAllowedToVote()) {
$thisVoter = (!empty($GLOBALS['xoopsUser']) && ($GLOBALS['xoopsUser'] instanceof XoopsUser)) ? $GLOBALS['xoopsUser']->getVar('uid') : null ;
$votedThisPoll = $logHandler->hasVoted($pollId, xoops_getenv('REMOTE_ADDR'), $thisVoter);
@@ -182,7 +182,7 @@
}
$msg = _MD_XOOPSPOLL_THANKSFORVOTE;
} else {
- // there was a problem registering the vote
+ /* there was a problem registering the vote */
redirect_header($GLOBALS['xoops']->buildUrl('index.php', array('poll_id' => $pollId)), XoopspollConstants::REDIRECT_DELAY_MEDIUM, _MD_XOOPSPOLL_VOTE_ERROR);
}
} else {
Modified: XoopsModules/xoopspoll/branches/zyspec/pollresults.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/pollresults.php 2013-05-16 14:31:43 UTC (rev 11552)
+++ XoopsModules/xoopspoll/branches/zyspec/pollresults.php 2013-05-17 04:15:44 UTC (rev 11553)
@@ -72,7 +72,7 @@
$pollHandler =& xoops_getmodulehandler('poll', 'xoopspoll');
$pollObj = $pollHandler->get($pollId);
if ((!empty($pollObj)) && ($pollObj instanceof XoopspollPoll)) {
- // make sure the poll has started
+ /* make sure the poll has started */
if ($pollObj->getVar('start_time') > time()) {
redirect_header('index.php', XoopspollConstants::REDIRECT_DELAY_NONE);
exit();
Modified: XoopsModules/xoopspoll/branches/zyspec/xoops_version.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/xoops_version.php 2013-05-16 14:31:43 UTC (rev 11552)
+++ XoopsModules/xoopspoll/branches/zyspec/xoops_version.php 2013-05-17 04:15:44 UTC (rev 11553)
@@ -82,8 +82,8 @@
$modversion['demo_site_name'] = '';
$modversion['module_website_url'] = 'xoops.org';
$modversion['module_website_name'] = 'XOOPS';
-$modversion['release_date'] = '2013/05/15';
-$modversion['module_status'] = 'ALPHA 5';
+$modversion['release_date'] = '2013/05/17';
+$modversion['module_status'] = 'BETA 1';
$modversion["author_website_url"] = 'http://www.myweb.ne.jp';
$modversion["author_website_name"] = 'Kazumi Ono';
|
|
From: <zy...@us...> - 2013-05-18 12:45:37
|
Revision: 11554
http://sourceforge.net/p/xoops/svn/11554
Author: zyspec
Date: 2013-05-18 12:45:32 +0000 (Sat, 18 May 2013)
Log Message:
-----------
* fixed bug in object access - poll class use '$this' instead of $poll_obj
* updated module revision to BETA 2
Modified Paths:
--------------
XoopsModules/xoopspoll/branches/zyspec/class/poll.php
XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt
XoopsModules/xoopspoll/branches/zyspec/xoops_version.php
Modified: XoopsModules/xoopspoll/branches/zyspec/class/poll.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/class/poll.php 2013-05-17 04:15:44 UTC (rev 11553)
+++ XoopsModules/xoopspoll/branches/zyspec/class/poll.php 2013-05-18 12:45:32 UTC (rev 11554)
@@ -351,7 +351,7 @@
$visibleMsg = _MD_XOOPSPOLL_HIDE_ALWAYS_MSG;
break;
case XoopspollConstants::HIDE_END: // hide the results until the poll ends
- if (!$poll_obj->hasExpired()) {
+ if (!$this->hasExpired()) {
$visibleMsg = _MD_XOOPSPOLL_HIDE_END_MSG;
$isVisible = false;
} else {
Modified: XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt 2013-05-17 04:15:44 UTC (rev 11553)
+++ XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt 2013-05-18 12:45:32 UTC (rev 11554)
@@ -1,4 +1,4 @@
-v1.40 BETA (ZySpec) 2013/05/17
+v1.40 BETA (ZySpec) 2013/05/18
=================================
+ added ability to change poll results visibility
++ results always visible
Modified: XoopsModules/xoopspoll/branches/zyspec/xoops_version.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/xoops_version.php 2013-05-17 04:15:44 UTC (rev 11553)
+++ XoopsModules/xoopspoll/branches/zyspec/xoops_version.php 2013-05-18 12:45:32 UTC (rev 11554)
@@ -82,8 +82,8 @@
$modversion['demo_site_name'] = '';
$modversion['module_website_url'] = 'xoops.org';
$modversion['module_website_name'] = 'XOOPS';
-$modversion['release_date'] = '2013/05/17';
-$modversion['module_status'] = 'BETA 1';
+$modversion['release_date'] = '2013/05/18';
+$modversion['module_status'] = 'BETA 2';
$modversion["author_website_url"] = 'http://www.myweb.ne.jp';
$modversion["author_website_name"] = 'Kazumi Ono';
|
|
From: <zy...@us...> - 2013-05-27 22:28:08
|
Revision: 11593
http://sourceforge.net/p/xoops/svn/11593
Author: zyspec
Date: 2013-05-27 22:28:05 +0000 (Mon, 27 May 2013)
Log Message:
-----------
* remove XoopsEditor select in xoops_version and use XOOPS Preferences setting for editor selection
* add 'extra' renderer code to XoopspollPoll->renderForm() method
* update version to v1.40 BETA 2
Modified Paths:
--------------
XoopsModules/xoopspoll/branches/zyspec/class/poll.php
XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt
XoopsModules/xoopspoll/branches/zyspec/language/english/modinfo.php
XoopsModules/xoopspoll/branches/zyspec/language/french_iso/modinfo.php
XoopsModules/xoopspoll/branches/zyspec/language/french_utf8/modinfo.php
XoopsModules/xoopspoll/branches/zyspec/language/nederlands/modinfo.php
XoopsModules/xoopspoll/branches/zyspec/language/persian/modinfo.php
XoopsModules/xoopspoll/branches/zyspec/language/spanish/modinfo.php
XoopsModules/xoopspoll/branches/zyspec/language/swedish/modinfo.php
XoopsModules/xoopspoll/branches/zyspec/xoops_version.php
Modified: XoopsModules/xoopspoll/branches/zyspec/class/poll.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/class/poll.php 2013-05-27 08:49:49 UTC (rev 11592)
+++ XoopsModules/xoopspoll/branches/zyspec/class/poll.php 2013-05-27 22:28:05 UTC (rev 11593)
@@ -242,13 +242,17 @@
$module_handler =& xoops_gethandler("module");
$config_handler =& xoops_gethandler("config");
- $xp_module =& $module_handler->getByDirname("xoopspoll");
- $module_id = $xp_module->getVar("mid");
- $xp_config =& $config_handler->getConfigsByCat(0, $module_id);
+// $xp_module =& $module_handler->getByDirname("xoopspoll");
+// $module_id = $xp_module->getVar("mid");
+// $xp_config =& $config_handler->getConfigsByCat(0, $module_id);
+ $sys_module =& $module_handler->getByDirname("system");
+ $sys_id = $sys_module->getVar("mid");
+ $sys_config =& $config_handler->getConfigsByCat(0, $sys_id);
$editorConfigs = array(
// 'editor' => $GLOBALS['xoopsModuleConfig']['useeditor'],
- 'editor' => $xp_config['useeditor'],
+// 'editor' => $xp_config['useeditor'],
+ 'editor' => $sys_config['general_editor'],
'rows' => 15,
'cols' => 60,
'width' => '100%',
@@ -283,12 +287,28 @@
, 20
, $xuEndTimestamp);
} else {
+/*
+ $extra = "";
+ foreach($addHidden as $key=>$value) {
+ $extra="&{$key}={$value}";
+ }
+
$xuEndFormattedTime = ucfirst(date(_MEDIUMDATESTRING, $xuEndTimestamp));
$endTimeText = new XoopsFormLabel("<div class='bold middle'>" . _AM_XOOPSPOLL_EXPIRATION,
sprintf(_AM_XOOPSPOLL_EXPIREDAT, $xuEndFormattedTime)
. "<br /><a href='{$rtnPage}?op=restart&poll_id="
- . $this->getVar('poll_id') . "'>" . _AM_XOOPSPOLL_RESTART . "</a></div>");
+ . $this->getVar('poll_id') . "{$extra}'>" . _AM_XOOPSPOLL_RESTART . "</a></div>");
}
+*/
+ $extra = (is_array($addHidden)) ? $addHidden : array();
+ $extra = array_merge($extra, array('op'=>'restart', 'poll_id' => $this->getVar('poll_id')));
+ $query = http_build_query($extra);
+ $query = htmlentities($query, ENT_QUOTES);
+ $xuEndFormattedTime = ucfirst(date(_MEDIUMDATESTRING, $xuEndTimestamp));
+ $endTimeText = new XoopsFormLabel("<div class='bold middle'>" . _AM_XOOPSPOLL_EXPIRATION,
+ sprintf(_AM_XOOPSPOLL_EXPIREDAT, $xuEndFormattedTime)
+ . "<br /><a href='{$rtnPage}?{$query}'>" . _AM_XOOPSPOLL_RESTART . "</a></div>");
+ }
$timeTray->addElement($startTimeText);
$timeTray->addElement($endTimeText, true);
Modified: XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt 2013-05-27 08:49:49 UTC (rev 11592)
+++ XoopsModules/xoopspoll/branches/zyspec/docs/changelog.txt 2013-05-27 22:28:05 UTC (rev 11593)
@@ -1,4 +1,4 @@
-v1.40 BETA (ZySpec) 2013/05/18
+v1.40 BETA (ZySpec) 2013/05/27
=================================
+ added ability to change poll results visibility
++ results always visible
@@ -20,7 +20,7 @@
+ added updated plugin for XOOPS marquee module in extras folder
+ added ability to mail notification to poll voter (XoopsUsers only)
+ added ability to set maximum number of options for multi-select poll
-+ added ability to select XoopsEditors to enable HTML in poll descriptions
++ added use of XoopsEditors to enable HTML in poll descriptions (selected via XOOPS Preferences)
+ added ability to hide polls created with forum (newbb) from frontside of polls module
+ added obscured graphic to hide votes/voters polls that don't have visible results
+ added Userlog plugin for poll_id from pollresults.php and index.php
Modified: XoopsModules/xoopspoll/branches/zyspec/language/english/modinfo.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/language/english/modinfo.php 2013-05-27 08:49:49 UTC (rev 11592)
+++ XoopsModules/xoopspoll/branches/zyspec/language/english/modinfo.php 2013-05-27 22:28:05 UTC (rev 11593)
@@ -38,8 +38,8 @@
define('_MI_XOOPSPOLL_LOOKUPHOSTDSC', "List host names instead of IP addresses in viewing poll log. Since nslookup is used, It might take longer to show names.");
define('_MI_XOOPSPOLL_DISPVOTE', "Display number of poll votes and voters to users.");
define('_MI_XOOPSPOLL_DISPVOTEDSC', "This will show/hide the total number of votes and voters in a poll to users in pages and blocks. Numbers are always shown in Admin panel.");
-define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
-define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
+//define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
+//define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLS', "Hide polls created in a forum from polls module and blocks");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLSDSC', "If Yes, polls created from a forum (newbb) are hidden in the polls module.<br />Set to Yes if forum module is not installed.");
/**#@-*/
Modified: XoopsModules/xoopspoll/branches/zyspec/language/french_iso/modinfo.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/language/french_iso/modinfo.php 2013-05-27 08:49:49 UTC (rev 11592)
+++ XoopsModules/xoopspoll/branches/zyspec/language/french_iso/modinfo.php 2013-05-27 22:28:05 UTC (rev 11593)
@@ -36,8 +36,8 @@
define('_MI_XOOPSPOLL_LOOKUPHOSTDSC', "List host names instead of IP addresses in viewing poll log. Since nslookup is used, It might take longer to show names.");
define('_MI_XOOPSPOLL_DISPVOTE', "Display number of poll votes and voters to users.");
define('_MI_XOOPSPOLL_DISPVOTEDSC', "This will show/hide the total number of votes and voters in a poll to users in pages and blocks. Numbers are always shown in Admin panel.");
-define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
-define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
+//define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
+//define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLS', "Hide polls created in a forum from polls module and blocks");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLSDSC', "If Yes, polls created from a forum (newbb) are hidden in the polls module.<br />Set to Yes if forum module is not installed.");
Modified: XoopsModules/xoopspoll/branches/zyspec/language/french_utf8/modinfo.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/language/french_utf8/modinfo.php 2013-05-27 08:49:49 UTC (rev 11592)
+++ XoopsModules/xoopspoll/branches/zyspec/language/french_utf8/modinfo.php 2013-05-27 22:28:05 UTC (rev 11593)
@@ -38,8 +38,8 @@
define('_MI_XOOPSPOLL_LOOKUPHOSTDSC', "");
define('_MI_XOOPSPOLL_DISPVOTE', "Display number of poll votes and voters to users.");
define('_MI_XOOPSPOLL_DISPVOTEDSC', "This will show/hide the total number of votes and voters in a poll to users in pages and blocks. Numbers are always shown in Admin panel.");
-define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
-define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
+//define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
+//define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLS', "Hide polls created in a forum from polls module and blocks");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLSDSC', "If Yes, polls created from a forum (newbb) are hidden in the polls module.<br />Set to Yes if forum module is not installed.");
Modified: XoopsModules/xoopspoll/branches/zyspec/language/nederlands/modinfo.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/language/nederlands/modinfo.php 2013-05-27 08:49:49 UTC (rev 11592)
+++ XoopsModules/xoopspoll/branches/zyspec/language/nederlands/modinfo.php 2013-05-27 22:28:05 UTC (rev 11593)
@@ -34,8 +34,8 @@
define('_MI_XOOPSPOLL_LOOKUPHOSTDSC', "");
define('_MI_XOOPSPOLL_DISPVOTE', "Display number of poll votes and voters to users.");
define('_MI_XOOPSPOLL_DISPVOTEDSC', "This will show/hide the total number of votes and voters in a poll to users in pages and blocks. Numbers are always shown in Admin panel.");
-define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
-define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
+//define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
+//define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLS', "Hide polls created in a forum from polls module and blocks");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLSDSC', "If Yes, polls created from a forum (newbb) are hidden in the polls module.<br />Set to Yes if forum module is not installed.");
Modified: XoopsModules/xoopspoll/branches/zyspec/language/persian/modinfo.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/language/persian/modinfo.php 2013-05-27 08:49:49 UTC (rev 11592)
+++ XoopsModules/xoopspoll/branches/zyspec/language/persian/modinfo.php 2013-05-27 22:28:05 UTC (rev 11593)
@@ -42,8 +42,8 @@
define("_MI_XOOPSPOLL_LOOKUPHOSTDSC","فهرست نام هاست ها به جای آدرس IP در نمایش اطلاعات نظر سنجی ها. اگر نام هاست انتخاب شود زمان بیشتری برای نمایش نام ها طول خواهد کشید.");
define('_MI_XOOPSPOLL_DISPVOTE', "Display number of poll votes and voters to users.");
define('_MI_XOOPSPOLL_DISPVOTEDSC', "This will show/hide the total number of votes and voters in a poll to users in pages and blocks. Numbers are always shown in Admin panel.");
-define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
-define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
+//define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
+//define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLS', "Hide polls created in a forum from polls module and blocks");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLSDSC', "If Yes, polls created from a forum (newbb) are hidden in the polls module.<br />Set to Yes if forum module is not installed.");
Modified: XoopsModules/xoopspoll/branches/zyspec/language/spanish/modinfo.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/language/spanish/modinfo.php 2013-05-27 08:49:49 UTC (rev 11592)
+++ XoopsModules/xoopspoll/branches/zyspec/language/spanish/modinfo.php 2013-05-27 22:28:05 UTC (rev 11593)
@@ -35,8 +35,8 @@
define('_MI_XOOPSPOLL_LOOKUPHOSTDSC', "List host names instead of IP addresses in viewing poll log. Since nslookup is used, It might take longer to show names.");
define('_MI_XOOPSPOLL_DISPVOTE', "Display number of poll votes and voters to users.");
define('_MI_XOOPSPOLL_DISPVOTEDSC', "This will show/hide the total number of votes and voters in a poll to users in pages and blocks. Numbers are always shown in Admin panel.");
-define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
-define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
+//define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
+//define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLS', "Hide polls created in a forum from polls module and blocks");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLSDSC', "If Yes, polls created from a forum (newbb) are hidden in the polls module.<br />Set to Yes if forum module is not installed.");
Modified: XoopsModules/xoopspoll/branches/zyspec/language/swedish/modinfo.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/language/swedish/modinfo.php 2013-05-27 08:49:49 UTC (rev 11592)
+++ XoopsModules/xoopspoll/branches/zyspec/language/swedish/modinfo.php 2013-05-27 22:28:05 UTC (rev 11593)
@@ -35,8 +35,8 @@
define('_MI_XOOPSPOLL_LOOKUPHOSTDSC', "");
define('_MI_XOOPSPOLL_DISPVOTE', "Display number of poll votes and voters to users.");
define('_MI_XOOPSPOLL_DISPVOTEDSC', "This will show/hide the total number of votes and voters in a poll to users in pages and blocks. Numbers are always shown in Admin panel.");
-define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
-define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
+//define('_MI_XOOPSPOLL_CHOOSEEDITOR', "Choose text editor to use:");
+//define('_MI_XOOPSPOLL_CHOOSEEDITORDSC', "This is the editor to be used when entering descriptions.");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLS', "Hide polls created in a forum from polls module and blocks");
define('_MI_XOOPSPOLL_HIDEFORUM_POLLSDSC', "If Yes, polls created from a forum (newbb) are hidden in the polls module.<br />Set to Yes if forum module is not installed.");
Modified: XoopsModules/xoopspoll/branches/zyspec/xoops_version.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/xoops_version.php 2013-05-27 08:49:49 UTC (rev 11592)
+++ XoopsModules/xoopspoll/branches/zyspec/xoops_version.php 2013-05-27 22:28:05 UTC (rev 11593)
@@ -82,7 +82,7 @@
$modversion['demo_site_name'] = '';
$modversion['module_website_url'] = 'xoops.org';
$modversion['module_website_name'] = 'XOOPS';
-$modversion['release_date'] = '2013/05/18';
+$modversion['release_date'] = '2013/05/27';
$modversion['module_status'] = 'BETA 2';
$modversion["author_website_url"] = 'http://www.myweb.ne.jp';
$modversion["author_website_name"] = 'Kazumi Ono';
@@ -230,6 +230,7 @@
/**
* Select the WYSIWYG Editor
*/
+/*
xoops_load('XoopsEditorHandler');
$editor_handler = XoopsEditorHandler::getInstance();
$editorList = array_flip($editor_handler->getList());
@@ -242,6 +243,7 @@
'valuetype' => 'text',
'options' => $editorList,
'default' => 'dhtmltextarea');
+*/
/**#@-*/
/**
|
|
From: <be...@us...> - 2013-08-14 11:33:11
|
Revision: 11918
http://sourceforge.net/p/xoops/svn/11918
Author: beckmi
Date: 2013-08-14 11:33:08 +0000 (Wed, 14 Aug 2013)
Log Message:
-----------
Fixing preg_replace /e for PHP 5.5.x
Modified Paths:
--------------
XoopsModules/xoopspoll/branches/zyspec/class/request.php
XoopsModules/xoopspoll/branches/zyspec/xoops_version.php
Modified: XoopsModules/xoopspoll/branches/zyspec/class/request.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/class/request.php 2013-08-14 10:29:47 UTC (rev 11917)
+++ XoopsModules/xoopspoll/branches/zyspec/class/request.php 2013-08-14 11:33:08 UTC (rev 11918)
@@ -932,9 +932,14 @@
}
$source = strtr($source, $ttr);
// convert decimal
- $source = preg_replace('/&#(\d+);/me', "chr(\\1)", $source); // decimal notation
+// $source = preg_replace('/&#(\d+);/me', "chr(\\1)", $source); // decimal notation
+ $source = preg_replace_callback('/&#(\d+);/m', create_function('$matches',"return chr(\$matches[1]);"),$source);
+
+
// convert hex
- $source = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $source); // hex notation
+// $source = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $source); // hex notation
+ $source = preg_replace_callback('/&#x([a-f0-9]+);/mi', create_function('$matches',"return chr('0x'.\$matches[1]);"),$source);
+
return $source;
}
}
\ No newline at end of file
Modified: XoopsModules/xoopspoll/branches/zyspec/xoops_version.php
===================================================================
--- XoopsModules/xoopspoll/branches/zyspec/xoops_version.php 2013-08-14 10:29:47 UTC (rev 11917)
+++ XoopsModules/xoopspoll/branches/zyspec/xoops_version.php 2013-08-14 11:33:08 UTC (rev 11918)
@@ -51,7 +51,7 @@
$modversion['official'] = 1; // 0 = 3rd party module, 1 = supported by XOOPS Community
$modversion['image'] = 'images'
. DIRECTORY_SEPARATOR . 'xoopspoll_slogo.png';
-$modversion['dirname'] = 'xoopspoll';
+$modversion['dirname'] = basename(dirname(__FILE__));
$modversion['dirmoduleadmin'] = 'Frameworks'
. DIRECTORY_SEPARATOR . 'moduleclasses'
. DIRECTORY_SEPARATOR . 'moduleadmin';
|