Add to Favorites as Text and button - Page 2 Add to Favorites as Text and button - Page 2
 

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

Main Menu

Add to Favorites as Text and button

Started by Walkinman, January 11, 2006, 09:37:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Walkinman

#20
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


Paver

"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: 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:

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:
        '{FAVORITE}' => $favorite,

I didn't try out your theme file, but this should cover your question I think.

Walkinman

hey Paver,

Thank you so much. That works perfectly.

I really appreciate your help.

Cheers

Carl


Paver

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

Walkinman


Joachim Müller

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

Paver

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.

Joachim Müller

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.

modiba

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

zac

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

QuoteAre you Neo?  No, you are not.  Be a user, not a core-abuser.

Nibbler

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.

zac

thanks nibbler but  ??? ???  sorry i  am not sure what you mean..  built-in link?