forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 plugins => Topic started by: Eudemon on July 01, 2011, 02:21:27 am

Title: anyone interested in writing a prefix mod?
Post by: Eudemon on July 01, 2011, 02:21:27 am
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
Title: Re: anyone interested in writing a prefix mod?
Post by: Eudemon on July 06, 2011, 10:28:06 pm
never mind, i figured it out myself
Title: Re: anyone interested in writing a prefix mod?
Post by: Αndré on July 13, 2011, 12:44:57 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.
Title: Re: anyone interested in writing a prefix mod?
Post by: Eudemon on July 21, 2011, 05:39:43 pm
solution
go to upload.php, find the function that gets the file name
add a prefix to it
Title: Re: anyone interested in writing a prefix mod?
Post by: Αndré on July 21, 2011, 06:29:32 pm
For the benefit of other users, I guess you're talking about that line:
Code: [Select]
$picture_name = replace_forbidden($picture_name);
E.g. you have to change it to
Code: [Select]
$picture_name = replace_forbidden('my_prefix_' . $picture_name);
Title: Re: anyone interested in writing a prefix mod?
Post by: Αndré on September 02, 2011, 12:22:03 pm
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 (http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.5.x/plugins/random_file_name_suffix/), which adds a random suffix to your newly uploaded files' names.
Title: Re: Re: anyone interested in writing a prefix mod?
Post by: Eudemon on February 01, 2012, 09:52:13 pm
For the benefit of other users, I guess you're talking about that line:
Code: [Select]
$picture_name = replace_forbidden($picture_name);
E.g. you have to change it to
Code: [Select]
$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
Title: Re: Re: anyone interested in writing a prefix mod?
Post by: lurkalot on February 01, 2012, 11:23:28 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? 
Title: Re: anyone interested in writing a prefix mod?
Post by: 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??
Title: Re: anyone interested in writing a prefix mod?
Post by: lurkalot on February 01, 2012, 11:41:51 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 (http://forum.coppermine-gallery.net/index.php/board,7.0.html) board. ;)
Title: Re: anyone interested in writing a prefix mod?
Post by: Eudemon on February 02, 2012, 12:12:21 am
 ??? 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
Title: Re: anyone interested in writing a prefix mod?
Post by: Αndré on February 02, 2012, 08:53:32 am
Please stop the unrelated discussion about the moderator feature. If you want to know why it has been disabled, see here (http://forum.coppermine-gallery.net/index.php/topic,64408.msg323489.html#msg323489).