1
goffy
Re: New site for modules downloads
  • Yesterday 6:37

  • goffy

  • Just can't stay away

  • Posts: 556

  • Since: 2010/12/27


nice website and nice modules
thank you for sharing :)



2
Runeher2
New site for modules downloads
  • 10/9 12:21

  • Runeher2

  • Just popping in

  • Posts: 19

  • Since: 2020/2/1 1


Hi, I've been working on a little website where I share my XOOPS modules and a few apps.

Feel free to check it out at https://wideroam.com/

Feedback, suggestions and bug reports are always welcome!

Will be adding more modules to the site as time allows (I have lot of custom modules on different sites) :)



3
Mamba
XOOPS 2.5.11.1 - security update for XOOPS 2.5.11

Resized Image


XOOPS 2.5.11.1 — security update for XOOPS 2.5.11

The XOOPS Development Team has released XOOPS 2.5.11.1, a security update for XOOPS 2.5.11. It changes only the input filter that XOOPS uses on request data. If your site runs XOOPS 2.5.11, please apply it.

DOWNLOAD: https://github.com/XOOPS/XoopsCore25/releases/tag/v2.5.11.1

What's fixed

XOOPS 2.5.11 bundles the XMF library, and its input filter (Xmf\FilterInput, which XoopsFilterInput builds on) now includes the fixes from XMF 1.2.32.1:

* Filtering always finishes: some input made the filter run until PHP hit its memory limit, so one request could take a page down. A value that does not settle after a fixed number of passes is now dropped. (GHSA-8j4x-8r8r-5jgw)
* Stricter tag and attribute checks: some tag and attribute patterns got through the filter. Tag and attribute names are now checked strictly, event-handler attributes are matched whatever their case, link schemes are checked after HTML entities are decoded, and stripped text keeps no partial tag. (GHSA-pf53-59r5-mhjv)

There are no database, template or language changes, and no new features. The fix keeps PHP 5.6 compatibility, so 2.5.11.1 runs on the same servers as 2.5.11.

How to update

From XOOPS 2.5.11 (recommended: the patch)
1. Download xoops-2.5.11-to-2.5.11.1-patch.zip from the release page
2. Back up your site files
3. Copy the contents of the zip's htdocs folder over your XOOPS root folder (the one that holds mainfile.php), keeping the folder paths. Two files are replaced:
class/libraries/vendor/xoops/xmf/src/FilterInput.php
include/version.php
4. That's it. You don't need to run the upgrade wizard. System Admin now shows XOOPS 2.5.11.1-Stable

New install, or a version older than 2.5.11
Use the full package (the source code zip on the release page) and follow the usual install or upgrade steps.

XOOPS 2.7
XOOPS 2.7.4 RC 2 already includes the same fixes through XMF 1.3.2. If you are planning a move to the 2.7 line, see github.com/XOOPS/XoopsCore27/releases.

Reporting issues
Please report problems at github.com/XOOPS/XoopsCore25/issues, with your PHP and MySQL versions. Security issues should be reported privately, as described in the repository's SECURITY.md, not in a public issue. Questions are welcome in the support forums.

Thank you
Thank you to the researchers who reported these issues responsibly and to everyone who reviewed and tested the fixes. And a standing thank-you to JetBrains for the complimentary PhpStorm licenses that power the core team's development.

The XOOPS Development Team
Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



4
Mamba
XOOPS 2.7.4-RC2 Released

Resized Image


XOOPS 2.7.4 RC 2 — security hardening ahead of the final release

The XOOPS Development Team is pleased to announce XOOPS 2.7.4 RC 2, the second release candidate for XOOPS 2.7.4. RC 2 adds no new features. It collects the security hardening and bug fixes made since RC 1, after a review of the core with CodeQL, Snyk, SonarCloud, Scrutinizer and manual audits.

XOOPS 2.7.4 brings two-factor authentication into the core, makes SCEditor a full visual editor and the default for new sites, and adds Markdown support through EasyMDE. It runs on PHP 8.2 through 8.5.

Please test RC 2 on a staging copy of your site and report anything you find. Unless something serious turns up, the next release is 2.7.4 Final.

DOWNLOAD: https://github.com/XOOPS/XoopsCore27/releases

What's new since RC 1

Forms and redirects

* Form security tokens no longer depend on the browser's User-Agent: a token is now a random value compared in constant time. A browser update, a privacy extension or a "desktop site" toggle between opening and submitting a form no longer rejects it. Forms opened before the upgrade still submit
* Protector uses the core form token: its admin pages check the same token as the rest of XOOPS. XoopsGTicket is deprecated and now wraps the core token, so modules that still call it keep working
* One same-site check for redirects: login, post-login and theme-switch return addresses share one check. It refuses targets written with backslashes, encoded slashes, HTML entities or embedded line breaks, and sends them to the home page instead
* Escaped confirmation pages and error lists: xoops_confirm() escapes every field, value and label, and the object and login error lists are escaped too

Files and storage

* Uploads are deleted only inside the upload directory: the image manager and the smilies, user-rank and avatar admin pages resolve a stored file name before they delete it
* Protected database dumps: a dump is written only under XOOPS_VAR_PATH, into a directory guarded by a deny-all .htaccess and private to the PHP user
* Cache ids use a site key: the group part of theme and block cache ids is keyed with a random site key in xoops_data/data instead of the database credentials
* Random installer names: the installer renames itself and names its cleanup script with random_bytes(). Only the installing session can finish the clean-up
* Protector writes its ban files atomically and rejects an uploaded image it cannot inspect instead of staging it in uploads/

Server configuration

* xoops_lib/.htaccess works on Apache 2.4 without mod_access_compat, where the old rules returned a 500 error instead of denying access
* PHPMailer's unused OAuth helper is removed from the bundled vendor tree, and a Composer script removes it again after every vendor refresh
* reCAPTCHA v2 verifies over POST, so the secret key no longer appears in proxy or server logs
* The bundled XMF library is updated to 1.3.2, which tightens the tag and attribute filtering used for request input

Fixes

* The optional confirmation step for deleting notifications works again
* Deleting a user rank or avatar that no longer exists shows an error instead of a fatal error
* Uploading an image to a database-stored category reports a failed upload instead of stopping with a fatal error
* The TinyMCE 5 and 7 image managers no longer double-encode their target field
* Errors that were silenced with @ (cache, avatar and debug clean-up, session start-up, upgrade-script clean-up) are now handled or reported

The full list is in docs/changelog.270.txt.

Upgrading

From 2.7.4 RC 1

Copy the new files over the web root. There are no database changes since RC 1, so the upgrade wizard is not required (running it does no harm).
* A Protector admin form that was open during the upgrade must be reloaded once
* xoops_data/data must stay writable: the new cache-id key is created there on first use

From XOOPS 2.7.3 or a 2.7.4 beta

Copy the new files over the web root and run the upgrade wizard. It creates the user_2fa table and the two-factor preference, registers the SCEditor emoticons as smileys, adds the Editors preferences, and updates the System module. No mainfile.php changes are needed.
* Two-factor authentication needs the PHP sodium extension; the wizard reports whether it is available. Operations notes are in docs/2fa-operations.md
* Every remembered device logs in once more after the upgrade
* An upgraded site keeps its current editor settings; SCEditor becomes the default only on a fresh install
* If you copied extras/login.php elsewhere on your site, replace or remove that copy
* A site running a custom template set should re-import it

System requirements

* PHP 8.2 to 8.5
* MySQL 5.7+ or MariaDB 10.3+
* The PHP sodium extension for two-factor authentication

Translations

XOOPS is available in 37 community translations at github.com/XoopsLanguages. RC 2 adds two English strings for the database dump in the System module's maintenance page; docs/lang_diff.txt lists every new constant in 2.7.4. Translators, thank you: updated packs are very welcome before the final release.

Reporting issues

Please report bugs at github.com/XOOPS/XoopsCore27/issues, with your PHP and MySQL versions and the steps to reproduce. Questions are welcome in the support forums.

Thank you
Thank you to everyone who tested RC 1, reported issues, submitted pull requests (including the documentation and typo fixes from peter279k), translated strings and reviewed security findings. And a standing thank-you to JetBrains for the complimentary PhpStorm licenses that power the core team's development.

The XOOPS Development Team
Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



5
Mamba
Re: XOOPS 2.7.4-RC1 Released

Thank you for your kind words!

It's nice that some people see and appreciate the progress!
Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



6
blindman
Re: XOOPS 2.7.4-RC1 Released
  • 9/26 11:15

  • blindman

  • Not too shy to talk

  • Posts: 120

  • Since: 2005/6/26


Xoops is gaining traction and making a major comeback in the CMS world.
It is catching up in many areas where it previously lagged behind.

I first dabbled in PHP thanks to Xoops—that was about 20 years ago—and I still try to implement things in a localhost environment.
As always, I look forward to daily updates on Xoops development.

I congratulate the team; the direction is encouraging.



7
Mamba
XOOPS 2.7.4-RC1 Released

Resized Image


XOOPS 2.7.4 RC 1 — two-factor authentication and a new editor experience

The XOOPS Development Team is pleased to announce XOOPS 2.7.4 RC 1, the release candidate for XOOPS 2.7.4. This release brings two-factor authentication into the core, makes SCEditor a full visual editor and the default for new sites, adds Markdown support through EasyMDE, and continues the security hardening of the 2.7 line.

The feature set is final. Please test this release candidate on a staging copy of your site and report anything you find before the final release.

DOWNLOAD: https://github.com/XOOPS/XoopsCore27/releases

Two-factor authentication

* Two methods: a time-based authenticator app (Google Authenticator, Microsoft Authenticator, Aegis, FreeOTP, or any password manager that generates TOTP codes), or a six-digit code mailed to the member's address
* Recovery codes: ten one-time codes at enrolment, for the day the phone or the mailbox is out of reach
* Lockout: five wrong codes lock the second step for fifteen minutes, and the member is notified by e-mail
* Self-service: members enrol, disable and replace their recovery codes from Edit Account; administrators can reset a member's factor from Users, and an operator locked out of the site has a documented recovery procedure
* Off by default: switch it to "Optional" in System Preferences and every member may enrol; nobody is forced
* Protected at rest: authenticator secrets are encrypted with a site key; mailed codes are stored hashed and expire after ten minutes

Editors

* SCEditor edits visually with its full toolbar and keeps XOOPS BBCode intact across visual and source modes. Its emoticons are registered as XOOPS smileys, and new installs use it as the default editor
* System > Preferences > Editors configures SCEditor's toolbar buttons, plugins, emoticons, resizing, auto-expand, spellcheck, size and the image category for dropped images
* Markdown through EasyMDE: Markdown is stored in the existing text columns and rendered with Parsedown in safe mode; the editor preview uses the same renderer
* More BBCode: MyTextSanitizer renders the tags SCEditor writes: sub, sup, s (strikethrough), justify, hr, ol and table
* TinyMCE 7.9.3: the bundled TinyMCE 7 is updated to the current 7.x release, which carries three content-sanitisation fixes

Security hardening

* Remember-me tokens are revoked when the password changes, including a lost-password reset
* A restored session ends for a deactivated account, and group membership is read from the database on every request, so a removed group right takes effect immediately
* Registration validates the account again at the save step, not only at the first step
* Comment editing and deletion check that the comment belongs to the module handling the request
* The TinyMCE image manager checks category permissions for upload, delete and listing, as the core image manager does
* The upgrade wizard admits webmasters only
* The LDAP and Active Directory adapters stop when a requested StartTLS connection fails, instead of continuing without it
* Editor output is tightened: BBCode attributes and rendered Markdown are restored only where they belong, and SCEditor's visual view checks link schemes

Fixes
* The upgrade wizard reports a patch task that cannot complete, instead of re-queuing it silently, and no longer re-queues the 2.5.10-to-2.5.11 patch on every run
* The Modern admin theme shows its redirect notifications again, in light, dark and right-to-left layouts
* The Administration Menu link in the user block is shown only to administrators
* Several legacy classes load again on PHP 8: the tar and zip downloaders, the XML-RPC parser, and XoopsTpl::fetchFromData()
* An unknown user ID in the users admin shows a message instead of an error page, and logout works on sites with remember-me turned off

Changed since Beta 2:

* the editor work (SCEditor, the Editors preferences, Markdown),
* the upgrade wizard fix,
* the Modern theme notifications,
* the user-block fix,
* the PHP 8 legacy-class fixes,
* translatable upgrade-wizard messages are new in RC 1.
* the System module moves to 2.1.13; the upgrade wizard applies it.

Upgrading from 2.7.3

Copy the new files over the web root and run the upgrade wizard. It creates the user_2fa table and the two-factor preference, registers the SCEditor emoticons as smileys, and adds the Editors preferences. No mainfile.php changes are needed.
* Two-factor authentication needs the PHP sodium extension; the wizard reports whether it is available. Operations notes are in docs/2fa-operations.md
* Every remembered device logs in once more after the upgrade
* An upgraded site keeps its current editor settings; SCEditor becomes the default only on a fresh install. For SCEditor's MP3 button, set 'mp3' => 1 in xoops_data/configs/textsanitizer/config.php
* If you copied extras/login.php (the SSL popup login) elsewhere on your site, replace or remove that copy: updating the core does not patch it
* A site running a custom template set should re-import it

From a 2.7.4 beta: copy the new files and run the upgrade wizard again; it applies the RC 1 changes and updates the System module.

System requirements

PHP 8.2 to 8.5, MySQL 5.7+ or MariaDB 10.3+, and the PHP sodium extension for two-factor authentication.

Translations

XOOPS is available in 37 community translations at https://github.com/XoopsLanguages. XOOPS 2.7.4 adds English strings for two-factor authentication, the Editors preferences, SCEditor and the upgrade wizard; docs/lang_diff.txt lists every new constant. Translators, thank you: updated packs are very welcome before the final release.

Reporting issues

Please report bugs at https://github.com/XOOPS/XoopsCore27/issues with your PHP and MySQL versions and the steps to reproduce. Questions are welcome in the support forums.

Thank you to everyone who tested the betas, reported issues, submitted pull requests, translated strings and reviewed security findings during the 2.7.4 cycle. And a standing thank-you to JetBrains for the complimentary PhpStorm licenses that power the core team's development.

The XOOPS Development Team
Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



8
Mamba
Re: XOOPS Plugin for PhpStorm 1.0 Alpha 3 Released

4. Inspections + Alt+Enter

  1. Copy test-fixtures/bad_module_sample.php under htdocs/modules/_xoops_demo/.
  2. Open it — highlights for guards, query/exec, Request, etc.
  3. Alt+Enter on each highlight and apply the fix.
  4. For Smarty: a .tpl with bare {if …} should offer delimiter conversion.
  5. Goffy / wgSimpleAcc shapes: test-fixtures/wgsimpleacc_shapes.php (namespaced die guard + while (list = fetchRow)) and test-fixtures/index_404_stub.php (must not warn).

All inspections live under Settings → Editor → Inspections → XOOPS. Each can be switched off or downgraded there, and the Inspection ID below is what you put in a @noinspection comment or an .idea/inspectionProfiles file. Every inspection is silent in vendor/, templates_c/, cache/ and node_modules/.

4.1 Deprecated database API — XoopsDeprecatedDbApi

Flags queryF() and quoteString(). Use query() / exec() and quote() instead.

Why. queryF() was the "force" variant that skipped the write block on query(). Since XOOPS 2.5.12 the split is explicit: query() refuses mutating SQL and exec() is the only sanctioned write path, so queryF() no longer has a job. quoteString() is a plain alias of quote() kept for backward compatibility and scheduled for removal.

// before $db->queryF('UPDATE ' . $db->prefix('news') . ' SET hits = hits + 1'); $name = $db->quoteString($name); // after $db->exec('UPDATE ' . $db->prefix('news') . ' SET hits = hits + 1'); $name = $db->quote($name);

Quick-fixes. quoteString() is renamed to quote(). For queryF() the inspection reads the first string argument to decide what to offer:

  • SQL starting with SELECT / SHOW / DESCRIBE / EXPLAIN: rename to query() only.
  • SQL starting with INSERT / UPDATE / DELETE / REPLACE / TRUNCATE / ALTER / DROP / CREATE: exec() is offered first, query() second.
  • SQL that cannot be read (a variable, a concatenation): both renames are offered; pick by intent.

exec() takes one argument, so the exec() rename is withheld while the call still passes $limit / $start. Drop those first, then re-run the fix.

4.2 Deprecated XOBJ_DTYPE_UNICODE_* — XoopsDeprecatedUnicodeDtype

XOBJ_DTYPE_UNICODE_* constants were deprecated in XOOPS 2.7.3 (core issue #164) and are scheduled for removal in 4.0. The quick-fix renames the constant to its non-UNICODE successor (XOBJ_DTYPE_TXTBOX, TXTAREA, URL, EMAIL, ARRAY, OTHER). Value migration stays a core concern and is not performed here. Silent when the project Core Version is set to 2.5.

Why. The UNICODE_* types date from the pre-UTF-8 era when a field had to declare that it might hold multibyte text. Every supported core runs on utf8mb4, so the distinction is dead weight: the sanitizer treats XOBJ_DTYPE_UNICODE_TXTBOX and XOBJ_DTYPE_TXTBOX identically. Renaming is safe at the initVar() site because it changes only which constant name is looked up, not how the stored value is read or written.

// before $this->initVar('title', XOBJ_DTYPE_UNICODE_TXTBOX, null, true, 255); // after $this->initVar('title', XOBJ_DTYPE_TXTBOX, null, true, 255);

Core Version gate. The 2.5 LTS line never deprecated these constants, so a module that must keep running on 2.5 gets no warning. Set Core Version to 2.5 in Settings for that project; Auto, 2.7 and 4.0 all report.

4.3 isResultSet guard — XoopsResultSetGuard

Warns when fetchArray / fetchRow / fetchBoth appears without a dominating isResultSet check. Prefer the two-part guard:

$result = $db->query($sql); if (!$db->isResultSet($result) || !$result instanceof \mysqli_result) { throw new \RuntimeException('Database query failed'); } while (list($id, $title) = $db->fetchRow($result)) { // ... }

An early-exit guard covers later fetches of the same variable, including while (list(...) = $db->fetchRow($result)), until that variable is reassigned. The quick-fix inserts before the enclosing statement using the current PSI (safe to apply several times after Inspect Code).

Why two parts. query() returns false on failure, and fetchArray(false) is a fatal TypeError on PHP 8. isResultSet() is the XOOPS check; the instanceof \mysqli_result half is for static analysers such as Scrutinizer and PHPStan, which do not know that isResultSet() narrows the type.

What counts as guarded. The analysis is textual, so it follows a few explicit rules rather than full control flow:

  • A negative check that throws, returns or exits (if (!$db->isResultSet($result)) { return; }) covers every later fetch of $result in the same block. It stops covering at a reassignment of $result, at a nested function, or when the enclosing } closes.
  • A positive check (if ($db->isResultSet($result)) { ... }) covers fetches inside its body, brace-less body included. || and xor in a positive condition disqualify it: if ($db->isResultSet($result) || $fallback) can enter the body with $result === false, so the fetch inside is still reported. || is fine only in the terminating negative form above.
  • $result = $db->fetchArray($result) inside a guarded region stays guarded: the fetch reads the old value. $result = false or $db->fetchArray($result) does not, because or binds looser than = and the assignment completes first.
  • &&, and and xor in the guard condition disqualify it. if (!isResultSet($r) && $x) return; can fall through while $r is still false.
  • Comments and strings are masked first, so a commented-out guard never counts.

Guard quick-fix scope. The guard is inserted within the existing statement list. Unbraced if, while, for and foreach bodies receive a warning without a quick-fix; add braces first so the guard can stay inside the control flow.

4.4 include_once for headers — XoopsIncludeOnceHeader

XOOPS module entry points should load header.php / footer.php with include_once (not bare include).

Why. header.php starts the theme, opens the output buffer and pulls in $xoopsTpl; footer.php renders and flushes. Including either twice, which happens easily once a page delegates to a shared include/ file, produces duplicate headers or a blank page. include_once makes the second include a no-op. The rule applies to the core files and to a module's own header.php / footer.php, with or without the XOOPS_ROOT_PATH . prefix.

// before include XOOPS_ROOT_PATH . '/header.php'; include __DIR__ . '/footer.php'; // after include_once XOOPS_ROOT_PATH . '/header.php'; include_once __DIR__ . '/footer.php';

Quick-fix rewrites the keyword in place. require / require_once are not touched; only a bare include of a header.php / footer.php path is reported.

4.5 Direct-access guard — XoopsRootPathGuard

Reports include-only PHP files (classes, preloads, includes, blocks) that lack a terminating defined('XOOPS_ROOT_PATH') || exit/die(...) guard. The guard must be the first executable statement after <?php, declare and namespace; a use block before or after it is fine. die and exit are both accepted. In namespaced files the quick-fix inserts the guard after the namespace and before the use block (never before namespace, that is invalid PHP).

Not reported: language files, vendor/cache, tests, xoops_version.php, admin/ control-panel scripts, files whose first work is including mainfile.php / header.php / admin_header.php, and directory-protection stubs that only send HTTP 404/403.

Why. Files under class/, include/, preloads/, blocks/, kernel/ and src/ are meant to be pulled in by a bootstrapped page. Requested directly over HTTP they run without a session, without $xoopsUser, and with every global undefined, which is how include files turn into information leaks or code paths that skip permission checks. The guard turns a direct request into a one-line exit.

<?php namespace XoopsModules\Demo; defined('XOOPS_ROOT_PATH') || exit('Restricted access'); use XoopsModules\Demo\Constants; class Accounts extends \XoopsObject { }

Placement. PHP requires namespace to be the first statement, but use imports may follow executable code, so the guard sits between them. That is also where the wgSimpleAcc family and most Goffy modules put it. if (!defined('XOOPS_ROOT_PATH')) { exit('...'); } is accepted as an equivalent form.

Why entry points are skipped. A page that starts with include mainfile.php or header.php is bootstrapping itself and must be reachable over HTTP. admin/ scripts include admin_header.php for the same reason. A guard on any of these would exit every public request. A 404/403 stub (header('HTTP/1.0 404 Not Found'); and nothing else) is meant to answer direct requests, so a guard there would replace the intended HTTP status with "Restricted access".

Quick-fix limits. The fix computes the insert offset from the file, so it works after declare(strict_types=1), multiple declare statements, namespace Foo; and namespace Foo { … }, with both <?php and short <? tags. A file that starts with HTML before its first <?php is still reported, but the fix declines rather than guess where the guard belongs.

4.6 query() vs exec() — XoopsQueryExec

Flags string SQL starting with INSERT / UPDATE / DELETE / REPLACE / TRUNCATE / ALTER / DROP / CREATE passed to ->query(). Use exec() for mutations (XOOPS 2.5.12+ convention).

Why. Since 2.5.12 query() inspects the statement and blocks writes on a GET request, logging query() called with a mutating statement; use exec(). Code that worked on 2.5.11 silently stops writing on upgrade, and the only symptom is a log line. Splitting reads and writes at the call site also makes a future prepared-statement layer possible, because exec() never needs $limit / $start.

// before $db->query('DELETE FROM ' . $db->prefix('news') . ' WHERE storyid = ' . $id); // after $db->exec('DELETE FROM ' . $db->prefix('news') . ' WHERE storyid = ' . $id);

Quick-fix renames query to exec when the call has a single argument. With $limit / $start present the problem is still reported, but the fix is withheld: exec() takes one argument, so the extra ones must be removed by hand first. SQL held in a variable is not inspected; only a string literal as the first argument is read.

4.7 Raw superglobals — XoopsSuperglobal

Flags raw $_GET, $_POST, $_REQUEST, and $_COOKIE in module and XMF code. Prefer \Xmf\Request.

Why. \Xmf\Request does the type coercion, default handling and filtering that hand-written isset($_POST['x']) ? (int) $_POST['x'] : 0 tends to get subtly wrong, and it makes the input source explicit. $_REQUEST merges GET, POST and COOKIE in php.ini-dependent order, so a cookie can override a form field; that is why the fix always names a source and never offers $_REQUEST as one.

// before $op = $_GET['op']; $name = $_POST['name']; // after $op = \Xmf\Request::getString('op', '', 'GET'); $name = \Xmf\Request::getString('name', '', 'POST');

Quick-fix scope. Only a keyed read with a string-literal key ($_GET['op'], $_POST['name'], $_COOKIE['sid']) gets an Alt+Enter replacement, and it always uses getString. Change it to getInt, getBool, getArray or getCmd afterwards when the value is not free text. A bare $_POST (passed to a function, iterated, or used with a variable key) and any use of $_REQUEST are warnings only, because the right method and source cannot be inferred.

4.8 Missing registered template — XoopsMissingRegisteredTemplate

A template listed in xoops_version.php (file / template key) was not found under the module templates/ (or blocks/) directory. A case-only difference is reported as TEMPLATE_CASE_MISMATCH, with the actual disk spelling and no create-file quick-fix.

Why. On install and update XOOPS reads $modversion['templates'] and copies each listed file into the tplfile table. A missing file is skipped without an error, so the page or block later fails with a Smarty "unable to read resource" message that names a template you registered but never created, or that was renamed on disk without the manifest following.

$modversion['templates'][] = [ 'file' => 'demo_index.tpl', // must exist as templates/demo_index.tpl 'description' => 'Index page', ];

Both template inspections read xoops_version.php only, so they cover legacy and hybrid modules; a module.json-only module is not checked.

Quick-fix creates the file under templates/, keeping any sub-path in the name (blocks/demo_block.tpl becomes templates/blocks/demo_block.tpl), with a Smarty comment <{* name *}> as placeholder so the manifest and disk agree; fill in the markup afterwards. The inspection runs on xoops_version.php and is the inverse of 4.9.

4.9 Unregistered template — XoopsUnregisteredTemplate

A .tpl file under the module templates/ or blocks/ directory is not listed in xoops_version.php, so Smarty cannot display() it as a registered module template. Theme overrides under themes/ are ignored. The quick-fix appends a $modversion['templates'][] entry to the manifest.

Why. The db: template resource resolves through the tplfile table, and only registered templates get a row. An unregistered .tpl renders fine from the file system on a stock template set during development, then breaks on a site whose template set was imported, or on the first module update that resyncs templates. Registering it at creation time removes the surprise.

Matching. A manifest entry may be spelled relative to templates/ (demo_index.tpl, the XOOPS convention) or from the module root (templates/demo_index.tpl); both are accepted. Case-insensitive matching identifies the registration, but filename and directory spelling must match the disk exactly. The missing-template inspection and scanner report casing differences as a case mismatch, not a missing or unregistered template.

Quick-fix appends this at the end of the manifest (before a trailing ?> if there is one), unless the name is already quoted somewhere in the file:

$modversion['templates'][] = [ 'file' => 'demo_orphan.tpl', 'description' => '', ];

Files under themes/ and templates_c/ are never reported: a theme override is not a module template, and compiled templates are generated.

4.10 Wrong Smarty delimiters — XoopsWrongSmartyDelimiter

XOOPS Smarty uses <{ and }> delimiters. Bare {if} / {$var} tags are usually a mistake and will not render.

Why. XOOPS configures Smarty with <{ }> so that plain braces in CSS, JavaScript and JSON inside a template are left alone. A tag written in stock Smarty syntax is not an error: it is passed to the browser as literal text, so the symptom is {$title} appearing on the page, or an {if} block that always shows both branches.

<!-- before --> {if $items}<ul>{foreach $items as $item}<li>{$item.title}</li>{/foreach}</ul>{/if} <!-- after --> <{if $items}><ul><{foreach $items as $item}><li><{$item.title}></li><{/foreach}></ul><{/if}>

What is matched. A brace immediately followed by $ or by one of the common tag keywords (if, /if, foreach, /foreach, include, assign, block, literal) up to the closing brace on the same line. Tags already written as <{ … }> are skipped, and so are braces that do not look like a tag, which keeps inline CSS and JavaScript quiet.

Quick-fix wraps the tag in <{ }>. Apply it per tag, or run Code → Inspect Code on the templates/ folder and use Apply fix on the group to convert a whole template.

Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



9
Mamba
Re: XOOPS Plugin for PhpStorm 1.0 Alpha 3 Released

1. Install

./gradlew buildPlugin

# Windows: gradlew.bat buildPlugin

Then Install Plugin from Disk… → build/distributions/xoops-support-*.zip → restart.

2. Project detection

  1. Open a real XOOPS install (with mainfile.php or htdocs/mainfile.php). This plugin repository alone is not a XOOPS site root.
  2. Optional balloon: “XOOPS Support active”.
  3. Tools → XOOPS Support → Show XOOPS Project Info (runs in the background).
  4. Settings (search “XOOPS Support”): enable/disable, Core Version, suppress notification.

3. Tool window / scanner

  1. View → Tool Windows → XOOPS Support
  2. Refresh (or Tools → XOOPS Support → Refresh XOOPS Overview)
  3. Click findings to open files.

Reading the Overview. The header line gives the totals (here 22 modules, 316 findings) and the detected core line (XOOPS 2.7.x, from the Core Version setting or auto-detection) with the web root the scan used.

The Modules table lists every directory under modules/ that has a manifest, one row per module:

Column

Meaning

Manifest

xoops_version.php (legacy), module.json (4.0), or hybrid when both exist

TPL

.tpl files under templates/

Lang

.php files under language/ (all locales)

Pre

.php files under preloads/

Cls

.php files under class/ and src/ together

The counts are a quick health read: TPL 0 means the module renders nothing of its own (fine for a library module such as protector or xwhoops), Lang grows with every shipped locale (each adds its own set of files), and an unexpectedly large Cls usually means a vendored library sits under class/ or src/.

Findings are listed per module in the same order as the table. Each line is a kind, a message and a file:line link that opens the editor at that spot. The kinds map onto the section 4 inspections:

Finding

Inspection

MUTATING_QUERY

4.6 XoopsQueryExec

DEPRECATED_QUERY_F, DEPRECATED_QUOTE_STRING

4.1 XoopsDeprecatedDbApi

RAW_REQUEST

4.7 XoopsSuperglobal, $_REQUEST only; keyed $_GET / $_POST are left to the editor

MISSING_REGISTERED_TEMPLATE

4.8 XoopsMissingRegisteredTemplate

TEMPLATE_CASE_MISMATCH

4.8 XoopsMissingRegisteredTemplate: filename/directory spelling differs from disk

UNREGISTERED_TEMPLATE

4.9 XoopsUnregisteredTemplate

WRONG_SMARTY_DELIMITER

4.10 XoopsWrongSmartyDelimiter

SCAN_ERROR

a file or directory the scanner could not read

The scanner reports the first occurrence per file for the code-pattern kinds, so one RAW_REQUEST line can stand for several uses in that file; the editor inspection marks each one. The guard and isResultSet rules run only in the editor, where they have the PSI they need.

Use the Overview as the whole-site view: triage a large install or a module you have just imported, then open a file and let Alt+Enter do the individual fixes. The scan runs as a background task and honours Cancel.

Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



10
Mamba
ModuleTools 1.5 for XOOPS 2.8.0

Resized Image


ModuleTools: the shared toolbox every XOOPS 2.8.0 module now gets for free
 
If you have ever built a XOOPS module, you know the ritual. Copy a class/Common/ folder from the last module. Paste in the install helpers, the version checks, the admin table code, the confirmation dialog, the breadcrumb builder. Fix the namespace. Hope nothing drifted since the last copy.
 
With XOOPS 2.8, that ritual is over. ModuleTools ships inside XOOPS 2.8.0 Core as Xoops\ModuleTools\*, autoloaded on every request. There is nothing to install, nothing to activate, and no helper module to keep in sync. Your module just calls it.
 
What is in the box
 
ModuleTools is the successor to the mTools helper module, rebuilt as a proper library. It gathers the services modules used to carry as copied files:
 
 
*  Install and update hooks. Directory checks, file checks, dependency and version guards, sample-data buttons, and an update checker that reads your GitHub releases.
*  Admin pages in minutes. Object tables, tree tables, single-record views, CSV export, and a controller that handles create, edit, delete and uploads from one form definition.
*  Objects and forms. A dynamic object base with SEO fields and a form builder that turns your handler's metadata into a ready XoopsThemeForm.
*  Front-end helpers. Breadcrumbs, letter navigation, pagination, text truncation with intact HTML, social bookmarks, syntax highlighting, image resizing.
*  Permissions. Per-item group permissions with a clean gateway, so your module never writes to the permission table by hand.
*  Module lifecycle. A ModuleContext value object for paths, URLs and constants, a namespace autoloader that also understands legacy filenames, and a cloner that turns one module into the starting point for the next.
 
 
Why it matters
 
Less code to own. A typical converted module drops dozens of copied files. Fewer files means fewer places for a bug to hide and fewer places to patch when one is found.
 
Security fixes land once. When the confirmation dialog or the CSV export is hardened, every module on the site gets the fix on the next Core update. No module release required.
 
Modern PHP, tested. The library targets PHP 8.4, passes PHPStan at level 6, and ships a growing PHPUnit suite that includes consumer tests run against real modules inside a XOOPS tree.
 
No migration cliff. Existing modules keep working. ModuleTools registers lazy aliases for the stable XoopsModules\Mtools\* names, so a module written for the mTools module runs on 2.8 unchanged. When you are ready, the migration guide walks through swapping copied classes for library calls, and a Rector rule set does most of the typing.
 
Still there for 2.7. Sites on XOOPS 2.7.x keep the separately distributed mTools module with the same class names. Write against the API once and it runs on both.
 
Getting started
 
On XOOPS 2.8 the library is already loaded. In a module, grab your XMF helper and go:
 
use XmfModuleHelper;
use 
XoopsModuleToolsModuleModuleContext;
 
$helper 
= Helper::getHelper('mymodule');
$ctx    = ModuleContext::fromHelper($helper);
$ctx->uploadPath('images');
 
For standalone development, composer require xoops/moduletools brings in the same package with its stubs and test suite.
 
The full walkthrough lives in docs/getting-started.md, and docs/migrating-a-module.md covers converting an existing module. Try it on your next module, or on the one you have been meaning to clean up, and let us know what you build.
 
PACKAGIST: https://packagist.org/packages/xoops/moduletools
 
INSTALLATION: composer require xoops/moduletools
Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs




TopTop
(1) 2 3 4 ... 29457 »