is there a way to do this by users of coppermine? (adding/removing) thanks.
Are you asking how to add files to the favorites list of your users? Why would you do that? It wouldn't be their list of favorites then, but yours. Anyway: out of the box, such a feature doesn't exist. You'll have to run some queries against the table 'yourCoppermineTablePrefix_favpics' to accomplish this.
No, i was wondering if is there a way *for users* to add photos to their favorites.
Ok.
Like user can do it on Youtube for examaple. It would be great feature.
It works the same as youtube - click the link below the picture to add it to your favourites. If you have set the file information section to be hidden by default in config then you won't see the link unless you click on the (i) button above the pic first to display it.
A link to your gallery would help if you can't figure it out.
Cool, I see it. Thanks! ;)
Can I move that link "Add to Favorites" to some more visible place? For example right under the particular photo?
Sure, go ahead.
Marking thread as "solved".
I expected more contributive answer than "sure, go ahead" :)
or do I have to create new topic for this question?
Ok i have solution :)
download this mod
http://forum.coppermine-gallery.net/index.php?topic=36302.0
Now you must remove BB links
Find in codebase.php
//this just brings everything in form... we create a table etc.
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '<td>[url][img][/url]</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40" style="overflow:off;">'.$img_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'")\'></td>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '<td>[url]title[/url]</td>';
$bbcode_data .= '<td><textarea name="bbcode" rows="1" cols="40">'.$name_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$name_url.'")\'></td>';
$bbcode_data .= '</tr></table>';
Remove BB links - you get this
//this just brings everything in form... we create a table etc.
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '</tr></table>';
Replace with this code
//this just brings everything in form... we create a table etc.
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= "<td colspan=\"2\" align=\"center\"><a href=\"addfav.php?pid={$pic_data['pid']}\">Add to Favorites</a></td></tr><tr>";
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '</tr></table>';
Go to cofnig/manage plugins/ and install "Paste BB Code image url v1.2"
Text "Add to Favorites" you can replace with image
Sample
<img border=0 src=\"fav.gif\" >
And forgive my English :)
Sample in use
http://wallpapers.digitalne.eu/displayimage.php?album=favpics&cat=0&pos=1
Sorry last link doesn't work.
New Sample
http://wallpapers.digitalne.eu/displayimage.php?album=random&cat=0&pos=-994
THNX A LOT
This saved me a lot of time!
Good Job!
No problem :)
This is a great addition to my gallery, but is there a way to make Add to Favorites dissappear if the photo has already been added? This would work similar to the Add Favorites to Lightbox from Nibbler. The issue with that plugin is that it does not add favorites from the photo page itself, just the thumbnails pages. So if I can get this code to work I would really appreciate it. Thanks in advance for the help.
Steven
You need to wrap this code
//this just brings everything in form... we create a table etc.
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= "<td colspan=\"2\" align=\"center\"><a href=\"addfav.php?pid={$pic_data['pid']}\">Add to Favorites</a></td></tr><tr>";
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '</tr></table>';
in a condition, maybe like this:
if (!in_array($pic_data['pid'], $FAVPICS)){
//this just brings everything in form... we create a table etc.
$bbcode_data = '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '</tr><tr>';
$bbcode_data .= "<td colspan=\"2\" align=\"center\"><a href=\"addfav.php?pid={$pic_data['pid']}\">Add to Favorites</a></td></tr><tr>";
$bbcode_data .= '</tr><tr>';
$bbcode_data .= '</tr></table>';
}
You probably also need
global $FAVPICS;
I don't know the context of the code.
Thank you very much, this worked like a charm!
Steven
Hi Nibbler. This is a great function. The only problem is that the 'Add to my favourites' icon does not get replaced with 'Remove from my favourites' once clicked. Instead it just stays as 'Add to my favourites' (even though it will remove the file if clicked). What extra bit of code do I need to correct this?
Thanks.
Anyone?
Just add an else block to the code I posted but with 'Remove from' instead of 'Add to'.
Sorry Nibbler, you're basically talking to a coding idiot. How do you express the 'else block' in code? Thanks.