Groups info editing

Hello dolphins.

As I am working on my website, I want to change the info shown about the group(shown on attachment 1). I want to change 'Country and City' to 'Categories' which were chosen when a person created a group (attachment 2). I think I found the root .php files for this changes, but still have problems with editing the needed issue. Can someone help with the code, or show the script I need to change?

Also I would be very thenkful if someone could help me with issues like:

  • Adding search fields to search module
  • 'Attach one more file' ability to the outline file downloader
  • Flash player sound downloader instead of custon

 

 

ToThis.png · 784.9K · 267 views
Screen.png · 281K · 286 views
Quote · 19 Feb 2013

modules/boonex/groups/templates/base/unit.html

change

__country_city__

to

__categories__

dont forget to clear your caches

Let me know if that works

caredesign.net
Quote · 19 Feb 2013

Thank you very much for the answer :)

Well it did not work, it shows like this '__categories__'.

Could it be the problem with the script?

Quote · 19 Feb 2013

OK - just to see something - replace the __categories__  with __tags__ and see if it displays the tags for you. that will help[ me out. Although someone else may come in and be able to give you a better and quicker answer

EDIT

Scratch that last comment - instead of __categories__

use

__cats__

caredesign.net
Quote · 19 Feb 2013

Did not work, still shows as '__tags__' or '__cats__'.

 

Quote · 20 Feb 2013

ok - i wasnt sure if categories was in the sql statement, i will check the code and let you know where and what to change- unless someone wants to jump in and give the correct answer

caredesign.net
Quote · 20 Feb 2013

Thank you for your time and help. Can you tell me where to look for such statements, so in future I can do such work by myself?:)

Quote · 20 Feb 2013

First off - I use firefox

Second - I also have firebug for firefox add-on installed - it is free

Firebug will allow you to visually break a site down and see most of the elements and whats going on.

From there, you would have to play with it and get used to its functionality.

Then - as in your case - finding what you are looking for

Since your issue involves the groups module, Start with the files there . And using search to find exactly what you are looking for.

Thats just the quick version, it is more detailed than that - but you have to play with it yourself and get used to it and then it makes it easier to find what you are loking for. It also helps a great deal to have some php knowledge.

When I first started using dolphin, I had very minimal experience designing websites, but I have spent a lot of time learning what I can and it helps a lot.

caredesign.net
Quote · 20 Feb 2013

OK, I know that I am still a noob, but I will walk you through what I am doing - as a tutorial I guess - anyone else with better ideas, please help out as I may be looking at things incorrectly:

First off - looking at your question and screenshots - we know that the categories shows up in one block but not another - so lets find our 2 block templates.

In the groups case - your screen.png is the unit.html template, and the tothis.png is the entry_view_block_info.html template. Both found in modules/boonex/groups/templates/base. So, my first thought would be to copy the variable (__cats__) from entry_view_block_info.html to where you want it at on unit.html.

Now - this did not work as I originally expected. So that tells ME, that there is a different sql statement that handles that block - so now to find the function for it. Here is where understanding the basic concept of modules comes in handy.

I dont know if the is the best way to do this, but it is the way I am working through it to try and help you. in the groups module, classes folder, BxGroupsTemplate.php, starting around line 24 find:

    function unit ($aData, $sTemplateName, &$oVotingView, $isShort = false)
    {
        if (null == $this->_oMain)
            $this->_oMain = BxDolModule::getInstance('BxGroupsModule');

        if (!$this->_oMain->isAllowedView ($aData)) {
            $aVars = array ('extra_css_class' => 'bx_groups_unit');
            return $this->parseHtmlByName('twig_unit_private', $aVars);
        }

        $sImage = '';
        if ($aData['thumb']) {
            $a = array ('ID' => $aData['author_id'], 'Avatar' => $aData['thumb']);
            $aImage = BxDolService::call('photos', 'get_image', array($a, 'browse'), 'Search');
            $sImage = $aImage['no_image'] ? '' : $aImage['file'];
        }

        $aVars = array (
            'id' => $aData['id'],
            'thumb_url' => $sImage ? $sImage : $this->getImageUrl('no-image-thumb.png'),
            'group_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aData['uri'],
            'group_title' => $aData['title'],
            'created' => defineTimeInterval($aData['created']),
            'fans_count' => $aData['fans_count'],
            'cats' => $aData['categories'],
            'country_city' => $this->_oMain->_formatLocation($aData),
            'snippet_text' => $this->_oMain->_formatSnippetText($aData),
            'bx_if:full' => array (
                'condition' => !$isShort,
                'content' => array (
                    'author' => getNickName($aData['author_id']),
                    'author_url' => $aData['author_id'] ? getProfileLink($aData['author_id']) : 'javascript:void(0);',
                    'created' => defineTimeInterval($aData['created']),
                    'rate' => $oVotingView ? $oVotingView->getJustVotingElement(0, $aData['id'], $aData['rate']) : ' ',
                ),
            ),
        );

        return $this->parseHtmlByName($sTemplateName, $aVars);
    }

The section in Blue is the section to add - BUT MAKE A BACKUP FIRST.

What this is doing is, pulling in the info from the categories field and assigning it the variable of __cats__, which you should have on the Unit.html page, and now instead onf __cats__, it should display what is in the categories column.

And as always - clear all of your caches

caredesign.net
Quote · 20 Feb 2013

There is progress now :) Instead of just '__cats__' it doesn`t show nothing now, as I can guess a little script edit needed?

Quote · 20 Feb 2013

yeah - i am still looking for where it is at, had to install groups to try and get it setup on mine - so iwll let you know when i get it.

caredesign.net
Quote · 21 Feb 2013

OK - in modules/boonex/groups/classes/BxGroupsSearchResults.php around line 15:

 

        'ownFields' => array('id', 'title', 'uri', 'created', 'author_id', 'thumb', 'rate', 'categories', 'fans_count', 'country', 'city', 'desc'),

 

Add whats in blue.

in modules/boonex/groups/classes/BxGroupsDb.php around line 30:


        $this->_sFieldFeatured = 'featured';
        $this->_sFieldCreated = 'created';
        $this->_sFieldCategories = 'categories';
        $this->_sFieldJoinConfirmation = 'join_confirmation';

Add whats in blue.

in modules/boonex/groups/classes/PageMain.php around line 43:

 'group_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aDataEntry['uri'],
            'group_title' => $aDataEntry['title'],
            'author_title' => _t('_From'),
            'author_username' => getNickName($aAuthor['ID']),
            'categories' => $aDataEntry['categories'],
            'author_url' => getProfileLink($aAuthor['ID']),
            'rating' => $oRating->isEnabled() ? $oRating->getJustVotingElement (true, $aDataEntry['id']) : '',
            'fans_count' => $aDataEntry['fans_count'],
            'country_city' => $this->oMain->_formatLocation($aDataEntry, false, true),

Add whats in blue.

caredesign.net
Quote · 21 Feb 2013

Thank you soo much! It worked, and now showing the categories :)

Also I think I have advanced a little bit in my php-editing knowldege with the code you gave me, and I understand more what and how to edit now, so another big plus for me for the future.

Thank you for your time and effort :)

Quote · 21 Feb 2013

i would highly recommend the my first module tutorial. Once you can create a simple module, and it works from installation to uninstallation, it will help understand how dolphin is setup.

Also, research php tutorials and learn all you can, as well as javascript tutorials.

caredesign.net
Quote · 21 Feb 2013

Thanks, I will check out theese tutorials right now :)

Give me 1 small hint please-as I edited groups info with your help, on the Outline it still shows like this (Screen attached). As you can see, in template I changed '__location__' to '__categories__'. Should I look for needed code in groups module folder or in wall module, to show categories instead of location?

I changed '__location__' to '__categories__' in groups module template, but in PHP files it seems I cannot see the code for outline info.

Quote · 22 Feb 2013

Note: I tried '__cats__' instead of categories as well, same result.

Quote · 22 Feb 2013

i dont see attached screenshot

caredesign.net
Quote · 22 Feb 2013

Missed that, here it is

ScreenAttached.png · 721.2K · 244 views
Quote · 22 Feb 2013
 
 
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.