1
angelomorto
Problem whit TAG module

Hi,
I have a problem with the form of tags and smartsection, this is my
configuration:
Xoops 2.4.4
TAG 2.3
Smartsection 2.14

With Smartsection I can publish an article
post-date, that will be visible from a determintat date. Now, the problem is the form of TAG, which if you put a tag in this article, even if the item is not visible in Smartsection, however, is visible in the form of TAG, because it does not take into account the date of publication.

How can I hide the contents of the tag post-dated?

2
voltan
Re: Problem whit TAG module
  • 2011/4/1 17:22

  • voltan

  • Theme Designer

  • Posts: 724

  • Since: 2006/12/5


hello

you must edit tag plugin in smartsection/include/plugin.tag.php

<?php
/**
* $Id: plugin.tag.php 331 2007-12-23 16:01:11Z malanciault $
* Module: SmartSection
* Author: The SmartFactory <www.smartfactory.ca>
* Licence: GNU
*/

if (!defined("XOOPS_ROOT_PATH")) {
    die(
"XOOPS root path not defined");
}

/** Get item fields: title, content, time, link, uid, uname, tags **/
function smartsection_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);
        }
    }
    
$item_handler =& xoops_getmodulehandler("item""smartsection");
    
$criteria = new Criteria("itemid""(".implode(", "$items_id).")""IN");
    
$items_obj $item_handler->getObjects($criteria'itemid');

    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("title"),
                
"uid"        => $item_obj->getVar("uid"),
                
"link"        => "item.php?itemid={$item_id}",
                
"time"        => $item_obj->getVar("datesub"),
                
"tags"        => tag_parse_tag($item_obj->getVar("item_tag""n")), // optional
                
"content"    => "",
                );
        }
    }
    unset(
$items_obj);
}
/** Remove orphan tag-item links **/
function smartsection_tag_synchronization($mid)
{
    
// Optional
}

?>


in line 37 change :

"time"        => $item_obj->getVar("datesub"),

to
"time"        => "",

3
angelomorto
Re: Problem whit TAG module

Hi Voltan,
your solution does not work.
I recommend that users read the post, not to edit the file smartsection/include/plugin.tag.php but to edit the file

modules/tag/view.tag.php at line
$limit  = empty($tag_config["items_perpage"]) ? 10 $tag_config["items_perpage"]; 
$sort   "time"
$order  "DESC"

$criteria = new CriteriaCompo(new Criteria("o.tag_id"$tag_id));


add

$now time(); 
$criteria->add(new Criteria('o.tag_time'$now'<='));


this is the result

$limit  = empty($tag_config["items_perpage"]) ? 10 $tag_config["items_perpage"]; 
$sort   "time"
$order  "DESC"

$criteria = new CriteriaCompo(new Criteria("o.tag_id"$tag_id)); 
$now time(); 
$criteria->add(new Criteria('o.tag_time'$now'<=')); 
$criteria->setSort($sort); 
$criteria->setOrder($order); 
$criteria->setStart($start); 
$criteria->setLimit($limit);




Login

Who's Online

197 user(s) are online (166 user(s) are browsing Support Forums)


Members: 0


Guests: 197


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits