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.

0
votes
1answer
14 views

joomla user list filtering

For joomla, I want to list only the ones with a group_id value of 10. Why doesn't the following query work? $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->...
0
votes
2answers
106 views

PHP7.2 Undefined variable: option in … index.php with Dj-Business004 template

When I update PHP from PHP7 to PHP7.2 the website gives this error: 500 Internal Server Error This is in the Log file: [Thu Jan 24 04:44:56.061781 2019] [proxy_fcgi:error] [pid 30185:tid ...
1
vote
2answers
2k views

Check if items from an array exists in table and if not insert them into new records?

I have an array of image file names which i want to compare against a table in my DB, if the filename is not present then i want to insert it. I have started work on the insert statement, so i will ...
0
votes
1answer
83 views

Error trying to update above PHP 7.1.27

Trying to update PHP from 7.1.27 to 7.3.3 and can't seem to. Set error reporting to max and after awhile of loading these are the errors I get on top of a white screen (admin also gone) Warning: ...
1
vote
1answer
25 views

Joomla Warning Showing Incorrect PHP Version

Using Joomla 3.9.8 I recently migrated from localhost (PHP 7.1.9) to a live server (PHP 7.2) On localhost my site was installed at localhost/mysote. On my live server it's installed at dev.example....
0
votes
1answer
42 views

Using a custom field with different names

I want to use a flexible field name for a field across different forms thru my extension. My custom example field looks like this: defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\...
0
votes
3answers
38 views

(Module override/PHP) Checking if a content-item has an image otherwise display a placeholder

I am customising a Joomla module (Override) and it does not seem to accommodate if an image is not selected (just shows a broken image symbol). What I'd like to do is check if there is an image and ...
0
votes
1answer
646 views

Problems When I change my PHP version to 7.2(Error 0 Using $this when not in object context )

I have my website in production now, The site works very good with PHP 5.6 and 7.0 but When I try to change the PHP version to 7.2 the website doesn't work. It shows me an error message like this: I'...
1
vote
1answer
30 views

mklink and JFolder: :folder: Path is not a folder [due to is_dir()]

Joomla is on Win2012 R2, XAMPP, Fabrik. I created a symlink like so: C:\Users\Administrator>mklink /D "C:\xampp\htdocs\pdf" "Z:\" symbolic link created for C:\xampp\htdocs\pdf <<===>> ...
3
votes
2answers
385 views

How to sort my query's results by publish_up value?

I have a .php script that retrieve fields from my database table and then displays them in a foreach loop (here are the relevant parts of the code): <?php $jquery1 = "SELECT `...
3
votes
1answer
2k views

Creating custom field type multiselect list - how to save the values?

I want to make a module that parses the manufacturers from virtuemart, and the user will select which manufacturers he wants to be shown in the index page. Its the first time I try to create a custom ...
1
vote
1answer
151 views

Joomla.submitbutton is not a function at HTMLButtonElement.onclick

I have been facing a problem when I try to update the article from the frontend then it shows this error Joomla.submitbutton is not a function at HTMLButtonElement.onclick Here is my code &...
0
votes
1answer
62 views

How to remove username field from the reset password confirmation form?

Does anybody know how to remove the username field from the reset password confirmation form? I edited the reset_confirm.xml file in /components/com_users/models/forms to remove it from the front end,...
0
votes
2answers
133 views

How to write a condition to check if a number is a multiple of 30?

How to set up an array so that instead of maximum - an array on multiples of 30 is shown i.e $max = 30, 60, 90, 120, 150......and so on If array $max matches on multiple of 30, 60, 90, 120, 150, 180,...
0
votes
1answer
30 views

Joomla backend not reflecting updated PHP version

I've updated to PHP 7.2.17 through my host's cpanel, but I'm still getting a message in the Joomla backend that my PHP version is not updated. Error We have detected that your server is using ...
1
vote
1answer
21 views

How to pass a php array to javascript array/object with non-sequential keys

I'm trying to pass a php array to javascript, but the array has non-sequential keys. Here is a portion of the array: Array ( [1812] => Array ( [RecID] => 1 [...
0
votes
0answers
25 views

com_weblinks Unhandled exception - InvalidArgumentException

Admin Tools is notifying me of a PHP exception that occurs within the Weblinks component on Joomla 3.9.6. I have included the stack trace below for reference. The exception occurs infrequently (about ...
0
votes
3answers
782 views

Reformat DATETIME type value to European date format

I have a select query which returns a DATETIME value (stored format: YYYY-MM-DD HH:MM:SS). I want to show this on my site in "Euro date format" in other words d-m-y format. So what sql code should ...
2
votes
2answers
34 views

How to stop Joomla 2.5 from disabling PHP

I need to stop Joomla from converting PHP code to a comment (or otherwise disabling it). I copied a working page with a basic [directory listing] function, and the duplicate wouldn't work. I am ...
-2
votes
1answer
32 views

What does the line in the code below does? [closed]

$hasContent = empty($this->item->module) || isset($this->item->xml->customContent); line 23 in /administrator/components/com_modules/tmpl/module/edit.php
0
votes
3answers
393 views

Problems with sourcerer and a table

Why if I try to generate a table in a custom html it doesn't show a table?, it appears everything in the same line and I don't know why. This is the code: {source} <?php $db =& JFactory::...
0
votes
2answers
100 views

How can I generate a csv file using query results and email the file as an attachment?

I am trying to email the results of a query as an attached .csv file to my admin email. The code correctly saves the .csv file, but the email is never actually sent. If I put the sendmail code into ...
0
votes
2answers
41 views

Individual user fine grained ACL is it possible in Joomla! 3.x

I was wondering if it was possible in Joomla! 3.x to have permissions down to individual user level. Eg: user A can see item X but not user B even if user B is in the same group or have the same ...
0
votes
1answer
41 views

Joomla / PHPMyAdmin bug when “select” is in the value

This question was originally asked on StackExchange, and it was recommended by @mickmackusa that I ask it here. Background We recently changed over from one server to a brand new one. Old server: ...
0
votes
2answers
299 views

How to make a mysqli connection and execute a SELECT query in Joomla?

I am having an issue with a basic query in PHP. The query runs perfectly in PHPMyAdmin, but in the browser I am getting: Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, ...
1
vote
0answers
455 views

Fatal error: Call to undefined method WFEditor::getContext() in …/administrator/components/com_jce/models/model.php on line 128 [closed]

I am unable to login into back end of joomla, i am using joomla 3.6 and when i operate PHP Version 7.0.12 and try login, i get Fatal error: Call to undefined method WFEditor::getContext() in .........
1
vote
1answer
61 views

Generate and render a module on an article with PHP

I want to create a module and add it to an article I can already create the module manually and can add it to the article using php. I can't figure out how to add a module using php. So if I have ...
0
votes
1answer
267 views

Implement Joomla 3 registration field with jquery autocomplete

I want to implement a field with jquery autocomplete the code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title></title> <link rel="...
2
votes
1answer
764 views

How to load and use external libraries in a component?

I am wondering how to load "external" php-libraries into my component. I would like to fetch mail via imap. To get this working, I would like to use a lib which is able to handle smime-encoded mails. ...
1
vote
2answers
2k views

MySQLi PHP Warning

I am getting the following errors (in this order) thousands of times in my error log: [08-Jun-2016 13:11:05 America/Detroit] PHP Warning: mysqli::stat(): Couldn't fetch mysqli in {...}/libraries/...
1
vote
3answers
248 views

How to iterate over the “params” of an item ZOO Joomla?

The item of my interest is in the __zoo_item table. My query: $query ->select($db->quoteName(array('params'))) ->from($db->quoteName('#__zoo_item')); $db->setQuery($query); $...
0
votes
2answers
313 views

Use one pdo connection across multiple modules?

I have multiple modules on the same page that are individually connecting to the same external database through pdo connections. The website is getting slower since I added more modules. My guess is ...
0
votes
1answer
137 views

Parsing Error Javascript in php include page on the test server

We're getting this error in our test environment: Parse error: syntax error, unexpected 'var' (T_VAR) in /home/usaspo5/public_html/dev/usgnew/components/com_usg_programs/tmpls/default.php We have ...
0
votes
2answers
58 views

How to add php & js code in the header of a Gantry Helium template?

I want add some PHP code to the head of a template, but I am unsure as to how to achieve this. I've tried adding the following to my index.php but it doesn't work: <?php class __AntiAdBlock_ { ...
0
votes
1answer
56 views

Hikashop, extract text after read more

I want to have the introtext and then the rest of the text in Hikashop product details page. So in the product description I insert the <hr id="system-readmore" /> to separate the introtext and ...
0
votes
1answer
38 views

How can I prevent Joomla from removing octothorpe/pound from URL post login?

For example, I would like to send the following links in an email to users: https://www.example.com/#foo https://www.example.com/deep-link/#foo When clicked on, I get the following results: https://...
2
votes
3answers
121 views

Is there a file that defines error messages?

I would like to catch some exceptions to inspect the error code and determine if I should re-throw it with a more user friendly message. This would probably be most beneficial with MySQL errors. Is ...
1
vote
0answers
31 views

Echo PHP output in a slider effect

I'm fetching data using for loop and echo results on a page. How do I output the results in a slider effect? I have tried a simple CSS slider but can't get the intended result. What I end up getting ...
2
votes
1answer
24 views

What type of extension processes non-HTML markup in an article?

I'd like to develop an extension that processes images and related data using article markup, such as is done by Articles Anywhere, for example: {article 999}{/article} In my case it would look ...
0
votes
1answer
33 views

CheckToken() error when TinyMCE init

I have a form, which add some data to DataBase. <form> <input type="text" name="mydata" /> <textarea name="mytext"></textarea> <?php echo JHtml::_( 'form.token' );?> ...
0
votes
2answers
47 views

Is there any one to use the mod_menu as we please? *Modifying the backend*

so I've been asked to make a special menu for a website.I'm using the default module that is mod_menu. The issue is I want to modify the HTML Structure to that module. But I heard modify the default ...
1
vote
1answer
61 views

How can I use joomla 3 user group access level code under public static function

Currently I am trying to use group access level code under public static function. File is belong to 3rd part component and stays under the administrator folder. 3rd part component has own custom ...
-1
votes
1answer
103 views

Simple plugin to check folder contents on component update

I'm wanting to make a very simple plugin. All it needs to do is On installation of the plugin, copy a folder to a particular component's library folder. When a particular component library is ...
1
vote
4answers
2k views

Display a Value from a Specific DB Field

I'm trying to figure out what I've got going on here thats not working - I'm using RsTicketsPro and I'm trying to pull a specific value from their custom fields section in the database. I reached out ...
1
vote
1answer
61 views

Virtuemart 3.4 - products on manufacturer page

Virtuemart 3.4.2, joomla 3.8 i try copy code from category template, but cant fix this errors: at /my_template/html/com_virtuemart/manufacturer/details.php NOW I HAVE Two ERRORS: Call to a member ...
1
vote
2answers
154 views

How to refactor two select queries on RSForm submission data?

I was wondering if anyone could help me JOIN multiple queries into one query. Currently, these 2 blocks of code retrieve information from the DB. I am using the "Sourcerer" plugin to add custom PHP ...
2
votes
2answers
159 views

How to retrieve RSForm submission data grouped by SubmissionId?

I have a table with 3 columns: SubmissionId, FieldName and FieldValue. 1) SubmissionId keeps ID submission. 2) FieldName stores field name of a form. 3) FieldValue stores field value of form field. ...
3
votes
2answers
477 views

Make CodeMirror highlight PHP syntax

CodeMirror by default only highlights mixed-html syntax (i.e html, css and javascript) in Joomla. Many of us use custom plugins to run PHP inside modules and articles but CodeMirror doesn't highlight ...
2
votes
1answer
49 views

create user and set its frontend language via php-script

The code below (modified from another post) works fine for me to create a user. But how do you set the new user's frontend language? In the code below, the lines 'frontend-language'=>'de-DE', '...
8
votes
2answers
1k views

What is the Joomla Execution Flow, after a request reach to index.php till the final output on the browser?

Based on this question: How Templates work and load css/js files? Website building process with Purity III Quote: .... I have to present my website tomorrow and i may get asked "where does the ...