Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: adding pictures to favorites  (Read 8163 times)

0 Members and 1 Guest are viewing this topic.

alanpalan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
adding pictures to favorites
« on: November 08, 2007, 07:40:41 pm »

is there a way to do this by users of coppermine? (adding/removing) thanks.
« Last Edit: November 09, 2007, 06:47:57 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: adding pictures to favorites
« Reply #1 on: November 09, 2007, 08:04:06 am »

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.
Logged

alanpalan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
Re: adding pictures to favorites
« Reply #2 on: November 09, 2007, 11:36:11 am »

No, i was wondering if is there a way *for users* to add photos to their favorites.
Ok.
Logged

alanpalan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
Re: adding pictures to favorites
« Reply #3 on: November 09, 2007, 11:39:06 am »

Like user can do it on Youtube for examaple. It would be great feature.
Logged

Nibbler

  • Guest
Re: adding pictures to favorites
« Reply #4 on: November 09, 2007, 12:24:00 pm »

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.
Logged

alanpalan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
Re: adding pictures to favorites
« Reply #5 on: November 09, 2007, 06:35:47 pm »

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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: adding pictures to favorites
« Reply #6 on: November 09, 2007, 06:47:48 pm »

Sure, go ahead.
Marking thread as "solved".
Logged

alanpalan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
Re: adding pictures to favorites
« Reply #7 on: November 09, 2007, 07:04:59 pm »

I expected more contributive answer than "sure, go ahead" :)
Logged

alanpalan

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
Re: adding pictures to favorites
« Reply #8 on: November 09, 2007, 07:15:16 pm »

or do I have to create new topic for this question?
Logged

Alfinators

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
    • My Page
Re: adding pictures to favorites
« Reply #9 on: December 07, 2007, 02:17:04 am »

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
Code: [Select]
//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
Code: [Select]
//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
Code: [Select]
//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
 
Code: [Select]
<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
Logged

Alfinators

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
    • My Page
Re: adding pictures to favorites
« Reply #10 on: December 07, 2007, 02:37:33 am »

Logged

Bernd1975

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: adding pictures to favorites
« Reply #11 on: February 04, 2008, 08:27:15 pm »

THNX A LOT
This saved me a lot of time!

Good Job!
Logged

Alfinators

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
    • My Page
Re: adding pictures to favorites
« Reply #12 on: February 08, 2008, 10:35:31 pm »

No problem :)
Logged

socalboy

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: adding pictures to favorites
« Reply #13 on: February 29, 2008, 08:18:43 pm »

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
Logged

Nibbler

  • Guest
Re: adding pictures to favorites
« Reply #14 on: February 29, 2008, 08:23:54 pm »

You need to wrap this code

Code: [Select]
//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:

Code: [Select]
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

Code: [Select]
global $FAVPICS;
I don't know the context of the code.
Logged

socalboy

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: adding pictures to favorites
« Reply #15 on: March 01, 2008, 08:46:06 am »

Thank you very much, this worked like a charm!

Steven
Logged

DeJay

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: adding pictures to favorites
« Reply #16 on: March 28, 2008, 09:56:06 pm »

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.
Logged

DeJay

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: adding pictures to favorites
« Reply #17 on: March 31, 2008, 06:29:44 am »

Anyone?
Logged

Nibbler

  • Guest
Re: adding pictures to favorites
« Reply #18 on: March 31, 2008, 06:44:00 am »

Just add an else block to the code I posted but with 'Remove from' instead of 'Add to'.
Logged

DeJay

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: adding pictures to favorites
« Reply #19 on: March 31, 2008, 09:36:52 am »

Sorry Nibbler, you're basically talking to a coding idiot. How do you express the 'else block' in code? Thanks.
Logged
Pages: [1]   Go Up
 

Page created in 0.033 seconds with 21 queries.