Alo Mates,
I need help making a field for a "status" of a "user".
For instance when a user goes to a particular node there will be code in the backround that would upgrade the status field to different stage.
Ex. When a user signs up they are assigned "NEW Student"
when they visit a certain node they will be assinged "Completed Course 1"
when the visit another node their my account status would change and say "Completed Course 2"
Any help or putting me in the right dirrection would help, trying to mess with the user.module is complicated
Any help is appreciated
Thanks
[Edit to remove sales pitch and counter at end. Repeating such content can get you banned, you have been warned. Nevets]
[And please do not double post, duplicate has been removed: Nevets]
Comments
Changing core module makes
Changing core module makes updating hard.
You should investigate the profile module (part of core) or for more flexibility the content profile module. You may need to write a custom module to update the status field.
Changing the core files is a
Changing the core files is a bad thing.
You can create a new module that would change the user profile status on node view.
You can use
hook_nodeapi().-------------------------------
Read jQuery howto's and tips at jQuery HowTo Resouce
_
You should be able to work this out, or most of it at any rate, with the content_profile and rules modules.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Can someone give me a push in the right direction
This is all to broad for me, So i understand that i need to make a module and use the nood_hook to get the status to change form the my account page.
But how do i get something to display in the myaccount page. I can make a block view but is that the best way to go and how would i actually create a "status box".
Thanks for the input people.
_
I really don't think you need a module for this. You can use the core profile module to create a select list with all the different status designations. Then use the rules module to change the status based on viewed or updated pages. If you want more than basic profiles, use the content_profile module.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Rules Set Up
Ok, thanks for all the help
so what did is set up a profile so there is a list selection of all the roles a user can get and that shows up fine on the my account page.
But i had a problem setting up the rules, itried to set up when a page is viewd that an action heppens, but i cant select an action of a profile change. And i also had trouble setting it up the action to happen when a certain page is viewd? How can i do this.
How do i set up so when a node is seen to activate the action?
how i create an action that changes the status of a profile field.?
Thanks man, youve been a great help so far
_
When adding the rule select the 'content is going to be viewed' event. Then add a condition to test for the proper node. There's probably a couple of ways to do this. Something like 'check a truth value' and [node:nid] == 1 or whatever the node id is should work.
To change the status i think you can use the actions of 'load a content profile' and 'populate a field' if you're using content profiles. If you're not using content profiles, you'll probably have to use the 'execute custom php code' (requires the 'php code' core module to be enabled) to load the current user and change the value of the profile field.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Php
Hey WorldFallz,
Thanks for helpin out so far. Really Appreciated.
Ok well i tried to dothe content profile thing and that really didnt work out so well so i think i will just stick to the profile core module.
But i have a problem, i dont know what php code to insert can you give me an example code?
I honestly tried to make the rules with content profile module but it wouldnt let me select the content profile from the list it was blank.
Anyhow i figure you can really get a look at it if i made you an account on the site.
Its at hairsational.com/lasers
user name xxxxx
pass xxxxx
Man i thanks you a thousand times. if you need anything let me know
Edited by WorldFallz: removed login credentials.I need an example
Hey worldfallz, could you give me an exa,ple of what the php code would look like?
Thanks
_
I would think it should be something like:
Edit: Yowsa-- i just edited your previous post to remove the login credentials. It's a bad idea to post those in the forums-- you're asking for your site to be hacked. Give that code a shot and post back if you have any questions.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
execute custom php code
Hey,
that code didnt work, i made sure to see if the condition was working properly and it is; so that code isint working i tried alternatives but no luck. You got any other ideas?
Thanks :)