Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ItemManager 2.0
Hi Felix,

I think this is just a target value, it has default to a maximum of 200 px width, depending on the image size and orientation.

As far as I can remember UploadHandler uses these config values "thumbwidth" and "thumbheight" to resize images. You can retrieve them like this:
PHP Code:
$config imanager('config');
Util::preformat($config->backend->thumbwidth);
// ... 

Unfortunately, ItemManager 2 doesn't have an API to write the configuration directly, but that's not a problem since you can use default GS's SimpleXML method to overwrite it (not tested!):

PHP Code:
imanager();
$config simplexml_load_file(IM_CONFIG_FILE);

// Whatever maximum value you want
$config->backend->thumbwidth 50;
$config->backend->thumbheight 50;
XMLsave($configIM_CONFIG_FILE); 

Note that the values would only apply to new uploads, the images that are already loaded will not be resized.
Reply
Hi Bigin,

I just uploaded my first theme: >>> ItemManager-Theme
Reply
Hi,
After my first steps with the ItemManager v2.4.6 plugin I came up with a usable workflow
that seems practical enough to work with
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

 ItemManager work flow to manage pages in a website

 1) Create a category: site-pages.
      In this category you create items that represent and hold the content for each website page.

 2) For each website page,  create an item such as: home-page,  about-page, contact-page, etc.

 3) You can also create an item for the sidebar.

 4) Create a category: gallery. In this category you create 2 items that represent the pictures and the script files.

      gallery item-1    gallery-pictures, for managing the pictures and each picture title or caption.
      gallery item-2    gallery-files, for managing the css and js scripts needed for the gallery to work.

 5) Create a category: album. In this category you create items that represent and hold the content
      for the pictures in each album.

 6) In the functions.php file create your functions and logic to output the content for the pages.
     Note that you can make use of both the GS api and the ItemManager api.

    The use of functions in your functions.php file has 3 advantages:

 a) it can wrap your output in any html you want for local layout and style (Generate markup)
      you can do this with the simple use of <?php echo "your html here"; ?>

 b) you can use both the GS api and the ItemManager api in the same function        

 c) it let's you easy separate logic from html layout in your page template files,
      in the template files layout all you need is <?php your-function(); ?>

 ItemManager automatically creates the folder structure where the content for each page (item) is stored.
 From the manager TAB in the GS backend you can manage all the categories, items, fields, etc.

F.
Reply
Hello Felix,

yeah, this is an example of direct application. However, remember that the main purpose of ItemManager is to provide a basis for the development of user-friendly plugins and the direct application can be quite cumbersome.
Reply
Quote:... direct application can be quite cumbersome ...

I took it one step further and follow the amazing concept of the processwire cms/cmf where "everything is a page"
ItemManager allows to work with the same concept where "everything is a category"
Works great.
Reply
You got it, it's a similar concept or rather has certain parallels with it, yes
Reply
Hi,
I want to make my own Guestbook for websites. It is hard to find a good one
that also has the option to upload a picture with a post. The only one I
have ever found with that option is Lazarus Guestbook. The problem is that
I have to use an iframe to use it in a website. I want to have such a Guestbook
work directly in a website without the use of an iframe or include.
I want to use ItemManager to make this work a Guestbook where visitors
can write a post including a smiley and a picture. Can you give me advice
or point me in the right direction with ItemManager ? Thanks.
Reply
Hello Felix,

that with image upload, could be tricky, the other stuff should not be very difficult to realize. The simplest way, just use ImForms with a custom processor, I already gave you a link how it works.

But, since you're going to write your own plugin anyway, still the best recommendation I can give you: Switch to IM3, it'll save you a lot of work and you'll be able to upload pictures in a few minutes.

Anyway, I will support you in the process of development ;-)
Reply
Hi Bigin,

Thanks for your reply. Ok you convinced me to learn IM3 and ImForms.
Highly appreciated for offering support with this project since I
can't read code as easy as a sunday morning newspaper Smile Maybe the
plugin could be donated to the GS library. I have no hurry with it.
I will start Sunday collecting and write startup mockup scripts.
F.
Reply
Hi,
I started to learn ItemManager 3

I am following the Image Gallery example here:
https://im.ehret-studio.com/tuts/itemman...e-gallery/

I have set it up and uploaded it here:
http://gallery.showme.zone/

I have initiated the ItemManager here:
http://gallery.showme.zone/initiate.php

This is the login page:
http://gallery.showme.zone/login.php
Name = Name
Pass = 123456

When I try to upload a picture I get this error:
Error: The field value could not be set

I cannot find what is wrong, can you help ?
F.
Reply
Hi Felix,

unfortunately I am not able to give you a direct reply at the moment, so it will be a little short today, but I will be back on Sunday or Monday at the latest, and I will help you then.

Several factors can can play a role, especially take note of the naming of the fields. What is the name of your FileUpload field, same as in the example "images"? You should also check the logs under /data/logs/, sometimes you can find more information there.
Reply
Hi Bigin,

Because this is ItemManager 3, maybe this should have it's own thread ?

F.
Reply
I'm back now, I'm going to look into your problem. Ohh and right at the beginning: You should always get the latest master version from GitHub. The current one is 3.1.6. because I fail to keep track of the releases ;-)


(2020-08-07, 18:25:28)Felix Wrote: Because this is ItemManager 3, maybe this should have it's own thread ?

Let's start here, see how it progresses. Maybe I'll make a separate thread for it.
Reply
Hello Felix, 

the Gallery tutorial was out of date, I have corrected the problems, please check it again with 3.1.6 - thank you for your help!
Reply
Hi Bigin,

Thanks for coming back on it today, appreciate it.

I updated to itemmanager 3.1.6 and updated the tuto php files.

Next I had issues with Options -Indexes and Options +SymLinksIfOwnerMatch
in the framework .htaccess file, it blocked the gallery pictures.

I had to comment them out:
#Options -Indexes
#Options +SymLinksIfOwnerMatch

I guess this is hosting dependent.

F.
Reply
Hi,

I have the IM3 gallery working. The IM3 gallery tuto is great for
getting more familiar with the IM3 api.

I have uploaded the IM3 gallery here:

http://gallery.showme.zone/

F.
Reply
Great, if you have questions about the IM3 code, just ask ;-)
Reply
(2020-08-11, 07:09:31)Felix Wrote: I had to comment them out:
#Options -Indexes
#Options +SymLinksIfOwnerMatch

I guess this is hosting dependent.

Hello Felix,

try to remove the comment in this line:

# Options +SymLinksifOwnerMatch
Reply
Quote:Great, if you have questions about the IM3 code, just ask ;-)

There are many drag and drop uploaders out there like dropzone etc.
Here is a good tuto about it:
https://artisansweb.net/drag-drop-file-u...cript-php/

But of course it would be cool to make a drag and drop uploader
with IM3 handling the upload and storage.

How to start this using IM3. Is there example code for this with IM3 ?

F.
Reply
Hi,
IM2 and IM3 already supports drag and drop (IM2 since 8 years). Instead of selecting, just drop your image(s) onto the area. But, you can mark it with CSS or add an additional information if you like.
Reply
Hi,

I am trying to include IM3 with Get-Simple CMS 3.3.16

I have IM3 inside GS CMS folder: data/framework/imanager.php

I have a test image 01.jpg in 2 locations:

This location shows the picture:

<img src="<?php get_site_url(); ?>data/uploads/01.jpg">

This location does not show the picture:

<img src="<?php get_site_url(); ?>data/framework/data/uploads/1.1.1/01.jpg">

Is this because a permission needs to be set somewhere for IM3 ?

===================================================

imanager.php needs to be included to have access to the IM3 api

I have IM3 inside GS CMS folder: data/framework/imanager.php

What is the correct way to include imanager.php in the GS CMS function.php file ?

Is this correct inside the GS CMS function.php file ?

<?php
include get_site_url(false) . 'data/framework/imanager.php';
...
...
?>

===================================================

I have this for each loop in my home.php template file:

Code:
<?php
if($item && $item->images) {
foreach($item->images as $image) {
if(!$image->name) { continue; }
echo '<div>';
echo '<a href="<?php get_site_url(); ?>data/framework/'.$image->url.'" rel="group_1" title="'.$image->title.'">
<img src="<?php get_site_url(); ?>data/framework/'.$image->url.'"  alt=""></a>';
echo '</div>';
}
}
?>


will $item be available globally ?

Thanks in advance
F.
Reply
Hi,

(2020-08-12, 07:15:53)Felix Wrote: Is this because a permission needs to be set somewhere for IM3 ?

It is your .htaccess in the GS data directory that blocks access. You must either allow it there to access your framework/, or modify the .htaccess in IM root with "Allow from all". IM3 has its own .htaccess file, it already protects all the important files/dirs.

(2020-08-12, 07:15:53)Felix Wrote: Is this correct inside the GS CMS function.php file ?

The data/ is not the best position for the library. I would rather write a plugin for it and place the library folder there (but that's your thing). For example:

Code:
plugins/
    your_plugin.php
    your_plugin/
        framework/
            imanager.php

So you could write a function which renders your gallery images and then output it in the template.php with e.g. show_gallery(); etc.

(2020-08-12, 07:15:53)Felix Wrote: include get_site_url(false) . 'data/framework/imanager.php';

This is the URL not a path. Use that:
Code:
include dirname(dirname(__DIR__)).'/data/framework/imanager.php';

(2020-08-12, 07:15:53)Felix Wrote: will $item be available globally ?

If you define it globally before then, sure. For example, if you have something like that in your functions.php:

PHP Code:
$gallery $imanager->getCategory('name=Gallery');
$item $gallery->getItem(1); 

Because the functions.php is called before your template.php your $item is also available in the template.php.

Here is an example plugin: ImGallery
Activate for testing and add a [[im_gallery]] placeholder in the content of a page where you want to show your gallery output.
Your template must contain <?php get_page_content() ?>
Reply
Hi Bigin,

About the gallery pictures not showing up:
My hoster doesn't like Options +SymLinksifOwnerMatch

I moved the framework folder out of the data foldeer to the root of gs-simple
But the real reason why it was not working was my bad:
I was writing the gallery php "already in php"

Many thanks for uploading the example ImGallery.zip to learn more about the api.
Now I have my picture gallery working.

F.
Reply
My previous gallery site wasn't good and looked bad.
I have improved it and now it is ok.

http://gallery.showme.zone/
Reply
Hello Felix, I'm glad you solved it.
Reply




Users browsing this thread: 1 Guest(s)