Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
1answer
1k views

Joomla administrator error Call to a member function isAdmin() on null

I' m trying to login in Joomla Administrator (Joomla 3.5) and I am getting this error: Fatal error: Call to a member function isAdmin() on null in /var/www/html/plugins/system/stats/stats.php on ...
2
votes
2answers
132 views

Fatal error in K2 Tools Module

Every so often, I get this error in one of the sites I manage: [16-Dec-2016 17:08:20 America/Detroit] PHP Warning: require_once(/path/to/site/modules/mod_k2_toolsDShelper.php): failed to open stream:...
0
votes
0answers
665 views

“PHP Fatal error: Call to a member function get() on a non-object” in K2 Template

On December 8, I first received this error on a site I manage: [08-Dec-2016 13:38:28 America/Detroit] PHP Fatal error: Call to a member function get() on a non-object in /path/to/site/templates/...
3
votes
2answers
3k views

PHP Fatal error: Class 'ContentHelperRoute' not found

I am getting this line in the error_log of a Joomla! 3.6.5 site every so often: [21-Dec-2016 18:29:41 America/Detroit] PHP Fatal error: Class 'ContentHelperRoute' not found in /path/to/site/...
2
votes
1answer
53 views

How to develop a survey extension which prevents respondents from taking a survey more than once?

I'm looking for advice on how to make a survey for my Joomla production (3.6.4) site. A key requirement is to restrict respondents to only taking the survey once (i.e. preventing 'ballot-box' ...
1
vote
1answer
168 views

How to update bulk articles using php script without content modification

I want to edit/update Joomla article using an external script. The assets table has been broken and for that I used ACL Manager to fix it. But there are some missing assets for which I need to open ...
2
votes
2answers
894 views

How to share Joomla Article through Whatsapp?

This is my sample article..How can I share this article through Whatsapp? Your answers will be appreciated..thanks!
1
vote
0answers
47 views

What are the purpose of comments with @ in Joomla PHP files? [closed]

There are PHP comments similar to these: /** * @package Joomla.Administrator * * @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. * @license GNU ...
5
votes
1answer
4k views

How to know which usergroup/specific access level user belongs to

For determining whether user is a super user, we do something like this : $user = JFactory::getUser(); $isAdmin = $user->get('isRoot'); if ($isAdmin) { echo 'You are an Administrator'; What would ...
3
votes
2answers
607 views

SMTP connect() failed, Cannot send mails

I have a vanilla Joomla installation. I installed RSForm plugin to send emails from Contact Us form. However, when the user fills out the form get the message: SMTP connect() failed I tried to ...
1
vote
0answers
386 views

Retrieving data from Joomla! Subform form field type

I'm trying to retrieving data from Joomla! Subform form field type, Here what I have: <fieldset name="item_lists" label="Item List"> <field name="ilist" type="subform" ...
3
votes
1answer
780 views

Register user via external script and a random password

I have this PHP script that I want to call from a mobile app, that registers an email address, uses a random password, and automatically activates & asks the user to reset the password upon first ...
0
votes
1answer
288 views

How to filter and reduce drop down select box

Using below code to display database values as drop down in rsjoomla $items = "|Please Select[c]\n"; $db = JFactory::getDBO(); $db->setQuery("SELECT id, prod_name FROM __used_products ORDER BY ...
3
votes
2answers
796 views

AJAX post not able to update database

How can I achieve a database insert using AJAX? I've created a module and I'm using AJAX post to insert a record into the database but seem to get a silent error and no database update; I know the ...
3
votes
2answers
453 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 ...
0
votes
2answers
690 views

Update to 3.6.3: hitting php memory limit

I'm trying to update my installed Joomla! 3.6.2 to 3.6.3 using the update tool provided. On doing so I seem to hit the php Memory limit: Fatal error: Allowed memory size of 67108864 bytes exhausted (...
1
vote
1answer
80 views

Add a different class to each item

I have a problem with long article titles at my homepage. https://imgur.com/NhtkJh3 I've tried to condense it to one-line by putting the HTML/CSS code in plugins like sourcerer or rokcandy, however ...
3
votes
1answer
194 views

K2 User show total number of Item hits

I have a requirement where I want to show the total number of hits that a user's items have been read. For example, if they have ten K2 items, each have been read 10 times, then I want to show the ...
0
votes
1answer
60 views

Add header to Category Blog Menu Item

I'm looking to add a header to the 2 pages we have with Category Blog pages. I want to add an RSS button to subscribe to these pages. Any insight on how I can add this without hacking the core ...
1
vote
3answers
807 views

Creating custom form field in Joomla 3.6 plugin

I looking if there is a solution for creating a custom field in the xml file so i tried to create a field <field name="inject_label" type="note" default="WRAPROTECT_PLG_INJECT_LABEL" ...
5
votes
1answer
408 views

Abandonware user self-registration procedure in Joomla core

Joomla 3.6 has two different controllers intended to create a new user: UsersControllerRegistration::register() defined in components/com_users/controllers/registration.php and UsersControllerUser::...
1
vote
1answer
209 views

How to prevent a single user from voting multiple times on a single article?

I am using the Joomla Rating System, and I'm trying to change the code slightly. Right now, there is a possibility that a user can rate more than once on one article. I have already changed the star ...
1
vote
1answer
333 views

How to define Array in XML field - Joomla

I have try to define a array in media field name in joomla xml file.but it doesn't work. <field name="s1img[]" label="Image 1" type="media" directory="Images" /> <field name="...
1
vote
2answers
27 views

FB adverts plugin on Joomla

Is there any plugin for adding FB adverts code on joomla similar to Google anlytics plugins, so that it can be enabled on every page at a time. To put it more simple is there some plugin which can ...
1
vote
1answer
919 views

Refreshing module/div on form submit [without page reload]

I have this simple search form inside a custom module. HTML FORM: <div id="search-form"> <form action="" method="post"> <input type="text" name="roll_no"> <input type="submit" ...
1
vote
1answer
70 views

Adding a stand alone php (with sql queries built using mysql phpgenerator) to existing Joomla application

I am totally new to Joomla development in specific but have done good old prog days (C, Oracle, Sybase etc). So i use a Library software in Joomla and do all the installation, admin etc thing.. i want ...
1
vote
2answers
71 views

Empty space before doctype in custom joomla template

Hello I have custom joomla template: Demo is here When I check source code for this template here is empty space before doctype html. I try to make: included helper file and here is no problem. (...
1
vote
1answer
90 views

Archive file corrupt error but tmp dir is writable

I have a Joomla 3.4.5 running on an Azure web app and when I try to run the update to 3.6.0 I get the The archive file is corrupt, truncated or archive parts are missing error. I checked in system ...
1
vote
3answers
445 views

PHP function with JDatabase queries

I have these two blocks of identical code in one of my PHP modules. The only difference between these two blocks is that in first block it is ... active = ' .$db->q('1')); and in the second block ...
0
votes
1answer
25 views

How to get all the articles by only knowing half of the ID or Name?

I need to get an array of all the articles that have a fixed part in their ID or Name and then create a template based of them. For example: I'll create many articles that have in their ID "plants" ,...
0
votes
1answer
367 views

Koowa suddenly throwing strict errors

Got a call from a client today who suddenly had these errors on the site, on Joomla 2.5.28 Really interesting is - no one has made edits to this site in over a month, but these errors were not ...
0
votes
2answers
222 views

Joomla! 3.6.2 Template Purity III Layout Glossary - second alphabet ordering

I'm on Joomla! 3.6.2 with Purity III template (JA). I try to use the glossary layout with Cyrillic alphabet but the php doesn't check the language and puts the articles in alphabet order only in ...
2
votes
2answers
78 views

How to make it easier for a client to update Joomla website?

I'm new to Joomla! and I'm designing a website for a client, my very first in Joomla!. He doesn't know how to code, so I'm trying to make it easier for him to update content after I finish with the ...
1
vote
1answer
159 views

Joomla 3.6.2 - Generate datePublished and link of img of item

I have a problem on the generation of an article creation date . The code is inside the script google < script type = " application / ld + json " > and my code is this : <?php echo JHTML::_('...
2
votes
1answer
154 views

Joomla sessions within a loop passing only a single value

I need to pass some variables from one PHP module to another PHP module within a loop and at the same time display the module multiple times as well. I use Joomla sessions for passing variables and ...
0
votes
3answers
506 views

Custom Payment Gateway integration in joomla registration form

I have installed Joomla 3.5. There are a default joomla registration form, image as follows: So I want to integrate Pay-u-money payment gateway and users should enter card details in the same ...
1
vote
3answers
207 views

Joomla PHP what file to make cookie on all pages

So on all pages of my site including error pages I want a cookie to be created on the clients browser to define if they are logged in or not. Just need to know what Joomla core file or plugin etc I ...
0
votes
2answers
3k views

What is the best way of using PHP code in Joomla's articles or modules?

Let's say I need to create a simple page and for my links I want to use JRoute::_() in order to make them SEF or display ID of the current user. What would be the best way to achieve this? Joomla by ...
0
votes
1answer
82 views

Restricted direct access creates problems passing references between files

Context (Long Story Short): I am using a PHP script and the $_POST variable to handle certain ajax POST requests from a view template. It needs access to database connector classes which can be ...
2
votes
1answer
175 views

Where to prevent field value change in custom component form record?

Where is the best place in Joomla MVC (server-side) to forbid users from changing a value in a pre-existing form record? In JTable check / bind/ JModel prepareTable, or elsewhere? For context, I have ...
1
vote
1answer
1k views

Website error when I backed up my website from my old web host and restored the site onto my new web host

I just recently backed up my Joomla website from my old web host and transferred the domain to my new web host. I then restored the database files and SQL files as well as corrected the configuration....
3
votes
1answer
150 views

Get the output of another url and store it in a variable, while maintaining session

Scenario: User is posting an ajax request to Joomla site (via com_ajax). Inside the called method, I want to retrieve the entire html output of a known Joomla submenu (let's say /contact). The ...
1
vote
1answer
59 views

Reading from & writing to user-specific page

I'm new to web development and php, but i'm knowledgeable in Java, Python, C and programming in general. I want to create a user-specific page that stores the IP addresses of the user (and users have ...
2
votes
2answers
152 views

Set module assignment at menu creation

I have a component which creates content pages for custom entities. I have an xml which allows to set those pages as menu items of that entity type. I have 1 module that I always want to display on ...
1
vote
1answer
86 views

Re-using Joomla module positions not setting Bootstrap Column width correctly

I want to use 1 module position (showcase) but have duplicate modules set the bootstrap column width based on the amount of modules assigned to that position. I have written the following code: <...
2
votes
2answers
134 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. ...
0
votes
2answers
195 views

How add days to date into query joomla?

I need to run a query that selects records whose date is not within a date range. More exactly, I need the records whose date is not found among their own date and 5 days later. For example, suppose ...
1
vote
0answers
164 views

Joomla 3.5.1 - Ajax with PHP not send email

I'm having some problems with the action of an Ajax form. Here is the Javascript: <script type="text/javascript"> var $j = jQuery.noConflict(); $j(document).ready(function() { $j(...
1
vote
0answers
184 views

Why use ob_start and eval instead of using a simple include in this Joomla Plugin?

I was looking at the code of a Plugin for Joomla! CMS for a functionality I need: the possibility to run custom PHP scripts when a Joomla! Plugin/Events is fired. I wanted to learn the mechanism used ...
1
vote
1answer
38 views

How to recover the values of two columns with the same name?

I have this query: $query ->select(array('a.id', 'a.alias', 'b.category_id', 'b.item_id', 'c.id', 'c.name', 'c.alias')) ->from($db->quoteName('#__zoo_category', 'a')) ->join('...