Page 1 of 1
Yii-User: How to add user's image to profiles
#1
Posted 11 January 2011 - 04:55 AM
Hello,
I am starting a new project and want to use yii-user for that. The problem I am facing is that I dont understand how can I add user's image in profile. Does anyone have any idea?
Regards,
I am starting a new project and want to use yii-user for that. The problem I am facing is that I dont understand how can I add user's image in profile. Does anyone have any idea?
Regards,
#2
Posted 11 January 2011 - 05:43 AM
This may help you http://www.yiiframew...-using-a-model/
¿How long would it take for you to understand that you own nothing in this world?
www.ramirezcobos.com
www.ramirezcobos.com
#3
Posted 11 January 2011 - 05:48 AM
Antonio Ramirez, on 11 January 2011 - 05:43 AM, said:
This may help you http://www.yiiframew...-using-a-model/
Thank you for replying. I have implemented file uploading in Yii way. I wanted to know that does User module handles this. Since I have to add this field in Profiles table and User module automatically creates form controls, so how can I use Image in User module
Regards
#4
Posted 12 January 2011 - 06:32 AM
Please excuse me Sadaf, but I do not understand what you mean by that
¿How long would it take for you to understand that you own nothing in this world?
www.ramirezcobos.com
www.ramirezcobos.com
#5
Posted 12 January 2011 - 06:39 AM
Antonio Ramirez, on 12 January 2011 - 06:32 AM, said:
Please excuse me Sadaf, but I do not understand what you mean by that
Actually in my application, I have to save pictures of users as well. Since in yii-user module every information is saved in profile table and the forms (registration and profile modification) are generated dynamically, how can I implement the user image requirement :s
#6
Posted 12 January 2011 - 07:18 AM
As you already stated that you did already the uploading process, what I do is normally add a field to the profile table (lets called picture) and I save the filename of the image there.
When you render the model, you just need, to include the full or relative path to the image and append the image filename, whatever its name is. This way, you can move your images wherever you wish to afterwards, and the only thing you need to change its path to the images on your code (global var
).
To change the forms and include the fileuploader, follow the instructions on the article I sent you and modify them to suit your upload needs.
When you render the model, you just need, to include the full or relative path to the image and append the image filename, whatever its name is. This way, you can move your images wherever you wish to afterwards, and the only thing you need to change its path to the images on your code (global var
To change the forms and include the fileuploader, follow the instructions on the article I sent you and modify them to suit your upload needs.
¿How long would it take for you to understand that you own nothing in this world?
www.ramirezcobos.com
www.ramirezcobos.com
#7
Posted 07 September 2012 - 04:47 AM
Hi I created a Yii-User widget just for this purpose.
It's on github:
github.com/rizkyramadhan/yii-user-profilepic
Can't create link, just registered to reply to this thread.
It's on github:
github.com/rizkyramadhan/yii-user-profilepic
Can't create link, just registered to reply to this thread.
#8
Posted 06 November 2012 - 03:17 PM
rizky, on 07 September 2012 - 04:47 AM, said:
Hi I created a Yii-User widget just for this purpose.
It's on github:
github.com/rizkyramadhan/yii-user-profilepic
Can't create link, just registered to reply to this thread.
It's on github:
github.com/rizkyramadhan/yii-user-profilepic
Can't create link, just registered to reply to this thread.
@rizky,
first, thank you for sharing your work.
i am new to yii.. i have used ur extension to add a profile picture upload field to my form. The image is being uploaded and a thumb is created, but for some reason it is not being saved in the database.
Note: the related column in the db table is always empty.
Do you have an idea of what could be the problem?
Thank you!
Share this topic:
Page 1 of 1

Help











