xoops forums

Wondergnome

Just popping in
Posted on: 2010/1/13 13:24
Wondergnome
Wondergnome (Show more)
Just popping in
Posts: 10
Since: 2009/4/23
#11

Re: Tag 2.30 RC - X-Forum Plugin

it works in my news module, but I can't get it working with x-forum and I'm running XOOPS 2.4.3...

ghia

Community Support Member
Posted on: 2010/1/13 14:32
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#12

Re: Tag 2.30 RC - X-Forum Plugin

Did you synchronize?
Quote:
/modules/X-Forum/include/plugin.tag.php
(not sure for the correct module directory name)

Alternate location to
/modules/xforum/include/plugin.tag.php
is
/modules/tag/plugin/xforum.php

Quote:
Ridiculous!

You can't find it searching the site.
Altough tag itself is a short and often used word, it is not so dificult to find the module in question.

chefry

Home away from home
Posted on: 2010/1/13 19:25
chefry
chefry (Show more)
Home away from home
Posts: 1005
Since: 2006/10/14
#13

Re: Tag 2.30 RC - X-Forum Plugin

That search produces plugins for newbb and x-forum.

It does not find Tag 2.30 or XOOPS tags in the module repository

It wouldn't install in 2.4.3 and left two "module not found" fields in my module list, and they can't be deleted

sailjapan

Moderator
Posted on: 2010/1/13 23:03
sailjapan
sailjapan (Show more)
Moderator
Posts: 1672
Since: 2005/11/16
#14

Re: Tag 2.30 RC - X-Forum Plugin

Quote:
It does not find Tag 2.30


I found it in Ghia's search results.

ghia

Community Support Member
Posted on: 2010/1/14 1:07
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#15

Re: Tag 2.30 RC - X-Forum Plugin

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.

DarinAllan

Friend of XOOPS
Posted on: 2010/1/14 4:07
DarinAllan
DarinAllan (Show more)
Friend of XOOPS
Posts: 477
Since: 2005/5/18
#16

Re: Tag 2.30 RC - X-Forum Plugin

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

Wondergnome

Just popping in
Posted on: 2010/1/14 15:20
Wondergnome
Wondergnome (Show more)
Just popping in
Posts: 10
Since: 2009/4/23
#17

Re: Tag 2.30 RC - X-Forum Plugin

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.

Wondergnome

Just popping in
Posted on: 2010/1/14 15:54
Wondergnome
Wondergnome (Show more)
Just popping in
Posts: 10
Since: 2009/4/23
#18

Re: Tag 2.30 RC - X-Forum Plugin

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!

wishcraft

Module Developer
Posted on: 2010/1/16 5:45
wishcraft
wishcraft (Show more)
Module Developer
Posts: 3710
Since: 2007/5/18
#19

Better: Tag 2.30 RC - X-Forum Plugin

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& ...  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_comparemysql_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());
    
}
}
?>