xoops forums

Forum Index


Board index » All Posts (lunaticalm)




lunaticalm

Just popping in
Posted on: 2009/11/18 14:07
lunaticalm
lunaticalm (Show more)
Just popping in
Posts: 14
Since: 2005/1/4 1
#1

How can I add my criteria code to CriteriaCompo() in extcall module.

I have a code like this in extcall module
$now time();
$criteriaNoRecur = new CriteriaCompo();
$criteriaNoRecur->add(new Criteria('event_end'$now'>='));
$criteriaNoRecur->add(new Criteria('event_isrecur'0));

This produce MySQL select code like
OR (event_end >= $now AND event_isrecur 0in MySQL query filter.


How can I create criteria
I need to produce this code in MySQL query
AND (FIND_IN_SET($Today,REPLACE(event_recur_rules,'|',',')) AND event_isrecur 1)


e.g.

$Today substr(strtoupper(date('l')),0,2); 

$criteriaNo = new CriteriaCompo();
$criteriaNo->add(new Criteria('event_recur_rules'$Today'FIND_IN_SET'));//??????????
$criteriaNo->add(new Criteria('event_isrecur'1));


//event_recur_rules column has values like MO|TU|WE



$criteriaCompo = new CriteriaCompo();
$criteriaCompo->add($criteriaNoRecur'OR');
$criteriaCompo->add($criteriaNo'AND');


lunaticalm

Just popping in
Posted on: 2009/4/22 5:03
lunaticalm
lunaticalm (Show more)
Just popping in
Posts: 14
Since: 2005/1/4 1
#2

Re: Need help in kernel/member.php

Thank you very much ghia, phppp.

Quote:
$res = $xoopsDB->queryF($query);

This solved the code to work.
Many time i wondered what is the diference between query and queryF, now i know :).


lunaticalm

Just popping in
Posted on: 2009/4/21 22:07
lunaticalm
lunaticalm (Show more)
Just popping in
Posts: 14
Since: 2005/1/4 1
#3

Re: Need help in kernel/member.php

I added and global $xoopsDB; at the code and
at error msg i have
errorINSERT INTO myprefix_xoopsnotifications (not_modidnot_itemidnot_categorynot_eventnot_uidnot_modeVALUES (9,867,'scrap','new_scrap',867,0)


When i run that query with phpmyadmin the query is executed with no errors , and new record is inserted into the table


lunaticalm

Just popping in
Posted on: 2009/4/21 21:45
lunaticalm
lunaticalm (Show more)
Just popping in
Posts: 14
Since: 2005/1/4 1
#4

Re: Need help in kernel/member.php

Becouse the page is refrshing after activation, Yes i see the error if i ad exit() after echo "error: $query";

$xoopsDB->prefix is ok becouse that is pointing at my db prefix in databse, i can see that on the error , but can't understand what is causing the error.


lunaticalm

Just popping in
Posted on: 2009/4/21 20:40
lunaticalm
lunaticalm (Show more)
Just popping in
Posts: 14
Since: 2005/1/4 1
#5

Need help in kernel/member.php

Hi I want to add to function activateUser() a notification from one of the modules to be default checked for the registered users.
so I have added this to the activateUser() function, but i can't make this to insert value into xoopsnotifications table,

Please help me thanks.

function activateUser(&$user)
    {
        if (
$user->getVar('level') != 0) {
            return 
true;
        }

        
$user->setVar('level'1);

 
//notification mod start       
//module id =9 

  
$query "INSERT INTO ".$xoopsDB->prefix("xoopsnotifications")." (not_modid, not_itemid, not_category, not_event, not_uid, not_mode) VALUES (9,".$user->getVar('uid').",'scrap','new_scrap',".$user->getVar('uid').",0)";
$res=$xoopsDB->query($query);
if(!
$res) {
echo 
"error: $query";
}
//notification mod end


        
return $this->_uHandler->insert($usertrue);
    }


lunaticalm

Just popping in
Posted on: 2007/1/26 16:09
lunaticalm
lunaticalm (Show more)
Just popping in
Posts: 14
Since: 2005/1/4 1
#6

Re: Auth Module for wrapping HTML, PHP, CGI web site

Hi all,

Does anyone have a working link to download this module? All posted links are dead. Thanks!


lunaticalm

Just popping in
Posted on: 2006/1/20 13:51
lunaticalm
lunaticalm (Show more)
Just popping in
Posts: 14
Since: 2005/1/4 1
#7

Re: How to show right block in search.php

The right blocks will show in the search if i enable that in admin to show in all pages.
But i need the right block only in some modules and in the search.
The search is not presented as module in the admin blocks.
p.x. in the forum i dont want the right block
Is there way to call the right block from the search.php


lunaticalm

Just popping in
Posted on: 2006/1/19 20:36
lunaticalm
lunaticalm (Show more)
Just popping in
Posts: 14
Since: 2005/1/4 1
#8

How to show right block in search.php

Can i make to show the right block content in the search.php page?
Thank you.


lunaticalm

Just popping in
Posted on: 2006/1/15 2:26
lunaticalm
lunaticalm (Show more)
Just popping in
Posts: 14
Since: 2005/1/4 1
#9

Re: How to ? XoopsTree - makeMySelBox ORDER by A

Ok I dit that byt again the dropdown is not sorted by title ASC.
I have this
$mytreee = new XoopsTree($xoopsDB->prefix("table_links"),"lid","title");

Then i wrote instead
$mytreee->makeMySelBox("title","title");
this
$mytreee->makeMySelBox("title","title ASC");
The dropdown is ok by title is not sorted by title ASC

also i have make change to the
function makeMySelBox($title,$order="",$preset_id=0, $none=0, $sel_name="", $onchange="", $multiple=0)
to
function makeMySelBox($title,$order="title ASC",$preset_id=0, $none=0, $sel_name="", $onchange="", $multiple=0)
but again the title of my dropdown is not sorted bu the title ASC.


lunaticalm

Just popping in
Posted on: 2006/1/4 12:57
lunaticalm
lunaticalm (Show more)
Just popping in
Posts: 14
Since: 2005/1/4 1
#10

Re: How to ? XoopsTree - makeMySelBox ORDER by A

Thank you wery much



TopTop
(1) 2 »