Questions tagged [php]

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. Joomla is based on PHP.

Filter by
Sorted by
Tagged with
0 votes
0 answers
36 views

Joomla 3.10.11 on server with MySql 8.0

On my online server which has MySql 5.7 and PHP 7.4 I have three sites in joomla which have the following: Mywebsite1 with joomla 3.10.11 and JD Boston template with Helix framework 3.0.3 Mywebsite2 ...
Jackom's user avatar
  • 101
0 votes
1 answer
24 views

Where to place component code that executes after controller invocation?

For a custom component in Joomla 4 (and 5), is there a way to have some component code that gets executed after the controller execution step, regardless of which controller is triggered? Why? In ...
John Rix's user avatar
  • 551
0 votes
1 answer
38 views

Creating site routes from Administrator client

I am in the process of migrating a large Joomla component from v3.x (with lots of legacy code from 1.5+!) to Joomla 5 at present. One item I have stumbled upon is how best to bootstrap the component's ...
John Rix's user avatar
  • 551
0 votes
0 answers
55 views

Include php file in Joomla 4 article

I created a font.php file that is used to preview fonts and I try to include it in a joomla 4 article, but it always returns error 500. -Include some simple php file in joomla article works. -Include ...
Midhat's user avatar
  • 109
1 vote
2 answers
53 views

Best way to save timestamp for new or modified records in custom component

In my custom component I have two database tables for items in my component with the standard 'created' and 'modified' datetime columns to contain timestamps when those items are created or modified. ...
Grant Hood's user avatar
0 votes
1 answer
51 views

Tagged Weblinks appearing in a Compact List linking to items on external site require two clicks to get to items. - Version 4.4.2 -

At the url below there is a tag at the top left called "Big Picture Pubs". It leads to a table showing a compact list of tagged weblinks. https://www.victoriasforestryheritage.o ... cture....
Richard's user avatar
0 votes
1 answer
35 views

how can i override method save plugin joomla 4

I have custom plugin and I want to do something when my plugin save in admin panel of Joomla 4 . How can I override save method in plugin ?
سبحان مقیسه's user avatar
0 votes
0 answers
31 views

Downloading file from Joomla page or menu item, but prohibit the link from being usable by copy&paste outside of Joomla

I'm looking for a way to provide a "secured" file download for authorized Joomla users (registered user being member of a certain group), but the "link" shall not be usable in any ...
phunsoft's user avatar
  • 230
0 votes
1 answer
61 views

Problem inserting Joomla 4/5 Custom Field in Text Article-simple syntax solution?

Use Case: I maintain a simple site for a small orchestra. Originally written in Joomla 2010, updated to Joomla 3 in 2016 and now updating to Joomla 4/5. Each concert, the items, conductor, soloists ...
DerekE's user avatar
  • 1
1 vote
0 answers
36 views

Show Arabic/Persian number if choice this number in Joomla

After changing the site language to Farsi/Arabic, I still see the numbers in English on my site. My font is completely Farsi, but the numbers are displayed in English. Please advise that I have to do ...
Ali Zangeneh's user avatar
0 votes
2 answers
75 views

How to truncate category description?

I'd like to be able to truncate the character length of the article category description. This is the code that renders the description: <div class="com-content-category-blog__description ...
Brendan Hedges's user avatar
0 votes
1 answer
40 views

Show the category custom fields in article page

I have category custom fields and I need to show these in the article (which is in the category) view. I have used the following: use Joomla\CMS\Factory; use Joomla\Component\Fields\Administrator\...
RustyJoomla's user avatar
  • 2,078
0 votes
2 answers
64 views

How to conditionally display custom fields in template overrides

I am using the following code to pull in some custom fields into an override of com_content > category > blog_item.php: $video = $this->item->jcfields[4]->value; $media = $this->item-...
Mike Hermary's user avatar
1 vote
1 answer
49 views

Which line should PHP files in Joomla start with?

I know, that the first line in PHP Files is because of security reasons. I read it here: https://docs.joomla.org/Why_do_most_of_the_Joomla!_PHP_files_start_with_defined(%27_JEXEC%27)%3F But in the ...
agi's user avatar
  • 303
0 votes
0 answers
19 views

Can't install Antispam plugin by CleanTalk in Joomla3.8

I'm trying to install . Once the install button is clicked, I keep waiting and nothing happens. Upon checking the DevTools Console, there are errors stating: Uncaught Reference Error: jedpps-...
pal's user avatar
  • 1
1 vote
1 answer
199 views

Export as Excel with PHPSpreadsheet as download how to keep Joomla Messages?

In my custom Joomla 5 component I've added PHPSpreadsheet via composer. In the Export View (Backend) i have a small adminform for setting up the export and a submit button that toggles the download by ...
Marco's user avatar
  • 653
0 votes
0 answers
24 views

How to handle duplicate items coming from an external JSON API and being imported as article content

I have adapted working code from Joomla 3 and the CLI to Joomla 4/5 and the API. The core functionality using the API system is working, but I am struggling to find a replacement for checking for ...
Mike Hermary's user avatar
0 votes
0 answers
117 views

The PHP temporary folder is not writeable

On Joomla 5 (same problem on Joomla 4) I am getting the warning "The PHP temporary folder is not writeable". In more detail: This folder is not writeable by the Joomla! instance, which may ...
Bruce Button's user avatar
0 votes
0 answers
83 views

How to configure PHP-FPM to run Joomla without setting $live_site in configuration.php

I've spent a good few hours ploughing through code and setting up servers to test exactly what is goes on to cause Joomla to fail in PHP-FPM unless $live_site is correctly set. The problem turns out ...
mbrampton's user avatar
  • 314
0 votes
1 answer
49 views

How do I override Joomlas default field template, but just in my component?

Is it possible to override the default field template just in my component? How would I go about doing it? The template I specifically want to override is "joomla.form.renderlabel", which is ...
Obscerno's user avatar
  • 191
0 votes
1 answer
37 views

Styling Joomla custom fields

0 i have created some custom fields in Joomla and created an over-ride: /components/com_fields/layouts/field/render.php to /templates/YOUR_TEMPLATE/html/layouts/com_fields/field/MY_OVERRIDE.ph ...
user408's user avatar
  • 33
0 votes
1 answer
185 views

Joomla 4 custom template not loading web assets

I am in the process of writing a custom theme for a client and am having issues with the Web Asset Manager. I have been following examples of other templates that are built for Joomla 4+, but I must ...
Mike Hermary's user avatar
2 votes
1 answer
344 views

How can I filter the Persian alphabet in PHP for Joomla 4?

Before anything, I must say this code works as well for the English language, but in Persian it never works. I use this code on model/celebrities.php. This code shows my frontend model: class ...
Ali Zangeneh's user avatar
0 votes
1 answer
62 views

My script doesn't work on joomla 4

I used this simple php gallery from a folder on my Joomla 3 site. Now I'm getting ready to do an update to Joomla 4 and I noticed that I have a problem with displaying images from the directory. if I ...
Midhat's user avatar
  • 109
1 vote
1 answer
188 views

Standalone PHP script to get username in Joomla 4?

In Joomla 3 I used the following code. What do I need to change to use it with Joomla 4? <?php define( 'DS', DIRECTORY_SEPARATOR ); $rootFolder = explode(DS,dirname(__FILE__)); //current level ...
yowww23's user avatar
  • 11
0 votes
1 answer
69 views

Upgrade Joomla CLi script to handle bulk import of items into articles

I am upgrading a client's CLi script that is used to automatically bulk import news items into Joomla articles. The code was originally programmed for Joomla 3 and now needs to support Joomla 4. I ...
Mike Hermary's user avatar
0 votes
1 answer
156 views

PHP load class from namespace error

I have been using this doc to convert a client's CLi news import script from Joomla 3 to 4. The code has been stripped of all the JSON to article code for brevity. I have gone over all of my code and ...
Mike Hermary's user avatar
0 votes
1 answer
105 views

PHP: Need to know how to trigger onContentAfterSave on existing article

I have what I thought would be a simple challenge: to automate publishing an article and trigger the onAfterContentSave event for saving the article. This code ultimately has to run within another ...
Bruce S's user avatar
2 votes
1 answer
123 views

Filling custom fields when creating an article with an script via the API

I am creating an article in Joomla 4 using the excellent code that is suggested here: Joomla 4 create article programmatically My task is write the values of the custom field simultaneously with the ...
Igor K.'s user avatar
  • 23
0 votes
0 answers
54 views

How to resolve the Internal Server Error with my custom components calendar in Joomla 4?

I try to make a custom calendar in my custom component in Joomla 4. For that I write a code who connect to a database and retrieve the data. For that I have 3 files : default.php, ...
Sephirah's user avatar
0 votes
2 answers
60 views

Joomla PHP Framework problems. White page, no errors

I've upgraded a Joomla 3.10 website to 4.x. I use custom scripts on the website wich use the framework and that worked fine until after the upgrade. I did some searching and since the framework got an ...
Martin Law's user avatar
0 votes
1 answer
71 views

Joomla component loading throws exception

I'm working on a Joomla 4 website which is migrated from Joomla 3.11. Everything else is working fine except one page. These page is also rendered and further it loads data from a ajax request from ...
Ramesh Jangra's user avatar
0 votes
1 answer
215 views

getMailer gives "Failed to start application" exception after updating to Joomla4, how do I fix it?

The issue Quoting (again) from an old question of mine: I have a form in my Joomla! site. Once completed, the form should send an e-mail but only if some conditions have been met. Not having been ...
Firefighter's user avatar
1 vote
1 answer
76 views

Plugin Events - how are they helpful in a real life?

There's a knowledge base for one Joomla component and it contains a whole bunch of Plugin Events. Text files with a code, basically. I wonder how they can be used in a real life an what for? Would it ...
papakota's user avatar
1 vote
0 answers
36 views

Where are the Joomla tests located, and how can I include them in my CI/CD pipeline?

I am trying to set up a CI/CD pipeline for a Joomla project and would like to include tests for my Joomla components. I am looking for the location of the Joomla tests and how I can integrate them ...
DeesreX's user avatar
  • 87
1 vote
1 answer
53 views

How implement the PHP strip_tags in the Joomla 4-file com_content/archive/default_items.php

In Joomla 4.3.1, I've made an override of the com_content/archive/default_items.php Now I want to strip tags and display the string (text from article) as one line <p> only. Without any ...
TorbjörnN's user avatar
0 votes
0 answers
31 views

RSform: How to skip strings in query output if variables are empty?

I have this Code. I don't know PHP, but I got the result I wanted. Almost. As you can see, the output will include empty URL parameters if none are provided. Some fields will always be filled, others ...
getimo's user avatar
  • 9
2 votes
1 answer
227 views

How can I query a custom field value in JavaScript?

I am creating a website for a composer to include a page in a blog style with YouTube videos of concerts. I am attempting to block all the code for the videos from automatically loading on the page (...
Gillian's user avatar
  • 411
0 votes
1 answer
66 views

"0 - syntax error, unexpected end of file" after transfering my site to another hoster

I recently transfered my domain from strato to netcup. I installed a fresh joomla 4 and installed my template (custom written). The Issue is I get the error: "0 - syntax error, unexpected end of ...
Jonathan Schmidt's user avatar
1 vote
1 answer
46 views

No response from Joomla plugin that should receive AJAX calls

I followed this guide step by step and I've just created a plugin that should elaborate AJAX calls received from a form in the front-end, so that the data sent by every user will be structured and ...
smarmolena's user avatar
0 votes
0 answers
67 views

Joomla 3 Custom PHP Script needs to be updated for Joomla 4

I have a custom php script that was written for a Joomla 3 site. Of course on Joomla 4 it doesn't work. I've been working on re writing the query statements to use prepared statements but even with ...
hpgodwin's user avatar
1 vote
1 answer
39 views

Dynamic Title Module Control

I'm using PHP to creata dynamic page title based on the menu item using Sourcer and the following PHP: <?php $active = JFactory::getApplication()->getMenu()->getActive(); echo $active->...
John S's user avatar
  • 11
0 votes
0 answers
52 views

Filtering Data in Php oop

After I click the search button - there's no data output in the web page. What should I do? This is my view page <label>DATE FROM:</label> <input type="date" ...
pal's user avatar
  • 1
1 vote
1 answer
187 views

How to print a php variable to the browser's console?

So within administrator function. echo("<script>console.log('PHP: " . $data . "');</script>"); It seems it doesn't insert the js script on the page. This works from a ...
Plamen's user avatar
  • 745
2 votes
0 answers
144 views

Adding a Tag to an Article (in PHP)

In J4, when I want to set a value to a Custom Field, I use the following code and it works fine: $model = new FieldModel(array('ignore_request' => true)); $model->setFieldValue(2, $item->id, '...
Marc Dechèvre's user avatar
2 votes
0 answers
127 views

SimpleXML load file error for cli PHP script

I am using the following code in the Joomla Cli to import news items into articles on a client's website. It was working perfectly until yesterday when an error was reported and no news items were ...
Mike Hermary's user avatar
0 votes
1 answer
351 views

Display current article's specific custom field in module

Im using Joomla 4. And for some reasons I need to publish my articles with joomla 4 custom html module that shows specific custom fields of current article. I have changed mod_custom's default.php ...
okisan's user avatar
  • 55
1 vote
2 answers
78 views

How do I create a new PHP variable for a blog override from the result of JDatabase join query?

In a category blog override I am attempting to reflect the featured status of an article. In order to find out whether it is currently actively featured - i.e. not 'pending' or 'expired' I am querying ...
Gillian's user avatar
  • 411
1 vote
1 answer
97 views

After joining two tables in phpMyAdmin how do I save the results as a dynamic table?

In order to query the exact featured status of an article in a blog override (i.e. currently featured, not pending or expired or not featured at all) I have created a query to join two tables and ...
Gillian's user avatar
  • 411
1 vote
1 answer
100 views

Where is Joomla's ServiceProviderInterface

I am working my way through a Joomla 4 component tutorial. I have setup Visual Studio Code's Intelephense to be able to find Joomla classes using includepath. That seems to be working fine for the ...
Jimmy's user avatar
  • 327

1
2 3 4 5
16