SocialEngine 4: Customize SocialEngine “Create New Album” Form

Here is a Mod to allow more fields to SE Albums

This modification not for noobs, just be warned!

This is sample how to add new field only – for users’ permissions and searchable options you need much, much more code, and THAT you not get as free ride.

You need to modify few things:

I will use location, just as example, you may use something else. If you have a question(s), feel free to ask!

You need to add new, for example Album location – Where is pictured album:

1. Open file ../Album/Form/Album.php – find code:

// Init descriptions
          $this->addElement('Textarea', 'description', array(
            'label' => 'Album Description',
            'filters' => array(
              'StripTags',
              new Engine_Filter_Censor(),
              //new Engine_Filter_HtmlSpecialChars(),
              new Engine_Filter_EnableLinks(),
            ),
          ));

And add below code:

// Init album location
          $this->addElement('Textarea', 'location', array(
            'label' => 'Album Location',
            'filters' => array(
              'StripTags',
              new Engine_Filter_Censor(),
              //new Engine_Filter_HtmlSpecialChars(),
              new Engine_Filter_EnableLinks(),
            ),
          ));

2. In same file – find code:

$params['category_id'] = (int) @$values['category_id'];
            $params['description'] = $values['description'];
            $params['search'] = $values['search'];

And add below code:

$params['location'] = $values['location'];

3. Open file ../Album/Form/Album/Edit.php

And find code:

$this->addElement('Textarea', 'description', array(
            'label' => 'Album Description',
            'rows' => 2,
            'filters' => array(
              new Engine_Filter_Censor(),
              'StripTags',
              //new Engine_Filter_HtmlSpecialChars(),
              new Engine_Filter_EnableLinks(),
            )
          ));

And add below code:

$this->addElement('Textarea', 'location', array(
            'label' => 'Album Location',
            'filters' => array(
              'StripTags',
              new Engine_Filter_Censor(),
              //new Engine_Filter_HtmlSpecialChars(),
              new Engine_Filter_EnableLinks(),
            ),
          ));

4. Open file ../Album/views/scripts/album/view.tpl

And find code:

<?php if( '' != trim($this->album->getDescription()) ): ?>
        <p>
          <?php echo $this->album->getDescription() ?>
        </p>

      <?php endif ?>

And add below code:

<?php if ($this->album->location !=''):?><b><?php echo $this->translate('Album Location:');?></b> <?php echo $this->album->location; ?><br/ ><br/ ><?php endif ?>

Also, you need to add in engine4_album_albums tb table

New column named location

ALTER table `engine4_album_albums` add column `location` mediumtext COLLATION utf8_unicode_ci;

<img class="aligncenter" alt="" src="http://tiny-img.com/image.php?di=TX02" width="835" height="733" />

<img class="aligncenter" alt="" src="http://tiny-img.com/image.php?di=LDIO" width="745" height="767" />

<img class="aligncenter" alt="" src="http://tiny-img.com/image.php?di=0PR1" width="824" height="550" />

Looking for quality SocialEngine Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , , , | Posted under SocialEngine | RSS 2.0

Author Spotlight

Andrew Cross

Andrew Cross

Hi, I'm Andrew. A am a 26, ICT Administrator which offers support to company's around the South Wales Area. I have created a few social sites for myself and other company's. So far 2 out of 3 have been successful using the powerful SocialEngine Script. I continue to try and help the community of SocialEngine by giving Support and Technical Help where possible.

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 4 = 7

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>