Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 16 Dec 2014, 16:49
gfran5's Avatar
gfran5 gfran5 is offline
 
Join Date: Nov 2014
Real name: Glenn
Google Chart Integration

I would love to include a pie graph on my members profile, where users can enter two different values e.g. Height & Weight and it is automatically produced as a pie graph.

I noticed the Google Charts API and it seems like it would be possible to do, i'm not a coder so i'm not sure. Has anybody used Google Charts or knows how this would be possible?

https://developers.google.com/chart/
Reply With Quote
  #2  
Old 16 Dec 2014, 19:11
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Real name: Len Kaiser
You would probably need to hire a PHP programmer for that. That would take some coding to have it work if its possible. Since you do not code it would probably be near to impossible for you to implement it yourself.
Reply With Quote
  #3  
Old 16 Dec 2014, 20:06
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
This is not something hard to do but not a task for the average hobbyist. (Store submitted data in the database, retrieve on user profile and call Google Charts API.)
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #4  
Old 17 Dec 2014, 00:29
gfran5's Avatar
gfran5 gfran5 is offline
 
Join Date: Nov 2014
Real name: Glenn
This is not something hard to do but not a task for the average hobbyist. (Store submitted data in the database, retrieve on user profile and call Google Charts API.)
So would you be able to help me out? I'm currently making my own profile tab.
Reply With Quote
  #5  
Old 17 Dec 2014, 11:19
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Real name: Chris
Someone might be able to help you out, once you start coding it, and then when you run into issues, post your code and describe what issues you are having.
__________________
You can get access to my 180 mods for vB 3.6 - 4.x at The Admin Zone as well as the professional support you are used to. New vBulletin Spider Definitions, vBulletin Spiders List Hits 1000 Spiders! ​ OzzModz down. Site has had a data breach, checking how the intrusion happened. Change your PW if you use the same one on my site and others.
Reply With Quote
  #6  
Old 17 Dec 2014, 11:24
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by gfran5 View Post
I would love to include a pie graph on my members profile, where users can enter two different values e.g. Height & Weight and it is automatically produced as a pie graph.
I don't think it's very difficult, there's an example as part of the docs that you linked to above. But I don't understand what you want to display. You say "height and weight", but are you going to display those two values on the same chart, or do you want to display all users' heights on one pie chart and weights on another?
Reply With Quote
  #7  
Old 17 Dec 2014, 12:42
gfran5's Avatar
gfran5 gfran5 is offline
 
Join Date: Nov 2014
Real name: Glenn
I want to have them both on the same pie chart, one figure as weight and the other as body fat % as seen here: http://www.theironden.com/forum/members/24086-gfran5

thoughts on where i should start, or if anybody would be willing to start me off and give me a rough guide of what to do.
Reply With Quote
  #8  
Old 17 Dec 2014, 12:55
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
OK, I guess you want a pie chart showing percentage of lean mass vs. total body weight, which you're going to caluclate using height and weight?

Anyway, here's the google example (modified a little) which you can put in a template and it should display:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So you just have to change the parts you want to change. I guess you could create profile variables for height and weight (using the "User Profile Field Manager"), then you can access those values in the template. If you're creating a new template for this then you probably need a plugin to register variables to it and render it. To be honest I'm not sure of the details of adding a profile tab.

Last edited by kh99; 17 Dec 2014 at 13:10.
Reply With Quote
  #9  
Old 17 Dec 2014, 13:38
gfran5's Avatar
gfran5 gfran5 is offline
 
Join Date: Nov 2014
Real name: Glenn
I have already created those variables for Height and Weight needed, but i'm currently stuck with making the My Bodyspace page.

I have followed this guide on how to setup extra profile tabs, but i have no idea how to register my custom height and weight profile fields in the plugin so that they display on the template.

my template currently has:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #10  
Old 17 Dec 2014, 13:47
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Hmm...yeah, it would be nice if that guide had a little more detail about using the member's data. But going by a comment that appears later in the thread, I think it's in $prepared. So you'd have to add 'register' lines to the code that renders your template. For example you might be able to just do this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

(line in red added), then use {userdata.field7} and {userdata.field8} in your template. I'm not sure if that will work or not, but it's the best guess I can make without trying it myself.
Reply With Quote
  #11  
Old 17 Dec 2014, 13:53
gfran5's Avatar
gfran5 gfran5 is offline
 
Join Date: Nov 2014
Real name: Glenn
i tried:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

but the numbers still didn't show up on the page, anything else i could try?
Reply With Quote
  #12  
Old 17 Dec 2014, 13:55
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Did you create a plugin like that guide showed? What code do you have in your plugin?
Reply With Quote
  #13  
Old 17 Dec 2014, 14:01
gfran5's Avatar
gfran5 gfran5 is offline
 
Join Date: Nov 2014
Real name: Glenn
my plugin is this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

--------------- Added 17 Dec 2014 at 14:35 ---------------

Any other ideas for how i can get my custom field data into my bodyspace profile page Kevin?
Reply With Quote
  #14  
Old 17 Dec 2014, 16:30
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Sorry, I lost my internet connection for a couple hours. Anyway, I copied your plugin code to create a new plugin using hook member_complete, and I created a template called memberinfo_block_test using the code from the guide page you linked to, but I get a blank tab. I haven't had a chance to figure out why yet.

Are you seeing anything from your template? I think I might have been wrong about using $prepared, I think you might want to use $userdata instead. So maybe change the added line to:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


then use {userinfo.field8}, etc. But if you're having the same issue I am with the tab being entirely blank then you probably still won't see the profile fields.

Last edited by kh99; 17 Dec 2014 at 16:54.
Reply With Quote
  #15  
Old 17 Dec 2014, 23:09
gfran5's Avatar
gfran5 gfran5 is offline
 
Join Date: Nov 2014
Real name: Glenn
I tried that but that didn't work either, i am able to see "Congratulations, you can see me, I'm your PHP Code!" on the profile tab page, therefore it should work if it is right.

Not sure why this is so hard to do.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Integration with vBulletin Google Admanager Integration ThorstenA vBulletin 3.8 Add-ons 67 26 Oct 2010 15:06



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 09:49.

Layout Options | Width: Wide Color: