Jump to content



mattjt83

Member Since 22 Feb 2011
OFFLINE Last Active Yesterday, 22:16
*****

#1754461 [Addon] iBar Dashboard Modules

Posted by mattjt83 on 09 March 2017 - 18:30

@Dan Cole

 

On a standard setup you can't get the icon modules to be in a nice little row like in the screenshots. I decided to code up a hook and display the iBar modules on their own at the top of the page instead of altering my index page to accommodate them.

 

on admin/index.php under this:

$adm_array = explode(';', MODULE_ADMIN_DASHBOARD_INSTALLED);

I added this:

//BOF iBar
echo $OSCOM_Hooks->call('index', 'indexiBarOutput');
//EOF iBar

Then I created a hook file catalog/includes/hooks/admin/index/iBar.php

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2017 osCommerce

  Released under the GNU General Public License
*/

  class hook_admin_index_iBar {
    
    function listen_indexiBarOutput() {
        global $adm_array, $language;
        
        if ( is_array( $adm_array ) && sizeof( $adm_array ) > 0 ){
            $iBar_array    = array();
            $new_adm_array = array();
            
            foreach ( $adm_array as $key => $value ){
                
                if ( strpos( $value, 'iBar' ) !== false ) {
                    $iBar_array[] = $value;
                }else{
                    $new_adm_array[] = $value;
                }
                
            }//eof foreach
            
            //set new $adm_array without iBar modules included
            if ( sizeof( $new_adm_array ) > 0 ){
                $adm_array = $new_adm_array;
            }
            
            //build iBar modules output here
            if ( sizeof( $iBar_array ) > 0 ){
                $iBar_output = '<!-- BOF iBar additions -->
                                <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
                                <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
                                <link rel="stylesheet" type="text/css" href="includes/iBar.css">
                                <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
                                <!-- EOF iBar additions -->';
                $iBar_output .= '<tr><td colspan="2"><div class="row">';
                
                for ( $i=0, $n=sizeof($iBar_array); $i<$n; $i++ ) {
                    $adm = $iBar_array[$i];

                    $class = substr($adm, 0, strrpos($adm, '.'));

                    if ( !class_exists($class) ) {
                        include(DIR_WS_LANGUAGES . $language . '/modules/dashboard/' . $adm);
                        include(DIR_WS_MODULES . 'dashboard/' . $class . '.php');
                    }

                    $ad = new $class();

                    if ( $ad->isEnabled() ) {
                        $iBar_output .= $ad->getOutput();
                    }
                }
                
                $iBar_output .= '</td></tr></div>';
                
            }
            
            return $iBar_output;
        }
        
    }
        
  }    
?>

Also don't forget to call the index page hooks with this before the output of the hook:

$OSCOM_Hooks->register('index');



#1752562 Addons

Posted by mattjt83 on 23 January 2017 - 18:12

I got the #15 - Business Schema module plugged in on my site and it works perfectly! Pretty much zero effort required




#1745872 Summer Blowout 2016

Posted by mattjt83 on 22 July 2016 - 01:59

@mattjt83 cool, good ROI ?

Yes, cost me $1.70 for the ads and made quite a bit more on the sales :)




#1745854 Summer Blowout 2016

Posted by mattjt83 on 21 July 2016 - 12:39

@burt

 

2 conversions from the dynamic ads last night :)




#1745841 Summer Blowout 2016

Posted by mattjt83 on 20 July 2016 - 18:41

@burt

@Dan Cole

 

I sent Gary a few screenshots if he'd like to post them here.




#1745434 Summer Blowout 2016

Posted by mattjt83 on 04 July 2016 - 13:16

@burt Payment link works B)




#1743719 Edit content module language files from admin/modules_content

Posted by mattjt83 on 19 May 2016 - 23:46

@altoid

 

It's pretty handy to have around. Especially for those small code tweaks.




#1743596 Problem: Header Tag Module including multiple Javascript files

Posted by mattjt83 on 16 May 2016 - 13:02

@katapofatico

 

You can paste your modules code here so we can look at it but you could also do something like....

$output = '<script type="text/javascript" src="ext/modules/validation/jquery.validate.min.js" />';
$output .= '<script type="text/javascript" src="ext/modules/validation/localization/messages_es.min.js" />';
  
$oscTemplate->addBlock($output, $this->group);

Also make sure inside your function you include

global $oscTemplate;



#1743449 Edit content module language files from admin/modules_content

Posted by mattjt83 on 11 May 2016 - 19:40

@piernas

 

The naming convention caught me a bit off-guard and is why I wrote a patch for it. If you want to get the thing working with multi-languages would you consider coding it up and sending it to me? There will need to be additions to the processing logic as well to handle everything.

 

This whole thing is pretty handy I think for most shop-owners but is not something that will *probably* ever make it into the core code. It works well for my shop and has already proven to be very handy for quick adjustments, which is why I decided to share it.




#1743437 Ajax attribute manager load index page in categories.php

Posted by mattjt83 on 11 May 2016 - 16:33

@JaumeUbach

 

Look here: http://forums.oscomm...67#entry1714879

 

And here: http://forums.oscomm...67#entry1729091




#1743383 Admin header_tag modules

Posted by mattjt83 on 10 May 2016 - 02:35

@azpro

@GLWalker

@altoid

 

I'll put together a fork on github so you can guys can check it out. Very simple and seems to work well.




#1743375 Admin header_tag modules

Posted by mattjt83 on 09 May 2016 - 20:26

Is there any interest in this? I have found it to be pretty handy in my shops admin. Very simple to implement.




#1743370 Edit content module language files from admin/modules_content

Posted by mattjt83 on 09 May 2016 - 16:31

I've updated my github page with the recent changes if anyone wants them :)

 

https://github.com/m..._language_files




#1743359 Edit content module language files from admin/modules_content

Posted by mattjt83 on 09 May 2016 - 13:51

Turns out it's pretty easy to be able to add template file editing as well. Screenshot attached.

Attached Files




#1743313 Edit content module language files from admin/modules_content

Posted by mattjt83 on 07 May 2016 - 21:58

You can find the code here: https://github.com/m..._language_files

 

This was just a fun little project to use an admin hook to be able to edit the language file that goes with each content module right from admin/modules_content.php.

 

Feedback is welcome and improvements as well.