How to get groups module on app home screen

I was adding a new record to sys_menu_mobile in database by following the procedure given in "http://www.boonex.com/trac/dolphin/wiki/DolModMobile#a1.Addingitemstohomeandprofilepages".

 

I got stuck with what I should enter as action_data while adding groups module. Can anybody help me out with this?

Quote · 10 Jul 2014

@Deanos @Prashank @geek_girl @Nathan

Guys where are you?

Quote · 10 Jul 2014

The post that you refer to is how to create a default mobile module. If you are trying to create a mobile Groups module, this is not really going to help as there are MANY things you have to do to an existing module. 

 

Honestly, the best bet, if you are not an experienced developer, is to check out the one in the Market.

Nothing to see here
Quote · 11 Jul 2014

I cannot help with the mobile apps. I do not do mobile app development. I do not have the needed software or hardware to do it.

No android devices for testing.

I do have a iPhone 5. My sister actually gave that to me along with the cell service. Way out of my price range to get it myself.

But cannot develop for it as i do not have a modern mac able to run the current xcode.

I do not even have a mobile license so i have no access to the mobile code. And cannot even begin to afford that license at this time.

https://www.deanbassett.com
Quote · 11 Jul 2014

For type field. use: system

For action field, use: 100

For action_data field, use: {site_url}m/groups/mobilegroup

Then, you need to add the code to create the mobile page in your Groups module on BxGroupsModule.php, similar to this:


function actionMobileGroup() {
       
        bx_import('BxDolMobileTemplate');
        $oMobileTemplate = new BxDolMobileTemplate($this->_oConfig, $this->_oDb);
        $oMobileTemplate->pageStart();

        (php code here for displaying what you want to display. As an example, I have included a code snippet that I am using in one of my modules)


$eVideo = mysql_query("SELECT * FROM cf_embeds_main WHERE `uri` = '" . $_GET['video'] . "'");
        while ($row = mysql_fetch_array($eVideo)) {
            $Thumb = $row['thumbnailImg'];
            $Description = $row['desc'];
            $Author = $row['author'];
            $Title = $row['title'];
            $embed_id = $row['embed_id'];
            $tags = $row['tags'];
            $categories = $row['categories'];

        }
?>
<div class="bx-sys-row bx-sys-mobile-padding bx-sys-mobile-border bx-sys-mobile-box-bg bx-sys-mobile-margin-top-auto">
  <table width="100%">
    <tr>
    <th width="11%" rowspan="2" align="left" valign="top"><img src="<?php echo $Thumb ?>" width="240" height="180" alt="<?php echo $Title ?>"/></th>
    <td width="89%" align="left" valign="top"><h4>   <?php echo $Title ?></h4></td>
  </tr>
    <tr>
      <td align="left" valign="top"><?php echo $Description ?></td>
    </tr>
  </table>
 
   
</div>

<div class="bx-sys-row bx-sys-mobile-padding bx-sys-mobile-border bx-sys-mobile-box-bg bx-sys-mobile-margin-top-auto">
<iframe width="100%" height="315" src="//www.youtube.com/embed/<?php echo $embed_id ?>?rel=0" frameborder="0" allowfullscreen></iframe>
 
   
</div>

<?php

        $oMobileTemplate->pageCode($Title, false, true);
    }

 

Hope that helps.

caredesign.net
Quote · 12 Jul 2014

Thanks Zarcon & Deanos for the reply. Zarcon I did go through the one which is available on market but thats not the default boonex groups module mobile version. If I have missed any market product then please post the link.

you are awesome man!!! Thank you so very much. I will try to work around this. I just need to list the groups just the way blogs or news get displayed. Not the advanced version like adding groups etc. Can you post some basic code which will just display groups?

Quote · 12 Jul 2014

Sorry it took so long. I had a few tasks to take care of. But, this is a rough edit of my existing mobile pages for a custom module. Please keep in mind, this may not work for you right out of the box, and also - make backups before applying any changes you may make. And after making changes, be sure to clear your caches. So, this is what I have: on BxGroupsModule.php

 


   
   function actionMobileGroups() {
        
        bx_import('BxDolMobileTemplate');
        $oMobileTemplate = new BxDolMobileTemplate($this->_oConfig, $this->_oDb);
        $oMobileTemplate->pageStart();


        $aGroups = mysql_query("SELECT * FROM bx_groups_main");
        while ($row = mysql_fetch_array($aGroups)) {
            $Thumb = $row['thumb'];
            $Description = $row['desc'];
            $Author = $row['author_id'];
            $Title = $row['title'];
            $Uri = $row['uri'];

?>
<div class="bx-sys-row bx-sys-mobile-padding bx-sys-mobile-border bx-sys-mobile-box-bg bx-sys-mobile-margin-top-auto" onclick="if('mobilegroup?group=<?php echo $Uri ?>'.length) document.location = 'mobilegroup?group=<?php echo $Uri ?>';">
  <table width="100%">
    <tr>
    <th width="11%" rowspan="2" align="left" valign="top"><img src="<?php echo BX_DOL_URL_MODULES ?>boonex/photos/data/files/<?php echo $Thumb ?>_t.jpg" width="120" height="80" alt="<?php echo $Title ?>"/></th>
    <td width="89%" align="left" valign="top"><h4>   <?php echo $Title ?></h4></td>
  </tr>
    <tr>
      <td align="left" valign="top"><?php echo $Description ?></td>
    </tr>
  </table>
    <div class="bx-sys-row-accessory bx-sys-mobile-margin-right">
        <img class="bx-sys-row-accessory-img" src="<bx_icon_url:mobile_next.png />" />
  </div>

</div>

<?php
        }
        $oMobileTemplate->pageCode('Groups', false, true);
    }
    
    function actionMobileGroup() {
        
        bx_import('BxDolMobileTemplate');
        $oMobileTemplate = new BxDolMobileTemplate($this->_oConfig, $this->_oDb);
        $oMobileTemplate->pageStart();

        $sGroup = mysql_query("SELECT * FROM bx_groups_main WHERE `uri` = '" . $_GET['group'] . "'");
        while ($row = mysql_fetch_array($sGroup)) {
            $Thumb = $row['thumb'];
            $Description = $row['desc'];
            $Author = $row['author_id'];
            $Title = $row['title'];
            $zip = $row['zip'];
            $city = $row['city'];
            $country = $row['country'];
            $group_id = $row['group_id'];
            $address = $row['address'];
            $state = $row['state'];
            $email = $row['email'];

        }
         $eMap = mysql_query("SELECT * FROM bx_wmap_locations WHERE `uri` = '" . $_GET['group'] . "'");
        while ($row = mysql_fetch_array($eMap)) {
            $lat = $row['lat'];
            $lng = $row['lng'];

        }
?>
<div class="bx-sys-row bx-sys-mobile-padding bx-sys-mobile-border bx-sys-mobile-box-bg bx-sys-mobile-margin-top-auto">
  <table width="100%">
    <tr>
    <th colspan="2" align="left" valign="top"><h4>   <?php echo $Title ?></h4></th>
    </tr>
    <tr>
      <th width="29%" rowspan="4" align="left" valign="top"><img src="<?php echo BX_DOL_URL_MODULES ?>boonex/photos/data/files/<?php echo $Thumb ?>_t.jpg" width="120" height="60" alt="<?php echo $Title ?>"/></th>
      <td width="71%" align="left" valign="top"><?php echo $address ?></td>
    </tr>
    <tr>
      <td align="left" valign="top"><?php echo $city ?>, <?php echo $state ?> <?php echo $zip ?></td>
    </tr>
  </table>
 
    
</div>



<div class="bx-sys-row bx-sys-mobile-padding bx-sys-mobile-border bx-sys-mobile-box-bg bx-sys-mobile-margin-top-auto">
 <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><div style="overflow:hidden;height:240px;width:100%;"><div id="gmap_canvas" style="height:240px;width:100%;"></div><a class="google-map-code" href="http://www.map-embed.com" id="get-map-data">map-embed.com</a><style>#gmap_canvas img{max-width:none!important;background:none!important}</style></div><script type="text/javascript"> function init_map(){var myOptions = {zoom:17,center:new google.maps.LatLng(<?php echo $lat ?>,<?php echo $lng ?>),mapTypeId: google.maps.MapTypeId.ROADMAP};map = new google.maps.Map(document.getElementById("gmap_canvas"), myOptions);marker = new google.maps.Marker({map: map,position: new google.maps.LatLng(<?php echo $lat ?>, <?php echo $lng ?>)});infowindow = new google.maps.InfoWindow({content:"<b><?php echo $Title ?>" });google.maps.event.addListener(marker, "click", function(){infowindow.open(map,marker);});infowindow.open(map,marker);}google.maps.event.addDomListener(window, 'load', init_map);</script>
 
    
</div>

<?php
       
        $oMobileTemplate->pageCode($Title, false, true);
    }

 

This code includes the first page you see after clicking Groups on the mobile app home page. You will need to make a slight change to your sys_menu_mobile table. :

For action_data field, use: {site_url}m/groups/mobilegroups (in my first answer there was no 's' at the end.)

It also includes the Specific Group page. So, after clicking Groups on the mobile App homepage, you should see a list of all groups. User clicks on a group and is redirected to that Groups info page with a map showing location and other brief info.


Again, this is just a rough draft. I know there are probably simpler ways of doing things using functions and such, and I gladly accept any assistance in making this bit of code useable for everyone.

caredesign.net
Quote · 13 Jul 2014

 Thank you so much for the code . I tried to use your code and it showed the Groups in mobile app, only thing is images were not visible.

Sorry it took so long. I had a few tasks to take care of. But, this is a rough edit of my existing mobile pages for a custom module. Please keep in mind, this may not work for you right out of the box, and also - make backups before applying any changes you may make. And after making changes, be sure to clear your caches. So, this is what I have: on BxGroupsModule.php

 


   
   function actionMobileGroups() {
        
        bx_import('BxDolMobileTemplate');
        $oMobileTemplate = new BxDolMobileTemplate($this->_oConfig, $this->_oDb);
        $oMobileTemplate->pageStart();


        $aGroups = mysql_query("SELECT * FROM bx_groups_main");
        while ($row = mysql_fetch_array($aGroups)) {
            $Thumb = $row['thumb'];
            $Description = $row['desc'];
            $Author = $row['author_id'];
            $Title = $row['title'];
            $Uri = $row['uri'];

?>
<div class="bx-sys-row bx-sys-mobile-padding bx-sys-mobile-border bx-sys-mobile-box-bg bx-sys-mobile-margin-top-auto" onclick="if('mobilegroup?group=<?php echo $Uri ?>'.length) document.location = 'mobilegroup?group=<?php echo $Uri ?>';">
  <table width="100%">
    <tr>
    <th width="11%" rowspan="2" align="left" valign="top"><img src="<?php echo BX_DOL_URL_MODULES ?>boonex/photos/data/files/<?php echo $Thumb ?>_t.jpg" width="120" height="80" alt="<?php echo $Title ?>"/></th>
    <td width="89%" align="left" valign="top"><h4>   <?php echo $Title ?></h4></td>
  </tr>
    <tr>
      <td align="left" valign="top"><?php echo $Description ?></td>
    </tr>
  </table>
    <div class="bx-sys-row-accessory bx-sys-mobile-margin-right">
        <img class="bx-sys-row-accessory-img" src="<bx_icon_url:mobile_next.png />" />
  </div>

</div>

<?php
        }
        $oMobileTemplate->pageCode('Groups', false, true);
    }
    
    function actionMobileGroup() {
        
        bx_import('BxDolMobileTemplate');
        $oMobileTemplate = new BxDolMobileTemplate($this->_oConfig, $this->_oDb);
        $oMobileTemplate->pageStart();

        $sGroup = mysql_query("SELECT * FROM bx_groups_main WHERE `uri` = '" . $_GET['group'] . "'");
        while ($row = mysql_fetch_array($sGroup)) {
            $Thumb = $row['thumb'];
            $Description = $row['desc'];
            $Author = $row['author_id'];
            $Title = $row['title'];
            $zip = $row['zip'];
            $city = $row['city'];
            $country = $row['country'];
            $group_id = $row['group_id'];
            $address = $row['address'];
            $state = $row['state'];
            $email = $row['email'];

        }
         $eMap = mysql_query("SELECT * FROM bx_wmap_locations WHERE `uri` = '" . $_GET['group'] . "'");
        while ($row = mysql_fetch_array($eMap)) {
            $lat = $row['lat'];
            $lng = $row['lng'];

        }
?>
<div class="bx-sys-row bx-sys-mobile-padding bx-sys-mobile-border bx-sys-mobile-box-bg bx-sys-mobile-margin-top-auto">
  <table width="100%">
    <tr>
    <th colspan="2" align="left" valign="top"><h4>   <?php echo $Title ?></h4></th>
    </tr>
    <tr>
      <th width="29%" rowspan="4" align="left" valign="top"><img src="<?php echo BX_DOL_URL_MODULES ?>boonex/photos/data/files/<?php echo $Thumb ?>_t.jpg" width="120" height="60" alt="<?php echo $Title ?>"/></th>
      <td width="71%" align="left" valign="top"><?php echo $address ?></td>
    </tr>
    <tr>
      <td align="left" valign="top"><?php echo $city ?>, <?php echo $state ?> <?php echo $zip ?></td>
    </tr>
  </table>
 
    
</div>



<div class="bx-sys-row bx-sys-mobile-padding bx-sys-mobile-border bx-sys-mobile-box-bg bx-sys-mobile-margin-top-auto">
 <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><div style="overflow:hidden;height:240px;width:100%;"><div id="gmap_canvas" style="height:240px;width:100%;"></div><a class="google-map-code" href="http://www.map-embed.com" id="get-map-data">map-embed.com</a><style>#gmap_canvas img{max-width:none!important;background:none!important}</style></div><script type="text/javascript"> function init_map(){var myOptions = {zoom:17,center:new google.maps.LatLng(<?php echo $lat ?>,<?php echo $lng ?>),mapTypeId: google.maps.MapTypeId.ROADMAP};map = new google.maps.Map(document.getElementById("gmap_canvas"), myOptions);marker = new google.maps.Marker({map: map,position: new google.maps.LatLng(<?php echo $lat ?>, <?php echo $lng ?>)});infowindow = new google.maps.InfoWindow({content:"<b><?php echo $Title ?>" });google.maps.event.addListener(marker, "click", function(){infowindow.open(map,marker);});infowindow.open(map,marker);}google.maps.event.addDomListener(window, 'load', init_map);</script>
 
    
</div>

<?php
       
        $oMobileTemplate->pageCode($Title, false, true);
    }

 

This code includes the first page you see after clicking Groups on the mobile app home page. You will need to make a slight change to your sys_menu_mobile table. :

For action_data field, use: {site_url}m/groups/mobilegroups (in my first answer there was no 's' at the end.)

It also includes the Specific Group page. So, after clicking Groups on the mobile App homepage, you should see a list of all groups. User clicks on a group and is redirected to that Groups info page with a map showing location and other brief info.


Again, this is just a rough draft. I know there are probably simpler ways of doing things using functions and such, and I gladly accept any assistance in making this bit of code useable for everyone.

 

Quote · 15 Jul 2014

I was worried about that. I had to rename the .htaccess file in the photos folder to htaccess.txt. Maybe someone knows how to add the proper line in the .htaccess file to allow requests from the mobile app?

caredesign.net
Quote · 17 Jul 2014

 Can anybody help us out on this?

I was worried about that. I had to rename the .htaccess file in the photos folder to htaccess.txt. Maybe someone knows how to add the proper line in the .htaccess file to allow requests from the mobile app?

 

Quote · 19 Jul 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.