mygallery mod

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
User avatar
Fulvio Romanin
Posts: 394
Joined: Thu 4. Dec 2003, 11:12
Location: Udine, Italy
Contact:

Post by Fulvio Romanin »

take your time.... fast and good are rare companions... :D

keep up the good work! :wink:
Completeness is reached through subtraction, not through addition
scraper
Posts: 30
Joined: Tue 9. Aug 2005, 08:01
Location: Belgium

Post by scraper »

Hi all,

Instead of launching a demo, I thought it would be better to provide a link to download the mod.
Please note that it is still under development, so all feedback is welcome...

Any bug report is highly appreciated as well as any ideas for modification or enhancement.

Get version 1 here:
http://www.multisource.be/docs/gallery_mod_v01.zip

The documentation of how to install is included.
Kurt S.
Pick something up whenever you fall.
-O.Avery-
Lumimies
Posts: 63
Joined: Sat 25. Sep 2004, 14:03
Location: Suomi - Finland

Post by Lumimies »

Hello!

Just installed gallery mod on phpwcms v1.2.6-DEV.

I can see "Gallery Module" in "MODULES" section but nothing happens when clicking the "Gallery Module" link.

Also, when i log off and go to the site frontend i have error message:

"Fatal error: Cannot redeclare fmod() in /home/aineisto/public_html/sln/include/inc_module/mygallery/inc_lib/main.functions.php on line 4"

I made installing twice and it should be "by the book"

Any suggestions?

Could this be because i ran this phpwcms installation from subfolder?

Thank You!

Regards

Lumimies
scraper
Posts: 30
Joined: Tue 9. Aug 2005, 08:01
Location: Belgium

Post by scraper »

Hi Lumimies,

The error message is with the fmod function. Open the file
mygallery/inc_lib/main.functions.php
In the beginning of the file you will see the block

Code: Select all

function fmod($x,$y){
    $i = floor($x/$y);
    return $x - $i*$y;
}
Just remove this code or comment it. this will solve the error.

This will probably solve the problem in the backend as well. Just let me know if it didn't.
Kurt S.
Pick something up whenever you fall.
-O.Avery-
Lumimies
Posts: 63
Joined: Sat 25. Sep 2004, 14:03
Location: Suomi - Finland

Post by Lumimies »

Hi!

I`ll check this later this evening.. Thank You very much for this fast response!

I`ll keep You informed if i got this great feature working.

:-))

Regards

Lumimies
Lumimies
Posts: 63
Joined: Sat 25. Sep 2004, 14:03
Location: Suomi - Finland

Post by Lumimies »

Hi again!

Okay.. Now the functions after installation are ok (i guess..)

>> I can add albums and .jpg images inside
(images seem to go in folders named with album id in "mygallery" folder - folders are chmod 777)

>> If i try to save configuration i got error message: "Error: 1054: Unknown column 'imagedir' in 'field list'" (I checked with phpMyAdmin and there is no such a column in database - is this normal?)

>> After all i am not able to see any photos in frontend. Just those image placeholders and album name and description.

Hmmm... Maybe i have misconfigured something?

:oops:

Regards

Lumimies
scraper
Posts: 30
Joined: Tue 9. Aug 2005, 08:01
Location: Belgium

Post by scraper »

Hi Lumimies,

I'll check this later this evening. I've made some changes along the way and I think I forgot to update the config file for the installation.

You can add the field manually in the table, type is text.
The default entry for imagedir is images/ (with the / )
Lumimies
Posts: 63
Joined: Sat 25. Sep 2004, 14:03
Location: Suomi - Finland

Post by Lumimies »

Hello!

Thank You for Your help! I have added that "imagedir" field to the database as you suggested. Now those image (album) folders appear inside the "images" folder.

Everything seems to be working in backend then.

Now when in try to load frontend page with MYGAL rt i got album placeholder with albumname and description. When i click image placeholder or album namellink i got errormessages:

Warning: opendir(mygal1): failed to open dir: No such file or directory in /home/aineisto/public_html/sln/include/inc_module/mygallery/inc_lib/main.functions.php on line 84

Warning: readdir(): supplied argument is not a valid Directory resource in /home/aineisto/public_html/sln/include/inc_module/mygallery/inc_lib/main.functions.php on line 87


Hmmm..

Regards

Lumimies
scraper
Posts: 30
Joined: Tue 9. Aug 2005, 08:01
Location: Belgium

Post by scraper »

Hi Lumimies,

It seems that nothing is working for you :oops:
I'm happy that the backend is working for you :P

The RT are tricky as you have to create for each RT a category with the respective alias

MYGAL -> category alias is free to chose
MYAL -> category alias must be mygal
MYPIC -> category alias must be mypic

Still some work here, not sure which way to go as I want to keep it as flexible as possible (meaning with placing the gallery on your site).

When you move your mouse over the album it should show a link like this
http://your.domain/phpwcms-install-fold ... al&album=1

You did puth the trailing slash for the imagedir (kinda important).
Lumimies
Posts: 63
Joined: Sat 25. Sep 2004, 14:03
Location: Suomi - Finland

Post by Lumimies »

Hi!

This is propably in my brain or config... :D

I`ll play around with RT:s - and keep You informed..


"When you move your mouse over the album it should show a link like this
http://your.domain/phpwcms-install-fold ... al&album=1"

>> This is what i have..

>> ...and also have that trailing slash for the imagedir.

But i`ll keep trying!

Regards

Lumimies
scraper
Posts: 30
Joined: Tue 9. Aug 2005, 08:01
Location: Belgium

Post by scraper »

Lumimies,

Strange!
I've done a fresh install of the gallery (I've modified the config file and updated the zip file). No problems for installation :wink:

For the RTs, look at the screenshot:
Image

Very simple setup, the gallery article content is {MYGAL}
the Album category has mygal as alias, the article content {MYAL}
the Pictures category has mypic as alias, the article content {MYPIC}

If you can't get it to work, I can provide you access to this site so you can see the config.
I'm working this evening on the RT's.
How do you want the gallery to show on your site? Everything in the main area like the one here http://www.damongraulus.be/index.php?photos_nl
Kurt S.
Pick something up whenever you fall.
-O.Avery-
Lumimies
Posts: 63
Joined: Sat 25. Sep 2004, 14:03
Location: Suomi - Finland

Post by Lumimies »

Strange indeed... :D

NOW i can see my images BUT only when i am logged in to backend... (when logged in i click article preview and see images)

>> When i log out - the images disappear... (and again those same errormessages)

>> Configurations "Thumcols" chooser does not function. (every photo in gallery shows next to each other - regardles what i put in "Thumcols")


So.. I think this is something to do with my config.. But where... My installation is fresh DEV 1.2.6 with the latest code. (Mac OS X and Firefox)

... and at this moment my dev server is behind password. Do You think this could affect like this? - Hmmm.. I`ll try the site without passwords to see if it helps.. (Propably not)...

I`ll keep trying still.. - at least i have seen my images... :D

Regards

Lumimies
scraper
Posts: 30
Joined: Tue 9. Aug 2005, 08:01
Location: Belgium

Post by scraper »

Hey Lumimies,

While I was testing to resolv the errors, I stumble uppon a few bugs.
I modified a lot of code on different pages so it would be advisable to download the zip file again (drop the tables for the gallery as well).

http://www.multisource.be/docs/gallery_mod_v01.zip

The bug fixes solved the strange behaviour we encountered :P

solved bug fixes:
* problem whit the album id when deleting albums and adding new albums
* pictures dissapear when you are not logged in

I'm sure there are bugs left :roll:

I installed the mod on a site I'm working on for a friend and it does work.
Granted that you have to take some initiative but... :wink:
On this site I changed the aliases in the code... It's becoming a quest now to find a good overall config for the RT's :lol:
http://www.gofit.multisource.be/
Kurt S.
Pick something up whenever you fall.
-O.Avery-
Lumimies
Posts: 63
Joined: Sat 25. Sep 2004, 14:03
Location: Suomi - Finland

Post by Lumimies »

Hi!

Sorry for this delay.. I`ll check this up this weekend!

Thank You for great support! :D

Regards

Lumimies
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

hi all,
hi scraper,
I have installed your mod but am have ing issues that are not yet mentions here..

I found the fmod bug and just wrapped it in a 'function tester'

Code: Select all

if(!function_exists('fmod')) { 
   function fmod($x,$y) { 
      $i = floor($x/$y); 
      return $x - $i * $y; 
   } 
}
if this suits your needs then maybe you would include this in your download code.

I think your mod is best suited for a 'SAFE_MODE = off' server as you create new folders that are in turn CHOWNed by the server therefore not allowing access to them by the script - permissions error.

Work around: I will need to create the ne wfolder myself within the images folder.
Problem with this: add.album.php fails on line 9 (if !mkdir...throw error )
Possible solution: Alter the code so that if dir !exist then mkdir then if !mkdir... throw error ?

also your script has not fully integrated the 'prepend' varibale - the INSERT queries used to create a new gallery do not use them (I have not looked for others so can not see if there are more)

...other than that.. I hope to have it working soon as it is a 'nice initialtive' as trip said :)
Post Reply