500 JHtml image not found - joomla

I am using Joomla 3.1 please help fix error 500 JHtml image not found.
<?php
$link=JRoute::_('index.php?option=com_joomleague&task=project.edit&cid[]='.$this->project->id);
$text=JText::_('COM_JOikOMLEAGUE_P_MENU_PSETTINGS');
$imageFile='icon-48-ProjectSettings.png';
$linkParams="<span>$text</span> ";
$image=JHtml::_('image.administrator',$imageFile,$path,NULL,NULL,$text).$linkParams;
?>

The method you're requesting, JHtmlImage::administrator(), does not exist in Joomla! 3. Suggest you take a look at the JHtml::image() method as a replacement.

Related

Include divi section on php page

I'm trying to add a divi section to a php page (these are documentation pages which we generate automatically with a build script). The code snippet below works for non-divi shortcodes, but not for the divi shortcodes.
<?php
require($_SERVER['DOCUMENT_ROOT']."/wp-load.php");
get_header();
...
echo do_shortcode('[et_pb_section global_module="9822"][/et_pb_section]');
...
getfooter();
Instead of getting rendered the shortcode itself is shown on the page.
Any thoughts on how I can get this working?
I found a possible solution here:
https://liampedleydesign.co.uk/placing-divi-modules-anywhere-using-shortcodes/
The shortcode code is slightly different for Divi:
echo do_shortcode('[showmodule id="9822"]');

Magento 1.7 - Move Category & Sub-Category Description After Products

I want to move my Descriptions from existing - Top of the Page to - After Products
I have referred to the Solution for this at various Forums but none of them Worked.
The Easiest One I could find and implement too was here . But this resolution also did not work.
Kindly help in this regard.
PARTIALLY SOLVED:
I pasted this at the end of the code in /app/design/frontend/default/XXYY/template/magenthemes/filter/filter_content_wrapper.phtml :
categoryAttribute($_category, $_description, 'description') ?>
Having said this, there is 1 Problem, the Description is now appearing at 2 Locations - Above the products and below the products.
Looking for further resolution on this
SOLVED
Thanks rajat
Here is how I did it:
IMPORTANT: DO NOT USE THE FILE PATH HERE OR GIVEN UNDER ANY POSTS - IT IS THEME DEPENDENT
1) Use Template hints to identify the Category Description File Path
2) Now to shift your Description: Just find and Paste this code from the file towards the end and Save:
getCurrentCategory()->getDescription()): ?>
categoryAttribute($_category, $_description, 'description') ?>
NOTE: <?php echo $this->getChildHtml('content'); ?> should be right above the Category Description Code

CodeIgniter - Binary image not being displayed

I've built a function on class Image that retrieves or should retrieve me the image in a binary format. However I just get the error icon when I call that controller method.
I need this done this way, because the images are being sent to an iOS and Android app.
The path of the image is correct (I've double checked it)
I'm using CodeIgniter 2.1.3 and my code looks like this
$images = $this->image->getImageById($database,$id);
$data = fopen($images->path, 'rb');
header('Content-type: image/jpeg');
fpassthru($data);
Any idea on how can I achieve this?
Thank you
I thing you are looking for something like this.
http://www.ehow.com/how_8745742_convert-binary-data-using-php.html
I think this may help you. After getting the result in your model file in an array. In your example $images.
In the view file display it like this <img src="<?php echo $images['path'] ?>" />

zend framework 2 get locale from view PhpRenderer

How I can obtain traslator locale in my view?
I want to do it starting from the variable $this (the PhpRenderer of the view).
i.e. I don't want use onBootstrap nor ActionController because I don't care to have a view variables.
Thank you!
You should try:
<?php echo \Locale::getDefault(); ?>
Many of the I18n classes make reference to PHP's Locale class (http://www.php.net/locale) - so in my opinion that would be a good starting point.
<?php echo $this->plugin('translate')->getTranslator()->getLocale(); ?>
See:
Get local value in layout or view in Zend Framework 2

Magento title not showing on category view

On http://www.justdoors.co/vinyl-colours.html for whatever reason the product titles aren't showing.
This is the relevent code from our template/catalog/product/list.phtml file:
<h2 class="product-name"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h2>
It was working OK in magento 1.5.1 but we've done an update to 1.6.0 and seems to be since that. can anyone shed some light on this problem, I don't seem to be getting and error message so not really sure where to start!
Seems like your variable is just empty. Always look what is inside of your object by dumping it or inspecting it with debugger
<?php print_r($_product);?>
or if its too large and has many references then try to see object parameters only
<?php print_r(array_keys($_product));?>
Then you can inspect yourself what variables you can ask directly from object or what you need to query or extend your collections to get by default.
Its worth to look if your product name attribute is enabled for listings (from attribute settings).

Resources