# CGY-Share

**Version:** 19.69.06  
**Developer:** YCP  
**Module ID:** `cgy-share`

CGY-Share automatically shares eligible HumHub profile posts into one
administrator-selected Main Space. Members publish normally on their profile;
there is no extra checkbox or button. The module uses HumHub’s native sharing
service, so the original post remains the source instead of being duplicated.

The administration page uses the responsive Blue Saucer dashboard with live
status cards, sidebar navigation, Automation and How It Works tabs, and
high-contrast electric-blue controls.

## Compatibility

- HumHub 1.18.1 through 1.18.x
- The matching HumHub **Share content** module (`sharebetween`)
- PHP version supported by the installed HumHub release

Test releases on a staging copy before enabling them in production.

## Features

- Automatically share newly created profile posts
- One fixed Main Space configured by a system administrator
- Optional public-post-only enforcement
- Master enable or pause control
- Native HumHub Share Content rendering
- Duplicate-share protection
- Published-state verification
- Author and destination permission checks
- Error logging under the `cgy-share` category
- Blue flying-saucer module artwork
- Responsive dark SaaS-style administration dashboard
- Dedicated **How It Works** tab

## Important behavior

CGY-Share operates on **new profile posts** created after the plugin is enabled.
It does not backfill older posts.

The direction is:

`User profile post → Main Space share`

Posts created directly inside a Space are ignored because they already belong
to a Space. The original profile post is not moved or copied.

## Requirements

Before enabling CGY-Share:

1. Open HumHub’s Marketplace.
2. Install **Share content**.
3. Enable **Share content** globally.
4. Ensure members who will publish have permission to share content into the
   intended Main Space.

If the required module is missing or disabled, CGY-Share records a warning and
does not attempt to share the post.

## Installation

1. Extract the CGY-Share release ZIP.
2. Confirm the extracted module folder is named `cgy-share`.
3. Upload the folder to:

   `protected/modules/cgy-share/`

4. Confirm that `Module.php`, `config.php`, and `module.json` are directly
   inside that folder. Avoid an extra version folder in the path.
5. Sign in to HumHub as a system administrator.
6. Open **Administration → Modules**.
7. Enable **CGY-Share**.
8. Open the module’s **Configure** page.

## How to use

### 1. Select the Main Space

Open the **Automation** tab and choose a destination from **Main Space**.

The list contains HumHub Spaces ordered by name. Choose the Space that should
serve as the primary community feed.

### 2. Enable automatic sharing

Enable **Automatically share profile posts to the Main Space**.

This is the master switch. Disable it to pause new shares while keeping the
module installed and configured.

### 3. Choose the visibility rule

Keep **Allow public posts only** enabled for the safest community setup.

When enabled:

- Public, published profile posts can be shared.
- Private profile posts remain private.
- Draft, scheduled, or otherwise unpublished content is skipped.

Disabling this option relaxes CGY-Share’s extra public-only filter, but HumHub’s
native visibility and permission rules still apply. Review your privacy model
carefully before doing so.

### 4. Save

Select **Save CGY-Share settings**.

The status cards at the top of the page show:

- Whether automation is live or paused
- Whether the public-only rule is active
- Which Main Space is selected

### 5. Test

1. Use a normal member account that can share into the Main Space.
2. Create a new public post directly on that member’s profile.
3. Open the configured Main Space.
4. Confirm the shared entry appears.
5. Confirm the original remains on the member’s profile.

## Eligibility checks

Before sharing, CGY-Share verifies:

1. Automatic sharing is enabled.
2. The Share content module is installed and active.
3. The content is a newly created profile post.
4. The post meets the configured visibility rule.
5. The post is published.
6. The configured Main Space exists.
7. The post author can be resolved.
8. The post has not already been shared to the Main Space.
9. The author is allowed to share into that Space.

If a check fails, the original post remains untouched.

## Permissions

CGY-Share deliberately respects HumHub’s normal permissions. It does not use an
administrator identity to bypass Space rules.

If a post does not appear, confirm that the author:

- Can view the destination Space
- Is permitted to share content into it
- Meets any membership rules enforced by the Space

## Pausing automation

Open **Administration → Modules → CGY-Share → Configure**, disable the
automatic-sharing checkbox, and save. Existing shares remain in place; only
future profile posts are affected.

## Updating

1. Back up the current `protected/modules/cgy-share/` folder.
2. Extract the new release.
3. Replace the existing module files with the new files.
4. In HumHub, open **Administration → Information → Database** and apply any
   offered module migrations.
5. Open **Administration → Settings → Advanced** and select
   **Save & Flush Caches**.
6. Confirm the version displayed in the CGY-Share header.
7. Publish a staging test post.

The Main Space and toggle values are stored through HumHub’s module-settings
service and should remain in place after a file upgrade.

## Uninstalling

1. Disable CGY-Share under **Administration → Modules**.
2. Confirm new profile posts are no longer shared.
3. Remove `protected/modules/cgy-share/` if the plugin is no longer required.
4. Flush HumHub’s application cache.

Disabling or removing CGY-Share does not delete previous shares or original
posts.

## Troubleshooting

### A post does not appear in the Main Space

- Confirm the post was created on a user profile, not inside another Space.
- Confirm it was created after CGY-Share was enabled.
- Confirm it is public and published.
- Confirm automation is live.
- Confirm the selected Main Space still exists.
- Confirm **Share content** is enabled.
- Confirm the author can share into the destination.
- Review HumHub logs for the `cgy-share` category.

### The same post appears more than once

CGY-Share checks HumHub’s share service before adding the destination. If a
duplicate still occurs, record the steps and inspect whether another automation
or plugin is sharing the same post.

### The generic module icon is displayed

Verify this file exists:

`protected/modules/cgy-share/resources/module_image.png`

Then flush HumHub’s application cache and refresh the browser.

### The interface looks unstyled

Verify these files exist:

- `resources/css/admin.css`
- `resources/js/admin.js`

Flush HumHub’s cache so the updated assets are republished.

### A PHP or sharing error occurs

Open **Administration → Information → Logging**, filter for `cgy-share`, and
capture the complete message along with the HumHub and Share content versions.

## Security and privacy

- CGY-Share does not modify HumHub core files.
- It respects HumHub visibility, publication, and sharing permissions.
- It does not expose private posts when public-only enforcement is enabled.
- It does not provide user-facing controls that could alter the configured
  destination.
- Exceptions are caught and written to the HumHub log rather than interrupting
  the member’s original post creation.

## Support information

When reporting a problem, include:

- HumHub version
- PHP version
- CGY-Share version
- Share content module version
- Active theme
- Source profile and destination Space permission details
- Relevant `cgy-share` log entries

CGY-Share is designed and developed by **YCP**.
