anyone interested in writing a prefix mod? anyone interested in writing a prefix mod?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

anyone interested in writing a prefix mod?

Started by Eudemon, July 01, 2011, 02:21:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Eudemon

andre said it's a pretty easy to create
i can't do it right now bcuz i'm not familiar with coppermine

so if u interested see this topic for more detail
http://forum.coppermine-gallery.net/index.php/topic,72959.0.html

thanks in advance  :-X

Eudemon


Αndré

Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
Resolve your threads
If you have found an answer to your question, resolve your thread. Don't just post "I have found the answer", but tell others what you actually did to solve your issues. Posting a link to the page where you found the answer might help. Describing what you did might help as well.

Eudemon

solution
go to upload.php, find the function that gets the file name
add a prefix to it

Αndré

For the benefit of other users, I guess you're talking about that line:
$picture_name = replace_forbidden($picture_name);

E.g. you have to change it to
$picture_name = replace_forbidden('my_prefix_' . $picture_name);

Αndré

The same change has to be applied to db_input.php if you want to use it with the simple upload form.

To avoid modifying core files I've added a new plugin hook 'upload_file_name' to our svn repository in revision 8251. As an example I also added a plugin, which adds a random suffix to your newly uploaded files' names.

Eudemon

Quote from: Αndré on July 21, 2011, 06:29:32 PM
For the benefit of other users, I guess you're talking about that line:
$picture_name = replace_forbidden($picture_name);

E.g. you have to change it to
$picture_name = replace_forbidden('my_prefix_' . $picture_name);

yeah that's one of the ways
however i personally prefer adding an extra line after that (in case some1 need it)
   $picture_name = 'lalalallalalala.org '.$picture_name;
bcuz replace_forbidden function will replace "." and " " with under score
we could modify the replace_forbidden function so that it ignores certain characters
but that just extra modifications, or maybe in the admin setting has these values im not sure

and yes, like andre says, do the same to db_input.php
was playing with menalto gallery for a while and here i'm back  :P

i'm a mod/plugin author in smf, probably will jack around here a little bit, so hi everyone
btw will rly appreciated if u guys can get the moderator thinggy done in the future

lurkalot

Quote from: Eudemon on February 01, 2012, 09:52:13 PM

i'm a mod/plugin author in smf, probably will jack around here a little bit, so hi everyone
btw will rly appreciated if u guys can get the moderator thinggy done in the future


Hi Eudemon, (again) ;)

What "moderator thingy" are you ralking about? 
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Eudemon

oh hi lurkalot
by that i mean moderation permissions (assigned to specific member or group to have move, edit, delete  etc others' upload)
just like a board moderator in smf

the last time i searched here i saw someone (i think it's andre) said it was planed as a core feature
but didn't get done bcuz didn't have proper documentation??

lurkalot

Quote from: Eudemon on February 01, 2012, 11:29:54 PM
oh hi lurkalot
by that i mean moderation permissions (assigned to specific member or group to have move, edit, delete  etc others' upload)
just like a board moderator in smf

the last time i searched here i saw someone (i think it's andre) said it was planed as a core feature
but didn't get done bcuz didn't have proper documentation??

I'd love this feature too tbh, but not sure how easy / difficult it would be especially when using a bridged setup, like Coppermine bridged with SMF 2.0.2 for example.   If I were you, I'd add your suggestion to the Feature requests board. ;)
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Eudemon

 ??? i thought it's alrdy planned by the team
adding permission to bridged setup should be easy i think, since coppermine alrdy have some permissions based bridged users/groups
the difficult part is writing this new permission up in the main script, i don't rly know how cop is setup so if im wrong forgive me

i did a search in the feature request board, it seems like moderator permission is been asked numerous times

Αndré

Please stop the unrelated discussion about the moderator feature. If you want to know why it has been disabled, see here.