Sorry to bother you with this... some questions. I installed the flag module and flags are not appearing on nodes. I have enabled it for page, panels, userprofile, user nodes, & event... not seeing any flags on any pages. I need to have users flag user profiles using "advanced profile" module especially and also events. But flags are not displaying even on page nodes. I am using the "clean" theme.

Looking at this post:

http://drupal.org/node/279318

should I go through this process adding the code to the module and also the theme? I upgraded to jquery 1 - no display, then to jquery 2 - and no display. I also upgraded to the dev version of the module and same result. Before I add the code listed on the other post to the module & template, maybe there is something I missed? If I have to add that code can you be more specific as to where in each file? The checkboxes are appearing, for example on "content types" and when creating a new node ("add to bookmarks") - the javascript is appearing in the header page code for pages and events but not the profiles.

Side note / different issue: "My bookmarks" is appearing in navigation menu for unregistered users as well.

Any assistance or recommendations appreciated.

Comments

quicksketch’s picture

Maybe your theme isn't printing out any links at all (like "Add a comment" and "x Reads")? Flag's links should follow them. If the links are being printed anywhere, you might need to use that code Moofie posted in the other issue (actually this sounds like it might be the exact same request). At the same time, this request might need to be pushed to nodeprofile module, requesting that the links be printed out.

mooffie’s picture

Side note / different issue: "My bookmarks" is appearing in navigation menu for unregistered users as well.

Please open a new issue.

typehost’s picture

#1 quicksketch - you are right - I don't have any "add a comment" or "x read" - commenting is just added through the form. When adding the code listed on the other page, it would be good if the instructions are more clear.

mooffie’s picture

Status: Active » Fixed

So this issue is 'fixed', right? Please re-open if it isn't.

When adding the code listed on the other page, it would be good if the instructions are more clear.

The "general audience" was not supposed to use that code. See explanation in a new issue, "a bad thing have happened":
http://drupal.org/node/280766

typehost’s picture

Actually, I added that code and got the same mass of error listed on the other page - just the same. I plugged the print code into the template, and it is just displaying in the top corner with the errors. Trying to position the print code exactly in the template in every instance it is supposed to appear is probably not going to work well for me, as the automatic addition feature is really key to the module. You mentioned something about the template missing a node function, it seems a better idea to try to add that and get it working correctly. Any suggestions or pointing in the right direction to fix it would be great. Seems like a great module and we need it on our site, I am not sure if there are any alternatives.

typehost’s picture

Incidentally, I changed back to bluemarine and the bookmark links are appearing for pages and events without any problem, but not appearing on user profile nodes using "advanced profile" (which is what we really need to bookmark).

mooffie’s picture

Actually, I added that code and got the same mass of error listed on the other page - just the same. I plugged the print code into the template, and it is just displaying in the top corner with the errors. Trying to position the print code exactly in the template in every instance it is supposed to appear is probably not going to work well for me, as the automatic addition feature is really key to the module. You mentioned something about the template missing a node function, it seems a better idea to try to add that and get it working correctly. Any suggestions or pointing in the right direction to fix it would be great. Seems like a great module and we need it on our site, I am not sure if there are any alternatives.

Using this attitude won't help you (or me understanding the problem).

If you get "the same mass of error listed on the other page" then it means you don't have a $node object in your template. The one-line code in that other issue is meant to be put in your 'node.tpl.php' (or similar).

I suggest you first try to make the flag link appear on a 'page' or 'event'. If you manage to do that, you know your code is ok. Then find out how/where to get at the $node object of your "advanced profile".

typehost’s picture

Thanks for that: I put the code in the module & the one line in node.tpl.php and the links are displaying now on pages and events.

For Advanced Profile / userprofiles:
I put the same code in node-userprofile.tpl.php but no effect.
Advanced Profile is also using Panels2.

mooffie’s picture

I put the same code in node-userprofile.tpl.php but no effect.

First, try to put the following there:

<?php print "The node associated with this user is: $node->nid"; ?>

What happens?

mooffie’s picture

Jeffrey, I hope you didn't give up on this ;-)

This new function, _flag_create_link(), was just commited to the 'dev' version of this module.

I'll also write a book page describing "how to put a flag link anywhere", so I'm interested in how your user profile problem will be solved.

typehost’s picture

All that is in node-uprofile.tpl.php is this code:

<?php
  // We don't ever want to go to the usernode itself. Always redirect to the user page.
  drupal_goto("user/$node->uid", NULL, NULL, 301)
?>

I put the line you listed before and after that but didn't see anything print with either method.

There is also an advanced_profile_userinfo.tpl.php which has the print code for the cck fields - when I added the original code to that the whole list of errors came up again. When I added the code you gave me last there, it printed nicely under the "online" status button in the user profile. So, maybe we are close. But note - it only printed "The node associated with this user is: " and not the node user id info.

I appreciate your assistance with this.

mooffie’s picture

I downloaded this 'advanced profile' (I'll use 'AP' for short), and rummaged in its files, but came to the comnclusion that we can use the help of its people.

This 'flag' module flags nodes. The various profile modules provide nodes.

What's needed is the code that gives you the user's node. This isn't really a 'flag' issue.

I suggest you open an issue, at AP's queue, and ask them how to get at the user's node, in a template. Don't mention the 'flag' module: it's irrelevant. (And please leave here a link to the issue you open.)

Lastly, are you sure you need 'flag'? I see that AP intergates with buddylist, and buddylist provides a list of users, doesn't it?

typehost’s picture

I am using advanced profile with node profile / user node - the display is with panels 2. Basically, we need users to be able to bookmark other users' profiles for a social network - that is part of the site's functionality. I saw on the previous post an issue with panels, waiting for a new version of that to come out, maybe that will fix it.

typehost’s picture

Title: flags not appearing » advanced profile

I've opened up a support request in the advanced profile issues for this question:

http://drupal.org/node/280987

typehost’s picture

Title: advanced profile » flags not appearing / advanced profile integration

Is it necessary also for a new issue on the menu question - I don't think we should have a display of "my Bookmarks" for unregistered users in navigation.

neyoung’s picture

it looks like typehost is running into the same problem I was with this issue http://drupal.org/node/279318. I was trying to add the link to a panels page (panels2 module) and he/she is trying to add it to Advanced Profile (which is a glorified Panels Page). From the research I've done and talking with sdboyer, Panels2 doesn't provide access to the $node object, which is why typehost and I both get the errors. Which is exactly what mooffie said :)

I assume that typehost tried to do what I did. Add a new "Custom content pane" to a panel and call the flag_create_link() function from within the custom content pane. This is a no go. sdboyer added a new content type for panels2 in the dev release that has a "Custom php content pane". Which I think would help us get access to the $node object via panels2's context system. But I don't know enough to do this.

However, I think that maybe an easier solution would be if there was a flag block. sdboyer should be asked about this, but I believe that any block that is available on a site can be dropped into a panel page as a pane. Next time I see sdboyer on irc I'll ask about this. If this is the case, then making a simple block that called the flag_create_link() function would work for typehost and I.

At any rate, this is all new to me so I'm not 100% sure of what I'm doing, but I'm trying to learn quickly :)

neyoung’s picture

typehost... this should solve your problems!

http://drupal.org/node/279318#comment-930035

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

typehost’s picture

Status: Closed (fixed) » Active

Neyoung

Thanks for that, but it did not solve my problem. I am looking to print an icon + "Bookmark this" on the Advanced Profile page, in the user info section below "Send PM" & "Add Buddy".

This is the code of the advanced_profile_userinfo.tpl.php file:

<?php
/*
$account - The entire user object for the profile user
$picture - returned from theme_user_picture
$joined_raw - Date the user joined the site with no markup
$joined - Date the user joined the site in the format "Joined: DATE" marked up
$member_since_raw - Amount of time since the user joined the site with no markup
$member_since - Amount of time since the user joined the site in the format "Member since: DATE" marked up
$online_class 
$online_icon 
$online_text 
$online_status 
$points_raw 
$points 
$posts_raw 
$posts 
$user_title_raw 
$user_title 
$user_badges_raw 
$user_badges 
$contact_class 
$contact_icon 
$contact_text 
$contact_link 
$contact 
$privatemsg_icon 
$privatemsg_text 
$privatemsg_link 
$privatemsg  
$buddylist_class 
$buddylist_icon 
$buddylist_text 
$buddylist_link 
$buddylist 
$ip_raw
$ip
$profile - Profile object from core profile. Usage: $profile->fieldname

*/
?>

<div class="user-info">
  <?php print $user_title; ?>
  <?php print $posts; ?>
  <?php print $joined; ?>
  <?php print $points; ?>
  <?php print $user_badges;  ?>
  <?php print $online_status; ?>
  <?php print $contact; ?>
  <?php print $privatemsg; ?>
  <?php print $buddylist; ?> 
<?php print flag_create_link('bookmarks' /* the flag name */, $node->nid); ?>
</div>

The link is not appearing that way - see also:
http://drupal.org/node/280987

sirkitree’s picture

So what it looks like you're trying to do is to bookmark a user, correct?

If so, you need to have a flag that is a user flag, first off. Let's call if 'friend' for example. Then in your tpl file, when you use flag_create_link, you need to pass in the $account->uid.

print flag_create_link('friend', $account->uid);
typehost’s picture

Actually, referencing the note on Views 1:

"Many Drupal 5 websites use modules such as Bio or Node Profile, that create corresponding nodes for users. So, instead of flagging users directly, you can flag these nodes. Views can easily produce a list of them.

In other words, if you're using Bio or Node Profile, and you want to flag users, make your flag of type 'Nodes'."

I want the same "bookmark" as applies to the other types to also bookmark the "user profile" (content type: uprofile) that is related to each user. We are using Bio.

sirkitree’s picture

Ah, sorry for not reading the issue more thoroughly.

Are you sure that the $node object exists in the tpl? I don't see it listed in the available vars in comment #19. I would assume that it does, but just trying to think of the obvious.

typehost’s picture

Honestly I don't know about adding the $node object variable to the template or if there are other variables that need to be added. For example, in the above template, the "send PM", or "contact" links will appear if another user is viewing a profile, but not if the owner is viewing his or her own profile.

mooffie’s picture

typehost,

See this new feature: #332956: Flag Ctools integration

mooffie’s picture

Status: Active » Fixed

I'm closing this issue. #332956: Flag Ctools integration handles this.

As for having a $node variable pointing to your usernode/bionode/nodeprofilenode: you should ask this in the appropriate module's queue. "Advanced Profile"'s queue is also an appropriate place to ask this; however, you botched your question there by mentioning "Bookmarking"/"Flag", which is irrelevant.

mooffie’s picture

Alternatively, open a feature request against "Advanced Profile": "Have the usernode/bionode/whatever accessible in advanced_profile_userinfo.tpl.php".

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.