Advanced search  

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]

Pages: 1 [2]   Go Down

Author Topic: Add to Favorites as Text and button  (Read 21570 times)

0 Members and 1 Guest are viewing this topic.

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Add to Favorites as Text and button
« Reply #20 on: January 20, 2006, 08:58:00 pm »

Hey Paver,

Sorry it took me a while to get back with you, I've been out. I really appreciate the help. Your comments made sense to me, and helped a lot, thanks. When you say "themes.inc.php", you mean the sample theme, correct? I can't even find a themes.inc.php file. I haven't modified the sample theme at all, sorry if what I said implied that. I've copied it into the mytheme.php file and saved that one. And no, I'm certainly not a Neo.  ;)

As for the modification, it kinda half worked. It still show the button "Add to My Lightbox", and allows that to be clicked, yielding the "Remove from Lightbox" button. But it simply removed the "My Lightbox" text link from the Sub-menu, correct? What I'd really like is to have the actual "Add to My Lightbox" button simply not appear unless a User is logged in. Is that possible? Just as the Ecard button doesn't show unless a User is Logged in. I could still leave the "My Lightbox" text link in the Submenu, but just not have the option to add to a lightbox unless a User is logged in.

Thanks again for your help, it's invaluable.

Cheers

Carl

« Last Edit: January 21, 2006, 05:59:08 am by GauGau »
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Add to Favorites as Text and button
« Reply #21 on: January 20, 2006, 09:44:06 pm »

"A while" would be a week; overnight is a pretty quick response. 

All the .inc.php files are in the include folder.  The themes.inc.php file is in there and has all the default functions & variables that are used if you don't override them in your theme. 

My answer was about fixing your error; the error message referred to the sys_menu button that you renamed to 'My Lightbox'.  My last post deals with the sys_menu only.

gseb suggested the solution to your "Add to Lightbox" question.  I'll give mine.  Go to your theme.php file and look for these lines:
Code: [Select]
if (!in_array($CURRENT_PIC_DATA['pid'], $FAVPICS)) {
        $favorite = '<a href=addfav.php?pid=' . $CURRENT_PIC_DATA['pid'] . ' ><img src="images/addlight.jpg" align="middle" border="0" alt="" title="'. $lang_picinfo['addFav'] . '" /></a>';
    } else {
        $favorite = '<a href=addfav.php?pid=' . $CURRENT_PIC_DATA['pid'] . ' ><img src="images/remlight.jpg" align="middle" border="0" alt="" title="'. $lang_picinfo['remFav'] . '" /></a>';
    }
Add before it one line and after it three lines as shown:
Code: [Select]
if (USER_ID) {
if (!in_array($CURRENT_PIC_DATA['pid'], $FAVPICS)) {
             $favorite = '<a href=addfav.php?pid=' . $CURRENT_PIC_DATA['pid'] . ' ><img src="images/addlight.jpg" align="middle" border="0" alt="" title="'. $lang_picinfo['addFav'] . '" /></a>';
       } else {
             $favorite = '<a href=addfav.php?pid=' . $CURRENT_PIC_DATA['pid'] . ' ><img src="images/remlight.jpg" align="middle" border="0" alt="" title="'. $lang_picinfo['remFav'] . '" /></a>';
       }
} else {
       $favorite = '';
}

Also, this is not an error but a redundancy that is errrr... redundant.  You have two of the following lines in the same $params definition.  Look for this and remove one of them:
Code: [Select]
        '{FAVORITE}' => $favorite,
I didn't try out your theme file, but this should cover your question I think.
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Add to Favorites as Text and button
« Reply #22 on: January 21, 2006, 01:53:02 am »

hey Paver,

Thank you so much. That works perfectly.

I really appreciate your help.

Cheers

Carl

Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Add to Favorites as Text and button
« Reply #23 on: January 21, 2006, 02:00:52 am »

You're welcome.  I'm glad you're up & running.  Please modify the first post of this thread to have an icon of "Solved".
Logged

Walkinman

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 380
    • Skolai Images - Nature, Travel and Adventure stock photos
Re: Add to Favorites as Text and button
« Reply #24 on: January 21, 2006, 05:45:22 am »

Hey paver,

I don't think I can mark it 'solved', can I? According to this:

http://forum.coppermine-gallery.net/index.php?topic=18644.msg86001#msg86001

and this:

http://forum.coppermine-gallery.net/index.php?topic=19474.msg89634#msg89634

I can't do it. Or has something changed?

Cheers

Carl
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Add to Favorites as Text and button
« Reply #25 on: January 21, 2006, 05:58:47 am »

@Paver: Walkinman is right, regular users can't do that, only members of special groups (moderators, supporters, dev team members) can.
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Add to Favorites as Text and button
« Reply #26 on: January 21, 2006, 06:29:51 am »

GauGau: Ok, good to know.  Walkinman is to be commended for the relevant searching.  I asked on the dev board about this since I thought it was an "inside" question.  But since you brought up "Supporter" here and I have been designated as one, do I just change any of my posts in the thread as "Solved" and that marks the whole thread?  I assumed I had to have access to the first thread to do so.  I read the initial docs on the SMF site but didn't see such an answer and planned to download & read the manual but haven't yet.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Add to Favorites as Text and button
« Reply #27 on: January 21, 2006, 06:44:34 am »

It doesn't come with SMF, it's a custom hack I applied. You have to edit the first posting in a thread to mark the whole thread.
Logged

modiba

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: Add to Favorites as Text and button
« Reply #28 on: April 05, 2006, 04:15:23 am »

Hello,

I am trying to add a GIF button next to the E-Card button will add the image to the user's favorites.

I have read through this post over and over again but can't get it to work...

Is it possible to just possible to insert the image in HTML and hardcode a link which will add a photo to the favorites?
If so, what would the code be?

Thank you,
Greg
Logged

zac

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 153
Re: Add to Favorites as Text and button
« Reply #29 on: May 05, 2007, 02:10:15 am »

hello all.. sorry to bump such an old post but my problem is really specific to this mod.. I followed all the instructions and the button does work in adding the image to the favorites.. however after clicking the button and the gallery does the reload it returns with the selected album/files does not exist error.  The add to favorties link in the info panel works fine and does not have this error.  I am also running the add to lightbox plugin.. could this be screwing it up.  Thanks in advance for pointing me in the direction where I can solve this problem.


p.s.  LOL Paver

Quote
Are you Neo?  No, you are not.  Be a user, not a core-abuser.
Logged

Nibbler

  • Guest
Re: Add to Favorites as Text and button
« Reply #30 on: May 05, 2007, 02:42:35 am »

You need to add a redirect parameter to the link, look at the built-in link to see how this works. It was added as a bugfix since this mod was posted.
Logged

zac

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 153
Re: Add to Favorites as Text and button
« Reply #31 on: May 05, 2007, 03:01:49 am »

thanks nibbler but  ??? ???  sorry i  am not sure what you mean..  built-in link? 
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.03 seconds with 19 queries.