Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Gallery/Gallery2
Author Message
kenspa
Hangin' Around



Joined: Sep 24, 2005
Posts: 48
Location: Spain

PostPosted: Mon Jun 18, 2018 7:13 am Reply with quote

Hi all,
Not sure whether this forum refers to RN Gallery or not, but the case is I've spent quite a long time trying to make the album edit in RN Gallery to work with no luck.
in album.php, there are two functions related to edit existing albums:
Add new images (Where you can add) and the Current images (where you can delete) in an album. When the call is made to edit the album it only shows the current images and there's no way to trigger the "Add new images" no matter what I did:

I tried to play around the $add variable to make it '1' when it is called on some lines, then successfully the function will retrieve the images of a user with 0 $albid and show the Add new images table but not the current images in that album when switching to Current images anymore!!

Lines I changed in editalbum function:

php Code:


$path = 'modules.php?name=' . $module_name . '&op=' . $op . '&albid=' . $calbid;
if ($add == 1) {
$where = 'WHERE i.`albid` = 0 AND i.`user` = \'' . $db->sql_escape_string($usr) . '\'';
echo '<input type="hidden" name="add" value="' , $add , '" />' , PHP_EOL;
} else {
$where = 'WHERE i.`albid` = \'' . $calbid . '\'';
}
albimglist($where, $path, $add);


to:

php Code:


$path = 'modules.php?name=' . $module_name . '&amp;op=' . $op . '&amp;albid=' . $calbid;
if ($op = 'editalbum' && $add == 1) {
$where = 'WHERE i.`albid` = 0 AND i.`user` = \'' . $db->sql_escape_string($usr) . '\'';
echo '<input type="hidden" name="add" value="' , $add , '" />' , PHP_EOL;
albimglist($where, $path, $add=1);
} elseif ($op = 'editalbum' && $add == 0) {
$where = 'WHERE i.`albid` = \'' . $calbid . '\' AND i.`user` = \'' . $db->sql_escape_string($usr) . '\'';
albimglist($where, $path, $add);
}


I'm using Raven nuke 2.51, on spanish lang

Any hints are much appreciated Confused
Thanks
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1775

PostPosted: Mon Jun 18, 2018 8:30 am Reply with quote

This is my module and I guess we had the discussion about it to long but I will try it again.

1. Go to /admin.php?op=confrngal and check the version, which you are using - type it here, please!
2. Revert your changes because you will destroy the module with this kind of uncontrolled edits.

Edit: I guess I found the issue. It seems this is an relict from a older version.

Open 'modules/Gallery/includes/albums.php' and find:

php Code:
echo '&nbsp;[ <a href="' , $path , '&amp;add=1">' , _RNGAL_ALBUM_ADDNEWIMAGES , '</a> ]' , PHP_EOL;

Change it to:

php Code:
echo '&nbsp;[ <a href="modules.php?name=' , $module_name , '&amp;op=add&amp;albid=' , $albid , '">' , _RNGAL_ALBUM_ADDNEWIMAGES , '</a> ]' , PHP_EOL;

_________________
Only registered users can see links on this board! Get registered or login!

Last edited by neralex on Sat Jun 23, 2018 6:03 am; edited 1 time in total 
View user's profile Send private message
kenspa







PostPosted: Mon Jun 18, 2018 2:26 pm Reply with quote

Hi Neralex and thank you so much for your reply. Yes, we had a talk about this long ago, and I reverted all the changes to the original in the package as you indicated. I wasn't able to deal with this issue then.
Now, I've had enough time to understand the structure of the Gallery, which looks amazing to me (the best I found to work on php nuke), and I'm back to solve this problem.

The version I'm using is 1.3

And changing the link you posted did not solve the issue, but rather it takes me to the add image function with the targeted album already in the input. What I wanted and meant is:
I tried it on your site yesterday and it works as it is intended to do
I uploaded another pic, and went to My Albums/ Edit
modules.php?name=Gallery&op=editalbum&albid=xx

There, on top of the table you can see: [Current] Images [Add new], and by default it opens a table with the current pics in this album with the function of Title-pic and delete. Now if you click on [Add new] it opens another table where you can see the user images which are not asigned to any album and that you can add as many as you want to that specific album ( same table when you create a new album).
I think it's got something to do with:
albimglist($where, $path, $add); AND albimglist($where, $path, $add=1);

On your site it works perfectly till yesterday. I checked it again on your site before posting this, and it seems you've changed your album.php to the link you have posted, because this time it takes me to add image I mentioned above!!

Thanks again for any reply Cool
 
neralex







PostPosted: Mon Jun 18, 2018 2:54 pm Reply with quote

ahhh, now I got you. It seems we are lost in translation. I changed it back on my media-site. Sorry but this module is very old (2012) and it needs a whole recoding on some points like that. I uploaded my albums.php from my media-site, please try it and let me know, if it works for you.

https://gist.github.com/neralex/a3a7245102bd48e730c57adf2b756355
 
kenspa







PostPosted: Mon Jun 18, 2018 3:12 pm Reply with quote

Wow!! Now it works like a charm!!!! Very Happy

I'm not gonna ask you what you changed, I'll try to figure it out Laughing
But I do have a little question:
What does:
COUNT(`id`) as gid_count
stand for in the the query in editalbum function??

Thanks a lot
 
neralex







PostPosted: Mon Jun 18, 2018 3:33 pm Reply with quote

It counts only the ids of the query-loop - it seems its not really needed there but as I state it, I have to go deeper in the code to optimize it. If you should get an SQL error for that, then try to remove it. This file is made for my own website but it seems I missed something to put it in the download-package. I will test it in the next days. I removed it and I updated the GIST-file.

I will create a fixed version for RN252 on php7. There I will fix some issues and after that I will create a new version for RavenCMS.

RN252 is a php7-ready BETA version, based on RN251. If you are able to run an local test server on your local computer, then keep an eye on it but take care - its a BETA.

https://github.com/neralex/RavenNuke

On Windows are existing some tools for local test-servers like xampp, ampp, wamp etc. I'm using WAMP since some years with great results.

http://www.wampserver.com/en/
http://wampserver.aviatechno.net/
 
kenspa







PostPosted: Tue Jun 19, 2018 4:59 am Reply with quote

That's great. At the moment I'm not able to move to php7, but I´ll tell you if I had the opportunity to.
Now I will be working on shortlinks that are missing for RN Gallery v 1.3, I can post them here if you want me to.
Cheers Smile
 
neralex







PostPosted: Tue Jun 19, 2018 9:36 am Reply with quote

I don't need more shortlinks for this module because all public links are ready. Shorted links which are only available as user or as admin are not needed. Don't forget for what shortlinks were made. If you want do it for your site ok but its not needed to post it here, because this not the support forum for this module.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Gallery/Gallery2

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©