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
0answers
76 views

Set article attribs on-the-fly via JTable

I am using a CCK (Seblod) that extends com_content and allows adding complex fields, like PHP code to be run on onBeforeRender event. I need to change the values of some attribs of an article in the ...
1
vote
0answers
16 views

SqueezeBox in Joomla plugin

I'm just starting with Joomla. There is not much documentation about SqueezeBox to use modals. I noticed when I installed a plugin, it created a css file in this directory \joomla\media\system\css\...
1
vote
2answers
222 views

Selecting data from two tables and make a ranking in an HTML table

I want take the result from scheda_atleta table for every player and make an HTML table with the best result. I've two tables: first named: at +----+----------------+ | id | nome_e_cognome | +----+----...
0
votes
1answer
27 views

Get SEF path of an article from external script using articleID

I am practically new to Joomla and I need to get the SEF path of an article from an external php script. I feel like I'm close, but something is not working for me. The preliminary code I have as an ...
0
votes
0answers
33 views

Joomla - PHP session in joomla disappears

I am programming a little component and module in Joomla. My component and module reads a variable from the php session (this variable is set before for external php script). External php script: ...
1
vote
1answer
26 views

Why do the default PHP Joomla! files get restored without asking?

I edited \components\com_content\views\article\tmpl\default.php file to suit my needs, and to output a customized string instead of the default H1 header. The site was running all OK, but when I ...
0
votes
2answers
41 views

Using isset or is not set PHP variable with extra fields?

I have an issue with setting up variables - if the custom field is filled then it should be shown, if it's empty - then date (+1 month from today's date) is shown. However, it doesn't work properly. ...
1
vote
2answers
37 views

Fields component media field using absolute url instead of relative

I use the Fields component and I have a field "Media". You can choose an image this way. But this spits out a full tag. This should be no problem but in my case I need it to be a full ...
2
votes
0answers
39 views

Generating a module instance from PHP

I am trying to render a mod_login module - on the fly - from inside a system plugin. So far, there is no existing mod_login instance in the website nor the database. I am just trying to create a new ...
0
votes
0answers
4 views

how to fix array error on spgenries.php of sp movie database for joomla

This is my first time using sp movie database on joomla. I am getting an error on spgenries, please help with this.... Warning: count(): Parameter must be an array or an object that implements ...
2
votes
1answer
39 views

Using hooks in Joomla to add a Single Sign-On link in main page of Joomla

I have implemented SSO (Single Sign-On) in Joomla using OKTA and now my goal is to add a link in the main login page of Joomla using hooks. To do this, I have added one checkbox in the service ...
2
votes
3answers
61 views

Cannot Connect To MSSQL Server

I am using php 7 and trying to connect to mssql server. I have this code: <?php $serverName = "server"; //serverName\instanceName $connectionInfo = array( "Database"=>"...
2
votes
1answer
37 views

How do I pass _JEXEC to a php file?

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 able to use standard, commercially available mailers while ...
1
vote
2answers
34 views

Deleting rows in two different tables

I'm trying to make function (task) and deleting rows in two tables. But I don't get this sql query working, I only got this error: 1064 - An error has occurred. You have an error in your SQL syntax; ...
0
votes
1answer
42 views

Photo size validation

I use the Fox Contact component on my website, and through that component users send me photos (as an attachment) I had to make a few modifications in the upload form itself and make filters for file ...
1
vote
1answer
68 views

Pass PHP variables to CSS?

I want to pass some variables to my css, without using inline styles. During some research I found different sources pointing to the same solution. For example here on the Joomla forum. Basicly they ...
0
votes
2answers
35 views

How to reference a file locally within my class

I'm trying to use file_get_contents to reference a .json file in my module. My directory structure is as follows my custom field which is trying to reference the json file /models/fields....
0
votes
2answers
65 views

How to change logo's link URL?

I recently bought a new domain and transfered my old site's files to it. It's all nice, but the logo still points to the old site. How can I adjust it? Here's my new site home page and the logo is in ...
1
vote
2answers
86 views

Best way to clear a group's cache in Joomla via php, from an administrator plugin?

So background: I'm making a caching plugin that clears our site and CDN caches when content is saved in the administrator backend. In this instance, I want to clear the site cache for one group. My ...
0
votes
1answer
39 views

Controller Joomla - Output Class construct for color css style

thanks to you i'm learning a lot about php and Joomla Develop! Many thanks! Now i'm trying to understand php class into joomla and construct output i've created this class into my controller.php ...
0
votes
1answer
30 views

How to extend class on my component class in controller.php

I have created a Basic Joomla Component with Component Creator in order to prepare every single files in less the 1 minute :D (I'm lazy, i know.) I have one view default and one for form edit. I ...
1
vote
2answers
69 views

Use custom fields in index.php template file

For some reason i need tu use articles custom fields in index.php file template, i try this code without success : This after defined('_JEXEC') or die('Restricted access'); JLoader::register('...
0
votes
1answer
35 views

Joomla php function which prints the pagename

Is there a php function to insert in the template which prints the name of the menu item of the displayed page?
1
vote
1answer
38 views

Problem accessing database from front end of a component

I am currently working on a component which will display "events", stored in a database, on a map (filterable by location, category, date etc...). My first step is to display a simple report of the ...
0
votes
1answer
39 views

How to get the currently installed Joomla! Version in PHP

For one of my extensions i need a switch statement if the Joomla! Version is 3.x or 4. (in fact i have to call the Articles Model in different way for J4) - but how can i get the actual installed ...
0
votes
1answer
34 views

How to cancel a mandatory (required) field in Virtuemart form submission process?

I want to free my future site's visitors from having to fill out the form before submitting their name, e-mail and a phone No. Basically, in most cases it won't be needed for them to also add more ...
0
votes
0answers
22 views

Modify the Expires Header

In the file: /html/joomla-usa/libraries/src/Application/WebApplication.php are the code: if (!$this->response->cachable) { // Expires in the past. $this->...
2
votes
2answers
51 views

Language Constant Not Displaying in External Script

Joomla 3.9.14 I have an external application that uses the script below, allowing users to register as a user on my Joomla site. It all appears to be working apart from error displaying. My code is ...
1
vote
1answer
62 views

External Login Script and getDbo()

I have a Joomla 3.9.14 site with a subdomain app.example.com. I have a login form, and I want to allow users to login using their Joomla credentials. Everything is working as expected, users are ...
0
votes
0answers
37 views

Converting to JS

Hello i am still learning but was wondering if anyone here could help i have the two function be low i would like to convert them to JS to store in an external file then be able to call one of the ...
0
votes
1answer
58 views

Show the fieldgroup title on /html/com_content/article/edit.php

We want to move all field groups to the first content tab on the backend and assign individual classes to every field group. Therefore, we've already ignored the fieldsets to avoid the creation of the ...
1
vote
1answer
70 views

How to include images in Joomla's search results?

I'm trying to display images in search results for the default search of Joomla. I messed with some code from the web and I managed to display images with the following: in template/html/com_search/...
-1
votes
1answer
27 views

How do I find the first NON bootstrap class ancestor of my current module position?

Not sure I'm wording this right so please forgive me. I'm working on a situation where I want to apply the background to the 1st NON .container ancestor of my current module. So, for example.. <...
0
votes
2answers
56 views

Jooma Article content to load from mysql based on ID in url?

On my old website, built in php i had a link on a page, wich picked an ID based on what line it was. <td width=124><a href="tp/package.php?ID=<?php echo $row[0];?>">Package</a>...
0
votes
1answer
43 views

Joomla old code to latest 3x series with best practice of safe and secure code

Am Trying to rewrite this code with latest joomla and php for best practice Confused on where to use this function in new code onchange="showModelVariant(this.value)"> Is the new code correct ...
1
vote
1answer
124 views

RSS Feed error: “cURL error 22: The requested URL returned error: 403 Forbidden”

I'm trying to load the following RSS feed in a Joomla! Feeds module: https://community.joomla.org/events/view,rss.xml However, I get the following error: cURL error 22: The requested URL returned ...
2
votes
2answers
80 views

Latest articles structured data markup

I have added microdata into every article manually and it works fine. Now I want to insert them into the latest articles module. To override the module in my template and I added: <li itemscope ...
0
votes
0answers
143 views

Joomla 3.9.13 - Error: Failed to start application

I just installed version 3.9 joomla in local using xampp. Once the installation was finished correctly I tried to navigate the site and the backend. After loading a few pages, this annoying error ...
0
votes
0answers
19 views

How to change a language constant on the fly with PHP?

In Joomla! (currently 3.9.13) the language constant COM_INSTALLER_TYPE_TYPE_ is not defined. The constant is used in the error message that is displayed if the Joomla extension update system (the 'one-...
0
votes
0answers
11 views

Why am I getting an editors iframe popup in tiny mce editor when I embed a canva button in it

I am trying to embed a canva button in tinymce editor. Everything works fine. The canva url get loaded in a iframe but at the same time an iframe is also loaded in the back with the home url. How to ...
1
vote
0answers
46 views

ob_flush pushes output before Joomla header

I have a module that I've created to test ob_flush buffering off. I need to understand it so I can have some longer modules buffer output to the page as the script goes through long processes. The ...
3
votes
1answer
109 views

JHTML::_('behavior.tooltip') — Set tooltip position

I'm trying to set the position of the tooltip in Joomla 3.9.8. I've used: JHTML::_('behavior.tooltip'); At the top of the document. I then have field set as: <?php echo JHTML::tooltip($...
0
votes
1answer
160 views

I can't install Joomla because Zlib Compression Support no

I'm trying to install Joomla 3 on docker server using php 5.3.29 but I can't because : Zlib Compression Support no In Pre-Installation Check I tried every thing found on internet but still having ...
1
vote
1answer
46 views

How to add userinfo to link in Joomla Page

We have a Joomla site (latest version) with a page that links to another system with a fixed username/pw, so like https://www.othersystem.com/login.php?un=[fixed_un]&pw=[fixed_pw]. Now we need ...
3
votes
1answer
108 views

Programmatically set article image

I generate/update several articles through a PHP script (in the cli folder) that parses an external data source (custom tables). This works well. Now, if an article has not yet an image, the script ...
2
votes
4answers
108 views

How to use cookies to populate RSForm fields without notices/warnings?

I have used this code to save the RSForm data in a cookie and if the user tries to fill in the same form again, the previously entered data is loaded as default values: Script called on form display: ...
0
votes
3answers
153 views

Joomla 3 call model function inside controller

I want to call a function from model inside controller my model : httpdocs/components/com_storemanager/models/searchmanager.php <?php /** * @version CVS: 1.0.2 * @package ...
1
vote
1answer
101 views

Joomla 3 return view with parameters

I'm using Joomla 3 and I have a controller with the function abc that should call a view with some parameters title & address My controller :components/com_storemanager/controller.php <?php /...
0
votes
1answer
46 views

Joomla 3 database query select with limit [duplicate]

How can I use this query with joomla 3 with limit to 3 SELECT * , (3956 * 2 * ASIN(SQRT( POWER(SIN(( $coorlat - latitude) * pi()/180 / 2), 2) +COS( $coorlat * pi()/180) * COS(latitude * pi()/180) * ...
1
vote
0answers
67 views

Homepage of multilingual site not working anymore after removing index.php (404); all other sites working

So I removed the "index.php" - part from the URL in Joomla in the following way: Change the htaccess.txt - file name to .htaccess via FTP Set the URL-rewrite Option in the Joomla Configuration ...

1
2 3 4 5
13