Photo Albums Issue - part 2

Quote · 12 Apr 2015

Ok. I think I like it that way. I've decided I don't want them to create new albums from that page.

I want to rename the button from 'Upload' to 'Quick Upload'

I then want to remove the 'create new album' choice from the bottom of the list altogether. How would I do that?

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 12 Apr 2015

I have to go back though my code. I already know i missed the code that is in the ticket which i did not include in my writeup. I must have also missed something else.

 

https://www.deanbassett.com
Quote · 12 Apr 2015

First try changing all of the 9999999999 to just 99999

Some servers may not be able to handle numbers as large as what i first used.

https://www.deanbassett.com
Quote · 12 Apr 2015

I found an easy fix. Just changed _sys_album_create_new language key. By removing the text 'Create New Album" and leaving it blank, it just looks like an empty line in the drop down.

Problem solved. I don't really want them creating a new album there anyway

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 12 Apr 2015

 

First try changing all of the 9999999999 to just 99999

Some servers may not be able to handle numbers as large as what i first used.

 I'll go ahead and change this as well just for shi_s and giggles...

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 12 Apr 2015

I made the 99999999 change, still same result. That's ok though. I don;t want them to create a new album.

Although it might be a good idea to make the proper code changes to achieve that instead of relying on something that's broke to remain broke... lol

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 12 Apr 2015

Ok. I did miss a couple of items, so here it is again including what i missed.


Edit inc/classes/BxDolFilesModule

Look for this section starting at about line 813

    function actionUpload($sAction = '')
    {
        $sOwnerNick = getUsername($this->_iProfileId);
        $sOwnerAlbum = str_replace('{nickname}', $sOwnerNick, $this->_oConfig->getGlParam('profile_album_name'));
        if (!empty($sAction)) {
            $aRes = array('status' => 'Fail', 'error_msg' => _t('_sys_txt_sbs_error_occured'));
            $iAlbumId = (int)$_GET['album'];
            if (!$iAlbumId) {

Change line 820 from this

if (!$iAlbumId) {

to this

if ($iAlbumId == 99999) { // Deano. Changed from !$iAlbumId to $iAlbumId == 99999

Now go down to about line 858. Look for this code.

$aAlbumsList = $this->oAlbums->getAlbumList($aAlbumParams);

Change it to this.

$aAlbumsList = $this->oAlbums->getAlbumList($aAlbumParams, 1, $iAlbumsCount);    // Deano Add , 1, $iAlbumsCount

Now go down a few lines to about line 873 and look for this.

$sCode = $GLOBALS['oFunctions']->transBox($sCode, TRUE);

Insert this directly above that line.

// Deano Mod Start               
$sScript = "
<script>
var oTitle = $('tr:has(input[name=title]):last');
var oPrivacy = $('tr:has(select[name=AllowAlbumView]):last');
oTitle.hide();
oPrivacy.hide();
</script>
";
                $sCode = $sCode . $sScript;
// Deano Mod End               


Now look for this at about line 1173

    function getInstanceUploadFormArray($aAlbums, $aPrivFieldView, $sAlbumsCaption = false, $sAlbumTitleCaption = false, $sCreateNewAlbumCaption = false)
    {
        $aAlbums[0] = $sCreateNewAlbumCaption ? $sCreateNewAlbumCaption : _t('_sys_album_create_new');


Change this line

$aAlbums[0] = $sCreateNewAlbumCaption ? $sCreateNewAlbumCaption : _t('_sys_album_create_new');

To this.

// Deano Mod Start - Change 0 to 99999
$aAlbums[99999] = $sCreateNewAlbumCaption ? $sCreateNewAlbumCaption : _t('_sys_album_create_new');
// Deano Mod End

Then a few lines down at about line 1204 look for this.

'value' => $this->getInstanceUploadAlbumTempName($aAlbums),

And change to this.

'value' => '',


Thats it for inc/classes/BxDolFilesModule save it.

Now open inc/js/albums.js

Look for this at about line 5

if (iValue != 0) {

Change to this.

if (iValue != 99999) {

Look for this at about line 22

function submit_quick_upload_form(sUrl, sFields) {

Add this directly under it.

    // Deano. Code Start
    aFields = sFields.split("&");
    if(aFields[0] == 'album=99999' && aFields[1] == 'title=') {
        alert('Error! form field cannot be empty.');
        return false;
    }
    // Deano. Code End


And that should do it.

https://www.deanbassett.com
Quote · 12 Apr 2015

Perfect perfect perfect! Well done my friend..... Thanks....Cool

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 12 Apr 2015

Deano, I applied your new fix on my site.

However, there still an issue with it:

When I choose Upload > Add a new folder > Key-in folder name > Continue, I'm redirected to "[myname]'s files" folder and not to the newly created folder. 

Did I miss something?

Quote · 29 Apr 2015

An idea?

Quote · 19 May 2015
 
 
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.