User template with recent posts - drupal

I'm developing a custom theme for Drupal 7. My problem is I don't know how to make a page that shows information about the author, and below the info, a list of the author's articles. (For ex. if I go to user/ i want to see the profile of the user with the given id, and his/her latest posts).
So what would be the best solution for this?
I've tried with creating user-profile.tpl, it's ok, but I dont' know how the get the nodes, and I don't really want to make sql query-s, because I think there is a prettier method for this.
I've tried with Views, too, but I'm new to Drupal and the most of the tutorials/explanations were for drupal 6 (if it's simple with view, please write me a small guide for it).
Thanks!

It'd be better to create a view that takes the uid as an argument.

Related

Wordpress how to generate list of revisions (post and pages) for public

I need to implement to Wordpress something like Public Revisions. The idea is that for every post and page there'll be a list of revisions (public, not only for logged-in) that allows reader to click to display previous version of post or page. So, I guess there should be a loop to check if there is a revision and print them while there are some. Making the list clickable, and showing the revisions would be awsome.
There was a plugin to do that, but it's abandoned and it doesn't work anymore. In fact, you can't even get it from the official list of plugins for WP.
Please help me achieve it the best (easiest) possible way. Unfortunately, my knowledge of PHP is only basic.
Dunno if you still need it but perhaps you could have a look at this?
https://developer.wordpress.org/rest-api/reference/post-revisions/#list-post-revisions
Seems like you could retrieve the data and create a page with it.

How to create a listing of Social networks' posts with Drupal

I want to achieve something like this: http://curatorsofsweden.com with DRUPAL
Here different people post over the same twitter-Account for one week. The Twitter-stream is published on the Website and you can also „time travel“ via the archive to see what which people posted in which week/days.
I want to achieve the same with DRUPAL and with a Twitter AND Instagram Account (and maybe FB too). My Idea is to import those streams with the feeds-module to treat the posts as DRUPAL-content. This way is more flexible to work with the content afterwards. But how to "automatically" map this to different users (or maybe treat a user as own content-type instead of normal DRUPAL-user?)?
What modules - or combination of modules - would you use to realize this? Im open for any suggestion!
Thanks
St.
Edit the view/config page of the feed to include a "user reference" using terms or taxonomy. This might require using a custom hook_form_alter to tweak it a bit.

alter content administration page (admin/content)

I'm working on some drupal installation and googled the whole day, but I can't figure out an answer to the following question:
How is it possible to alter the admin/content page in a way that specific roles are only able to see or filter out limited content types?
Please notice that I don't want to restrict node access in general, I just want to make this page less confusing for editors with different roles and tasks.
I know there is the administration views module and there I can set filter fields in the way I want. The problem with this is that I'm not able to enter the views access restrictions and so all I can do is limit the view's content types for all roles.
Can somebody give me a hint how to solve this?
Thank you very much and sorry for bad english.
One way would be to make a custom module.
In this module you would create a page with hook_menu().
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_menu/7
Then in the page callback function that you create you load global $user and switch between the $user->roles, out putting different HTML lists of links depending on their role. If you want something a little more dynamic you can always load the various content types with node_type_get_types().
Then go into structure -> menus -> navigation and disable the default link, replacing it with the new page you created.
If you aren't 100% clear on how to do a couple of these things comment here and I will update my answer.

Wordpress User Submissions

I want to be able to modify my Wordpress theme to be able to do exactly what this page does.
http://www.planetminecraft.com/resources/texture_packs/
I know first one would have to allow user uploads, but i would like to moderate them as well.
Does anyone know of a Wordpress plugin or solution to this problem?
ALSO: If possible, I need to add meta to the file upload (eg. Image, Title, Description)
Thanks in advance!
Afaik there's no plugin yet doing something like that. But maybe you can find one yourself in the wordpress plugin repository!
Depending on your programming skills, you could just write one yourself. The idea here would be to create a folder named as a auto-incrementing id, which is equal to an id in the database that you create simultaniously together with all the information stored in the DB.

Live Sorting by Custom Field in Wordpress

Im working on a wordpress powered website for a client that involves a directory of local offices. Part of their requirement is that live sorting be implemented via drop downs, so when someone selects X Office in X Area, the page dynamically loads the relevant results.
I currently have a custom post type set-up called "listing", which lists all the relevant information for that office. I then display each of those fields via the Loop.
In a perfect world, a plugin would exist that would perform the above, but I've yet to find one. The closest I've come is The custom category sorting over at Digging into Wordpress.
Any suggestions on a "easy" solution that would allow me to sort "listings" with multiple attributes?
please use the wp-smart-sort plugin for that.
With the help of this plugin you can also sort the custom field
If there is any issue after the use of this plugin then let me know
thanks

Resources