|
From: <ari...@us...> - 2012-03-23 18:04:14
|
Revision: 9180
http://xoops.svn.sourceforge.net/xoops/?rev=9180&view=rev
Author: arion92fr
Date: 2012-03-23 18:04:02 +0000 (Fri, 23 Mar 2012)
Log Message:
-----------
Xoops 2.5 and Flash Cumulus
Added Paths:
-----------
XoopsModules/tag/branches/Arion92fr/tag/AMS.php
XoopsModules/tag/branches/Arion92fr/tag/admin/
XoopsModules/tag/branches/Arion92fr/tag/admin/admin.tag.php
XoopsModules/tag/branches/Arion92fr/tag/admin/header.php
XoopsModules/tag/branches/Arion92fr/tag/admin/index.php
XoopsModules/tag/branches/Arion92fr/tag/admin/menu.php
XoopsModules/tag/branches/Arion92fr/tag/admin/syn.tag.php
XoopsModules/tag/branches/Arion92fr/tag/article.php
XoopsModules/tag/branches/Arion92fr/tag/blocks/
XoopsModules/tag/branches/Arion92fr/tag/blocks/block.php
XoopsModules/tag/branches/Arion92fr/tag/blocks/index.html
XoopsModules/tag/branches/Arion92fr/tag/changelog.txt
XoopsModules/tag/branches/Arion92fr/tag/class/
XoopsModules/tag/branches/Arion92fr/tag/class/index.html
XoopsModules/tag/branches/Arion92fr/tag/class/link.php
XoopsModules/tag/branches/Arion92fr/tag/class/tag.php
XoopsModules/tag/branches/Arion92fr/tag/class/wp-cumulus.php
XoopsModules/tag/branches/Arion92fr/tag/footer.php
XoopsModules/tag/branches/Arion92fr/tag/gpl.txt
XoopsModules/tag/branches/Arion92fr/tag/header.php
XoopsModules/tag/branches/Arion92fr/tag/images/
XoopsModules/tag/branches/Arion92fr/tag/images/delimiter.gif
XoopsModules/tag/branches/Arion92fr/tag/images/left_both.gif
XoopsModules/tag/branches/Arion92fr/tag/images/logo.gif
XoopsModules/tag/branches/Arion92fr/tag/images/logo.old.gif
XoopsModules/tag/branches/Arion92fr/tag/images/modadminbg.gif
XoopsModules/tag/branches/Arion92fr/tag/images/right_both.gif
XoopsModules/tag/branches/Arion92fr/tag/include/
XoopsModules/tag/branches/Arion92fr/tag/include/action.module.php
XoopsModules/tag/branches/Arion92fr/tag/include/cumulus.swf
XoopsModules/tag/branches/Arion92fr/tag/include/formtag.php
XoopsModules/tag/branches/Arion92fr/tag/include/functions.ini.php
XoopsModules/tag/branches/Arion92fr/tag/include/functions.php
XoopsModules/tag/branches/Arion92fr/tag/include/functions.recon.php
XoopsModules/tag/branches/Arion92fr/tag/include/index.html
XoopsModules/tag/branches/Arion92fr/tag/include/plugin.dist.php
XoopsModules/tag/branches/Arion92fr/tag/include/plugin.php
XoopsModules/tag/branches/Arion92fr/tag/include/search.inc.php
XoopsModules/tag/branches/Arion92fr/tag/include/swfobject.js
XoopsModules/tag/branches/Arion92fr/tag/include/tagbar.php
XoopsModules/tag/branches/Arion92fr/tag/include/vars.php
XoopsModules/tag/branches/Arion92fr/tag/index.php
XoopsModules/tag/branches/Arion92fr/tag/language/
XoopsModules/tag/branches/Arion92fr/tag/language/english/
XoopsModules/tag/branches/Arion92fr/tag/language/english/admin.php
XoopsModules/tag/branches/Arion92fr/tag/language/english/blocks.php
XoopsModules/tag/branches/Arion92fr/tag/language/english/config.php
XoopsModules/tag/branches/Arion92fr/tag/language/english/index.html
XoopsModules/tag/branches/Arion92fr/tag/language/english/main.php
XoopsModules/tag/branches/Arion92fr/tag/language/english/modinfo.php
XoopsModules/tag/branches/Arion92fr/tag/language/french/
XoopsModules/tag/branches/Arion92fr/tag/language/french/admin.php
XoopsModules/tag/branches/Arion92fr/tag/language/french/blocks.php
XoopsModules/tag/branches/Arion92fr/tag/language/french/config.php
XoopsModules/tag/branches/Arion92fr/tag/language/french/index.html
XoopsModules/tag/branches/Arion92fr/tag/language/french/main.php
XoopsModules/tag/branches/Arion92fr/tag/language/french/modinfo.php
XoopsModules/tag/branches/Arion92fr/tag/language/index.html
XoopsModules/tag/branches/Arion92fr/tag/list.tag.php
XoopsModules/tag/branches/Arion92fr/tag/newbb.php
XoopsModules/tag/branches/Arion92fr/tag/news.php
XoopsModules/tag/branches/Arion92fr/tag/plugin/
XoopsModules/tag/branches/Arion92fr/tag/plugin/AMS.php
XoopsModules/tag/branches/Arion92fr/tag/plugin/article.php
XoopsModules/tag/branches/Arion92fr/tag/plugin/newbb.php
XoopsModules/tag/branches/Arion92fr/tag/plugin/news.php
XoopsModules/tag/branches/Arion92fr/tag/plugin/xforum.php
XoopsModules/tag/branches/Arion92fr/tag/sample.php
XoopsModules/tag/branches/Arion92fr/tag/sql/
XoopsModules/tag/branches/Arion92fr/tag/sql/index.html
XoopsModules/tag/branches/Arion92fr/tag/sql/mysql.150.sql
XoopsModules/tag/branches/Arion92fr/tag/sql/mysql.sql
XoopsModules/tag/branches/Arion92fr/tag/style.css
XoopsModules/tag/branches/Arion92fr/tag/tag_bar.html
XoopsModules/tag/branches/Arion92fr/tag/tag_index.html
XoopsModules/tag/branches/Arion92fr/tag/tag_list.html
XoopsModules/tag/branches/Arion92fr/tag/tag_view.html
XoopsModules/tag/branches/Arion92fr/tag/templates/
XoopsModules/tag/branches/Arion92fr/tag/templates/blocks/
XoopsModules/tag/branches/Arion92fr/tag/templates/blocks/tag_block_cloud.html
XoopsModules/tag/branches/Arion92fr/tag/templates/blocks/tag_block_cumulus.html
XoopsModules/tag/branches/Arion92fr/tag/templates/blocks/tag_block_top.html
XoopsModules/tag/branches/Arion92fr/tag/templates/index.html
XoopsModules/tag/branches/Arion92fr/tag/templates/style.css
XoopsModules/tag/branches/Arion92fr/tag/templates/tag_bar.html
XoopsModules/tag/branches/Arion92fr/tag/templates/tag_index.html
XoopsModules/tag/branches/Arion92fr/tag/templates/tag_list.html
XoopsModules/tag/branches/Arion92fr/tag/templates/tag_view.html
XoopsModules/tag/branches/Arion92fr/tag/view.tag.php
XoopsModules/tag/branches/Arion92fr/tag/xforum.php
XoopsModules/tag/branches/Arion92fr/tag/xoops_version.php
Added: XoopsModules/tag/branches/Arion92fr/tag/AMS.php
===================================================================
--- XoopsModules/tag/branches/Arion92fr/tag/AMS.php (rev 0)
+++ XoopsModules/tag/branches/Arion92fr/tag/AMS.php 2012-03-23 18:04:02 UTC (rev 9180)
@@ -0,0 +1,46 @@
+<?php
+/* Step 3: define functions to build info of tagged items */
+// File: /modules/tag/plugin/mymodule.php OR /modules/mymodule/include/plugin.tag.php
+/** Get item fields: title, content, time, link, uid, uname, tags **/
+include_once XOOPS_ROOT_PATH."/modules/AMS/class/class.newsstory.php";
+
+function AMS_tag_iteminfo(&$items)
+{
+ $items_id = array();
+ foreach (array_keys($items) as $cat_id) {
+ // Some handling here to build the link upon catid
+ // If catid is not used, just skip it
+ foreach (array_keys($items[$cat_id]) as $item_id) {
+ // In article, the item_id is "art_id"
+ $items_id[] = intval($item_id);
+ }
+ }
+ // $items_obj = AmsStory::getAllPublished(0, 0, false, 0, 1, true, 'published', $items_id);
+ //$item_handler =& xoops_getmodulehandler("AmsStory", "AMS");
+ //$items_obj = $item_handler->getObjects(new Criteria("itemid", "(" . implode(", ", $items_id) . ")", "IN"), true);
+ $items_obj = AmsStory::getAllPublished(0, 0, true, 0, 0, true, 'published', $items_id);
+
+ foreach (array_keys($items) as $cat_id) {
+ foreach (array_keys($items[$cat_id]) as $item_id) {
+ if(isset($items_obj[$item_id])) {
+ $item_obj =& $items_obj[$item_id];
+ $items[$cat_id][$item_id] = array(
+ "title" => $item_obj->title(),
+ "uid" => $item_obj->storyid(),
+ // modules/AMS/article.php?storyid=
+ "link" => "article.php?storyid={$item_obj->storyid()}",
+ "time" => $item_obj->published,
+ "tags" => "",// tag_parse_tag($item_obj->getVar("item_tags", "n")), // optional
+ "content" => $item_obj->hometext(), // "",
+ );
+ }
+ }
+ }
+ unset($items_obj);
+}
+/** Remove orphan tag-item links **/
+function AMS_tag_synchronization($mid)
+{
+ // Optional
+}
+?>
\ No newline at end of file
Property changes on: XoopsModules/tag/branches/Arion92fr/tag/AMS.php
___________________________________________________________________
Added: svn:eol-style
+ native
Added: XoopsModules/tag/branches/Arion92fr/tag/admin/admin.tag.php
===================================================================
--- XoopsModules/tag/branches/Arion92fr/tag/admin/admin.tag.php (rev 0)
+++ XoopsModules/tag/branches/Arion92fr/tag/admin/admin.tag.php 2012-03-23 18:04:02 UTC (rev 9180)
@@ -0,0 +1,141 @@
+<?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.
+*/
+
+/**
+ * XOOPS tag management module
+ *
+ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @since 1.0.0
+ * @author Taiwen Jiang <ph...@us...>
+ * @version $Id: admin.tag.php 2292 2008-10-12 04:53:18Z phppp $
+ * @package tag
+ */
+
+include 'header.php';
+require_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
+
+xoops_cp_header();
+
+include XOOPS_ROOT_PATH . "/modules/tag/include/vars.php";
+echo function_exists("loadModuleAdminMenu") ? loadModuleAdminMenu(1) : "";
+
+$limit = 10;
+$modid = intval( empty($_GET['modid']) ? @$_POST['modid'] : $_GET['modid'] );
+$start = intval( empty($_GET['start']) ? @$_POST['start'] : $_GET['start'] );
+$status = intval( empty($_GET['status']) ? @$_POST['status'] : $_GET['status'] );
+
+$tag_handler =& xoops_getmodulehandler("tag", $xoopsModule->getVar("dirname"));
+
+if (!empty($_POST['tags'])) {
+ foreach ($_POST['tags'] as $tag => $tag_status) {
+ $tag_obj =& $tag_handler->get($tag);
+ if (!is_object($tag_obj) || !$tag_obj->getVar("tag_id")) continue;
+ if ($tag_status < 0) {
+ $tag_handler->delete($tag_obj);
+ } elseif ($tag_status != $tag_obj->getVar("tag_status")) {
+ $tag_obj->setVar("tag_status", $tag_status);
+ $tag_handler->insert($tag_obj);
+ }
+ }
+ redirect_header("admin.tag.php?modid={$modid}&start={$start}&status={$status}", 2);
+ exit();
+}
+
+$sql = " SELECT tag_modid, COUNT(DISTINCT tag_id) AS count_tag";
+$sql .= " FROM " . $xoopsDB->prefix("tag_link");
+$sql .= " GROUP BY tag_modid";
+$counts_module = array();
+$module_list = array();
+if ( ($result = $xoopsDB->query($sql)) == false) {
+ xoops_error($xoopsDB->error());
+} else {
+ while ($myrow = $xoopsDB->fetchArray($result)) {
+ $counts_module[$myrow["tag_modid"]] = $myrow["count_tag"];
+ }
+ if (!empty($counts_module)) {
+ $module_handler =& xoops_gethandler("module");
+ $module_list = $module_handler->getList(new Criteria("mid", "(" . implode(", ", array_keys($counts_module)) . ")", "IN"));
+ }
+}
+
+$opform = new XoopsSimpleForm('', 'moduleform', xoops_getenv("PHP_SELF"), "get");
+$tray = new XoopsFormElementTray('');
+$mod_select = new XoopsFormSelect(_SELECT, 'modid', $modid);
+$mod_select->addOption(0, _ALL);
+foreach ($module_list as $module => $module_name) {
+ $mod_select->addOption($module, $module_name." (" . $counts_module[$module] . ")");
+}
+$tray->addElement($mod_select);
+$status_select = new XoopsFormRadio("", 'status', $status);
+$status_select->addOption(-1, _ALL);
+$status_select->addOption(0, TAG_AM_ACTIVE);
+$status_select->addOption(1, TAG_AM_INACTIVE);
+$tray->addElement($status_select);
+$tray->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit"));
+$opform->addElement($tray);
+$opform->display();
+
+$criteria = new CriteriaCompo();
+$criteria->setSort("a");
+$criteria->setOrder("ASC");
+$criteria->setStart($start);
+$criteria->setLimit($limit);
+if ($status >= 0) {
+ $criteria->add( new Criteria("o.tag_status", $status) );
+}
+if (!empty($modid)) {
+ $criteria->add( new Criteria("l.tag_modid", $modid) );
+}
+$tags = $tag_handler->getByLimit($criteria, false);
+
+$form_tags = "<form name='tags' method='post' action='" . xoops_getenv("PHP_SELF") . "'>";
+$form_tags .= "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
+$form_tags .= "<tr align='center'>";
+$form_tags .= "<td class='bg3'>" . TAG_AM_TERM . "</td>";
+$form_tags .= "<td class='bg3' width='10%'>" . TAG_AM_ACTIVE . "</td>";
+$form_tags .= "<td class='bg3' width='10%'>" . TAG_AM_INACTIVE . "</td>";
+$form_tags .= "<td class='bg3' width='10%'>" . _DELETE . "</td>";
+$form_tags .= "</tr>";
+if (empty($tags)) {
+ $form_tags .= "<tr><td colspan='4'>" . _NONE . "</td></tr>";
+} else {
+ $class_tr = array("odd", "even");
+ $i = 0;
+ foreach (array_keys($tags) as $key) {
+ $form_tags .= "<tr class='" . $class_tr[(++$i) % 2] . "'>";
+ $form_tags .= "<td>" . $tags[$key]["term"] . "</td>";
+ $form_tags .= "<td><input type='radio' name='tags[{$key}]' value='0' " . ( $tags[$key]["status"] ? "" : " 'checked' ") . "></td>";
+ $form_tags .= "<td><input type='radio' name='tags[{$key}]' value='1' " . ( $tags[$key]["status"] ? " 'checked' " : "") . "></td>";
+ $form_tags .= "<td><input type='radio' name='tags[{$key}]' value='-1'></td>";
+ $form_tags .= "</tr>";
+ }
+ if ( !empty($start) || count($tags) >= $limit ) {
+ $count_tag = $tag_handler->getCount($criteria);
+
+ include XOOPS_ROOT_PATH . "/class/pagenav.php";
+ $nav = new XoopsPageNav($count_tag, $limit, $start, "start", "modid={$modid}&status={$status}");
+ $form_tags .= "<tr><td colspan='4' align='right'>" . $nav->renderNav(4) . "</td></tr>";
+ }
+ $form_tags .= "<tr><td colspan='4' align='center'>";
+ $form_tags .= "<input type='hidden' name='status' value='{$status}'> ";
+ $form_tags .= "<input type='hidden' name='start' value='{$start}'> ";
+ $form_tags .= "<input type='hidden' name='modid' value='{$modid}'> ";
+ $form_tags .= "<input type='submit' name='submit' value='" . _SUBMIT . "'> ";
+ $form_tags .= "<input type='reset' name='submit' value='" . _CANCEL . "'>";
+ $form_tags .= "</td></tr>";
+}
+$form_tags .= "</table>";
+$form_tags .= "</form>";
+
+echo $form_tags;
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/tag/branches/Arion92fr/tag/admin/admin.tag.php
___________________________________________________________________
Added: svn:eol-style
+ native
Added: XoopsModules/tag/branches/Arion92fr/tag/admin/header.php
===================================================================
--- XoopsModules/tag/branches/Arion92fr/tag/admin/header.php (rev 0)
+++ XoopsModules/tag/branches/Arion92fr/tag/admin/header.php 2012-03-23 18:04:02 UTC (rev 9180)
@@ -0,0 +1,89 @@
+<?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.
+*/
+
+/**
+ * XOOPS tag management module
+ *
+ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @since 1.0.0
+ * @author Taiwen Jiang <ph...@us...>
+ * @version $Id: header.php 2292 2008-10-12 04:53:18Z phppp $
+ * @package tag
+ */
+
+include "../../../include/cp_header.php";
+require XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/vars.php";
+require_once XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/include/functions.php";
+xoops_loadLanguage("main", $xoopsModule->getVar("dirname"));
+
+$myts =& MyTextSanitizer::getInstance();
+
+IF (!@ include_once XOOPS_ROOT_PATH . "/Frameworks/art/functions.admin.php"):
+
+function loadModuleAdminMenu($currentoption, $breadcrumb = "")
+{
+ if (!$adminmenu = $GLOBALS["xoopsModule"]->getAdminMenu()) {
+ return false;
+ }
+
+ $breadcrumb = empty($breadcrumb) ? $adminmenu[$currentoption]["title"] : $breadcrumb;
+ $module_link = XOOPS_URL . "/modules/" . $GLOBALS["xoopsModule"]->getVar("dirname") . "/";
+ $image_link = XOOPS_URL . "/modules/" . $GLOBALS["xoopsModule"]->getVar("dirname") . "/images";
+
+ $adminmenu_text ='
+ <style type="text/css">
+ <!--
+ #buttontop { float:left; width:100%; background: #e7e7e7; font-size:93%; line-height:normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0;}
+ #buttonbar { float:left; width:100%; background: #e7e7e7 url("'.$image_link.'/modadminbg.gif") repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px;}
+ #buttonbar ul { margin:0; margin-top: 15px; padding:10px 10px 0; list-style:none; }
+ #buttonbar li { display:inline; margin:0; padding:0; }
+ #buttonbar a { float:left; background:url("'.$image_link.'/left_both.gif") no-repeat left top; margin:0; padding:0 0 0 9px; border-bottom:1px solid #000; text-decoration:none; }
+ #buttonbar a span { float:left; display:block; background:url("'.$image_link.'/right_both.gif") no-repeat right top; padding:5px 15px 4px 6px; font-weight:bold; color:#765; }
+ /* Commented Backslash Hack hides rule from IE5-Mac \*/
+ #buttonbar a span {float:none;}
+ /* End IE5-Mac hack */
+ #buttonbar a:hover span { color:#333; }
+ #buttonbar .current a { background-position:0 -150px; border-width:0; }
+ #buttonbar .current a span { background-position:100% -150px; padding-bottom:5px; color:#333; }
+ #buttonbar a:hover { background-position:0% -150px; }
+ #buttonbar a:hover span { background-position:100% -150px; }
+ //-->
+ </style>
+ <div id="buttontop">
+ <table style="width: 100%; padding: 0; " cellspacing="0">
+ <tr>
+ <td style="width: 70%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;">
+ <a href="../index.php">' . $GLOBALS["xoopsModule"]->getVar("name") . '</a>
+ </td>
+ <td style="width: 30%; font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;">
+ <strong>' . $GLOBALS["xoopsModule"]->getVar("name") . '</strong> ' . $breadcrumb . '
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div id="buttonbar">
+ <ul>
+ ';
+ foreach (array_keys($adminmenu) as $key) {
+ $adminmenu_text .= (($currentoption == $key) ? '<li class="current">' : '<li>') . '<a href="' . $module_link . $adminmenu[$key]["link"] . '"><span>' . $adminmenu[$key]["title"] . '</span></a></li>';
+ }
+ $adminmenu_text .= '<li><a href="' . XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $GLOBALS["xoopsModule"]->getVar("mid") . '"><span>' . _PREFERENCES . '</span></a></li>';
+ $adminmenu_text .= '
+ </ul>
+ </div>
+ <br style="clear:both;" />';
+
+ echo $adminmenu_text;
+}
+
+ENDIF;
+?>
\ No newline at end of file
Property changes on: XoopsModules/tag/branches/Arion92fr/tag/admin/header.php
___________________________________________________________________
Added: svn:eol-style
+ native
Added: XoopsModules/tag/branches/Arion92fr/tag/admin/index.php
===================================================================
--- XoopsModules/tag/branches/Arion92fr/tag/admin/index.php (rev 0)
+++ XoopsModules/tag/branches/Arion92fr/tag/admin/index.php 2012-03-23 18:04:02 UTC (rev 9180)
@@ -0,0 +1,89 @@
+<?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.
+*/
+
+/**
+ * XOOPS tag management module
+ *
+ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @since 1.0.0
+ * @author Taiwen Jiang <ph...@us...>
+ * @version $Id: index.php 2292 2008-10-12 04:53:18Z phppp $
+ * @package tag
+ */
+include 'header.php';
+
+xoops_cp_header();
+
+include XOOPS_ROOT_PATH . "/modules/tag/include/vars.php";
+echo function_exists("loadModuleAdminMenu") ? loadModuleAdminMenu(0) : "";
+
+$tag_handler =& xoops_getmodulehandler("tag", $xoopsModule->getVar("dirname"));
+$count_tag = $tag_handler->getCount();
+
+$count_item = 0;
+$sql = " SELECT COUNT(DISTINCT tl_id) FROM " . $xoopsDB->prefix("tag_link");
+if ( ($result = $xoopsDB->query($sql)) == false) {
+ xoops_error($xoopsDB->error());
+} else {
+ list($count_item) = $xoopsDB->fetchRow($result);
+}
+
+$sql = " SELECT tag_modid, SUM(tag_count) AS count_item, COUNT(DISTINCT tag_id) AS count_tag";
+$sql .= " FROM " . $xoopsDB->prefix("tag_stats");
+$sql .= " GROUP BY tag_modid";
+$counts_module = array();
+if( ($result = $xoopsDB->query($sql)) == false) {
+ xoops_error($xoopsDB->error());
+} else {
+ while ($myrow = $xoopsDB->fetchArray($result)) {
+ $counts_module[$myrow["tag_modid"]] = array("count_item" => $myrow["count_item"], "count_tag" => $myrow["count_tag"]);
+ }
+ if (!empty($counts_module)) {
+ $module_handler =& xoops_gethandler("module");
+ $module_list = $module_handler->getList(new Criteria("mid", "(" . implode(", ", array_keys($counts_module)) . ")", "IN"));
+ }
+}
+
+$output= "
+ <style type=\"text/css\">
+ label,text {
+ display: block;
+ float: left;
+ margin-bottom: 2px;
+ }
+ label {
+ text-align: right;
+ width: 150px;
+ padding-right: 20px;
+ }
+ br {
+ clear: left;
+ }
+ </style>
+";
+
+$output .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . TAG_AM_STATS . "</legend>";
+$output .= "<div style='padding: 8px;'>";
+$output .= "<label><strong>" . TAG_AM_COUNT_TAG . ":</strong></label><text>" . $count_tag . "</text><br />";
+$output .= "<label><strong>" . TAG_AM_COUNT_ITEM . ":</strong></label><text>" . $count_item . "</text><br />";
+$output .= "</div>";
+$output .= "<div style='padding: 8px;'>";
+$output .= "<label><strong>" . TAG_AM_COUNT_MODULE . "</strong>:</label><text>" . TAG_AM_COUNT_TAG . " - " . TAG_AM_COUNT_ITEM . "</text><br />";
+foreach ($counts_module as $module => $count) {
+ $output .= "<label>" . $module_list[$module] . ":</label><text>" . $count["count_tag"] . " - " . $count["count_item"] . " [<a href=\"" . XOOPS_URL . "/modules/tag/admin/admin.tag.php?modid={$module}\">" . TAG_AM_EDIT . "</a>] [<a href=\"" . XOOPS_URL . "/modules/tag/admin/syn.tag.php?modid={$module}\">" . TAG_AM_SYNCHRONIZATION . "</a>] </text><br />";
+}
+$output .= "</div>";
+$output .= "</fieldset>";
+
+echo $output;
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/tag/branches/Arion92fr/tag/admin/index.php
___________________________________________________________________
Added: svn:eol-style
+ native
Added: XoopsModules/tag/branches/Arion92fr/tag/admin/menu.php
===================================================================
--- XoopsModules/tag/branches/Arion92fr/tag/admin/menu.php (rev 0)
+++ XoopsModules/tag/branches/Arion92fr/tag/admin/menu.php 2012-03-23 18:04:02 UTC (rev 9180)
@@ -0,0 +1,35 @@
+<?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.
+*/
+
+/**
+ * XOOPS tag management module
+ *
+ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @since 1.0.0
+ * @author Taiwen Jiang <ph...@us...>
+ * @version $Id: menu.php 1575 2008-05-04 15:54:26Z phppp $
+ * @package tag
+ */
+
+if (!defined('XOOPS_ROOT_PATH')) { exit(); }
+
+global $adminmenu;
+
+$adminmenu = array();
+
+$adminmenu[]= array("link" => "admin/index.php",
+ "title" => TAG_MI_ADMENU_INDEX);
+$adminmenu[]= array("link" => "admin/admin.tag.php",
+ "title" => TAG_MI_ADMENU_EDIT);
+$adminmenu[]= array("link" => "admin/syn.tag.php",
+ "title" => TAG_MI_ADMENU_SYNCHRONIZATION);
+?>
\ No newline at end of file
Property changes on: XoopsModules/tag/branches/Arion92fr/tag/admin/menu.php
___________________________________________________________________
Added: svn:eol-style
+ native
Added: XoopsModules/tag/branches/Arion92fr/tag/admin/syn.tag.php
===================================================================
--- XoopsModules/tag/branches/Arion92fr/tag/admin/syn.tag.php (rev 0)
+++ XoopsModules/tag/branches/Arion92fr/tag/admin/syn.tag.php 2012-03-23 18:04:02 UTC (rev 9180)
@@ -0,0 +1,94 @@
+<?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.
+*/
+
+/**
+ * XOOPS tag management module
+ *
+ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @since 1.0.0
+ * @author Taiwen Jiang <ph...@us...>
+ * @version $Id: syn.tag.php 2292 2008-10-12 04:53:18Z phppp $
+ * @package tag
+ */
+include 'header.php';
+require_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
+
+xoops_cp_header();
+
+include XOOPS_ROOT_PATH . "/modules/tag/include/vars.php";
+echo function_exists("loadModuleAdminMenu") ? loadModuleAdminMenu(2) : "";
+
+$limit = 10;
+$modid = intval( @$_GET['modid'] );
+$start = intval( @$_GET['start'] );
+$limit = isset($_GET['limit']) ? intval( $_GET['limit'] ) : 100;
+
+$sql = " SELECT tag_modid, COUNT(DISTINCT tag_id) AS count_tag";
+$sql .= " FROM " . $xoopsDB->prefix("tag_link");
+$sql .= " GROUP BY tag_modid";
+$counts_module = array();
+$module_list = array();
+if ( $result = $xoopsDB->query($sql)) {
+ while ($myrow = $xoopsDB->fetchArray($result)) {
+ $counts_module[$myrow["tag_modid"]] = $myrow["count_tag"];
+ }
+ if (!empty($counts_module)) {
+ $module_handler =& xoops_gethandler("module");
+ $module_list = $module_handler->getList(new Criteria("mid", "(" . implode(", ", array_keys($counts_module)) . ")", "IN"));
+ }
+}
+
+$opform = new XoopsSimpleForm('', 'moduleform', xoops_getenv("PHP_SELF"), "get");
+$tray = new XoopsFormElementTray('');
+$mod_select = new XoopsFormSelect(_SELECT, 'modid', $modid);
+$mod_select->addOption(-1, TAG_AM_GLOBAL);
+$mod_select->addOption(0, TAG_AM_ALL);
+foreach ($module_list as $module => $module_name) {
+ $mod_select->addOption($module, $module_name . " (" . $counts_module[$module] . ")");
+}
+$tray->addElement($mod_select);
+$num_select = new XoopsFormSelect(TAG_AM_NUM, 'limit', $limit);
+foreach (array(10, 50, 100, 500) as $_num) {
+ $num_select->addOption($_num);
+}
+$num_select->addOption(0, _ALL);
+$tray->addElement($num_select);
+$tray->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit"));
+$tray->addElement(new XoopsFormHidden("start", $start));
+$opform->addElement($tray);
+$opform->display();
+
+
+if ( isset($_GET['start']) ) {
+
+ $tag_handler =& xoops_getmodulehandler("tag", $xoopsModule->getVar("dirname"));
+
+ $criteria = new CriteriaCompo();
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ if ($modid > 0) {
+ $criteria->add( new Criteria("l.tag_modid", $modid) );
+ }
+ $tags = $tag_handler->getByLimit($criteria, false);
+ if (empty($tags)) {
+ echo "<h2>" . TAG_AM_FINISHED . "</h2>";
+ } else {
+
+ foreach (array_keys($tags) as $tag_id) {
+ $tag_handler->update_stats($tag_id, ( $modid == -1 ) ? 0 : $tags[$tag_id]["modid"]);
+ }
+ redirect_header("syn.tag.php?modid={$modid}&start=" . ($start + $limit) . "&limit={$limit}", 2, TAG_AM_IN_PROCESS);
+ }
+}
+
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/tag/branches/Arion92fr/tag/admin/syn.tag.php
___________________________________________________________________
Added: svn:eol-style
+ native
Added: XoopsModules/tag/branches/Arion92fr/tag/article.php
===================================================================
--- XoopsModules/tag/branches/Arion92fr/tag/article.php (rev 0)
+++ XoopsModules/tag/branches/Arion92fr/tag/article.php 2012-03-23 18:04:02 UTC (rev 9180)
@@ -0,0 +1,110 @@
+<?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.
+*/
+
+/**
+ * XOOPS tag management module
+ *
+ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @since 1.0.0
+ * @author Taiwen Jiang <ph...@us...>
+ * @version $Id: article.php 2292 2008-10-12 04:53:18Z phppp $
+ * @package tag
+ */
+if (!defined('XOOPS_ROOT_PATH')) { exit(); }
+
+/**
+ * Get item fields:
+ * title
+ * content
+ * time
+ * link
+ * uid
+ * uname
+ * tags
+ *
+ * @var array $items associative array of items: [modid][catid][itemid]
+ *
+ * @return boolean
+ *
+ */
+function article_tag_iteminfo(&$items)
+{
+ if (empty($items) || !is_array($items)) {
+ return false;
+ }
+
+ $items_id = array();
+ foreach (array_keys($items) as $cat_id) {
+ // Some handling here to build the link upon catid
+ // catid is not used in article, so just skip it
+ foreach (array_keys($items[$cat_id]) as $item_id) {
+ // In article, the item_id is "art_id"
+ $items_id[] = intval($item_id);
+ }
+ }
+ $item_handler =& xoops_getmodulehandler("article", "article");
+ $items_obj = $item_handler->getObjects(new Criteria("art_id", "(" . implode(", ", $items_id) . ")", "IN"), true);
+
+ foreach (array_keys($items) as $cat_id) {
+ foreach (array_keys($items[$cat_id]) as $item_id) {
+ $item_obj =& $items_obj[$item_id];
+ $items[$cat_id][$item_id] = array(
+ "title" => $item_obj->getVar("art_title"),
+ "uid" => $item_obj->getVar("uid"),
+ "link" => "view.article.php?article={$item_id}",
+ "time" => $item_obj->getVar("art_time_publish"),
+ "tags" => tag_parse_tag($item_obj->getVar("art_keywords", "n")),
+ "content" => "",
+ );
+ }
+ }
+ unset($items_obj);
+}
+
+/**
+ * Remove orphan tag-item links
+ *
+ * @return boolean
+ *
+ */
+function article_tag_synchronization($mid)
+{
+ $item_handler =& xoops_getmodulehandler("article", "article");
+ $link_handler =& xoops_getmodulehandler("link", "tag");
+
+ /* clear tag-item links */
+ if (version_compare( mysql_get_server_info(), "4.1.0", "ge" )):
+ $sql = " DELETE FROM {$link_handler->table}" .
+ " WHERE " .
+ " tag_modid = {$mid}" .
+ " AND " .
+ " ( tag_itemid NOT IN " .
+ " ( SELECT DISTINCT {$item_handler->keyName} " .
+ " FROM {$item_handler->table} " .
+ " WHERE {$item_handler->table}.art_time_publish > 0" .
+ " ) " .
+ " )";
+ else:
+ $sql = " DELETE {$link_handler->table} FROM {$link_handler->table}" .
+ " LEFT JOIN {$item_handler->table} AS aa ON {$link_handler->table}.tag_itemid = aa.{$item_handler->keyName} " .
+ " WHERE " .
+ " tag_modid = {$mid}" .
+ " AND " .
+ " ( aa.{$item_handler->keyName} IS NULL" .
+ " OR aa.art_time_publish < 1" .
+ " )";
+ endif;
+ if (!$result = $link_handler->db->queryF($sql)) {
+ //xoops_error($link_handler->db->error());
+ }
+}
+?>
\ No newline at end of file
Property changes on: XoopsModules/tag/branches/Arion92fr/tag/article.php
___________________________________________________________________
Added: svn:eol-style
+ native
Added: XoopsModules/tag/branches/Arion92fr/tag/blocks/block.php
===================================================================
--- XoopsModules/tag/branches/Arion92fr/tag/blocks/block.php (rev 0)
+++ XoopsModules/tag/branches/Arion92fr/tag/blocks/block.php 2012-03-23 18:04:02 UTC (rev 9180)
@@ -0,0 +1,463 @@
+<?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.
+*/
+
+/**
+ * XOOPS tag management module
+ *
+ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @since 1.0.0
+ * @author Taiwen Jiang <ph...@us...>
+ * @version $Id: block.php 2292 2008-10-12 04:53:18Z phppp $
+ * @package tag
+ */
+
+if (!defined('XOOPS_ROOT_PATH')) { exit(); }
+include XOOPS_ROOT_PATH . "/modules/tag/include/vars.php";
+include_once XOOPS_ROOT_PATH . "/modules/tag/include/functions.php";
+
+xoops_loadLanguage("blocks", "tag");
+
+/**#@+
+ * Function to display tag cloud
+ *
+ * Developer guide:
+ * <ul>
+ * <li>Build your tag_block_cloud_show function, for example newbb_block_tag_cloud_show;</li>
+ * <li>Call the tag_block_cloud_show in your defined block function:<br />
+ * <code>
+ * function newbb_block_tag_cloud_show($options) {
+ * $catid = $options[4]; // Not used by newbb, Only for demonstration
+ * if (!@include_once XOOPS_ROOT_PATH."/modules/tag/blocks/block.php") {
+ * return null;
+ * }
+ * $block_content = tag_block_cloud_show($options, "newbb", $catid);
+ * return $block_content;
+ * }
+ * </code>
+ * </li>
+ * <li>Build your tag_block_cloud_edit function, for example newbb_block_tag_cloud_edit;</li>
+ * <li>Call the tag_block_cloud_edit in your defined block function:<br />
+ * <code>
+ * function newbb_block_tag_cloud_edit($options) {
+ * if (!@include_once XOOPS_ROOT_PATH."/modules/tag/blocks/block.php") {
+ * return null;
+ * }
+ * $form = tag_block_cloud_edit($options);
+ * $form .= $CODE_FOR_GET_CATID; // Not used by newbb, Only for demonstration
+ * return $form;
+ * }
+ * </code>
+ * </li>
+ * <li>Create your tag_block_cloud template, for example newbb_block_tag_cloud.html;</li>
+ * <li>Include tag_block_cloud template in your created block template:<br />
+ * <code>
+ * <{include file="db:tag_block_cloud.html"}>
+ * </code>
+ * </li>
+ * </ul>
+ *
+ * {@link TagTag}
+ *
+ * @param array $options:
+ * $options[0] - number of tags to display
+ * $options[1] - time duration, in days, 0 for all the time
+ * $options[2] - max font size (px or %)
+ * $options[3] - min font size (px or %)
+ */
+function tag_block_cloud_show( $options, $dirname = "", $catid = 0 )
+{
+ global $xoopsDB;
+
+ if (empty($dirname)) {
+ $modid = 0;
+ } elseif (isset($GLOBALS["xoopsModule"]) && is_object($GLOBALS["xoopsModule"]) && $GLOBALS["xoopsModule"]->getVar("dirname") == $dirname) {
+ $modid = $GLOBALS["xoopsModule"]->getVar("mid");
+ } else {
+ $module_handler =& xoops_gethandler("module");
+ $module = $module_handler->getByDirname($dirname);
+ $modid = $module->getVar("mid");
+ }
+
+ $block = array();
+ $tag_handler =& xoops_getmodulehandler("tag", "tag");
+ tag_define_url_delimiter();
+
+ $criteria = new CriteriaCompo();
+ $criteria->setSort("count");
+ $criteria->setOrder("DESC");
+ $criteria->setLimit($options[0]);
+ $criteria->add( new Criteria("o.tag_status", 0) );
+ if (!empty($modid)) {
+ $criteria->add( new Criteria("l.tag_modid", $modid) );
+ if ($catid >= 0) {
+ $criteria->add( new Criteria("l.tag_catid", $catid) );
+ }
+ }
+ if (!$tags = $tag_handler->getByLimit($criteria, empty($options[1]))) {
+ return $block;
+ }
+
+ $count_max = 0;
+ $count_min = 0;
+ $tags_term = array();
+ foreach (array_keys($tags) as $key) {
+ if ($tags[$key]["count"] > $count_max) $count_max = $tags[$key]["count"];
+ if ($tags[$key]["count"] < $count_min || $count_min == 0) $count_min = $tags[$key]["count"];
+ $tags_term[] = strtolower($tags[$key]["term"]);
+ }
+ array_multisort($tags_term, SORT_ASC, $tags);
+ $count_interval = $count_max - $count_min;
+ $level_limit = 5;
+
+ $font_max = $options[2];
+ $font_min = $options[3];
+ $font_ratio = ($count_interval) ? ($font_max - $font_min) / $count_interval : 1;
+
+ $tags_data = array();
+ foreach (array_keys($tags) as $key) {
+ $tags_data[] = array(
+ "id" => $tags[$key]["id"],
+ "font" => ($count_interval) ? floor( ($tags[$key]["count"] - $count_min) * $font_ratio + $font_min ) : 100,
+ "level" => empty($count_max) ? 0 : floor( ($tags[$key]["count"] - $count_min) * $level_limit / $count_max ),
+ "term" => $tags[$key]["term"],
+ "count" => $tags[$key]["count"],
+ );
+ }
+ unset($tags, $tags_term);
+
+ $block["tags"] =& $tags_data;
+ $block["tag_dirname"] = "tag";
+ if (!empty($modid)) {
+ $module_handler =& xoops_gethandler('module');
+ if ($module_obj =& $module_handler->get($modid)) {
+ $block["tag_dirname"] = $module_obj->getVar("dirname");
+ }
+ }
+ return $block;
+}
+
+function tag_block_cloud_edit($options)
+{
+ $form = TAG_MB_ITEMS . ": <input type=\"text\" name=\"options[0]\" value=\"" . $options[0] . "\" /><br />";
+ $form .= TAG_MB_TIME_DURATION . ": <input type=\"text\" name=\"options[1]\" value=\"" . $options[1] . "\" /><br />";
+ $form .= TAG_MB_FONTSIZE_MAX . ": <input type=\"text\" name=\"options[2]\" value=\"" . $options[2] . "\" /><br />";
+ $form .= TAG_MB_FONTSIZE_MIN . ": <input type=\"text\" name=\"options[3]\" value=\"" . $options[3] . "\" /><br />";
+
+ return $form;
+}
+
+
+/**#@+
+ * Function to display top tag list
+ *
+ * Developer guide:
+ * <ul>
+ * <li>Build your tag_block_top_show function, for example newbb_block_tag_top_show;</li>
+ * <li>Call the tag_block_top_show in your defined block function:<br />
+ * <code>
+ * function newbb_block_tag_top_show($options) {
+ * $catid = $options[3]; // Not used by newbb, Only for demonstration
+ * if (!@include_once XOOPS_ROOT_PATH."/modules/tag/blocks/block.php") {
+ * return null;
+ * }
+ * $block_content = tag_block_top_show($options, "newbb", $catid);
+ * return $block_content;
+ * }
+ * </code>
+ * </li>
+ * <li>Build your tag_block_top_edit function, for example newbb_block_tag_top_edit;</li>
+ * <li>Call the tag_block_top_edit in your defined block function:<br />
+ * <code>
+ * function newbb_block_tag_top_edit($options) {
+ * if (!@include_once XOOPS_ROOT_PATH."/modules/tag/blocks/block.php") {
+ * return null;
+ * }
+ * $form = tag_block_cloud_edit($options);
+ * $form .= $CODE_FOR_GET_CATID; // Not used by newbb, Only for demonstration
+ * return $form;
+ * }
+ * </code>
+ * </li>
+ * <li>Create your tag_block_top template, for example newbb_block_tag_top.html;</li>
+ * <li>Include tag_block_top template in your created block template:<br />
+ * <code>
+ * <{include file="db:tag_block_top.html"}>
+ * </code>
+ * </li>
+ * </ul>
+ *
+ * {@link TagTag}
+ *
+ * @param array $options:
+ * $options[0] - number of tags to display
+ * $options[1] - time duration, in days, 0 for all the time
+ * $options[2] - sort: a - alphabet; c - count; t - time
+ */
+function tag_block_top_show( $options, $dirname = "", $catid = 0 )
+{
+ global $xoopsDB;
+
+ if (empty($dirname)) {
+ $modid = 0;
+ } elseif (isset($GLOBALS["xoopsModule"]) && is_object($GLOBALS["xoopsModule"]) && $GLOBALS["xoopsModule"]->getVar("dirname") == $dirname) {
+ $modid = $GLOBALS["xoopsModule"]->getVar("mid");
+ } else {
+ $module_handler =& xoops_gethandler("module");
+ $module = $module_handler->getByDirname($dirname);
+ $modid = $module->getVar("mid");
+ }
+
+ $block = array();
+ $tag_handler =& xoops_getmodulehandler("tag", "tag");
+ tag_define_url_delimiter();
+
+ $criteria = new CriteriaCompo();
+ $sort = ($options[2] == "a" || $options[2] == "alphabet") ? "count" : $options[2];
+ $criteria->setSort("count");
+ $criteria->setOrder("DESC");
+ $criteria->setLimit($options[0]);
+ $criteria->add( new Criteria("o.tag_status", 0) );
+ if (!empty($options[1])) {
+ $criteria->add( new Criteria("l.tag_time", time() - $options[1] * 24 * 3600, ">") );
+ }
+ if (!empty($modid)) {
+ $criteria->add( new Criteria("l.tag_modid", $modid) );
+ if ($catid >= 0) {
+ $criteria->add( new Criteria("l.tag_catid", $catid) );
+ }
+ }
+ if (!$tags = $tag_handler->getByLimit($criteria, empty($options[1]))) {
+ return $block;
+ }
+
+ $count_max = 0;
+ $count_min = 0;
+ $tags_sort = array();
+ foreach (array_keys($tags) as $key) {
+ if ($tags[$key]["count"] > $count_max) $count_max = $tags[$key]["count"];
+ if ($tags[$key]["count"] < $count_min) $count_min = $tags[$key]["count"];
+ if ($options[2] == "a" || $options[2] == "alphabet") {
+ $tags_sort[] = strtolower($tags[$key]["term"]);
+ }
+ }
+ $count_interval = $count_max - $count_min;
+
+ /*
+ $font_max = $options[1];
+ $font_min = $options[2];
+ $font_ratio = ($count_interval) ? ($font_max - $font_min) / $count_interval : 1;
+ */
+ if (!empty($tags_sort)) {
+ array_multisort($tags_sort, SORT_ASC, $tags);
+ }
+
+ $tags_data = array();
+ foreach (array_keys($tags) as $key) {
+ $tags_data[] = array(
+ "id" => $tags[$key]["id"],
+ //"level" => ($tags[$key]["count"] - $count_min) * $font_ratio + $font_min,
+ "term" => $tags[$key]["term"],
+ "count" => $tags[$key]["count"],
+ );
+ }
+ unset($tags, $tags_term);
+
+ $block["tags"] =& $tags_data;
+ $block["tag_dirname"] = "tag";
+ if (!empty($modid)) {
+ $module_handler =& xoops_gethandler('module');
+ if ($module_obj =& $module_handler->get($modid)) {
+ $block["tag_dirname"] = $module_obj->getVar("dirname");
+ }
+ }
+ return $block;
+}
+
+function tag_block_top_edit($options)
+{
+ $form = TAG_MB_ITEMS . ": <input type=\"text\" name=\"options[0]\" value=\"" . $options[0] . "\" /><br />";
+ $form .= TAG_MB_TIME_DURATION . ": <input type=\"text\" name=\"options[1]\" value=\"" . $options[1] . "\" /><br />";
+ $form .= TAG_MB_SORT . ": <select name='options[2]'>";
+ $form .= "<option value='a'";
+ if ($options[2] == "a") $form .= " selected='selected' ";
+ $form .= ">" . TAG_MB_ALPHABET . "</option>";
+ $form .= "<option value='c'";
+ if ($options[2] == "c") $form .= " selected='selected' ";
+ $form .= ">" . TAG_MB_COUNT . "</option>";
+ $form .= "<option value='t'";
+ if ($options[2] == "t") $form .= " selected='selected' ";
+ $form .= ">" . TAG_MB_TIME . "</option>";
+ $form .= "</select>";
+
+ return $form;
+}
+
+/*
+ * $options: $options[0] - number of tags to display $options[1] - time duration
+* $options[2] - max font size (px or %) $options[3] - min font size (px or %)
+* $options[4] - cumulus_flash_width $options[5] - cumulus_flash_height
+* $options[6] - cumulus_flash_background $options[7] -
+* cumulus_flash_transparency $options[8] - cumulus_flash_color $options[9] -
+* cumulus_flash_hicolor $options[10] - cumulus_flash_speed
+*/
+function tag_block_cumulus_show($options, $dirname = "", $catid = 0) {
+ global $xoopsDB, $xoTheme;
+
+ $xoTheme->addScript("modules/tag/include/swfobject.js");
+ xoops_load('xoopscache');
+ $cache =& XoopsCache::getInstance();
+ $keysql=md5("tag_block_cumulus_show");
+ $result = $cache->read($keysql);
+ if ($result){
+ return $result;
+ }
+ if (empty ( $dirname )) {
+ $modid = 0;
+ } elseif (isset ( $GLOBALS ["xoopsModule"] ) && is_object ( $GLOBALS ["xoopsModule"] ) && $GLOBALS ["xoopsModule"]->getVar ( "dirname" ) == $dirname) {
+ $modid = $GLOBALS ["xoopsModule"]->getVar ( "mid" );
+ } else {
+ $module_handler = & xoops_gethandler ( "module" );
+ $module = $module_handler->getByDirname ( $dirname );
+ $modid = $module->getVar ( "mid" );
+ }
+
+ $block = array ();
+ $tag_handler = & xoops_getmodulehandler ( "tag", "tag" );
+ tag_define_url_delimiter ();
+
+ $criteria = new CriteriaCompo ();
+ $criteria->setSort ( "count" );
+ $criteria->setOrder ( "DESC" );
+ $criteria->setLimit ( $options [0] );
+ $criteria->add ( new Criteria ( "o.tag_status", 0 ) );
+ if (! empty ( $modid )) {
+ $criteria->add ( new Criteria ( "l.tag_modid", $modid ) );
+ if ($catid >= 0) {
+ $criteria->add ( new Criteria ( "l.tag_catid", $catid ) );
+ }
+ }
+ if (! $tags = $tag_handler->getByLimit ( $criteria, empty ( $options [1] ) )) {
+ return $block;
+ }
+
+ $count_max = 0;
+ $count_min = 0;
+ $tags_term = array ();
+ foreach ( array_keys ( $tags ) as $key ) {
+ if ($tags [$key] ["count"] > $count_max)
+ $count_max = $tags [$key] ["count"];
+ if ($tags [$key] ["count"] < $count_min || $count_min == 0)
+ $count_min = $tags [$key] ["count"];
+ $tags_term [] = strtolower ( $tags [$key] ["term"] );
+ }
+ array_multisort ( $tags_term, SORT_ASC, $tags );
+ $count_interval = $count_max - $count_min;
+ $level_limit = 5;
+
+ $font_max = $options [2];
+ $font_min = $options [3];
+ $font_ratio = ($count_interval) ? ($font_max - $font_min) / $count_interval : 1;
+
+ $tags_data = array ();
+ foreach ( array_keys ( $tags ) as $key ) {
+ $tags_data [] = array ("id" => $tags [$key] ["id"], "font" => ($count_interval) ? floor ( ($tags [$key] ["count"] - $count_min) * $font_ratio + $font_min ) : 12, "level" => empty ( $count_max ) ? 0 : floor ( ($tags [$key] ["count"] - $count_min) * $level_limit / $count_max ), "term" => $tags [$key] ["term"], "count" => $tags [$key] ["count"] );
+ }
+ unset ( $tags, $tags_term );
+ $block ["tags"] = & $tags_data;
+
+ $block ["tag_dirname"] = "tag";
+ if (! empty ( $modid )) {
+ $module_handler = & xoops_gethandler ( 'module' );
+ if ($module_obj = & $module_handler->get ( $modid )) {
+ $block ["tag_dirname"] = $module_obj->getVar ( "dirname" );
+ }
+ }
+ $flash_params = array ('flash_url' => XOOPS_URL . "/modules/tag/include/cumulus.swf",
+ 'width' => $options [4], 'height' => $options [5],
+ 'background' => preg_replace ( '/(#)/ie', '', $options [6] ),
+ 'color' => "0x" . preg_replace ( '/(#)/ie', '', $options [8] ), // 'hicolor' => "0x".preg_replace('/(#)/ie','',$options[9]),
+ 'speed' => $options [9] );
+
+ $output = '<tags>';
+ $xoops_url = XOOPS_URL;
+ foreach ( $tags_data as $term ) {
+ // assign font size
+ $output .= <<<EOT
+<a href='{$xoops_url}/modules/tag/view.tag.php?{$term['id']}' style='font-size: {$term['font']}px;'>{$term['term']}</a>
+EOT;
+ }
+ $output .= '</tags>';
+ $flash_params ['tags_formatted_flash'] = urlencode ( $output );
+ if ($options [7] === "transparent") {
+ $flash_params ['transparency'] = 'widget_so.addParam("wmode", "transparent");';
+ }
+ $block ["flash_params"] = $flash_params;
+ $cache->write($keysql, $block, 60*60);
+ return $block;
+
+}
+function tag_block_cumulus_edit($options) {
+error_reporting(E_ALL);
+ include_once (XOOPS_ROOT_PATH . "/class/xoopsformloader.php");
+ if (!class_exists("XoopsCumulusBlockForm")){
+ class XoopsCumulusBlockForm extends XoopsForm {
+
+ /**
+ * create HTML to output the form as a table
+ *
+ * @return string
+ */
+ function render() {
+ $ele_name = $this->getName ();
+ $ret = "
+ <div>
+ ";
+ $hidden = '';
+ foreach ( $this->getElements () as $ele ) {
+ if (! is_object ( $ele )) {
+ $ret .= $ele;
+ } elseif (! $ele->isHidden ()) {
+ if (($caption = $ele->getCaption ()) != '') {
+ $ret .= "<div class='xoops-form-element-caption" . ($ele->isRequired () ? "-required" : "") . "'>" . "<span class='caption-text'>{$caption}</span>" . "<span class='caption-marker'>*</span>" . "</div>";
+ }
+
+ $ret .= "<div style='margin:5px 0 8px 0; '>" . $ele->render () . "</div>\n";
+ } else {
+ $hidden .= $ele->render ();
+ }
+ }
+ $ret .= "</div>";
+ $ret .= $this->renderValidationJS ( true );
+ return $ret;
+ }
+ }}
+
+ $form = new XoopsCumulusBlockForm ( "", "", "" );
+ $form->addElement ( new XoopsFormText ( TAG_MB_ITEMS, "options[0]", 25, 25, $options [0] ) );
+ $form->addElement ( new XoopsFormText ( TAG_MB_TIME_DURATION, "options[1]", 25, 25, $options [1] ) );
+ $form->addElement ( new XoopsFormText ( TAG_MB_FONTSIZE_MAX, "options[2]", 25, 25, $options [2] ) );
+ $form->addElement ( new XoopsFormText ( TAG_MB_FONTSIZE_MIN, "options[3]", 25, 25, $options [3] ) );
+ $form->addElement ( new XoopsFormText ( TAG_MB_FLASH_WIDTH, "options[4]", 25, 25, $options [4] ) );
+ $form->addElement ( new XoopsFormText ( TAG_MB_FLASH_HEIGHT, "options[5]", 25, 25, $options [5] ) );
+ $form->addElement ( new XoopsFormColorPicker ( TAG_MB_FLASH_TRANSPARENCY, "options[6]", $options [6] ) );
+ $form_cumulus_flash_transparency = new XoopsFormSelect ( TAG_MB_FLASH_TRANSPARENCY, "options[7]", $options [7] );
+ $form_cumulus_flash_transparency->addOption ( 0, _NO );
+ $form_cumulus_flash_transparency->addOption ( "transparent", TAG_MB_FLASH_TRANSPARENT );
+ $form->addElement ( $form_cumulus_flash_transparency );
+ $form->addElement ( new XoopsFormColorPicker ( TAG_MB_FLASH_FONTCOLOR, "options[8]", $options [8] ) );
+ // $form->addElement(new
+ // XoopsFormColorPicker("cumulus_flash_hicolor","options[9]",$options[9]));
+ $form->addElement ( new XoopsFormText ( TAG_MB_FLASH_SPEED, "options[9]", 25, 25, $options [9] ) );
+
+ return $form->render ();
+}
+?>
\ No newline at end of file
Property changes on: XoopsModules/tag/branches/Arion92fr/tag/blocks/index.html
___________________________________________________________________
Added: svn:eol-style
+ native
Added: XoopsModules/tag/branches/Arion92fr/tag/changelog.txt
===================================================================
--- XoopsModules/tag/branches/Arion92fr/tag/changelog.txt (rev 0)
+++ XoopsModules/tag/branches/Arion92fr/tag/changelog.txt 2012-03-23 18:04:02 UTC (rev 9180)
@@ -0,0 +1,20 @@
+3.0 RC
+March 2012
+For Xoops 2.5
+Include Cumulus flash
+
+2.30 RC
+October 12th, 2008
+For XOOPS 2.3+
+
+2.0
+May 4th, 2008
+For XOOPS 2.3.0
+
+
+1.60
+Jan 3rd, 2007
+Added global search
+
+Oct 29th, 2006
+Minor bugfix by Gizmhail
\ No newline at end of file
Property changes on: XoopsModules/tag/branches/Arion92fr/tag/changelog.txt
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: XoopsModules/tag/branches/Arion92fr/tag/class/index.html
___________________________________________________________________
Added: svn:eol-style
+ native
Added: XoopsModules/tag/branches/Arion92fr/tag/class/link.php
===================================================================
--- XoopsModules/tag/branches/Arion92fr/tag/class/link.php (rev 0)
+++ XoopsModules/tag/branches/Arion92fr/tag/class/link.php 2012-03-23 18:04:02 UTC (rev 9180)
@@ -0,0 +1,79 @@
+<?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.
+*/
+
+/**
+ * XOOPS tag management module
+ *
+ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @since 1.0.0
+ * @author Taiwen Jiang <ph...@us...>
+ * @version $Id: link.php 2292 2008-10-12 04:53:18Z phppp $
+ * @package tag
+ */
+
+if (!defined("XOOPS_ROOT_PATH")) {
+ exit();
+}
+
+class TagLink extends XoopsObject
+{
+ /**
+ * Constructor
+ */
+ function TagLink()
+ {
+ $this->initVar("tl_id", XOBJ_DTYPE_INT, null, false);
+ $this->initVar("tag_id", XOBJ_DTYPE_INT, 0);
+ $this->initVar("tag_modid", XOBJ_DTYPE_INT, 0);
+ $this->initVar("tag_catid", XOBJ_DTYPE_INT, 0);
+ $this->initVar("tag_itemid", XOBJ_DTYPE_INT, 0);
+ $this->initVar("tag_time", XOBJ_DTYPE_INT, 0);
+ }
+}
+
+/**
+ * Tag link handler class.
+ * @package tag
+ *
+ * @author Taiwen Jiang <ph...@us...>
+ * @copyright copyright © The XOOPS Project
+ *
+ * {@link XoopsPersistableObjectHandler}
+ *
+ */
+
+class TagLinkHandler extends XoopsPersistableObjectHandler
+{
+ var $table_stats;
+
+ /**
+ * Constructor
+ *
+ * @param object $db reference to the {@link XoopsDatabase} object
+ **/
+ function TagLinkHandler(&$db)
+ {
+ $this->XoopsPersistableObjectHandler($db, "tag_link", "TagLink", "tl_id", "tag_itemid");
+ $this->table_stats = $this->db->prefix("tag_stats");
+ }
+
+ /**
+ * clean orphan links from database
+ *
+ * @return bool true on success
+ */
+ function cleanOrphan()
+ {
+ return parent::cleanOrphan($this->db->prefix("tag_tag"), "tag_id");
+ }
+}
+?>
\ No newline at end of file
Property changes on: XoopsModules/tag/branches/Arion92fr/tag/class/link.php
___________________________________________________________________
Added: svn:eol-style
+ native
Added: XoopsModules/tag/branches/Arion92fr/tag/class/tag.php
===================================================================
--- XoopsModules/tag/branches/Arion92fr/tag/class/tag.php (rev 0)
+++ XoopsModules/tag/branches/Arion92fr/tag/class/tag.php 2012-03-23 18:04:02 UTC (rev 9180)
@@ -0,0 +1,547 @@
+<?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.
+*/
+
+/**
+ * XOOPS tag management module
+ *
+ * @copyright The XOOPS project http://sourceforge.net/projects/xoops/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @since 1.0.0
+ * @author Taiwen Jiang <ph...@us...>
+ * @version $Id: tag.php 2292 2008-10-12 04:53:18Z phppp $
+ * @package tag
+ */
+
+if (!defined("XOOPS_ROOT_PATH")) {
+ exit();
+}
+
+class TagTag extends XoopsObject
+{
+ /**
+ * Constructor
+ *
+ * @param int $id ID of the tag, deprecated
+ */
+ function TagTag($id = null)
+ {
+ $this->initVar("tag_id", XOBJ_DTYPE_INT, null, false);
+ $this->initVar("tag_term", XOBJ_DTYPE_TXTBOX, "", true);
+ $this->initVar("tag_status", XOBJ_DTYPE_INT, 0);
+ $this->initVar("tag_count", XOBJ_DTYPE_INT, 0);
+ }
+}
+
+/**
+ * Tag object handler class.
+ *
+ * @author Taiwen Jiang <ph...@us...>
+ * @copyright copyright © The XOOPS Project
+ *
+ * {@link XoopsPersistableObjectHandler}
+ *
+ */
+
+class TagTagHandler extends XoopsPersistableObjectHandler
+{
+ var $table_link;
+ var $table_stats;
+
+ /**
+ * Constructor
+ *
+ * @param object $db reference to the {@link XoopsDatabase} object
+ **/
+ function TagTagHandler(&$db)
+ {
+ $this->XoopsPersistableObjectHandler($db, "tag_tag", "TagTag", "tag_id", "tag_term");
+ $this->table_link = $this->db->prefix("tag_link");
+ $this->table_stats = $this->db->prefix("tag_stats");
+ }
+
+ /**
+ * Get tags linked to an item
+ *
+ * @param integer $itemid item ID
+ * @param integer $modid module ID, optional
+ * @param integer $catid id of corresponding category, optional
+ * @return array associative array of tags (id, term)
+ */
+ function getByItem($itemid, $modid = 0, $catid = 0)
+ {
+ $ret = array();
+
+ $itemid = intval($itemid);
+ $modid = (empty($modid) && is_object($GLOBALS["xoopsModule"]) && "tag" != $GLOBALS["xoopsModule"]->getVar("dirname") ) ? $GLOBALS["xoopsModule"]->getVar("mid") : intval($modid);
+ if (...
[truncated message content] |