Simple, but not working

A multipurpose module, plugin and component

Simple, but not working

New postby blakeys » Wed Dec 15, 2010 10:29 pm

Hi,

I am using a template form Gavick. It has a style switcher in the footer. I would like to move this to be a bit f a feature in the left hand column.
I tried to move just the HTML, and the switcher does work but does not save the changed style as a cookie unless the footer style switcher is enabled. That would be OK except that uses IDs not classes and make the page fail validation.
So I decided to try and add it with the PHP script. Unfortunately Joomla takes that out. So now I found Jumi! I create a custom module, add the code, but then I just get an error message.

Please help me. I have very little understanding of PHP. I feel that this is a simple request but I am just stupid and don't know any other way.
My development website:
http://www.emw8.com/
All the code in the footer. Theme/layouts/blocks/footer.php
Code: Select all
<div id="gk-footer" class="clearfix main">
   <?php if($this->countModules('footer_nav')) : ?>
   <div id="gk-footer-nav">
      <jdoc:include type="modules" name="footer_nav" style="none" />
   </div>      
   <?php endif; ?>

<?php if($this->getParam('stylearea', 1)) : ?>
   <div id="stylearea">
      <a href="#" class="style_switcher" id="style_switcher1">Green</a>
      <a href="#" class="style_switcher" id="style_switcher2">Red</a>
      <a href="#" class="style_switcher" id="style_switcher3">Blue</a>
   </div>
   <?php endif; ?>   
   
   <div id="gk-copyright">
      <?php

         if (($mobile = $this->mobile_device_detect())) :
            $handheld_view = $this->getParam('ui');
            $switch_to = $handheld_view=='desktop'?'default':'desktop';
            $text = $handheld_view=='desktop'?'Mobile Version':'Desktop Version';
      ?>

         <a class="gk-tool-switchlayout" href="<?php echo JURI::base()?>?ui=<?php echo $switch_to?>" title="<?php echo JText::_($text)?>"><span><?php echo JText::_($text)?></span></a>

      <?php endif ; ?>
      <?php echo $this->_tpl->params->get("footer_content"); ?>
   </div>
</div>


All I would like to do is get the right code I need, place it in a simple Jumi module, and it to work!

here is the code that I tried to place i the Jumi 'code written' field:
Code: Select all
<?php if($this->getParam('stylearea', 1)) : ?>
   <div id="stylearea">
      <a href="#" class="style_switcher" id="style_switcher1">Green</a>
      <a href="#" class="style_switcher" id="style_switcher2">Red</a>
      <a href="#" class="style_switcher" id="style_switcher3">Blue</a>
   </div>
   <?php endif; ?>   


Thanks, CB
blakeys
 
Posts: 8
Joined: Wed Dec 15, 2010 10:19 pm

Re: Simple, but not working

New postby Edvard » Wed Dec 15, 2010 10:46 pm

I'm not sure, but probably you need to use this code instead
Code: Select all
<?php
$template =& JFactory::getTemplate();
if($template->getParam('stylearea', 1)) :
?>
   <div id="stylearea">
      <a href="#" class="style_switcher" id="style_switcher1">Green</a>
      <a href="#" class="style_switcher" id="style_switcher2">Red</a>
      <a href="#" class="style_switcher" id="style_switcher3">Blue</a>
   </div>
<?php endif; ?> 
Regards,

Edvard Ananyan - 2GLux Team

Please post a review at the Joomla Extensions Directory. It is very important for us!
Edvard
Site Admin
 
Posts: 1836
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Simple, but not working

New postby blakeys » Thu Dec 16, 2010 1:10 pm

That doesn't work either. I get this:
Fatal error: Call to undefined method JTemplate::getParam() in /var/www/vhosts/emw8.com/httpdocs/modules/mod_jumi/tmpl/default.php(12) : eval()'d code on line 3
blakeys
 
Posts: 8
Joined: Wed Dec 15, 2010 10:19 pm

Re: Simple, but not working

New postby blakeys » Fri Dec 17, 2010 5:51 am

PLEASE HELP!

Thanks, CB
blakeys
 
Posts: 8
Joined: Wed Dec 15, 2010 10:19 pm

Re: Simple, but not working

New postby Edvard » Fri Dec 17, 2010 12:53 pm

Try this:
Code: Select all
<?php
$document =& JFactory::getDocument();
if($document->params->getParam('stylearea', 1)) :
?>
   <div id="stylearea">
      <a href="#" class="style_switcher" id="style_switcher1">Green</a>
      <a href="#" class="style_switcher" id="style_switcher2">Red</a>
      <a href="#" class="style_switcher" id="style_switcher3">Blue</a>
   </div>
<?php endif; ?> 
Regards,

Edvard Ananyan - 2GLux Team

Please post a review at the Joomla Extensions Directory. It is very important for us!
Edvard
Site Admin
 
Posts: 1836
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Simple, but not working

New postby blakeys » Fri Dec 17, 2010 3:47 pm

Now I get this error:
Code: Select all
Fatal error: Cannot pass parameter 1 by reference in /var/www/vhosts/emw8.com/httpdocs/modules/mod_jumi/tmpl/default.php(12) : eval()'d code on line 3
blakeys
 
Posts: 8
Joined: Wed Dec 15, 2010 10:19 pm

Re: Simple, but not working

New postby Edvard » Fri Dec 17, 2010 3:52 pm

What do you get using this code:
Code: Select all
<?php
$document =& JFactory::getDocument();
echo '<pre>', print_r($document, true), '</pre>';
Regards,

Edvard Ananyan - 2GLux Team

Please post a review at the Joomla Extensions Directory. It is very important for us!
Edvard
Site Admin
 
Posts: 1836
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Simple, but not working

New postby blakeys » Fri Dec 17, 2010 9:22 pm

Code: Select all
Warning: imagejpeg() [function.imagejpeg]: Unable to open '/var/www/vhosts/emw8.com/httpdocs/cache/mod_novasfh/tmp/thb_lappys2.jpg' for writing in /var/www/vhosts/emw8.com/httpdocs/modules/mod_novasfh/helper.php on line 639

That and a whole lot of code that's in the module. http://www.emw8.com/

I really appreciate the help. TY, CB
blakeys
 
Posts: 8
Joined: Wed Dec 15, 2010 10:19 pm

Re: Simple, but not working

New postby Edvard » Fri Dec 17, 2010 9:29 pm

That is completely another error. You shouldn't see errors, you will see the document object dump.
Regards,

Edvard Ananyan - 2GLux Team

Please post a review at the Joomla Extensions Directory. It is very important for us!
Edvard
Site Admin
 
Posts: 1836
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Simple, but not working

New postby blakeys » Fri Dec 17, 2010 9:59 pm

Well that error is something to do with the flash gallery on the homepage - permissions problem that i've just fixed. The style switcher is still not showing as intended.

What should I do?
blakeys
 
Posts: 8
Joined: Wed Dec 15, 2010 10:19 pm

Re: Simple, but not working

New postby blakeys » Sat Dec 18, 2010 7:21 pm

Hi,

I managed to find a fix, that I thin is OK. It didn't evolve Jumi. I tried this module for something else and I couldn't get it to work. Maybe my understaning of PHP us too little, but I just don't understand it.

Thanks anyway.
blakeys
 
Posts: 8
Joined: Wed Dec 15, 2010 10:19 pm

Re: Simple, but not working

New postby blakeys » Sun Dec 19, 2010 12:56 am

IMO - ur module doesnt work!
blakeys
 
Posts: 8
Joined: Wed Dec 15, 2010 10:19 pm


Return to Jumi

Who is online

Users browsing this forum: No registered users and 2 guests

cron