Xuups
Get an account!     Login

Utilities

Related projects

Who's Online

5 user(s) are online (3 user(s) are browsing Forum)

Members: 0
Guests: 5

more...

Download the latest releases

   All Posts


(1) 2 3 4 ... 19 »


Re: Smartsection plugin for Mycomments
Moderator
Joined:
4/7 0:30
From Portugal
Group:
Webmasters
Registered Users
Posts: 79
Offline
Your plugin is fine, I just used the object because the item path or category path may change if you are using SEO.
And I took the opportunity to learn something more about smartsection. Smartfactory rocks!

Posted on: Today 0:59
Transfer the post to other applications Transfer


Re: Smartsection plugin for Mycomments
Moderator
Joined:
6/2 19:00
Group:
Webmasters
Registered Users
Posts: 2
Offline
your plugin tested and it is working fine

Posted on: Today 0:40
Transfer the post to other applications Transfer


Re: Smartsection plugin for Mycomments
Moderator
Joined:
6/2 19:00
Group:
Webmasters
Registered Users
Posts: 2
Offline
WOW!

I just made one now after I sent message to you based on your news plugin and it is working 100%

<?php
//  Author: Mowaffak
//  URL: http://www.arabxoops.com
//  E-Mail: arabxoops@yahoo.com

function smartsection_useritems($uid$limit=0$offset=0)
{
    global 
$xoopsDB;
    
$ret = array();

    
$sql "SELECT itemid FROM ".$xoopsDB->prefix("smartsection_items")." WHERE status=2 AND uid=".$uid;
    
$result $xoopsDB->query($sql$limit$offset);
    if ( 
$result ) {
        while (
$row $xoopsDB->fetchArray($result)){
          
$ret[] = $row['itemid'];
        }
    }
    return 
$ret;
}

function 
smartsection_iteminfo($items$limit=0$offset=0)
{
    global 
$xoopsDB;
    
$ret = array();
    
$URL_MOD XOOPS_URL."/modules/smartsection";

    
$sql "SELECT s.itemid, s.title, s.status, s.body, s.dohtml, s.dosmiley, s.datesub, s.uid, s.counter, s.comments, t.categoryid, t.name
    FROM "
.$xoopsDB->prefix("smartsection_items")." s, ".$xoopsDB->prefix("smartsection_categories")." t
    WHERE s.categoryid=t.categoryid
    AND s.itemid IN ("
.implode(',',$items).")
    AND s.status=2
    ORDER BY s.datesub DESC"
;
    
$result $xoopsDB->query($sql$limit$offset);

    
$i 0;
    while(
$row $xoopsDB->fetchArray($result)){
        
$storyid $row['storyid'];
        
$ret[$i]['link']     = $URL_MOD."/item.php?itemid=".$storyid;
        
$ret[$i]['pda']      = $URL_MOD."/print.php?itemid=".$storyid;
        
$ret[$i]['cat_link'] = $URL_MOD."/category.php?categoryid=".$row['categoryid'];
        
$ret[$i]['title'] = $row['title'];
        
$ret[$i]['time']  = $row['datesub'];
        
// uid
        
$ret[$i]['uid'] = $row['uid'];
        
// category
        
$ret[$i]['cat_name'] = $row['name'];
        
// counter
        
$ret[$i]['hits'] = $row['counter'];
        
$ret[$i]['replies'] = $row['comments'];
        
// description
        
$myts =& MyTextSanitizer::getInstance();
        
$html   0;
        
$smiley 0;
        
$xcodes 0;
        if ( 
$row['dohtml'] )   $html   1;
        if ( 
$row['dosmiley'] ) $smiley 1;
        
$ret[$i]['description'] = $myts->displayTarea($row['body'], $html$smiley$xcodes);
        
$i++;
    }

    return 
$ret;
}

?>


I will use your plugin but please check my plugin


Posted on: Today 0:36
Transfer the post to other applications Transfer


Smartsection plugin for Mycomments
Moderator
Joined:
4/7 0:30
From Portugal
Group:
Webmasters
Registered Users
Posts: 79
Offline
Here is a plugin for smartsection requested by Mowaffak:

Create a file named 'smartsection.php' under the plugins folder.
Paste this:
<?php
//  Author: Trabis
//  URL: http://www.xuups.com
//  E-Mail: lusopoemas@gmail.com

function smartsection_useritems($uid$limit=0$offset=0)
{
    global 
$xoopsDB;
    
$ret = array();

    
$sql "SELECT itemid FROM ".$xoopsDB->prefix("smartsection_items")." WHERE datesub<=".time()." AND status=2 AND uid=".$uid;
    
$result $xoopsDB->query($sql$limit$offset);
    if ( 
$result ) {
        while (
$row $xoopsDB->fetchArray($result)){
          
$ret[] = $row['itemid'];
        }
    }
    return 
$ret;
}

function 
smartsection_iteminfo($items$limit=0$offset=0)
{
    global 
$xoopsDB;
    
$ret = array();
    
    
$URL_MOD XOOPS_URL."/modules/smartsection";
    
$criteria = new Criteria('itemid','(' implode(',',$items) . ')''IN');
    
$smartsection_item_handler =& xoops_getmodulehandler('item','smartsection');
    
$itemsObjs $smartsection_item_handler->getItems($limit$offset, array(_SSECTION_STATUS_PUBLISHED), -1'datesub''DESC'''true$criteriatrue);

    
$i 0;
    if (
count($itemsObjs) > 0) {
    foreach (
$itemsObjs as $itemid => $obj){
        
$ret[$i]['link']     = $obj->getItemUrl();
        
$ret[$i]['pda']      = '';
        
$ret[$i]['cat_link'] = $obj->getCategoryUrl();
        
$ret[$i]['title'] = $obj->title();
        
$ret[$i]['time']  = $obj->getVar('datesub');  //must go as timestamp
        // uid
        
$ret[$i]['uid'] = $obj->uid();
        
// category
        
$ret[$i]['cat_name'] = $obj->getCategoryName();
        
// counter
        
$ret[$i]['hits'] = $obj->counter();
        
$ret[$i]['replies'] = $obj->comments();
        
// description
        
$myts =& MyTextSanitizer::getInstance();
        
$ret[$i]['description'] = $myts->displayTarea($obj->summary(), $obj->dohtml(), $obj->dosmiley(), $obj->doxcode());
        
$i++;
    }
    }
    return 
$ret;
}

?>


Any bug please report, thanks.

Posted on: Today 0:05
Transfer the post to other applications Transfer


Re: [Request] - Plugins for MyPoints
Moderator
Joined:
4/7 0:30
From Portugal
Group:
Webmasters
Registered Users
Posts: 79
Offline
Yes Giba, that is it.

(Ainda não vi o que se passa com as notificações )

Posted on: 11/12 13:29
Transfer the post to other applications Transfer


Re: [Request] - Plugins for MyPoints
Not too shy to talk
Joined:
6/2 10:57
Group:
Registered Users
Posts: 29
Offline
Very good. 1st world

Please, I will pass what I see.
You're talking about we can have the plug-in 2 places. We put the folder inside the module and also within imlinks plugins myPoints. If both do not cause any problem right?
I am asking McDonald to look at this.

[pt-br]
Por favor, vou passar o que entendi.
Você está falando que podemos ter o plugin em 2 locais. Podemos colocar dentro da pasta do módulo imlinks e também dentro de plugins myPoints. Se ambos existirem não causará problema certo ?
Estou solicitando a McDonald para olhar sobre isto.
[/pt-br]

Moment Zen (notifications)

Forum não gosta de enviar notificações
[v] Notify me of new posts in this thread ...

Posted on: 11/12 8:13
Transfer the post to other applications Transfer


Re: [Request] - Plugins for MyPoints
Moderator
Joined:
4/7 0:30
From Portugal
Group:
Webmasters
Registered Users
Posts: 79
Offline
Imlinks and wflinks use the same table structure as xoopstube so we can start by looking at the xoopstube plugin.

What we need to do is to create the file
mypoints/plugins/imlinks.php
You can also place the plugin inside thee module folder as:
imlinks/include/mypoints.plugin.php

Then we need to add 2 functions into it:
imlinks_useritems_count (count links submitted)
and
imlinks_uservotes_count (count votes on links)

both of them will recieve as paramater the uid of the user and the timestamp for the start date and must return the number of items found.

So for imlinks we will have this plugin(imlinks.php):
<?php
//  Author: Trabis
//  URL: http://www.xuups.com
//  E-Mail: lusopoemas@gmail.com

function imlinks_useritems_count($uid$since)
{
    global 
$xoopsDB;
    list(
$ret) = $xoopsDB->fetchRow($xoopsDB->query("SELECT  COUNT(*)  FROM ".$xoopsDB->prefix("imlinks_links")." WHERE (submitter ='$uid' AND date > '$since') AND status > '0'"));
    return 
$ret;
}

function 
imlinks_uservotes_count($uid$since)
{
    global 
$xoopsDB;
    list(
$ret) = $xoopsDB->fetchRow($xoopsDB->query("SELECT  COUNT(*)  FROM ".$xoopsDB->prefix("imlinks_votedata")." WHERE ratinguser ='$uid' AND ratingtimestamp > '$since'"));
    return 
$ret;
}
?>


Easy!

Posted on: 11/11 22:16
Transfer the post to other applications Transfer


[Request] - Plugins for MyPoints
Not too shy to talk
Joined:
6/2 10:57
Group:
Registered Users
Posts: 29
Offline
Given its orientation, I am requesting the opportunity to add plug-in for the module imlinks.
It would be an interesting step by step based on this plugin to Devs can create others.

Posted on: 11/11 8:55
Transfer the post to other applications Transfer


Re: Encoding problem with mytabs
Moderator
Joined:
4/7 0:30
From Portugal
Group:
Webmasters
Registered Users
Posts: 79
Offline
Have you upgraded to xoops 2.3 recently?
There are several sites using mytabs in chinese, arabic, persian, portuguese and I never met this problem before.


Posted on: 11/11 0:13
Transfer the post to other applications Transfer


Re: [RoadMap] - My points 1.0 - Feature Requests / Tests and feedback
Moderator
Joined:
4/7 0:30
From Portugal
Group:
Webmasters
Registered Users
Posts: 79
Offline
Thanks Giba! I´ll check that

Posted on: 11/10 23:54
Transfer the post to other applications Transfer



 Top
(1) 2 3 4 ... 19 »




Login

Username:

Password:

Remember me



Lost Password?

Register now!

Ajax Search


Advanced Search

Newest Posts