Post by jokomad » Sun Mar 03, 2013 8:19 pm

Hello, member Forum Community

Please help me if anybody have any best idea regarding my code

I want to get module value for each module like the image attachment
I have been code like this,
problem : when the module is in one position. it's working good. but when the module more than one will return the last record . no different when position module in left or right
module_account column_left 1
module_account column_right 2
I need column_left only show when position is left and so right position to.

have any body can give suggestion ?

Thank and Best Regards

catalog/controller/module/account.php
-------------------------------------------------------------

Code: Select all

                   $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "setting where `key`='account_module' ");
                   $this->data['filename'] = $query->rows[0]['value'];
                   $start='layout_id';
                   $this->data['modname'] = array();
                   $end  =';}';
                   if( preg_match_all( "#$start(.*?)$end#s", $query->rows[0]['value'], $match ) )			{
                     foreach($match[0] as $value) {
                          $value       = ereg_replace ('"', '', $value);
                          $value       = explode(";",$value);
                          $mlayout     = explode(":",$value[1]);
                          $mlocation   = explode(":",$value[3]);
                          $mstatus     = explode(":",$value[5]);
                          $msort_order = explode(":",$value[7]);
                          if($mstatus[2]=='1'){
                            $this->data['modname'][] = array(
        		               'layout'   => $mlayout[2],
        		               'location' => $mlocation[2],
        		               'status'   => $mstatus[2],
        		               'sort_order' => $msort_order[2]
      		                );
      		              }
                     }
                   }
----------------------------------------------------------

Attachments

positionopencart.JPG

positionopencart.JPG (37.49 KiB) Viewed 420 times


Newbie

Posts

Joined
Sun Mar 03, 2013 10:50 am
Who is online

Users browsing this forum: No registered users and 198 guests