drupal 6 VIEWS - I'm stumped - drupal

I've created a view (Drupal 6) that gets put on the users profile page.
The view is supposed to list all the images that the user has uploaded. However, the view is showing every uploaded image by all users.
(When a user uploads an image, it first gets approved by me, and then posted by me and displayed on the homepage with a credit to them and a link to their user profile -- so they are not the "author" of the post, I always am.)
How can I limit the photos displaying on their user profile to just show the images uploaded by that particular user?
Thank you.

Use arguments handling: add argument - User ID, check "if argument not provided" and select php code: return arg(1); // if views shown as block and you want to show it in user profile, path will like user/UID, so arg(1) return UID.
2Ted: hello Ted! php code will absolutely secured, if you will check it, for example via is_numeric() function. Also users cann't get any images, becuase Views wil use Block display, and you cann't provide for this arguments directly.
2user967969: Additionally about approving: You can create second field, where you will store user profile UID. So for my above text you should use this field for argument handling, instead of user uid.

Related

How do I create a new page for each user?

I need to create a new page for each user on signup so when you go to the site's explore page and click on someone's name or picture, it will take you to their specific page and display their data. (database is firebase firestore and firebase storage, saved link to each person's doc)
This is one of the issues I've been trying to fix for about a month(just fixed the explore page issue and got everyone profile pic to display with that individual user's name right below). I have tried making a new html page with someone's php and js script (didn't work, not familiar with php) and url rewriting.
I haven't been able to find anything else concrete or at least something else to point me in the right direction. Any pointers or tips?
(Vanilla/node.js)
With PHP, on clicking a persons username you can add the username as a parameter to the url e.g yoursite.com?user=personsusername then use GET method to retrieve the username and output data relating to that username from the database

Drupal 6: Want to remove access restrictions on a View

I have a View with a Page display that only allows the returned data to be linked if the user is authenticated/logged in.
I simply want to remove that restriction. There is another view that looks the same except it's for Public and shows all the same data but not linked. (the data are pdf files).
On the authenticated display, next to Access in the Basic Settings it has: authenticated user. If I click that user role (not the gear for options), then I'm allowed a list of:
Domain
None
Permission
Role
…for access restrictions. I click "None", save. But, the links are not there as an anon visitor. Same if I try by changing the user to Anonymous User. Note: In the permissions, anon has the right to see webfm attachments.
I noticed the url is like: documents-public or documents-auth so I made it just documents. No luck.
I visited the actual custom-page-type which puts the View in a content pane. I re-ordered the variants, removed all Selection Rules and that didn't do anything either.
Flushed all caches.
Somewhere, the view is still only showing a view based on whether a user is authenticated or not even though I've removed the access (it says "unrestricted" next to access) on both displays and removed all selection rules on the actual page.
I'm stuck where else to look.
The setting you're changing (Access restrictions) is for the entire page - the page URL will return a 403 error if the criteria are met.
As to where the logic is to display/not display the link, four things come to mind:
If the "view mode" is set to node or teaser, it could be in the node template file.
The logic might be in a specific view template (click on the theme information link and see if any of the templates have been overridden).
The developer might have user Views Custom Fields to put the logic directly in the fields.
The linked content is actually restricted.
I'm sure there are other possibilities too. The main point here though is that if access was restricted for anon users, they would see a 403 error, not just some missing fields.

Drupal 7 View to list content created by logged in user

I've just started using D7 and was trying to set up a system where people can add a couple types of content and associate one with the other via nodereference.
I only want users to be able to see and work with their own content.
To achieve this in D6 I used a view for nodereference.
In D6 I used argument : user: uid and if there is no arg, it uses the user id of the logged in user. This would return all of the content that was authored by the user.
I haven't been able to figure out how to do this in Views 3?
got it:
you first need to add a User relationship, then you will see new filters and contextual filters - one of which is "current user" or something like that
This five minute video shows how to do it, as well: http://nodeone.se/sv/node/684
With contextual filters you can also display the list as a tab on each user page (as shown in the screencast).
If you're interested in a list that always shows the current user's posts, you can use a standard filter instead – there is a "current user" filter available.
Edited: The original link is broken. I'm not sure which video it was, but it could be one of the following (which all deal with this topic).
https://vimeo.com/22276809 Video guide
https://vimeo.com/33588889 Exercise description
https://vimeo.com/33588956 Exercise solution
For drupal 7
Steps for doing as the above question are
Create a new content view and limit it to the content type you want.
Uncheck "Create a page" and check "Create a block." Select the format you want; I recommend an HTML list of linked titles. Click "Continue & edit."
Add a contextual filter for "Content: Author uid."
Under "When the filter value is not available," select "Provide a default value," and select "User ID from URL" from the dropdown. Because blocks don't understand contextual filters very well, the view won't work properly without this default value, and all posts of the given content type will show on all user pages (not just the user's own posts).
Under "When the filter value is available or a default is provided," check "Specify validation criteria" and select "Basic validation" as the validator. Select "Hide view" from the dropdown.
Save your view.
Assuming that you created a block display, the block will now be available on the Blocks page. Go there and open it.
Set your block to display on all user pages (/user/*) in the correct region. Save the block.
Your block should now appear on all user pages, showing the content written by each user.
Source

How I can add "files available for download" to Drupal user profile page

first time here. I have searched all day for my particular issue with no luck.
I have users that have specific roles auto generated (they purchase a game). I want to display files available to their particular role on their user profile page. I just want to know how I can add a generic view or associate a panel with user profile pages. I want this to display for every user, not on a per user basis. Basically it'll act like, say, direct2drive, you log in and go to your user profile basically and see what games you bought. Seems simple but I am having a heck of a time figuring out how to do this.
I am pretty used to using views but I just don't get how to edit the user profiles like I want to.
Thanks!
The simplest way is to install views_attach, and create a view with a Profile display. This displays the View on the user profile pages, rather than on its own page or in a block, and will pass the user's uid to the View as an argument.
Alternatively, if you're already using comfortable using panels, you can go to admin/build/panels and enable the Users panel. This replaces the user profile page with a panel, which you can add views, nodes and blocks to as normal.

Views not appearing for non admin user

I have setup a view which outputs nodes, including the name of the person who created it.
If a non-admin person browses to the page where that view is displayed, they dont see the name field, I recall somewhere about this being an administrative permission ??
Is the name of the creator a CCK field? Make sure the permission to view this field is set for anonymous users (in the /admin/user/permissions page).

Resources