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
1
vote
1answer
29 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
50 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 ...
1
vote
3answers
1k 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
40 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
36 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
471 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
409 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
935 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
531 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
508 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 ...
2
votes
1answer
1k 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. ...
0
votes
2answers
602 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_ { ...
1
vote
0answers
71 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
26 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
2answers
62 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
120 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
113 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
3k 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 ...
3
votes
2answers
855 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
79 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', '...
9
votes
2answers
2k 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 ...
1
vote
3answers
2k views

When calling sendMail, how do I get the error if the mail isn't sent?

I'm sending email using the following code: $mail =& JFactory::getMailer(); $email_sent = $mail->sendMail( $from_email, $from_name, $to_email, $subject, ...
2
votes
1answer
637 views

Update from 2.5.28 to 3.5.1 then to 3.6 on PHP 5.6 everything works except joomla update or database fix cause these errors

clicking joomla update button in backend end gives this error: 1054 Unknown column 'a.extra_query' in 'field list' SQL= SELECT DISTINCT a.update_site_id, a.type, a.location, a....
1
vote
3answers
2k views

Retrieving multiple results from the database

I don't have much Joomla or PHP experience so I'm probably missing something really simple. I'm trying to load a certain list of user IDs into an array. This code works except it only loads one result....
1
vote
2answers
137 views

How to refactor my iterated sequence of queries?

I'm building a component which is about to be finalized, but there is a bit of code that I want to refactor. I think this code can be completed in one statement and I used more than 3 statements. $db ...
0
votes
3answers
100 views

Convert PHP code to Jooma PHP syntax?

I'm running a query on phpmyadmin which has the "IN" function included. It is to extract data from the same column for different fields' (Waybill1, Waybill2 etc.) I shall post the SQL query below: ...
32
votes
4answers
4k views

Method for creating a subquery using JDatabase

At http://docs.joomla.org/Selecting_data_using_JDatabase, there isn't a documented method for writing a subquery using JDatabase. https://gist.github.com/gunjanpatel/8663333 exemplifies one way of ...
1
vote
2answers
238 views

Database query outputting twice

I have the following database query: $database = JFactory::getDBO(); $database->setQuery("SELECT items.headline, items.image, items.copy, items.source FROM ...
0
votes
2answers
1k views

How to run delete sql query with multiple values in Joomla?

I would like to run a delete sql query with multiple values in it in my joomla site. But I am unable to do so. So I need your help on this. In controller.php page: function deleteFiles() { ...
3
votes
1answer
2k views

Populate multi select data into the custom list field of form inside user management

I am trying to populate multi selected data on to the user management form below the name field of the user. Here is what I have added inside the form, in order to display multi selected data from db....
3
votes
2answers
2k views

Check if INSERT query was successful or failed because of a duplicate UNIQUE KEY

I have a db-table called league where the mail column is the unique id: |name |mail | |Bryan|bryan@hotmail.com | I have a frontend where users can sign up and then I have this for ...
3
votes
1answer
62 views

adding curent item to pagenavigation

I want to modify: /plugins/content/pagenavigation/tmpl/default.php. There are 2 <li> tags, one for "next" and one for "previous". I want to display the current article's title in a <li> ...
0
votes
2answers
527 views

onUserAfterSave called twice because of addUserToGroup

The process of registration is taking way too long (22 secs) so I've been profiling the plugin execution to see what is happening. My registration process is something I do with a custom component (...
1
vote
1answer
172 views

Can I set the directory that Joomla cache will store data in for my module?

Joomla has a nice "Clear Cache" page that lists cached content and lets you delete it. I'd like to allow cached content from my module to be deleted from there. I'm using Joomla's built-in cache ...
0
votes
1answer
1k views

Joomla: Filter items (show items between 2 dates)

I would like to improve my filter in my custom joomla-component. I would like to create a filter that shows all items which have been created between 2 dates (MySQL-Table: creationdate). At the ...
0
votes
2answers
7k views

403 Forbidden Access, when accessing custom html/php files directly

I am trying to open html and php pages directly, but it shows : 403 Forbidden Access to this resource on the server is denied! When I try www.mysite.com/dir/ index page shows up, error ...
1
vote
2answers
267 views

Possible php time outs causing 500 server error?

I was hoping for some advice regarding what I think is a time out error? My problem is that on the first few loads my pages can fail to load and show a 500 error, but if I continue to refresh, or ...
2
votes
1answer
235 views

0 - Using $this when not in object content

I moved a website from server (PHP 5.6.38) to localhost (PHP 7.2.10). And I receive this error in the page title (in the chrome tab): 0 - Using $this when not in object content While searching ...
3
votes
3answers
914 views

Joomla site content not loading

I recently shifted Joomla 1.6 site from one server to another. The site template is showing, but the articles and components are not loading. I tried the SEO friendly URL option, but turning it on ...
1
vote
2answers
5k views

Run UPDATE query on SELECT query result

I want to run an UPDATE query on a record after selecting it. $db = JFactory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query ->select(array('p.*', 'u.id', 'u....
2
votes
2answers
2k views

how to set tmp path and log pat

I am trying to set tem directory path and logs dir path in my joomla site . my site folder path is this "/httpdocs/example.com/online" and my site url this http://dev.maindomain.com/example/online/. ...
3
votes
1answer
1k views

Send array from javascript to php by POST in Joomla 3.x

im trying to send an array from javascript to Joomla 3.x php file. var options = ['foo', 'bar']; $.post('index.php?option=component&view=componentview&Itemid=123&tmpl=component&...
2
votes
1answer
528 views

Joomla registration emails and PHP mail() taking hours to deliver

UPDATE UPDATE UPDATE: Okay so all the emails ended up arriving, but they took anywhere from 30 minutes to 9 hours. Here's the raw message of one maybe osmeone can decipher it for me. Delivered-To: my....
1
vote
1answer
376 views

Custom header content depend on article

I am wondering is it possible to have different headers depending on the different articles? e.g article ID 1 shows header A and article ID 2 shows header B. Currently I have modified the template ...
3
votes
1answer
106 views

What is the prefered method for sharing code and SQL queries in joomla 3.9+?

I'm developing a component that is targeting Joomla 3.9+. The code is not using the legacy classes and is instead using the new namespaces. The component will duplicate much of the functionality from ...
3
votes
2answers
65 views

I would like to add a string after 'script' at JHtml::_('script', $file, true, true);

Inside the recaptcha.php file of the Recaptcha Plugin on Joomla 3.6, I have the following code: case '2.0': $theme = $this->params->get('theme2', 'light'); $file = '...
2
votes
2answers
804 views

How to check if specific table names exist in a database?

All I want to do is check if a table exists or not and I can't figure it out. I've tried: for ($r = 0; $r < count($tableArray); $r++) { $db = JFactory::getDbo(); $query = $db->getQuery(...
1
vote
1answer
85 views

Showing a module only on first page of Category Blog

I am using this code to show a module inside blog.php: <?php echo JHtml::_('content.prepare', '{loadposition myModule}'); ?> How can I show it only on the first page of the category blog? I ...
1
vote
0answers
185 views

How to configure PHP basedir for Joomla running on IIS shared hosting

I have the following setup: IIS 10 with Plesk Onyx 17.8.11. Joomla 3.8.13/PHP 7.2.10. The website is hosted in shared hosting provider. After installing Gantry 5 I get the following warning on the ...
2
votes
2answers
248 views

How to query certain rows from a table based on other associated rows in the same table?

I'm trying to query my jos_rsform_submission_values table for FieldValue data in rows with a FieldName of Container# which shares a SubmissionId with another row where the FieldValue is "Pending" and ...

1 2 3
4
5
14