1
lunaticalm
How can I add my criteria code to CriteriaCompo() in extcall module.
  • 2009/11/18 14:07

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


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');



2
lunaticalm
Re: Need help in kernel/member.php
  • 2009/4/22 5:03

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


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 :).



3
lunaticalm
Re: Need help in kernel/member.php
  • 2009/4/21 22:07

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


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



4
lunaticalm
Re: Need help in kernel/member.php
  • 2009/4/21 21:45

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


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.



5
lunaticalm
Need help in kernel/member.php
  • 2009/4/21 20:40

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


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);
    }



6
lunaticalm
Re: Auth Module for wrapping HTML, PHP, CGI web site
  • 2007/1/26 16:09

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


Hi all,

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



7
lunaticalm
Re: How to show right block in search.php
  • 2006/1/20 13:51

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


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



8
lunaticalm
How to show right block in search.php
  • 2006/1/19 20:36

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


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



9
lunaticalm
Re: How to ? XoopsTree - makeMySelBox ORDER by A
  • 2006/1/15 2:26

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


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.



10
lunaticalm
Re: How to ? XoopsTree - makeMySelBox ORDER by A
  • 2006/1/4 12:57

  • lunaticalm

  • Just popping in

  • Posts: 14

  • Since: 2005/1/4 1


Thank you wery much




TopTop
(1) 2 »



Login

Who's Online

249 user(s) are online (157 user(s) are browsing Support Forums)


Members: 0


Guests: 249


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