Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ItemManager 2.0
shrug* I'm glad to see that it's working for you now, but I didn't changed anything. Please delete the Util::dataLog() calls in /plugins/imanager/lib/CategoryProcessor.php file, and remove the log file output your postet, because everybody can see your server paths there. ;-)
Reply
(2017-04-05, 20:59:55)Bigin Wrote: shrug* I'm glad to see that it's working for you now, but I didn't changed anything. Please delete the Util::dataLog() calls in /plugins/imanager/lib/CategoryProcessor.php file, and remove the log file output your postet, because everybody can see your server paths there. ;-)

Smile))) Very strange. Smile)))))))
I still think the reason is in sessions.
Reply
Fantastic plug-in Smile

but I have problem return items between 2 date

PHP Code:
$simpleItems $itemMapper->getSimpleItems('active=1 && mydate>1504216800 && mydate<1506895140'); 
I'm try this..... but getSimpleItems() accepted only first mydate.

Please help 
Thanks
Reply
Hi angelo,

thanks.
Here was an issue when selecting "SimpleItem" objects. Therefore I recommend you to pull ItemManager from Github master repository https://github.com/bigin/ItemManager_2.0. Or just download the ZIP file from master and upgrade your installed version to the new one. Upgrading from one version of ItemManager to another is a matter of replacing these files and directories from your old version, and putting in fresh copies from the new version:

/plugins/imanager/ (complete folder)
/plugins/imanager.php (file)

For complex queries that contain multiple selectors (more than 2, there you use 3) is recommended to split them into several parts, here's an example:

PHP Code:
$activeItems $itemMapper->getSimpleItems('active=1');
$resultItems $itemMapper->getSimpleItems('mydate>1504216800 && mydate<1506895140'00$activeItems); 


Please also note the following, if you want to select SimpleItems within a specific date, including the date you have written in your selector example, then you should use ">=" and "<=" operators. So your query should then look like this:

PHP Code:
$activeItems $itemMapper->getSimpleItems('active=1');
$resultItems $itemMapper->getSimpleItems('mydate>=1504216800 && mydate<=1506895140'00$activeItems); 
Reply
(2017-09-19, 18:22:13)Bigin Wrote: Hi angelo,

thanks.
Here was an issue when selecting "SimpleItem" objects. Therefore I recommend you to pull ItemManager from Github master repository https://github.com/bigin/ItemManager_2.0. Or just download the ZIP file from master and upgrade your installed version to the new one. Upgrading from one version of ItemManager to another is a matter of replacing these files and directories from your old version, and putting in fresh copies from the new version:

/plugins/imanager/ (complete folder)
/plugins/imanager.php (file)

For complex queries that contain multiple selectors (more than 2, there you use 3) is recommended to split them into several parts, here's an example:

PHP Code:
$activeItems $itemMapper->getSimpleItems('active=1');
$resultItems $itemMapper->getSimpleItems('mydate>1504216800 && mydate<1506895140'00$activeItems); 


Please also note the following, if you want to select SimpleItems within a specific date, including the date you have written in your selector example, then you should use ">=" and "<=" operators. So your query should then look like this:

PHP Code:
$activeItems $itemMapper->getSimpleItems('active=1');
$resultItems $itemMapper->getSimpleItems('mydate>=1504216800 && mydate<=1506895140'00$activeItems); 

Wau .... thank you. worked perfect 
...but when add $start and $end parameter  getSimpleItems() not work

PHP Code:
$month 9;
$year  2017;
$start mktime(001$month1$year);
$end   mktime(235900$monthdate('t'$month), $year);

$activeItems $itemMapper->getSimpleItems('active=1');
$resultItems $itemMapper->getSimpleItems('mydate>='.$start.'&& mydate<='.$end00$activeItems);
$items       $itemMapper->filterSimpleItems('mydate''ASC','' ,'',$resultItems); 
Reply
That should work unless you have a mistake somewhere else.

I have just tested this snippet locally and it all seems to work:

PHP Code:
$date = new DateTime('2017-08-31 22:00:01');
$start $date->getTimestamp();

$date = new DateTime('2017-10-01 23:59:00');
$end $date->getTimestamp();

$activeItems $itemMapper->getSimpleItems('active=1');
$resultItems $itemMapper->getSimpleItems("mydate>=$start && mydate<=$end"00$activeItems);
$filteredItems $itemMapper->filterSimpleItems('mydate''ASC'0$resultItems);

Util::preformat($filteredItems); 
Reply
(2017-09-19, 23:31:33)Bigin Wrote: That should work unless you have a mistake somewhere else.

I have just tested this snippet locally and it all seems to work:

PHP Code:
$date = new DateTime('2017-08-31 22:00:01');
$start $date->getTimestamp();

$date = new DateTime('2017-10-01 23:59:00');
$end $date->getTimestamp();

$activeItems $itemMapper->getSimpleItems('active=1');
$resultItems $itemMapper->getSimpleItems("mydate>=$start && mydate<=$end"00$activeItems);
$filteredItems $itemMapper->filterSimpleItems('mydate''ASC'0$resultItems);

Util::preformat($filteredItems); 

I am thoroughly tested and still not worked. ItemManager v 2.4.0 from http://get-simple.info/

$activeItems -> return all items when active=1 
$resultItems -> return all items between 2 dates but ignore $activeItems, (return all active=1 and active=0 items)
$filteredItems -> worked fine 

but I try ItemManager v 2.4.0 from https://github.com/bigin/ItemManager_2.0
All worked fine Smile))

Please compare this version.

Thanks
Reply
Yes, as I mentioned before, the version from "extend" has an issue when rekursive selectig SimpleItem objects. This will be updated soon
Reply




Users browsing this thread: 1 Guest(s)
Free HDTV Channels Residential Solar Panels