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
5
votes
3answers
4k views

Php doesn't display special characters

I have a .php that retrieves the publish_up field and echo it. But it doesn't display the special characters such as é,è,û... Instead I get a �. I have set this content="text/html; charset=utf-8" but ...
5
votes
1answer
728 views

Gantry PHP Notice: Undefined property: Gantry::$belatedPNG

So I'm running the master Gantry template however I'm constantly hitting the following PHP notice in my error log - like 20/30 times a day: PHP Notice: Undefined property: Gantry::$belatedPNG in /...
5
votes
2answers
874 views

Module Articles Category: How to group articles and order by category order?

I use the Joomla module 'Articles Category' to present articles grouped by category. Under the 'Grouping Options' tab I selected 'Article Grouping -> Category'. But it only provides ordering by title....
5
votes
2answers
1k views

Rapid Ajax calls causing some MySQL queries to be ignored

I am currently working on a Joomla website on a Unix server. There are no users connected at the moment because I'm the only one who can access it (so no heavy traffic). During testing, I proceed to ...
5
votes
1answer
1k views

Custom component login task

I'm trying to do a very basic login function through my component, but I'm always getting back a TRUE response from the auth, whether I use valid credentials or not. The docs seem to indicate that it ...
4
votes
3answers
2k views

Pass var to jQuery script

I need to pass a php var to a jQuery script. They are in separate files, one file to php code and another file to jQuery scripts. Is there a way of doing it? I am using Joomla 3.4.1. I just need to ...
4
votes
3answers
2k views

Get module parameters using loop

I'm creating a module for a website, and to get the module parameters I do something like this: //-- Get a parameter from the module's configuration $company1_enable = $params->get('...
4
votes
3answers
22k views

Joomla DB Insert, how to get last inserted id?

I have to insert my data into 2 different tables, in the first table I have the following query which works perfectly: $insertProjectUser = 'INSERT INTO #__pmanager_user (user_cms_id, user_email, ...
4
votes
2answers
1k views

Can't change php variables in joomla official docker container

I am using the joomla official docker container. The problem is that I need to install a component but I receive the following error message: Maximum PHP file upload size is too small: This is set in ...
4
votes
2answers
6k views

Error 503 service unavailable in my Godaddy hosting with Joomla 2.5 website

I create a Joomla website before 1 year, but before 1 month my Godaddy hosting said we have reached all resources and the CPU 100%, when I contact the support they said we have a PHP Script that start ...
4
votes
2answers
11k views

All directories listed as unwritable

Previous title: Can't install extensions: Error: Archive does not exist I removed and reinstalled Joomla 3.3.6 on my CentOS 6.5 server. Wanted to install some backup utilities and a CCK. However i'm ...
4
votes
1answer
39 views

How is the relationship between template styles and menus stored in Joomla 3.x?

I'm working on a tool that imports content for a new language. As part of that process, I'm creating a copy of a template style specific to the new language. After making a copy of the template style ...
4
votes
2answers
712 views

Get Timestamp from Database

I have data stored in a db table, with an auto timestamp. In a module I want to then display a result based on the latest timestamp. It's not working and I'm getting an error Warning: strtotime() ...
4
votes
3answers
1k 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 ...
4
votes
1answer
1k views

SMTP email failing via Joomla, succeeding outside of Joomla

I think I need a way to debug in more detail how Joomla is trying to send SMTP email because I can't get any of its email mechanisms working, but I feel like SMTP is the one most likely to work since ...
4
votes
2answers
2k views

Custom Pagination: $this in “pagination_item_active” function is not in object context?

Joomla 3 I was trying to modify Joomla's pagination output. Following this documentation, I create mytemplate/html/pagination.php file and start modifying it. According to the document, I can write 4 ...
4
votes
1answer
541 views

Pulling XML parameter to PHP file

I'm attempting to create my first plugin! However, I want the user to be able to define a number that's then used in specific parts of the plugin. This plugin consists only of an xml file and a php ...
4
votes
1answer
709 views

Joomla Mailer won't send a second Email

I'm currently working on a big Joomla website created by a professional company, my job is to take some of the forms and update them. I've been using the Joomla Doc most of the time, but I'm still ...
4
votes
3answers
231 views

Add where statement to database query

I need to modify the database query to not select a certain ID in the database so the items with that ID do not show in the results. However, I cannot figure out how to do this. below I added a WHERE ...
3
votes
3answers
332 views

How can I diferentiate between guests and members?

How can I execute a different code in my plugin depending on if the user is logged in or not in Joomla? Basically I want to do this: <?php if (loggedin) { // Do something } else { // Do ...
3
votes
4answers
802 views

Override default php session

I'm building a AngularJs app using joomla in background. The AngularJs app get loaded once and then calls the server always through ajax. Some calls happen simultaneously. If I'm using the default PHP ...
3
votes
2answers
456 views

User group in joomla 3.2.1

Please help me. I have a problem about user group in joomla 3.2.1. I created a new user group(name: Hoa Si) then i create a new user(abc) for Hoa Si group. But i can not login with new user(abc) on ...
3
votes
2answers
1k views

Filter strings before saving them in the database

I just created a script witch fetches mails from IMAP and stores the title and content in the database. Of course I don't want to save these information without a check; I'm a bit paranoid but I ...
3
votes
2answers
1k views

Menu getActive() returns “Trying to get property of non-object” in Search Component

To identify the pages am using the following code if($menu->getActive()->id == 203){} // some actions this line returns error in search page. Search url goes like this http://localhost/...
3
votes
4answers
2k views

How to write my MySQL query with JOIN logic using JDatabase methods?

I'm having a difficult time translating this SQL script to JDatabase methods because I can't find the AND query method. SELECT user.firstname, user.lastname, leadership.leadname, leadership.lead_des ...
3
votes
3answers
1k views

Joomla! - Give Blog Categories Classes

First off, I'm a PHP noob :/ just to get that out of the way My goal is to give each Joomla! category a class, so I can pre-style layouts for my client, and when they choose a Category, they would ...
3
votes
2answers
551 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
680 views

Correct way to verify if the logged in user is super user

As my question implies what i want, i used google to search through the web to get correct answer though simple about how to verify if current logged in user is super user or not in both joomla 2.5 ...
3
votes
2answers
4k views

Save data to cookie

I want to save temporary data (id and name) from product page to cart via Ajax. The problem is to record new variables in cookie, using outstanding from Joomla file. I tried: $inputCookie = JFactory:...
3
votes
1answer
208 views

Output of modules

Every template I see has this way of outputting modules (in the index.php) <?php if ($this->countModules( 'user1' )) : ?> <jdoc:include type="modules" name="user1" style="rounded" /> &...
3
votes
3answers
916 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 ...
3
votes
1answer
103 views

How to find out what $this is?

I am not unfamiliar with this parameter in JavaScript. But in Joomla's PHP files, I often come across $this that seems coming from nowhere(Not in an object). To clarify some basic notions, here are ...
3
votes
3answers
2k views

How to get database information from Joomla category

I know how I can retrieve all information from a article in the database. I am trying to do the same thing for a category. And just for clarification, I am talking about when view is equal to category ...
3
votes
2answers
1k views

Trying to count the number of articles in a category but give wrong number

I'm trying to use some PHP I found on here to count all the articles in a specific category (10), the PHP is working but only showing 20 articles, when a manual count shows 28. $model = JModelLegacy:...
3
votes
1answer
1k views

String to language constant?

How can i create a language constant instead of a classic text? I tried it so: $langConstant = strtoupper(str_replace (' ', '', $this->fieldsClass->getFieldName($oneExtraField))); $...
3
votes
1answer
95 views

Component Development PHP Version Check

I've been developing a component, and have been trying to find some information, to no avail, of having my component perform a check of the PHP version before install. If PHP is greater than 7, then ...
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
2answers
460 views

Joomla and PHP versions

I work on a number of Joomla sites for clients, across multiple (differing) hosting environments. This can be a pain when troubleshooting as some of the hosts are running old versions of PHP (5.2) and ...
3
votes
1answer
263 views

Where to catch Post event?

I use the following JavaScript to open new window in which Joomla login page displayed: window.open('https://URL', '_blank', 'location=yes'); The new window opens is as follows: I need to ...
3
votes
1answer
129 views

How to separate database results into 2 columns?

I saw the examples of how to do the odd even way, but I want the order to flow from one whole column to the next and not alternating left to right for each alphabetical item. Can this be done? Here ...
3
votes
1answer
133 views

SQL syntax error when attempting to filter list view - how to build WHERE clause?

I built a Joomla component for a school using component-creator.com and now I am trying to modify the source files. My current view lists off all parents and students in my database, visible to all ...
3
votes
2answers
1k 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
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

Access ZOO item id in an element template file

Am trying in yootheme ZOO app to enable the rating element ONLY when the date element passed the today date but i cant find a way to get the item_id. If I try for example 277 everything is working, ...
3
votes
1answer
800 views

Joomla 3: applying custom module style doesn't work

I'm trying to set custom style for Joomla module. I have created the file: modules.php in /templates/MY_TEMPLATE_NAME/html directory. Content of this file below: defined('_JEXEC') or die; ...
3
votes
1answer
1k views

Component development, how to update submenu in administration?

I added in my helper file new sub-menu item, also in xml file like every other sub-menu item, but there is still not visible in administration, i tried wit discover functionality but this is not the ...
3
votes
1answer
2k views

Undefined index: view with external url menu

I am using Joomla 3.3.1 with SEO links on, and after changing a menu type to external menu (which points to a PDF), I am getting the following PHP notice: PHP Notice: Undefined index: view in /...
3
votes
1answer
95 views

Records in log file

In my site logs folder when i open error.php, i see lots of records per line as one is look like this - 2014-04-03 22:35:54 INFO 2.61.174.50 Joomla FAILURE: Username and password do not ...
3
votes
1answer
249 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($...
3
votes
2answers
74 views

Can't access all administrator menus and menu labels have weird symbols

I am trying to migrate a Joomla website from server A to my server B. Everything seems to be working fine, except my administrator side / backend has the following issues: I am not able to access all ...

1
2
3 4 5
14