Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
5 - 4 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Better: Tag 2.30 RC - X-Forum Plugin
by wishcraft on 2010/1/16 5:45:46

This is the best iteration of the code for a TAG 2.3 RC Plugin for xforum..

<?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 <phppp@users.sourceforge.net> * @version $Id: xforum.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 xforum_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 xforum, so just skip it foreach (array_keys($items[$cat_id]) as $item_id) { // In xforum, the item_id is "topic_id" $items_id[] = intval($item_id); } } $item_handler =& xoops_getmodulehandler('post', 'xforum'); $text_handler =& xoops_getmodulehandler('text', 'xforum'); $items_obj = $item_handler->getObjects(new Criteria("post_id", "(" . implode(", ", $items_id) . ")", "IN"), true); $myts =& MyTextSanitizer::getInstance(); foreach (array_keys($items) as $cat_id) { foreach (array_keys($items[$cat_id]) as $item_id) { $item_obj =& $items_obj[$item_id]; if (is_object($item_obj)){ $text = $text_handler->getObjects(new Criteria("post_id", "('" . $item_id . "')", "IN"), false); if (is_object($text[0])) $post_text = $text[0]->getVar("post_text"); $items[$cat_id][$item_id] = array( "title" => $item_obj->getVar("subject"), "uid" => $item_obj->getVar("uid"), "link" => 'viewtopic.php?post_id='.$item_obj->getVar("post_id").'&topic_id='.$item_obj->getVar("topic_id").'#forumpost'.$item_obj->getVar("post_id"), "time" => strtotime(date(_DATESTRING,$item_obj->getVar("post_time"))), "tags" => tag_parse_tag($item_obj->getVar("tags", "n")), "content" => $myts->displayTarea($post_text,true,true,true,true,true,true) ); } } } unset($items_obj); } /** * Remove orphan tag-item links * * @return boolean * */ function xforum_tag_synchronization($mid) { $item_handler =& xoops_getmodulehandler("post", "xforum"); $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}.approved > 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.approved < 1" . " )"; endif; if (!$result = $link_handler->db->queryF($sql)) { //xoops_error($link_handler->db->error()); } } ?>
Re: Tag 2.30 RC - X-Forum Plugin
by Wondergnome on 2010/1/14 15:54:27

ok - now they do work.
I have tried so many things that I guess I can't tell you how I got it to work, but if I find out, I'll let you know.
I'll try and backtrack trough what I did and post it here.
Thanks again for all your help! Splendid!
Re: Tag 2.30 RC - X-Forum Plugin
by Wondergnome on 2010/1/14 15:20:19

thanks for all your help so far.

I have placed the php files in both locations with the names you suggested. In the forum module, I have a text box, just like the news module to add tags to a post.

When I'm back in the tag module, and I synchronise globally, still nothing happening. I can see the news module in the drop down list, but not the forum module.

This is on a clean install - right from XOOPS being installed.

I just don't think that it works. Thanks though for all your help.
Re: Tag 2.30 RC - X-Forum Plugin
by DarinAllan on 2010/1/14 4:07:17

Download the zip or tar from ghias link, when you extract it, you then need to rename the folder to tag the folder is not named correctly.

To be more clear

When you extract the archive, the name of the module folder is

xoops-module-tag-230-rc

this is wrong, it needs to be renamed to

tag

I don't know why that hasn't been fixed, but it doesn't appear to be fixed when I downloaded the archive and tried it just now.

Cheers
Re: Tag 2.30 RC - X-Forum Plugin
by ghia on 2010/1/14 1:07:49

Quote:
It does not find Tag 2.30 or XOOPS tags in the module repository
No, because there isn't one, but it finds the same News article as your Google search.
Quote:
It wouldn't install in 2.4.3
It does! o you have PHP 5?
Quote:
and left two "module not found" fields in my module list
Probably, because you have two plugins in /module/tag/plugin/ and not the associated modules.

Who's Online

212 user(s) are online (133 user(s) are browsing Support Forums)


Members: 0


Guests: 212


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits