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
Here's an alpha version of ItemManager-3 for curious and open-minded people:
https://gitlab.com/bigin1/imanager

Please don't try to use temManager-3-alpha above the IM 2.* , it won't work.
Reply
Hey Bigin, i just found your plugin and i'm sure it's the one i've been looking for a long time Wink

Can you please help my to get the following idea working:

PHP Code:
<?php
  $manager 
= new IManager();
 
 $categoryClass $manager->getCategoryClass();
 
 $itemClass $manager->getItemClass();

 
 $category $categoryClass->getCategory(1);
 
 $itemClass->init($category->get('id'));
 
 $items $itemClass->getItems(1'active=1');

 
 foreach($items as $item) {
 
   $image      $item->fields->profilbild->imagefullurl[1];
 
   $name       $item->fields->name->value;
 
   $instrument $item->fields->instrument->value;
 
 };
?>


Thanks a lot for your work!!
Reply
Hello Fabmue,

hmm, hard to say, I don't really know what your idea is, it depends on what you want to do with your item data, whether you want to display it or process it further, and so on. If you just want to display them, better do it with "SimpleItem" objects, it's easy:

PHP Code:
$imanager imanager();
$mapper $imanager->getItemMapper();
// change 5 to your category id
$mapper->alloc(5);
foreach(
$mapper->simpleItems as $item) {
    echo 
'<img src="'.$item->profilbild[0].'">';
    echo 
"<h3>$item->name</h3>";
    echo 
"<p>$item->instrument</p>";

Reply
(2018-02-13, 17:10:09)Bigin Wrote: Hello Fabmue,

hmm, hard to say, I don't really know what your idea is, it depends on what you want to do with your item data, whether you want to display it or process it further, and so on. If you just want to display them, better do it with "SimpleItem" objects, it's easy:

PHP Code:
$imanager imanager();
$mapper $imanager->getItemMapper();
// change 5 to your category id
$mapper->alloc(5);
foreach(
$mapper->simpleItems as $item) {
 echo 
'<img src="'.$item->profilbild[0].'">';
 echo 
"<h3>$item->name</h3>";
 echo 
"<p>$item->instrument</p>";


It works perfectly!! Thank you so much Smile
Reply
One more question: when I use
PHP Code:
.$item->profilbild[0]. 
I get http://www.mydomain.com/PATH-TO-IMG. But if I'm not on the index page, it dosn't work, because the link is now http://www.mydomain.com/PAGENAME/PATH-TO-IMG.

Is there a chance to get the absolute img path? I think that would fix the problem.

Thanks!
Reply
Use constant:
PHP Code:
echo '<img src="'.IM_SITE_URL.$item->profilbild[0].'">'
;-)
Reply
(2018-02-14, 05:11:45)Bigin Wrote: Use constant:
PHP Code:
echo '<img src="'.IM_SITE_URL.$item->profilbild[0].'">'
;-)

brilliant!
Reply




Users browsing this thread: 1 Guest(s)